Server IP : 104.21.38.3 / Your IP : 172.70.143.132 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/ndb/r/ |
Upload File : |
DROP TABLE IF EXISTS t1,t2,t3; USE test; CREATE TABLE t1 ( id INT AUTO_INCREMENT, PRIMARY KEY(id) ) ENGINE=NDBCLUSTER; CREATE TABLE t2 ( id INT AUTO_INCREMENT, KEY(id) ) ENGINE=NDBCLUSTER; ERROR HY000: Got error 4335 'Only one autoincrement column allowed per table. Having a table without primary key uses an autoincr' from NDBCLUSTER SHOW TABLES; Tables_in_test t1 CREATE TABLE t3 ( id INT AUTO_INCREMENT, KEY(id) ) ENGINE=MYISAM; ALTER TABLE t3 ENGINE NDBCLUSTER; ERROR HY000: Got error 4335 'Only one autoincrement column allowed per table. Having a table without primary key uses an autoincr' from NDBCLUSTER SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( `id` int(11) NOT NULL AUTO_INCREMENT, KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ALTER TABLE t3 ADD PRIMARY KEY (id); SHOW CREATE TABLE t3; Table Create Table t3 CREATE TABLE `t3` ( `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, t3; End of 5.1 tests set @@auto_increment_increment=4; set @@auto_increment_offset=1; set @@ndb_autoincrement_prefetch_sz=2; create table t1 (a int unsigned not null primary key auto_increment) engine ndb; insert into t1 values (); insert into t1 values (2); insert into t1 values (); insert into t1 values (); select * from t1 order by a; a 1 2 5 9 drop table t1; set @@auto_increment_increment=2; set @@auto_increment_offset=1; First look at default SE behaviour on manual insert unaligned with offset + step create table t1 (a int unsigned not null primary key auto_increment); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 9 insert into t1 values(); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 1 insert into t1 values(18); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 1 insert into t1 values(); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 19 insert into t1 values(); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 21 insert into t1 values(); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 23 insert into t1 values(22); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 23 insert into t1 values(); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 25 insert into t1 values(28); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 25 insert into t1 values(); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 29 insert into t1 values(); show variables like 'LAST_INSERT_ID'; Variable_name Value last_insert_id 31 select * from t1 order by a; a 1 18 19 21 22 23 25 28 29 31 drop table t1;