-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tianmu):set sql_mode=MANDATORY_TIANMU,Cannot create stored routin…
…e xxx. Check warnings(#1065) NOTE: When adding new SQL_MODE types, make sure to also add them to the scripts used for creating the MySQL system tables in scripts/mysql_system_tables.sql and scripts/mysql_system_tables_fix.sql
- Loading branch information
Showing
4 changed files
with
360 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
USE test; | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
CREATE TABLE t_test( | ||
id INT NOT NULL AUTO_INCREMENT, | ||
first_name VARCHAR(10) NOT NULL, | ||
last_name VARCHAR(10) NOT NULL, | ||
sex VARCHAR(5) NOT NULL, | ||
score INT NOT NULL, | ||
copy_id INT NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) engine=tianmu; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
drop PROCEDURE add_user; | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,MANDATORY_TIANMU'; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
drop PROCEDURE add_user; | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
drop PROCEDURE add_user; | ||
drop table t_test; | ||
CREATE TABLE t_test( | ||
id INT NOT NULL AUTO_INCREMENT, | ||
first_name VARCHAR(10) NOT NULL, | ||
last_name VARCHAR(10) NOT NULL, | ||
sex VARCHAR(5) NOT NULL, | ||
score INT NOT NULL, | ||
copy_id INT NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) engine=innodb; | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,MANDATORY_TIANMU'; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
drop PROCEDURE add_user; | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
drop PROCEDURE add_user; | ||
drop table t_test; |
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 |
---|---|---|
@@ -0,0 +1,198 @@ | ||
--source include/have_tianmu.inc | ||
|
||
USE test; | ||
--disable_warnings | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
--enable_warnings | ||
CREATE TABLE t_test( | ||
id INT NOT NULL AUTO_INCREMENT, | ||
first_name VARCHAR(10) NOT NULL, | ||
last_name VARCHAR(10) NOT NULL, | ||
sex VARCHAR(5) NOT NULL, | ||
score INT NOT NULL, | ||
copy_id INT NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) engine=tianmu; | ||
|
||
|
||
DELIMITER //; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
DELIMITER ;// | ||
|
||
drop PROCEDURE add_user; | ||
|
||
|
||
--disable_warnings | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,MANDATORY_TIANMU'; | ||
--enable_warnings | ||
|
||
DELIMITER //; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
DELIMITER ;// | ||
|
||
drop PROCEDURE add_user; | ||
|
||
--disable_warnings | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
--enable_warnings | ||
|
||
DELIMITER //; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
DELIMITER ;// | ||
|
||
drop PROCEDURE add_user; | ||
|
||
drop table t_test; | ||
|
||
|
||
CREATE TABLE t_test( | ||
id INT NOT NULL AUTO_INCREMENT, | ||
first_name VARCHAR(10) NOT NULL, | ||
last_name VARCHAR(10) NOT NULL, | ||
sex VARCHAR(5) NOT NULL, | ||
score INT NOT NULL, | ||
copy_id INT NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) engine=innodb; | ||
|
||
--disable_warnings | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,MANDATORY_TIANMU'; | ||
--enable_warnings | ||
|
||
DELIMITER //; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
DELIMITER ;// | ||
|
||
drop PROCEDURE add_user; | ||
|
||
--disable_warnings | ||
set sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; | ||
--enable_warnings | ||
|
||
DELIMITER //; | ||
create PROCEDURE add_user(in num INT) | ||
BEGIN | ||
DECLARE rowid INT DEFAULT 0; | ||
DECLARE firstname CHAR(1); | ||
DECLARE name1 CHAR(1); | ||
DECLARE name2 CHAR(1); | ||
DECLARE lastname VARCHAR(3) DEFAULT ''; | ||
DECLARE sex CHAR(1); | ||
DECLARE score CHAR(2); | ||
WHILE rowid < num DO | ||
SET firstname = SUBSTRING('赵钱孙李周吴郑王林杨柳刘孙陈江阮侯邹高彭徐',FLOOR(1+21*RAND()),1); | ||
SET name1 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET name2 = SUBSTRING('一二三四五六七八九十甲乙丙丁静景京晶名明铭敏闵民军君俊骏天田甜兲恬益依成城诚立莉力黎励',ROUND(1+43*RAND()),1); | ||
SET sex=FLOOR(0 + (RAND() * 2)); | ||
SET score= FLOOR(40 + (RAND() *60)); | ||
SET rowid = rowid + 1; | ||
IF ROUND(RAND())=0 THEN | ||
SET lastname =name1; | ||
END IF; | ||
IF ROUND(RAND())=1 THEN | ||
SET lastname = CONCAT(name1,name2); | ||
END IF; | ||
insert INTO t_test(first_name,last_name,sex,score,copy_id) VALUES (firstname,lastname,sex,score,rowid); | ||
END WHILE; | ||
END // | ||
DELIMITER ;// | ||
|
||
drop PROCEDURE add_user; | ||
|
||
drop table t_test; |
Oops, something went wrong.