Server IP : 172.67.216.182 / Your IP : 172.68.242.42 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/innodb/r/ |
Upload File : |
use test; drop table if exists t; create temporary table t ( i int, f float, primary key pk_index(i), index sec_index(f) ) engine = innodb; insert into t values (10, 2.2), (20, 3.3), (30, 4.4), (40, 5.5); rollback; select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 update t set i = 50 where i = 40; update t set i = 60 where i = 30; rollback; select * from t; i f 10 2.2 20 3.3 60 4.4 50 5.5 delete from t where i = 10; delete from t where f < 3.4; rollback; select * from t; i f 60 4.4 50 5.5 delete from t where i = 10; delete from t; select * from t; i f drop table if exists t; create temporary table t ( i int, f float, primary key pk_index(i), index sec_index(f) ) engine = innodb; begin; insert into t values (10, 2.2), (20, 3.3), (30, 4.4), (40, 5.5); select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 commit; select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 rollback; select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 drop table if exists t; create temporary table t ( i int, f float, primary key pk_index(i), index sec_index(f) ) engine = innodb; begin; insert into t values (10, 2.2), (20, 3.3), (30, 4.4), (40, 5.5); select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 rollback; select * from t; i f insert into t values (10, 2.2), (20, 3.3), (30, 4.4), (40, 5.5); begin; delete from t; select * from t; i f rollback; select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 begin; update t set i = 50 where i = 40; update t set i = 60 where i = 30; select * from t; i f 10 2.2 20 3.3 60 4.4 50 5.5 rollback; select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 drop table if exists t; create temporary table t ( i int, f float, primary key pk_index(i), index sec_index(f) ) engine = innodb; start transaction; savepoint first; insert into t values (10, 2.2), (20, 3.3), (30, 4.4), (40, 5.5); select * from t; i f 10 2.2 20 3.3 30 4.4 40 5.5 rollback to first; select * from t; i f insert into t values (10, 2.2), (20, 3.3), (30, 4.4), (40, 5.5); begin; delete from t where i = 10; select * from t; i f 20 3.3 30 4.4 40 5.5 savepoint first; delete from t; select * from t; i f rollback to first; select * from t; i f 20 3.3 30 4.4 40 5.5 commit; select * from t; i f 20 3.3 30 4.4 40 5.5 begin; update t set i = 50 where i = 40; savepoint first; update t set i = 60 where i = 30; select * from t; i f 20 3.3 60 4.4 50 5.5 rollback to first; select * from t; i f 20 3.3 30 4.4 50 5.5 commit; drop table if exists t; use test; create temporary table t1 (i int, f float, primary key pk(i), unique index fk(f) ) engine = innodb; insert into t1 values (1, 1.2), (2, 2.3), (3, 3.4); select * from t1; i f 1 1.2 2 2.3 3 3.4 insert into t1 values (4, 4.5), (1, 5.6); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' select * from t1; i f 1 1.2 2 2.3 3 3.4 insert into t1 values (4, 4.5), (5, 5.6); select * from t1; i f 1 1.2 2 2.3 3 3.4 4 4.5 5 5.6 update t1 set i = 1 where i = 4; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' truncate table t1; insert into t1 values (1, 1.2), (3, 2.3), (5, 3.4), (6, 7.4); select * from t1; i f 1 1.2 3 2.3 5 3.4 6 7.4 update t1 set i = i + 1; ERROR 23000: Duplicate entry '6' for key 'PRIMARY' select * from t1; i f 1 1.2 3 2.3 5 3.4 6 7.4 drop table t1;