Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AUTO_INCREMENT in the UPDATE statement #868

Closed
wants to merge 1 commit into from

Conversation

minggr
Copy link
Contributor

@minggr minggr commented Aug 9, 2018

Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@lth lth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an mtr test as well?

return;
}

for (i = 0; i < table->s->fields; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to do the for loop? Doesn't table->s->next_number_index contain the field we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not always, for example,

CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (20);

(gdb) p table->s->next_number_index
$18 = 0
(gdb) p table->field[0]->val_uint()
$19 = 20

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I got confused on what table->s->next_number_index meant. It is actually telling us which index the autoincrement is one (not the "index" of the field array). In this case, it's 0 because it is on primary key.

Looking at ha_rocksdb::load_auto_incr_value_from_index, we just assume that the first column of the index is the autoincrement field. Looks like something similar is assumed in InnoDB (row_search_autoinc_read_column is always called with col_no == 0).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about the updated patch?

A value for an AUTO_INCREMENT column
was specified in the UPDATE statement.
*/
update_auto_incr_val_from_field();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already call update_auto_incr_val_from_field from update_pk, but it's not working as expected because it's using the 'old' row instead of the new one. I think a better fix is to unify these paths.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3;

table->next_number_field is null so update_auto_incr_val_from_field() is not called in update_pk()

(gdb) list
9408	    } else {
9409	      bytes_written = row_info.old_pk_slice.size();
9410	    }
9411	  }
9412	
9413	  if (table->next_number_field) {
9414	    update_auto_incr_val_from_field();
9415	  }
9416	
9417	  int rc = HA_EXIT_SUCCESS;
(gdb) p table->next_number_field
$2 = (Field *) 0x0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we merge these two paths, since I think they're trying to do the same thing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, table->next_number_field isn't nullptr for me, but it is using the old row, which is why this bug reproduces for me.

(gdb) list
9395          bytes_written = row_info.old_pk_slice.size();
9396        }
9397      }
9398
9399      if (table->next_number_field) {
9400        update_auto_incr_val_from_field();
9401      }
9402
9403      int rc = HA_EXIT_SUCCESS;
9404      rocksdb::Slice value_slice;
(gdb) p table->next_number_field
$2 = (Field *) 0x7f2a9c825150

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird. Can you set a memory watchpoint to show the call stack that sets table->next_number_field?

Breakpoint 13, mysql_update (thd=0x2c8f850, table_list=0x7fffdc005710, fields=..., values=..., conds=0x0, order_num=0, order=0x0, limit=18446744073709551615, handle_duplicates=DUP_ERROR, 
    ignore=false, found_return=0x7ffff7e8d4a0, updated_return=0x7ffff7e8d498) at /workspace/mysql/sql/sql_update.cc:266
266	  if (!table_list->updatable)
(gdb) list
261	  }
262	
263	  THD_STAGE_INFO(thd, stage_init);
264	  table= table_list->table;
265	
266	  if (!table_list->updatable)
267	  {
268	    my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "UPDATE");
269	    DBUG_RETURN(1);
270	  }
(gdb) p table
$53 = (TABLE *) 0x7fffdc021180
(gdb) watch ((TABLE *) 0x7fffdc021180)->next_number_field
Hardware watchpoint 14: ((TABLE *) 0x7fffdc021180)->next_number_field

It's not clear to me how to merge these two paths. Can we simply do below?

--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -9410,7 +9410,7 @@ int ha_rocksdb::update_pk(const Rdb_key_def &kd,
     }
   }
 
