This repository has been archived by the owner on Nov 24, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
okJiang
authored and
okJiang
committed
Jul 15, 2021
1 parent
2452d7e
commit 7250ee0
Showing
2 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
set @@session.SQL_MODE='PIPES_AS_CONCAT,IGNORE_SPACE,ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,NO_AUTO_VALUE_ON_ZERO,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,REAL_AS_FLOAT'; | ||
set @@session.sql_mode='ONLY_FULL_GROUP_BY,NO_UNSIGNED_SUBTRACTION,NO_DIR_IN_CREATE,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,REAL_AS_FLOAT'; | ||
-- NO_AUTO_CREATE_USER set failed in mysql8.0 | ||
use sql_mode; | ||
|
||
-- test sql_mode PIPES_AS_CONCAT | ||
set @@session.sql_mode=concat(@@session.sql_mode, ',PIPES_AS_CONCAT'); | ||
insert into t_2(name) values('pipes'||'as'||'concat'); | ||
|
||
-- test sql_mode ANSI_QUOTES | ||
insert into t_2(name) values("a"); | ||
|
||
-- test sql_mode IGNORE_SPACE | ||
set @@session.sql_mode=concat(@@session.sql_mode, ',IGNORE_SPACE'); | ||
select count (*) as c from t_2; | ||
|
||
-- test sql_mode NO_AUTO_VALUE_ON_ZERO | ||
set @@session.sql_mode=concat(@@session.sql_mode, ',NO_AUTO_VALUE_ON_ZERO'); | ||
insert into t_2(id, name) values (10, 'a'); | ||
insert into t_2(id, name) values (0, 'b'); | ||
|
||
-- test sql_mode NO_BACKSLASH_ESCAPES | ||
set @@session.sql_mode=concat(@@session.sql_mode, ',NO_BACKSLASH_ESCAPES'); | ||
insert into t_2(name) values ('\\a'); |