Loading client/mysqldump.c +25 −39 Original line number Diff line number Diff line Loading @@ -1193,12 +1193,12 @@ static void print_xml_row(FILE *xml_file, const char *row_name, static uint dump_routines_for_db (char *db) { char query_buff[512], routine_type[10]; char db_name_buff[NAME_LEN+3], name_buff[NAME_LEN+3]; char query_buff[512]; const char *routine_type[]={"FUNCTION", "PROCEDURE"}; char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3], *routine_name; int i; FILE *sql_file = md_result_file; MYSQL_RES *routine_res= NULL; MYSQL_RES *routine_list_res= NULL; MYSQL_RES *routine_res, *routine_list_res; MYSQL_ROW row, routine_list_row; DBUG_ENTER("dump_routines_for_db"); Loading @@ -1211,23 +1211,20 @@ static uint dump_routines_for_db (char *db) fprintf(sql_file, "\n--\n-- Dumping routines for database '%s'\n--\n", db); /* not using "mysql_query_with_error_report" because of privileges not using "mysql_query_with_error_report" because we may have not enough privileges to lock mysql.proc. */ if (opt_lock) if (lock_tables) mysql_query(sock, "LOCK TABLES mysql.proc READ"); fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n"); fprintf(sql_file, "DELIMITER //\n"); /* 0, retrieve and dump functions, 1, procedures */ for (i=0; i <= 1; i++) { my_snprintf(routine_type, sizeof(routine_type), "%s", i == 0 ? "FUNCTION" : "PROCEDURE"); my_snprintf(query_buff, sizeof(query_buff), "SHOW %s STATUS WHERE Db = '%s'", routine_type, db_name_buff); routine_type[i], db_name_buff); if (mysql_query_with_error_report(sock, &routine_list_res, query_buff)) DBUG_RETURN(1); Loading @@ -1237,11 +1234,11 @@ static uint dump_routines_for_db (char *db) while((routine_list_row= mysql_fetch_row(routine_list_res))) { DBUG_PRINT("info", ("retrieving CREATE %s for %s", routine_type, name_buff)); mysql_real_escape_string(sock, name_buff, routine_list_row[1], strlen(routine_list_row[1])); DBUG_PRINT("info", ("retrieving CREATE %s for %s", routine_type[i], name_buff)); routine_name=quote_name(routine_list_row[1], name_buff, 0); my_snprintf(query_buff, sizeof(query_buff), "SHOW CREATE %s %s", routine_type, name_buff); routine_type[i], routine_name); if (mysql_query_with_error_report(sock, &routine_res, query_buff)) DBUG_RETURN(1); Loading @@ -1249,41 +1246,36 @@ static uint dump_routines_for_db (char *db) while ((row=mysql_fetch_row(routine_res))) { /* the user can see routine names, but NOT the routine body of other routines that are not the creator of! if the user has EXECUTE privilege he see routine names, but NOT the routine body of other routines that are not the creator of! */ DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d", name_buff, row[2], strlen(row[2]))); routine_name, row[2], strlen(row[2]))); if (strlen(row[2])) { fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/ //\n", row[1] /* sql_mode */); if (opt_drop) fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */ //\n", routine_type, name_buff); routine_type[i], routine_name); /* the i==0 is temporary until we can figure out why functions can't be in comments */ /* create proc/func body */; we need to change sql_mode only for the CREATE PROCEDURE/FUNCTION otherwise we may need to re-quote routine_name */; fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/ //\n", row[1] /* sql_mode */); fprintf(sql_file, "/*!50003 %s */ //\n", row[2]); fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //\n"); } } /* end of routine printing */ } /* end of list of routines */ mysql_free_result(routine_res); routine_res=NULL; } mysql_free_result(routine_list_res); routine_list_res=NULL; } /* end of for i (0 .. 1) */ /* set the delimiter back to ';' */ fprintf(sql_file, "DELIMITER ;\n"); fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;\n"); /* again, no error report due to permissions */ if (opt_lock) mysql_query(sock, "UNLOCK TABLES"); if (lock_tables) mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"); DBUG_RETURN(0); } Loading Loading @@ -1739,12 +1731,6 @@ static uint get_table_structure(char *table, char *db) the tables have been dumped in case a trigger depends on the existence of a table INPUT char * tablename and db name RETURNS 0 Failure 1 Succes */ static void dump_triggers_for_table (char *table, char *db) Loading @@ -1752,7 +1738,7 @@ static void dump_triggers_for_table (char *table, char *db) MYSQL_RES *result; MYSQL_ROW row; char *result_table; char name_buff[NAME_LEN+3], table_buff[NAME_LEN*2+3]; char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3]; char query_buff[512]; FILE *sql_file = md_result_file; Loading mysql-test/mysql-test-run.sh +9 −1 Original line number Diff line number Diff line Loading @@ -235,6 +235,7 @@ DO_GDB="" MANUAL_GDB="" DO_DDD="" DO_CLIENT_GDB="" DO_VALGRIND_MYSQL_TEST="" SLEEP_TIME_AFTER_RESTART=1 SLEEP_TIME_FOR_DELETE=10 SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables Loading Loading @@ -432,6 +433,9 @@ while test $# -gt 0; do TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"` VALGRIND="$VALGRIND $TMP" ;; --valgrind-mysqltest) DO_VALGRIND_MYSQL_TEST=1 ;; --skip-ndbcluster | --skip-ndb) USE_NDBCLUSTER="" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-ndbcluster" Loading Loading @@ -666,7 +670,7 @@ else MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test_embedded" fi else MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_TEST="$VALGRIND_MYSQLTEST $CLIENT_BINDIR/mysqltest" MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test" fi fi Loading @@ -681,6 +685,10 @@ then SLAVE_MYSQLD=$MYSQLD fi if [ x$DO_VALGRIND_MYSQL_TEST = x1 ] ; then MYSQL_TEST="$VALGRIND $MYSQL_TEST" fi # If we should run all tests cases, we will use a local server for that if [ -z "$1" ] Loading mysql-test/r/bigint.result +185 −7 Original line number Diff line number Diff line Loading @@ -46,6 +46,14 @@ a drop table t1; create table t1 ( a int not null default 1, big bigint ); insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615); Warnings: Warning 1264 Out of range value adjusted for column 'big' at row 4 select * from t1; a big 1 -1 1 12345678901234567 1 9223372036854775807 1 9223372036854775807 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 Loading @@ -53,26 +61,51 @@ select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 alter table t1 modify big bigint unsigned not null; Warnings: Warning 1264 Out of range value adjusted for column 'big' at row 1 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 0 9223372036854775807 9223372036854775806 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 0 9223372036854775807 9223372036854775806 insert into t1 (big) values (18446744073709551615); select * from t1; a big 1 0 1 12345678901234567 1 9223372036854775807 1 9223372036854775807 1 18446744073709551615 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 alter table t1 add key (big); select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 alter table t1 modify big bigint not null; Warnings: Warning 1264 Out of range value adjusted for column 'big' at row 5 select * from t1; a big 1 0 1 12345678901234567 1 9223372036854775807 1 9223372036854775807 1 9223372036854775807 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 0 9223372036854775807 9223372036854775806 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 0 9223372036854775807 9223372036854775806 drop table t1; create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999; insert into t1 values (null,1); Loading @@ -89,7 +122,7 @@ insert into t1 values (10000000000000000000.0); insert into t1 values ('10000000000000000000'); select * from t1; quantity -8446744073709551616 10000000000000000000 10000000000000000000 10000000000000000000 drop table t1; Loading Loading @@ -154,3 +187,148 @@ select * from t1; a 9223372036854775809 drop table t1; DROP DATABASE IF EXISTS `scott`; Warnings: Note 1008 Can't drop database 'scott'; database doesn't exist create table t1 (a char(100), b varchar(100), c text, d blob); insert into t1 values( 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615 ); insert into t1 values (-1 | 0,-1 | 0,-1 | 0 ,-1 | 0); select * from t1; a b c d 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 drop table t1; create table t1 ( quantity decimal(2) unsigned); insert into t1 values (500), (-500), (~0), (-1); Warnings: Warning 1264 Out of range value adjusted for column 'quantity' at row 1 Warning 1264 Out of range value adjusted for column 'quantity' at row 2 Warning 1264 Out of range value adjusted for column 'quantity' at row 3 Warning 1264 Out of range value adjusted for column 'quantity' at row 4 select * from t1; quantity 99 0 99 0 drop table t1; CREATE TABLE t1 ( `col1` INT(1) NULL, `col2` INT(2) NULL, `col3` INT(3) NULL, `col4` INT(4) NULL, `col5` INT(5) NULL, `col6` INT(6) NULL, `col7` INT(7) NULL, `col8` INT(8) NULL, `col9` INT(9) NULL, `col10` BIGINT(10) NULL, `col11` BIGINT(11) NULL, `col12` BIGINT(12) NULL, `col13` BIGINT(13) NULL, `col14` BIGINT(14) NULL, `col15` BIGINT(15) NULL, `col16` BIGINT(16) NULL, `col17` BIGINT(17) NULL, `col18` BIGINT(18) NULL, `col19` DECIMAL(19, 0) NULL, `col20` DECIMAL(20, 0) NULL, `col21` DECIMAL(21, 0) NULL, `col22` DECIMAL(22, 0) NULL, `col23` DECIMAL(23, 0) NULL, `col24` DECIMAL(24, 0) NULL, `col25` DECIMAL(25, 0) NULL, `col26` DECIMAL(26, 0) NULL, `col27` DECIMAL(27, 0) NULL, `col28` DECIMAL(28, 0) NULL, `col29` DECIMAL(29, 0) NULL, `col30` DECIMAL(30, 0) NULL, `col31` DECIMAL(31, 0) NULL, `col32` DECIMAL(32, 0) NULL, `col33` DECIMAL(33, 0) NULL, `col34` DECIMAL(34, 0) NULL, `col35` DECIMAL(35, 0) NULL, `col36` DECIMAL(36, 0) NULL, `col37` DECIMAL(37, 0) NULL, `col38` DECIMAL(38, 0) NULL, `fix1` DECIMAL(38, 1) NULL, `fix2` DECIMAL(38, 2) NULL, `fix3` DECIMAL(38, 3) NULL, `fix4` DECIMAL(38, 4) NULL, `fix5` DECIMAL(38, 5) NULL, `fix6` DECIMAL(38, 6) NULL, `fix7` DECIMAL(38, 7) NULL, `fix8` DECIMAL(38, 8) NULL, `fix9` DECIMAL(38, 9) NULL, `fix10` DECIMAL(38, 10) NULL, `fix11` DECIMAL(38, 11) NULL, `fix12` DECIMAL(38, 12) NULL, `fix13` DECIMAL(38, 13) NULL, `fix14` DECIMAL(38, 14) NULL, `fix15` DECIMAL(38, 15) NULL, `fix16` DECIMAL(38, 16) NULL, `fix17` DECIMAL(38, 17) NULL, `fix18` DECIMAL(38, 18) NULL, `fix19` DECIMAL(38, 19) NULL, `fix20` DECIMAL(38, 20) NULL, `fix21` DECIMAL(38, 21) NULL, `fix22` DECIMAL(38, 22) NULL, `fix23` DECIMAL(38, 23) NULL, `fix24` DECIMAL(38, 24) NULL, `fix25` DECIMAL(38, 25) NULL, `fix26` DECIMAL(38, 26) NULL, `fix27` DECIMAL(38, 27) NULL, `fix28` DECIMAL(38, 28) NULL, `fix29` DECIMAL(38, 29) NULL, `fix30` DECIMAL(38, 30) NULL ); INSERT INTO t1(`col1`, `col2`, `col3`, `col4`, `col5`, `col6`, `col7`, `col8`, `col9`, `col10`, `col11`, `col12`, `col13`, `col14`, `col15`, `col16`, `col17`, `col18`, `col19`, `col20`, `col21`, `col22`, `col23`, `col24`, `col25`, `col26`, `col27`, `col28`, `col29`, `col30`, `col31`, `col32`, `col33`, `col34`, `col35`, `col36`, `col37`, `col38`, `fix1`, `fix2`, `fix3`, `fix4`, `fix5`, `fix6`, `fix7`, `fix8`, `fix9`, `fix10`, `fix11`, `fix12`, `fix13`, `fix14`, `fix15`, `fix16`, `fix17`, `fix18`, `fix19`, `fix20`, `fix21`, `fix22`, `fix23`, `fix24`, `fix25`, `fix26`, `fix27`, `fix28`, `fix29`, `fix30`) VALUES (9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, 9999999999, 99999999999, 999999999999, 9999999999999, 99999999999999, 999999999999999, 9999999999999999, 99999999999999999, 999999999999999999, 9999999999999999999, 99999999999999999999, 999999999999999999999, 9999999999999999999999, 99999999999999999999999, 999999999999999999999999, 9999999999999999999999999, 99999999999999999999999999, 999999999999999999999999999, 9999999999999999999999999999, 99999999999999999999999999999, 999999999999999999999999999999, 9999999999999999999999999999999, 99999999999999999999999999999999, 999999999999999999999999999999999, 9999999999999999999999999999999999, 99999999999999999999999999999999999, 999999999999999999999999999999999999, 9999999999999999999999999999999999999, 99999999999999999999999999999999999999, 9999999999999999999999999999999999999.9, 999999999999999999999999999999999999.99, 99999999999999999999999999999999999.999, 9999999999999999999999999999999999.9999, 999999999999999999999999999999999.99999, 99999999999999999999999999999999.999999, 9999999999999999999999999999999.9999999, 999999999999999999999999999999.99999999, 99999999999999999999999999999.999999999, 9999999999999999999999999999.9999999999, 999999999999999999999999999.99999999999, 99999999999999999999999999.999999999999, 9999999999999999999999999.9999999999999, 999999999999999999999999.99999999999999, 99999999999999999999999.999999999999999, 9999999999999999999999.9999999999999999, 999999999999999999999.99999999999999999, 99999999999999999999.999999999999999999, 9999999999999999999.9999999999999999999, 999999999999999999.99999999999999999999, 99999999999999999.999999999999999999999, 9999999999999999.9999999999999999999999, 999999999999999.99999999999999999999999, 99999999999999.999999999999999999999999, 9999999999999.9999999999999999999999999, 999999999999.99999999999999999999999999, 99999999999.999999999999999999999999999, 9999999999.9999999999999999999999999999, 999999999.99999999999999999999999999999, 99999999.999999999999999999999999999999); SELECT * FROM t1; col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 fix1 fix2 fix3 fix4 fix5 fix6 fix7 fix8 fix9 fix10 fix11 fix12 fix13 fix14 fix15 fix16 fix17 fix18 fix19 fix20 fix21 fix22 fix23 fix24 fix25 fix26 fix27 fix28 fix29 fix30 9 99 999 9999 99999 999999 9999999 99999999 999999999 9999999999 99999999999 999999999999 9999999999999 99999999999999 999999999999999 9999999999999999 99999999999999999 999999999999999999 9999999999999999999 99999999999999999999 999999999999999999999 9999999999999999999999 99999999999999999999999 999999999999999999999999 9999999999999999999999999 99999999999999999999999999 999999999999999999999999999 9999999999999999999999999999 99999999999999999999999999999 999999999999999999999999999999 9999999999999999999999999999999 99999999999999999999999999999999 999999999999999999999999999999999 9999999999999999999999999999999999 99999999999999999999999999999999999 999999999999999999999999999999999999 9999999999999999999999999999999999999 99999999999999999999999999999999999999 9999999999999999999999999999999999999.9 999999999999999999999999999999999999.99 99999999999999999999999999999999999.999 9999999999999999999999999999999999.9999 999999999999999999999999999999999.99999 99999999999999999999999999999999.999999 9999999999999999999999999999999.9999999 999999999999999999999999999999.99999999 99999999999999999999999999999.999999999 9999999999999999999999999999.9999999999 999999999999999999999999999.99999999999 99999999999999999999999999.999999999999 9999999999999999999999999.9999999999999 999999999999999999999999.99999999999999 99999999999999999999999.999999999999999 9999999999999999999999.9999999999999999 999999999999999999999.99999999999999999 99999999999999999999.999999999999999999 9999999999999999999.9999999999999999999 999999999999999999.99999999999999999999 99999999999999999.999999999999999999999 9999999999999999.9999999999999999999999 999999999999999.99999999999999999999999 99999999999999.999999999999999999999999 9999999999999.9999999999999999999999999 999999999999.99999999999999999999999999 99999999999.999999999999999999999999999 9999999999.9999999999999999999999999999 999999999.99999999999999999999999999999 99999999.999999999999999999999999999999 DROP TABLE t1; mysql-test/r/mysqldump.result +27 −21 Original line number Diff line number Diff line Loading @@ -1908,28 +1908,28 @@ a2 DROP TRIGGER testref; DROP TABLE test1; DROP TABLE test2; CREATE TABLE t1 (id int); INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(3); INSERT INTO t1 VALUES(4); INSERT INTO t1 VALUES(5); DROP TABLE IF EXISTS t1; DROP FUNCTION IF EXISTS bug9056_func1; CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b // DROP FUNCTION IF EXISTS bug9056_func2; DROP PROCEDURE IF EXISTS bug9056_proc1; DROP PROCEDURE IF EXISTS bug9056_proc2; CREATE TABLE t1 (id int); INSERT INTO t1 VALUES(1), (2), (3), (4), (5); CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b // CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) BEGIN SELECT a+b INTO c; end // DROP FUNCTION IF EXISTS bug9056_func2 // create function bug9056_func2(f1 char binary) returns char binary begin set f1= concat( 'hello', f1 ); return f1; end // DROP PROCEDURE IF EXISTS bug9056_proc2 // CREATE PROCEDURE bug9056_proc2(OUT a INT) BEGIN select sum(id) from t1 into a; END // set sql_mode='ansi'; create procedure `a'b` () select 1; set sql_mode=''; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; Loading @@ -1954,32 +1954,38 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2),(3),(4),(5); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; DELIMITER // /*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP FUNCTION IF EXISTS bug9056_func1 */ // /*!50003 CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP FUNCTION IF EXISTS bug9056_func2 */ // /*!50003 CREATE FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) begin set f1= concat( 'hello', f1 ); return f1; end */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP PROCEDURE IF EXISTS `a'b` */ // /*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/ // /*!50003 CREATE PROCEDURE "a'b"() select 1 */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP PROCEDURE IF EXISTS bug9056_proc1 */ // /*!50003 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) BEGIN SELECT a+b INTO c; end */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP PROCEDURE IF EXISTS bug9056_proc2 */ // /*!50003 CREATE PROCEDURE `bug9056_proc2`(OUT a INT) BEGIN select sum(id) from t1 into a; END */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // DELIMITER ; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; Loading @@ -1989,8 +1995,8 @@ DELIMITER ; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP PROCEDURE IF EXISTS bug9056_func1; DROP PROCEDURE IF EXISTS bug9056_func2; DROP PROCEDURE IF EXISTS bug9056_proc1; DROP PROCEDURE IF EXISTS bug9056_proc2; DROP FUNCTION bug9056_func1; DROP FUNCTION bug9056_func2; DROP PROCEDURE bug9056_proc1; DROP PROCEDURE bug9056_proc2; drop table t1; mysql-test/r/range.result +2 −2 Original line number Diff line number Diff line Loading @@ -521,8 +521,8 @@ select count(*) from t1 where x = 18446744073709551601; count(*) 1 create table t2 (x bigint not null); insert into t2(x) values (0xfffffffffffffff0); insert into t2(x) values (0xfffffffffffffff1); insert into t2(x) values (cast(0xfffffffffffffff0+0 as signed)); insert into t2(x) values (cast(0xfffffffffffffff1+0 as signed)); select * from t2; x -16 Loading Loading
client/mysqldump.c +25 −39 Original line number Diff line number Diff line Loading @@ -1193,12 +1193,12 @@ static void print_xml_row(FILE *xml_file, const char *row_name, static uint dump_routines_for_db (char *db) { char query_buff[512], routine_type[10]; char db_name_buff[NAME_LEN+3], name_buff[NAME_LEN+3]; char query_buff[512]; const char *routine_type[]={"FUNCTION", "PROCEDURE"}; char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3], *routine_name; int i; FILE *sql_file = md_result_file; MYSQL_RES *routine_res= NULL; MYSQL_RES *routine_list_res= NULL; MYSQL_RES *routine_res, *routine_list_res; MYSQL_ROW row, routine_list_row; DBUG_ENTER("dump_routines_for_db"); Loading @@ -1211,23 +1211,20 @@ static uint dump_routines_for_db (char *db) fprintf(sql_file, "\n--\n-- Dumping routines for database '%s'\n--\n", db); /* not using "mysql_query_with_error_report" because of privileges not using "mysql_query_with_error_report" because we may have not enough privileges to lock mysql.proc. */ if (opt_lock) if (lock_tables) mysql_query(sock, "LOCK TABLES mysql.proc READ"); fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n"); fprintf(sql_file, "DELIMITER //\n"); /* 0, retrieve and dump functions, 1, procedures */ for (i=0; i <= 1; i++) { my_snprintf(routine_type, sizeof(routine_type), "%s", i == 0 ? "FUNCTION" : "PROCEDURE"); my_snprintf(query_buff, sizeof(query_buff), "SHOW %s STATUS WHERE Db = '%s'", routine_type, db_name_buff); routine_type[i], db_name_buff); if (mysql_query_with_error_report(sock, &routine_list_res, query_buff)) DBUG_RETURN(1); Loading @@ -1237,11 +1234,11 @@ static uint dump_routines_for_db (char *db) while((routine_list_row= mysql_fetch_row(routine_list_res))) { DBUG_PRINT("info", ("retrieving CREATE %s for %s", routine_type, name_buff)); mysql_real_escape_string(sock, name_buff, routine_list_row[1], strlen(routine_list_row[1])); DBUG_PRINT("info", ("retrieving CREATE %s for %s", routine_type[i], name_buff)); routine_name=quote_name(routine_list_row[1], name_buff, 0); my_snprintf(query_buff, sizeof(query_buff), "SHOW CREATE %s %s", routine_type, name_buff); routine_type[i], routine_name); if (mysql_query_with_error_report(sock, &routine_res, query_buff)) DBUG_RETURN(1); Loading @@ -1249,41 +1246,36 @@ static uint dump_routines_for_db (char *db) while ((row=mysql_fetch_row(routine_res))) { /* the user can see routine names, but NOT the routine body of other routines that are not the creator of! if the user has EXECUTE privilege he see routine names, but NOT the routine body of other routines that are not the creator of! */ DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d", name_buff, row[2], strlen(row[2]))); routine_name, row[2], strlen(row[2]))); if (strlen(row[2])) { fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/ //\n", row[1] /* sql_mode */); if (opt_drop) fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */ //\n", routine_type, name_buff); routine_type[i], routine_name); /* the i==0 is temporary until we can figure out why functions can't be in comments */ /* create proc/func body */; we need to change sql_mode only for the CREATE PROCEDURE/FUNCTION otherwise we may need to re-quote routine_name */; fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/ //\n", row[1] /* sql_mode */); fprintf(sql_file, "/*!50003 %s */ //\n", row[2]); fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //\n"); } } /* end of routine printing */ } /* end of list of routines */ mysql_free_result(routine_res); routine_res=NULL; } mysql_free_result(routine_list_res); routine_list_res=NULL; } /* end of for i (0 .. 1) */ /* set the delimiter back to ';' */ fprintf(sql_file, "DELIMITER ;\n"); fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;\n"); /* again, no error report due to permissions */ if (opt_lock) mysql_query(sock, "UNLOCK TABLES"); if (lock_tables) mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"); DBUG_RETURN(0); } Loading Loading @@ -1739,12 +1731,6 @@ static uint get_table_structure(char *table, char *db) the tables have been dumped in case a trigger depends on the existence of a table INPUT char * tablename and db name RETURNS 0 Failure 1 Succes */ static void dump_triggers_for_table (char *table, char *db) Loading @@ -1752,7 +1738,7 @@ static void dump_triggers_for_table (char *table, char *db) MYSQL_RES *result; MYSQL_ROW row; char *result_table; char name_buff[NAME_LEN+3], table_buff[NAME_LEN*2+3]; char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3]; char query_buff[512]; FILE *sql_file = md_result_file; Loading
mysql-test/mysql-test-run.sh +9 −1 Original line number Diff line number Diff line Loading @@ -235,6 +235,7 @@ DO_GDB="" MANUAL_GDB="" DO_DDD="" DO_CLIENT_GDB="" DO_VALGRIND_MYSQL_TEST="" SLEEP_TIME_AFTER_RESTART=1 SLEEP_TIME_FOR_DELETE=10 SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables Loading Loading @@ -432,6 +433,9 @@ while test $# -gt 0; do TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"` VALGRIND="$VALGRIND $TMP" ;; --valgrind-mysqltest) DO_VALGRIND_MYSQL_TEST=1 ;; --skip-ndbcluster | --skip-ndb) USE_NDBCLUSTER="" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-ndbcluster" Loading Loading @@ -666,7 +670,7 @@ else MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test_embedded" fi else MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_TEST="$VALGRIND_MYSQLTEST $CLIENT_BINDIR/mysqltest" MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test" fi fi Loading @@ -681,6 +685,10 @@ then SLAVE_MYSQLD=$MYSQLD fi if [ x$DO_VALGRIND_MYSQL_TEST = x1 ] ; then MYSQL_TEST="$VALGRIND $MYSQL_TEST" fi # If we should run all tests cases, we will use a local server for that if [ -z "$1" ] Loading
mysql-test/r/bigint.result +185 −7 Original line number Diff line number Diff line Loading @@ -46,6 +46,14 @@ a drop table t1; create table t1 ( a int not null default 1, big bigint ); insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615); Warnings: Warning 1264 Out of range value adjusted for column 'big' at row 4 select * from t1; a big 1 -1 1 12345678901234567 1 9223372036854775807 1 9223372036854775807 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 Loading @@ -53,26 +61,51 @@ select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 alter table t1 modify big bigint unsigned not null; Warnings: Warning 1264 Out of range value adjusted for column 'big' at row 1 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 0 9223372036854775807 9223372036854775806 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 0 9223372036854775807 9223372036854775806 insert into t1 (big) values (18446744073709551615); select * from t1; a big 1 0 1 12345678901234567 1 9223372036854775807 1 9223372036854775807 1 18446744073709551615 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 alter table t1 add key (big); select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 12345678901234567 18446744073709551615 18446744073709551614 0 18446744073709551615 18446744073709551614 alter table t1 modify big bigint not null; Warnings: Warning 1264 Out of range value adjusted for column 'big' at row 5 select * from t1; a big 1 0 1 12345678901234567 1 9223372036854775807 1 9223372036854775807 1 9223372036854775807 select min(big),max(big),max(big)-1 from t1; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 0 9223372036854775807 9223372036854775806 select min(big),max(big),max(big)-1 from t1 group by a; min(big) max(big) max(big)-1 -1 9223372036854775807 9223372036854775806 0 9223372036854775807 9223372036854775806 drop table t1; create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999; insert into t1 values (null,1); Loading @@ -89,7 +122,7 @@ insert into t1 values (10000000000000000000.0); insert into t1 values ('10000000000000000000'); select * from t1; quantity -8446744073709551616 10000000000000000000 10000000000000000000 10000000000000000000 drop table t1; Loading Loading @@ -154,3 +187,148 @@ select * from t1; a 9223372036854775809 drop table t1; DROP DATABASE IF EXISTS `scott`; Warnings: Note 1008 Can't drop database 'scott'; database doesn't exist create table t1 (a char(100), b varchar(100), c text, d blob); insert into t1 values( 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615 ); insert into t1 values (-1 | 0,-1 | 0,-1 | 0 ,-1 | 0); select * from t1; a b c d 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 18446744073709551615 drop table t1; create table t1 ( quantity decimal(2) unsigned); insert into t1 values (500), (-500), (~0), (-1); Warnings: Warning 1264 Out of range value adjusted for column 'quantity' at row 1 Warning 1264 Out of range value adjusted for column 'quantity' at row 2 Warning 1264 Out of range value adjusted for column 'quantity' at row 3 Warning 1264 Out of range value adjusted for column 'quantity' at row 4 select * from t1; quantity 99 0 99 0 drop table t1; CREATE TABLE t1 ( `col1` INT(1) NULL, `col2` INT(2) NULL, `col3` INT(3) NULL, `col4` INT(4) NULL, `col5` INT(5) NULL, `col6` INT(6) NULL, `col7` INT(7) NULL, `col8` INT(8) NULL, `col9` INT(9) NULL, `col10` BIGINT(10) NULL, `col11` BIGINT(11) NULL, `col12` BIGINT(12) NULL, `col13` BIGINT(13) NULL, `col14` BIGINT(14) NULL, `col15` BIGINT(15) NULL, `col16` BIGINT(16) NULL, `col17` BIGINT(17) NULL, `col18` BIGINT(18) NULL, `col19` DECIMAL(19, 0) NULL, `col20` DECIMAL(20, 0) NULL, `col21` DECIMAL(21, 0) NULL, `col22` DECIMAL(22, 0) NULL, `col23` DECIMAL(23, 0) NULL, `col24` DECIMAL(24, 0) NULL, `col25` DECIMAL(25, 0) NULL, `col26` DECIMAL(26, 0) NULL, `col27` DECIMAL(27, 0) NULL, `col28` DECIMAL(28, 0) NULL, `col29` DECIMAL(29, 0) NULL, `col30` DECIMAL(30, 0) NULL, `col31` DECIMAL(31, 0) NULL, `col32` DECIMAL(32, 0) NULL, `col33` DECIMAL(33, 0) NULL, `col34` DECIMAL(34, 0) NULL, `col35` DECIMAL(35, 0) NULL, `col36` DECIMAL(36, 0) NULL, `col37` DECIMAL(37, 0) NULL, `col38` DECIMAL(38, 0) NULL, `fix1` DECIMAL(38, 1) NULL, `fix2` DECIMAL(38, 2) NULL, `fix3` DECIMAL(38, 3) NULL, `fix4` DECIMAL(38, 4) NULL, `fix5` DECIMAL(38, 5) NULL, `fix6` DECIMAL(38, 6) NULL, `fix7` DECIMAL(38, 7) NULL, `fix8` DECIMAL(38, 8) NULL, `fix9` DECIMAL(38, 9) NULL, `fix10` DECIMAL(38, 10) NULL, `fix11` DECIMAL(38, 11) NULL, `fix12` DECIMAL(38, 12) NULL, `fix13` DECIMAL(38, 13) NULL, `fix14` DECIMAL(38, 14) NULL, `fix15` DECIMAL(38, 15) NULL, `fix16` DECIMAL(38, 16) NULL, `fix17` DECIMAL(38, 17) NULL, `fix18` DECIMAL(38, 18) NULL, `fix19` DECIMAL(38, 19) NULL, `fix20` DECIMAL(38, 20) NULL, `fix21` DECIMAL(38, 21) NULL, `fix22` DECIMAL(38, 22) NULL, `fix23` DECIMAL(38, 23) NULL, `fix24` DECIMAL(38, 24) NULL, `fix25` DECIMAL(38, 25) NULL, `fix26` DECIMAL(38, 26) NULL, `fix27` DECIMAL(38, 27) NULL, `fix28` DECIMAL(38, 28) NULL, `fix29` DECIMAL(38, 29) NULL, `fix30` DECIMAL(38, 30) NULL ); INSERT INTO t1(`col1`, `col2`, `col3`, `col4`, `col5`, `col6`, `col7`, `col8`, `col9`, `col10`, `col11`, `col12`, `col13`, `col14`, `col15`, `col16`, `col17`, `col18`, `col19`, `col20`, `col21`, `col22`, `col23`, `col24`, `col25`, `col26`, `col27`, `col28`, `col29`, `col30`, `col31`, `col32`, `col33`, `col34`, `col35`, `col36`, `col37`, `col38`, `fix1`, `fix2`, `fix3`, `fix4`, `fix5`, `fix6`, `fix7`, `fix8`, `fix9`, `fix10`, `fix11`, `fix12`, `fix13`, `fix14`, `fix15`, `fix16`, `fix17`, `fix18`, `fix19`, `fix20`, `fix21`, `fix22`, `fix23`, `fix24`, `fix25`, `fix26`, `fix27`, `fix28`, `fix29`, `fix30`) VALUES (9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, 9999999999, 99999999999, 999999999999, 9999999999999, 99999999999999, 999999999999999, 9999999999999999, 99999999999999999, 999999999999999999, 9999999999999999999, 99999999999999999999, 999999999999999999999, 9999999999999999999999, 99999999999999999999999, 999999999999999999999999, 9999999999999999999999999, 99999999999999999999999999, 999999999999999999999999999, 9999999999999999999999999999, 99999999999999999999999999999, 999999999999999999999999999999, 9999999999999999999999999999999, 99999999999999999999999999999999, 999999999999999999999999999999999, 9999999999999999999999999999999999, 99999999999999999999999999999999999, 999999999999999999999999999999999999, 9999999999999999999999999999999999999, 99999999999999999999999999999999999999, 9999999999999999999999999999999999999.9, 999999999999999999999999999999999999.99, 99999999999999999999999999999999999.999, 9999999999999999999999999999999999.9999, 999999999999999999999999999999999.99999, 99999999999999999999999999999999.999999, 9999999999999999999999999999999.9999999, 999999999999999999999999999999.99999999, 99999999999999999999999999999.999999999, 9999999999999999999999999999.9999999999, 999999999999999999999999999.99999999999, 99999999999999999999999999.999999999999, 9999999999999999999999999.9999999999999, 999999999999999999999999.99999999999999, 99999999999999999999999.999999999999999, 9999999999999999999999.9999999999999999, 999999999999999999999.99999999999999999, 99999999999999999999.999999999999999999, 9999999999999999999.9999999999999999999, 999999999999999999.99999999999999999999, 99999999999999999.999999999999999999999, 9999999999999999.9999999999999999999999, 999999999999999.99999999999999999999999, 99999999999999.999999999999999999999999, 9999999999999.9999999999999999999999999, 999999999999.99999999999999999999999999, 99999999999.999999999999999999999999999, 9999999999.9999999999999999999999999999, 999999999.99999999999999999999999999999, 99999999.999999999999999999999999999999); SELECT * FROM t1; col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 fix1 fix2 fix3 fix4 fix5 fix6 fix7 fix8 fix9 fix10 fix11 fix12 fix13 fix14 fix15 fix16 fix17 fix18 fix19 fix20 fix21 fix22 fix23 fix24 fix25 fix26 fix27 fix28 fix29 fix30 9 99 999 9999 99999 999999 9999999 99999999 999999999 9999999999 99999999999 999999999999 9999999999999 99999999999999 999999999999999 9999999999999999 99999999999999999 999999999999999999 9999999999999999999 99999999999999999999 999999999999999999999 9999999999999999999999 99999999999999999999999 999999999999999999999999 9999999999999999999999999 99999999999999999999999999 999999999999999999999999999 9999999999999999999999999999 99999999999999999999999999999 999999999999999999999999999999 9999999999999999999999999999999 99999999999999999999999999999999 999999999999999999999999999999999 9999999999999999999999999999999999 99999999999999999999999999999999999 999999999999999999999999999999999999 9999999999999999999999999999999999999 99999999999999999999999999999999999999 9999999999999999999999999999999999999.9 999999999999999999999999999999999999.99 99999999999999999999999999999999999.999 9999999999999999999999999999999999.9999 999999999999999999999999999999999.99999 99999999999999999999999999999999.999999 9999999999999999999999999999999.9999999 999999999999999999999999999999.99999999 99999999999999999999999999999.999999999 9999999999999999999999999999.9999999999 999999999999999999999999999.99999999999 99999999999999999999999999.999999999999 9999999999999999999999999.9999999999999 999999999999999999999999.99999999999999 99999999999999999999999.999999999999999 9999999999999999999999.9999999999999999 999999999999999999999.99999999999999999 99999999999999999999.999999999999999999 9999999999999999999.9999999999999999999 999999999999999999.99999999999999999999 99999999999999999.999999999999999999999 9999999999999999.9999999999999999999999 999999999999999.99999999999999999999999 99999999999999.999999999999999999999999 9999999999999.9999999999999999999999999 999999999999.99999999999999999999999999 99999999999.999999999999999999999999999 9999999999.9999999999999999999999999999 999999999.99999999999999999999999999999 99999999.999999999999999999999999999999 DROP TABLE t1;
mysql-test/r/mysqldump.result +27 −21 Original line number Diff line number Diff line Loading @@ -1908,28 +1908,28 @@ a2 DROP TRIGGER testref; DROP TABLE test1; DROP TABLE test2; CREATE TABLE t1 (id int); INSERT INTO t1 VALUES(1); INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(3); INSERT INTO t1 VALUES(4); INSERT INTO t1 VALUES(5); DROP TABLE IF EXISTS t1; DROP FUNCTION IF EXISTS bug9056_func1; CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b // DROP FUNCTION IF EXISTS bug9056_func2; DROP PROCEDURE IF EXISTS bug9056_proc1; DROP PROCEDURE IF EXISTS bug9056_proc2; CREATE TABLE t1 (id int); INSERT INTO t1 VALUES(1), (2), (3), (4), (5); CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b // CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) BEGIN SELECT a+b INTO c; end // DROP FUNCTION IF EXISTS bug9056_func2 // create function bug9056_func2(f1 char binary) returns char binary begin set f1= concat( 'hello', f1 ); return f1; end // DROP PROCEDURE IF EXISTS bug9056_proc2 // CREATE PROCEDURE bug9056_proc2(OUT a INT) BEGIN select sum(id) from t1 into a; END // set sql_mode='ansi'; create procedure `a'b` () select 1; set sql_mode=''; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; Loading @@ -1954,32 +1954,38 @@ LOCK TABLES `t1` WRITE; INSERT INTO `t1` VALUES (1),(2),(3),(4),(5); UNLOCK TABLES; /*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/; DELIMITER // /*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP FUNCTION IF EXISTS bug9056_func1 */ // /*!50003 CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP FUNCTION IF EXISTS bug9056_func2 */ // /*!50003 CREATE FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) begin set f1= concat( 'hello', f1 ); return f1; end */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP PROCEDURE IF EXISTS `a'b` */ // /*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/ // /*!50003 CREATE PROCEDURE "a'b"() select 1 */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP PROCEDURE IF EXISTS bug9056_proc1 */ // /*!50003 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT) BEGIN SELECT a+b INTO c; end */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // /*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */ // /*!50003 SET SESSION SQL_MODE=""*/ // /*!50003 DROP PROCEDURE IF EXISTS bug9056_proc2 */ // /*!50003 CREATE PROCEDURE `bug9056_proc2`(OUT a INT) BEGIN select sum(id) from t1 into a; END */ // /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ // DELIMITER ; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; Loading @@ -1989,8 +1995,8 @@ DELIMITER ; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP PROCEDURE IF EXISTS bug9056_func1; DROP PROCEDURE IF EXISTS bug9056_func2; DROP PROCEDURE IF EXISTS bug9056_proc1; DROP PROCEDURE IF EXISTS bug9056_proc2; DROP FUNCTION bug9056_func1; DROP FUNCTION bug9056_func2; DROP PROCEDURE bug9056_proc1; DROP PROCEDURE bug9056_proc2; drop table t1;
mysql-test/r/range.result +2 −2 Original line number Diff line number Diff line Loading @@ -521,8 +521,8 @@ select count(*) from t1 where x = 18446744073709551601; count(*) 1 create table t2 (x bigint not null); insert into t2(x) values (0xfffffffffffffff0); insert into t2(x) values (0xfffffffffffffff1); insert into t2(x) values (cast(0xfffffffffffffff0+0 as signed)); insert into t2(x) values (cast(0xfffffffffffffff1+0 as signed)); select * from t2; x -16 Loading