-  if (table->next_number_field) {
+  if (table->found_next_number_field) {
     update_auto_incr_val_from_field();
   }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking found_next_number_field will probably be good enough for the fix. You might need to change update_auto_incr_val_from_field to look at new row.

For some reason, I'm seeing nullptr now for next_number_field, so I'm not sure how I got the previous results in the first place...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I'll update the patch and also add a mtr test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch updated.
In update_auto_incr_val_from_field(),
field = table->key_info[table->s->next_number_index].key_part[0].field;
field->val_int() is already new AUTO_INCREMENT value.

@lth
Copy link
Contributor

lth commented Aug 15, 2018

Can we add an mtr test as well?

@minggr
Copy link
Contributor Author

minggr commented Aug 15, 2018

Yes, I'll add a mtr test.

@minggr
Copy link
Contributor Author

minggr commented Aug 15, 2018

What are the correct parameters to run mtr test?
I tried as below,

./mtr --mysqld="--default-tmp-storage-engine=MyISAM --rocksdb --skip-innodb --default-storage-engine=RocksDB"  --suite=rocksdb 

But error log shows:

2018-08-15 15:02:32 76594 [Note] Plugin 'ROCKSDB' is disabled.
2018-08-15 15:02:32 76594 [Note] Plugin 'FEDERATED' is disabled.
2018-08-15 15:02:32 76594 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-08-15 15:02:32 7f34b2cd2880 InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
2018-08-15 15:02:32 7f34b2cd2880 InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!
2018-08-15 15:02:32 76594 [Note] InnoDB: The InnoDB memory heap is disabled
2018-08-15 15:02:32 76594 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-08-15 15:02:32 76594 [Note] InnoDB: Memory barrier is not used
2018-08-15 15:02:32 76594 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-08-15 15:02:32 76594 [Note] InnoDB: Using Linux native AIO

@spetrunia
Copy link
Contributor

spetrunia commented Aug 15, 2018

For me running tests like this works:

./mysql-test-run --mysqld=--default-storage-engine=rocksdb \
 --mysqld=--skip-innodb --mysqld=--default-tmp-storage-engine=MyISAM \
 --mysqld=--rocksdb  --suite=rocksdb

that is, mysqld arguments go one by one

@minggr
Copy link
Contributor Author

minggr commented Aug 15, 2018

Yes, that works. Thanks.

https://jira.mariadb.org/browse/MDEV-16703

Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.
Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lth has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@lth lth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

abhinav04sharma pushed a commit to abhinav04sharma/mysql-5.6 that referenced this pull request Nov 29, 2018
Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook#868
GitHub Author: Ming Lin <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.

Reviewers: svcscm

Reviewed By: svcscm

Subscribers: [email protected]

Differential Revision: https://phabricator.intern.facebook.com/D9360242

Signature: 9360242:1534435395:01c49a6b0cf6cf30991bfa7f6d26c8a622111292
george-lorch pushed a commit to george-lorch/percona-server that referenced this pull request Jan 9, 2019
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
george-lorch pushed a commit to george-lorch/percona-server that referenced this pull request Jan 10, 2019
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
facebook-github-bot pushed a commit that referenced this pull request Dec 23, 2019
Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: #868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 664dd17
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Aug 13, 2020
Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 664dd17
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Sep 9, 2020
Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 664dd17
inikep pushed a commit to inikep/mysql-5.6 that referenced this pull request Sep 16, 2020
Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 664dd17
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request Apr 16, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request Apr 16, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request Apr 16, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request Apr 16, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request Apr 16, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request Apr 18, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request Apr 29, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request May 13, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
oleksandr-kachan pushed a commit to oleksandr-kachan/percona-server that referenced this pull request May 27, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
VarunNagaraju pushed a commit to VarunNagaraju/percona-server that referenced this pull request May 31, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
VarunNagaraju pushed a commit to VarunNagaraju/percona-server that referenced this pull request Jun 5, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
VarunNagaraju pushed a commit to VarunNagaraju/percona-server that referenced this pull request Jun 10, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
VarunNagaraju pushed a commit to VarunNagaraju/percona-server that referenced this pull request Jun 12, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
VarunNagaraju pushed a commit to VarunNagaraju/percona-server that referenced this pull request Jun 12, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Jul 25, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Jul 30, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Aug 21, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Aug 28, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Aug 30, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to percona/percona-server that referenced this pull request Sep 23, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to percona/percona-server that referenced this pull request Sep 25, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to inikep/percona-server that referenced this pull request Sep 25, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Oct 17, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Oct 17, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
dlenev pushed a commit to dlenev/percona-server that referenced this pull request Oct 22, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to inikep/percona-server that referenced this pull request Oct 28, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to percona/percona-server that referenced this pull request Oct 30, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 11, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 14, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
inikep pushed a commit to inikep/percona-server that referenced this pull request Nov 14, 2024
Upstream commit ID : fb-mysql-5.6.35/f8ea6852be5484ed15ffbac844b3719673f0f057
PS-5217 : Merge fb-prod201803

Summary:
Currently RocksDB engine doesn't update AUTO_INCREMENT in the UPDATE statement.
For example,

CREATE TABLE t1 (pk INT AUTO_INCREMENT, a INT, PRIMARY KEY(pk)) ENGINE=RocksDB;
INSERT INTO t1 (a) VALUES (1);
UPDATE t1 SET pk = 3; ==> AUTO_INCREMENT should be updated to 4.

Without this fix, it hits the Assertion `dd_val >= last_val' failed in
myrocks::ha_rocksdb::load_auto_incr_value_from_index.

Please see detail at:
https://jira.mariadb.org/browse/MDEV-16703
Pull Request resolved: facebook/mysql-5.6#868

Differential Revision: D9360242

Pulled By: lth

fbshipit-source-id: 70ee31cb90f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants