Server IP : 172.67.216.182 / Your IP : 172.71.124.70 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/sys_vars/r/ |
Upload File : |
** Setup ** SET @default_sql_safe_updates = @@sql_safe_updates; CREATE TEMPORARY TABLE t1(a int PRIMARY KEY, b varchar(20)); INSERT INTO t1 VALUES(1, 'val1'); INSERT INTO t1 VALUES(2, 'val2'); INSERT INTO t1 VALUES(3, 'val3'); INSERT INTO t1 VALUES(4, 'val4'); INSERT INTO t1 VALUES(5, 'val5'); INSERT INTO t1 VALUES(6, 'val6'); INSERT INTO t1 VALUES(7, 'val7'); INSERT INTO t1 VALUES(8, 'val8'); INSERT INTO t1 VALUES(9, 'val9'); '#-----------------------------FN_DYNVARS_164_01------------------------------------#' Value ON SET SESSION sql_safe_updates = ON; '#-----------------------------FN_DYNVARS_164_02------------------------------------#' Expected error : Update without key in safe mode DELETE FROM t1; ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. SELECT * FROM t1; a b 1 val1 2 val2 3 val3 4 val4 5 val5 6 val6 7 val7 8 val8 9 val9 PREPARE stmt FROM 'DELETE FROM t1;'; Expected error : Update without key in safe mode EXECUTE stmt; ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. DEALLOCATE PREPARE stmt; '#-----------------------------FN_DYNVARS_164_03------------------------------------#' No error : Update without key in safe mode but with LIMIT DELETE FROM t1 LIMIT 2; SELECT * FROM t1; a b 3 val3 4 val4 5 val5 6 val6 7 val7 8 val8 9 val9 '#-----------------------------FN_DYNVARS_164_04------------------------------------#' Expected error : Update without key in safe mode DELETE FROM t1 WHERE b='val1'; ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. SELECT * FROM t1; a b 3 val3 4 val4 5 val5 6 val6 7 val7 8 val8 9 val9 '#-----------------------------FN_DYNVARS_164_05------------------------------------#' This one should work DELETE FROM t1 WHERE a=3; SELECT * FROM t1; a b 4 val4 5 val5 6 val6 7 val7 8 val8 9 val9 Value OFF SET SESSION sql_safe_updates = OFF; '#-----------------------------FN_DYNVARS_164_06------------------------------------#' This one should work DELETE FROM t1 WHERE b='val1'; SELECT * FROM t1; a b 4 val4 5 val5 6 val6 7 val7 8 val8 9 val9 '#-----------------------------FN_DYNVARS_164_07------------------------------------#' This one should work DELETE FROM t1 WHERE a=5; SELECT * FROM t1; a b 4 val4 6 val6 7 val7 8 val8 9 val9 '#-----------------------------FN_DYNVARS_164_08------------------------------------#' This one should work DELETE FROM t1 LIMIT 2; SELECT * FROM t1; a b 7 val7 8 val8 9 val9 '#-----------------------------FN_DYNVARS_164_09------------------------------------#' This one should work DELETE FROM t1; Bug#35392 Unexpected error occurs in this statement Can't change size of the file statement is remarked because the error is uncatchable by testing framework SELECT * FROM t1; a b 7 val7 8 val8 9 val9 PREPARE stmt FROM 'DELETE FROM t1;'; Expected error : Update without key in safe mode Bug#35392 Unexpected error occurs in this statement Can't change size of the file statement is remarked because the error is uncatchable by testing framework DEALLOCATE PREPARE stmt; '#----------------------------FN_DYNVARS_164_10--------------------------------------#' ** Connecting con_int1 using root ** ** Connection con_int1 ** SELECT @@SESSION.sql_safe_updates; @@SESSION.sql_safe_updates 0 0 / FALSE Expected SET SESSION sql_safe_updates = FALSE; ** Connecting con_int2 using root ** ** Connection con_int2 ** SELECT @@SESSION.sql_safe_updates; @@SESSION.sql_safe_updates 0 0 / FALSE Expected SET SESSION sql_safe_updates = TRUE; ** Connection con_int2 ** SELECT @@SESSION.sql_safe_updates; @@SESSION.sql_safe_updates 1 1 / TRUE Expected ** Connection con_int1 ** SELECT @@SESSION.sql_safe_updates; @@SESSION.sql_safe_updates 0 0 / FALSE Expected ** Connection default ** Disconnecting Connections con_int1, con_int2 SET SESSION sql_safe_updates = @default_sql_safe_updates; DROP TABLE t1;