Skip to content

Commit 7025a51

Browse files
committed
fix the typo OPTION_NO_CHECK_CONSTRAINT_CHECKS
1 parent acb4a87 commit 7025a51

File tree

5 files changed

+37
-10
lines changed

5 files changed

+37
-10
lines changed

mysql-test/r/check_constraint.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,16 @@ ERROR 23000: CONSTRAINT `t.b` failed for `test`.`t`
222222
insert into t values (1,1);
223223
ERROR 23000: CONSTRAINT `b` failed for `test`.`t`
224224
drop table t;
225+
create table t1 (a int auto_increment primary key, b int, check (b > 5));
226+
insert t1 (b) values (1);
227+
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
228+
insert t1 (b) values (10);
229+
select * from t1 where a is null;
230+
a b
231+
set sql_auto_is_null=1;
232+
select * from t1 where a is null;
233+
a b
234+
1 10
235+
insert t1 (b) values (1);
236+
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
237+
drop table t1;

mysql-test/r/mysqlbinlog.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ ROLLBACK/*!*/;
724724
use `test`/*!*/;
725725
SET TIMESTAMP=1253783037/*!*/;
726726
SET @@session.pseudo_thread_id=999999999/*!*/;
727-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
727+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
728728
SET @@session.sql_mode=0/*!*/;
729729
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
730730
/*!\C latin1 *//*!*/;
@@ -778,7 +778,7 @@ DELIMITER /*!*/;
778778
ROLLBACK/*!*/;
779779
SET TIMESTAMP=1253783037/*!*/;
780780
SET @@session.pseudo_thread_id=999999999/*!*/;
781-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
781+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
782782
SET @@session.sql_mode=0/*!*/;
783783
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
784784
/*!\C latin1 *//*!*/;
@@ -813,7 +813,7 @@ ROLLBACK /* added by mysqlbinlog */;
813813
DELIMITER /*!*/;
814814
SET TIMESTAMP=1266652094/*!*/;
815815
SET @@session.pseudo_thread_id=999999999/*!*/;
816-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
816+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
817817
SET @@session.sql_mode=0/*!*/;
818818
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
819819
/*!\C latin1 *//*!*/;
@@ -855,7 +855,7 @@ ROLLBACK /* added by mysqlbinlog */;
855855
DELIMITER /*!*/;
856856
SET TIMESTAMP=1266652094/*!*/;
857857
SET @@session.pseudo_thread_id=999999999/*!*/;
858-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
858+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
859859
SET @@session.sql_mode=0/*!*/;
860860
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
861861
/*!\C latin1 *//*!*/;
@@ -964,7 +964,7 @@ AAAAAAAAAAAAAAAAAAAgrgJSFzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
964964
# Event: Query thread_id=1 exec_time=0 error_code=0
965965
SET TIMESTAMP=1375907364/*!*/;
966966
SET @@session.pseudo_thread_id=1/*!*/;
967-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
967+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
968968
SET @@session.sql_mode=0/*!*/;
969969
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
970970
/*!\C latin1 *//*!*/;
@@ -1047,7 +1047,7 @@ AAAAAAAAAAAAAAAAAAA/rQJSGzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
10471047
# Event: Query thread_id=1 exec_time=1 error_code=0
10481048
SET TIMESTAMP=1375907141/*!*/;
10491049
SET @@session.pseudo_thread_id=1/*!*/;
1050-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
1050+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
10511051
SET @@session.sql_mode=0/*!*/;
10521052
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
10531053
/*!\C latin1 *//*!*/;
@@ -1130,7 +1130,7 @@ AAAAAAAAAAAAAAAAAAAnrAJSHzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
11301130
# Event: Query thread_id=1 exec_time=0 error_code=0
11311131
SET TIMESTAMP=1375906879/*!*/;
11321132
SET @@session.pseudo_thread_id=1/*!*/;
1133-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
1133+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
11341134
SET @@session.sql_mode=0/*!*/;
11351135
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
11361136
/*!\C latin1 *//*!*/;
@@ -1213,7 +1213,7 @@ AAAAAAAAAAAAAAAAAABbsAJSEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
12131213
# Event: Query thread_id=1 exec_time=0 error_code=0
12141214
SET TIMESTAMP=1375907933/*!*/;
12151215
SET @@session.pseudo_thread_id=1/*!*/;
1216-
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
1216+
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
12171217
SET @@session.sql_mode=0/*!*/;
12181218
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
12191219
/*!\C latin1 *//*!*/;

mysql-test/suite/binlog/r/binlog_base64_flag.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ DELIMITER /*!*/;
5757
# at 102
5858
<#>use `test`/*!*/;
5959
SET TIMESTAMP=1196959712/*!*/;
60-
<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
60+
<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
6161
SET @@session.sql_mode=0/*!*/;
6262
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
6363
/*!\C latin1 *//*!*/;

mysql-test/t/check_constraint.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,17 @@ insert into t values (-1, 0);
162162
insert into t values (1,1);
163163

164164
drop table t;
165+
166+
#
167+
# check constraints and auto_is_null typo
168+
#
169+
create table t1 (a int auto_increment primary key, b int, check (b > 5));
170+
--error ER_CONSTRAINT_FAILED
171+
insert t1 (b) values (1);
172+
insert t1 (b) values (10);
173+
select * from t1 where a is null;
174+
set sql_auto_is_null=1;
175+
select * from t1 where a is null;
176+
--error ER_CONSTRAINT_FAILED
177+
insert t1 (b) values (1);
178+
drop table t1;

sql/sql_priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern
127127
#define OPTION_WARNINGS (1ULL << 13) // THD, user
128128
#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog
129-
#define OPTION_NO_CHECK_CONSTRAINT_CHECKS (1ULL << 14)
129+
#define OPTION_NO_CHECK_CONSTRAINT_CHECKS (1ULL << 15)
130130
#define OPTION_SAFE_UPDATES (1ULL << 16) // THD, user
131131
#define OPTION_BUFFER_RESULT (1ULL << 17) // SELECT, user
132132
#define OPTION_BIN_LOG (1ULL << 18) // THD, user

0 commit comments

Comments
 (0)