Commit 7271a601 authored by lars@mysql.com's avatar lars@mysql.com

Merge 4.1->5.0

parents dcea8122 c583eb69
...@@ -493,7 +493,8 @@ static void write_header(FILE *sql_file, char *db_name) ...@@ -493,7 +493,8 @@ static void write_header(FILE *sql_file, char *db_name)
"); ");
} }
fprintf(sql_file, fprintf(sql_file,
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n", "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n"
"/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n",
path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",",
compatible_mode_normal_str); compatible_mode_normal_str);
check_io(sql_file); check_io(sql_file);
...@@ -522,6 +523,8 @@ static void write_footer(FILE *sql_file) ...@@ -522,6 +523,8 @@ static void write_footer(FILE *sql_file)
"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"
"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"
"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
fprintf(sql_file,
"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
fputs("\n", sql_file); fputs("\n", sql_file);
check_io(sql_file); check_io(sql_file);
} }
......
...@@ -64,6 +64,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) ...@@ -64,6 +64,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` decimal(10,5) default NULL, `a` decimal(10,5) default NULL,
...@@ -83,10 +84,12 @@ UNLOCK TABLES; ...@@ -83,10 +84,12 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` decimal(10,5) default NULL, `a` decimal(10,5) default NULL,
`b` float default NULL `b` float default NULL
...@@ -97,6 +100,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) ...@@ -97,6 +100,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(a int, b text, c varchar(3)); CREATE TABLE t1(a int, b text, c varchar(3));
...@@ -153,6 +157,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); ...@@ -153,6 +157,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` varchar(255) default NULL `a` varchar(255) default NULL
...@@ -172,6 +177,7 @@ UNLOCK TABLES; ...@@ -172,6 +177,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a int) ENGINE=MYISAM; CREATE TABLE t1 (a int) ENGINE=MYISAM;
...@@ -179,6 +185,7 @@ INSERT INTO t1 VALUES (1), (2); ...@@ -179,6 +185,7 @@ INSERT INTO t1 VALUES (1), (2);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
...@@ -194,10 +201,12 @@ UNLOCK TABLES; ...@@ -194,10 +201,12 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
...@@ -213,6 +222,7 @@ UNLOCK TABLES; ...@@ -213,6 +222,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1; DROP TABLE t1;
create table ```a` (i int); create table ```a` (i int);
...@@ -229,6 +239,7 @@ create table t1(a int); ...@@ -229,6 +239,7 @@ create table t1(a int);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
...@@ -246,10 +257,12 @@ UNLOCK TABLES; ...@@ -246,10 +257,12 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1"; DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" ( CREATE TABLE "t1" (
"a" int(11) default NULL "a" int(11) default NULL
...@@ -264,6 +277,7 @@ UNLOCK TABLES; ...@@ -264,6 +277,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
set global sql_mode='ANSI_QUOTES'; set global sql_mode='ANSI_QUOTES';
...@@ -274,6 +288,7 @@ set global sql_mode='ANSI_QUOTES'; ...@@ -274,6 +288,7 @@ set global sql_mode='ANSI_QUOTES';
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
...@@ -291,10 +306,12 @@ UNLOCK TABLES; ...@@ -291,10 +306,12 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1"; DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" ( CREATE TABLE "t1" (
"a" int(11) default NULL "a" int(11) default NULL
...@@ -309,6 +326,7 @@ UNLOCK TABLES; ...@@ -309,6 +326,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
set global sql_mode=''; set global sql_mode='';
drop table t1; drop table t1;
...@@ -320,6 +338,7 @@ insert into t1 values (1),(2),(3); ...@@ -320,6 +338,7 @@ insert into t1 values (1),(2),(3);
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */; /*!40101 SET NAMES utf8 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) default NULL `a` int(11) default NULL
...@@ -330,6 +349,7 @@ CREATE TABLE `t1` ( ...@@ -330,6 +349,7 @@ CREATE TABLE `t1` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1 1
2 2
...@@ -376,6 +396,7 @@ drop table t1; ...@@ -376,6 +396,7 @@ drop table t1;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
...@@ -387,6 +408,7 @@ USE `test`; ...@@ -387,6 +408,7 @@ USE `test`;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
create database mysqldump_test_db character set latin2 collate latin2_bin; create database mysqldump_test_db character set latin2 collate latin2_bin;
...@@ -397,6 +419,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; ...@@ -397,6 +419,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */;
...@@ -408,6 +431,7 @@ USE `mysqldump_test_db`; ...@@ -408,6 +431,7 @@ USE `mysqldump_test_db`;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop database mysqldump_test_db; drop database mysqldump_test_db;
CREATE TABLE t1 (a CHAR(10)); CREATE TABLE t1 (a CHAR(10));
...@@ -420,6 +444,7 @@ INSERT INTO t1 VALUES (_latin1 ' ...@@ -420,6 +444,7 @@ INSERT INTO t1 VALUES (_latin1 '
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` char(10) default NULL `a` char(10) default NULL
...@@ -438,10 +463,12 @@ UNLOCK TABLES; ...@@ -438,10 +463,12 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` char(10) default NULL `a` char(10) default NULL
...@@ -457,10 +484,12 @@ UNLOCK TABLES; ...@@ -457,10 +484,12 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` char(10) default NULL `a` char(10) default NULL
...@@ -476,10 +505,12 @@ UNLOCK TABLES; ...@@ -476,10 +505,12 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` char(10) default NULL `a` char(10) default NULL
...@@ -495,10 +526,12 @@ UNLOCK TABLES; ...@@ -495,10 +526,12 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` char(10) default NULL `a` char(10) default NULL
...@@ -514,6 +547,7 @@ UNLOCK TABLES; ...@@ -514,6 +547,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a int); CREATE TABLE t1 (a int);
...@@ -528,6 +562,7 @@ INSERT INTO t2 VALUES (4),(5),(6); ...@@ -528,6 +562,7 @@ INSERT INTO t2 VALUES (4),(5),(6);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t2`; DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` ( CREATE TABLE `t2` (
`a` int(11) default NULL `a` int(11) default NULL
...@@ -546,6 +581,7 @@ UNLOCK TABLES; ...@@ -546,6 +581,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
...@@ -246,3 +246,10 @@ SET TIMESTAMP=1000000000; ...@@ -246,3 +246,10 @@ SET TIMESTAMP=1000000000;
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30; SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30;
INSERT INTO t1 (c1, c2) VALUES (', ',', '); INSERT INTO t1 (c1, c2) VALUES (', ',', ');
drop table t1; drop table t1;
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=myisam default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
...@@ -63,10 +63,10 @@ connection master; ...@@ -63,10 +63,10 @@ connection master;
set character_set_client=latin1, collation_connection=latin1_german1_ci; set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler")); insert into t1 (b) values(LEAST("Müller","Muffler"));
set collation_connection=latin1_german2_ci; set collation_connection=latin1_german2_ci;
insert into t1 (b) values(@@collation_connection); insert into t1 (b) values(@@collation_connection);
insert into t1 (b) values(LEAST("Mller","Muffler")); insert into t1 (b) values(LEAST("Müller","Muffler"));
--disable_query_log --disable_query_log
select "--- --master--" as ""; select "--- --master--" as "";
--enable_query_log --enable_query_log
...@@ -90,7 +90,7 @@ select * from mysqltest2.t1 order by a; ...@@ -90,7 +90,7 @@ select * from mysqltest2.t1 order by a;
# which provokes error messages (like 'Illegal mix of collation') when # which provokes error messages (like 'Illegal mix of collation') when
# we replay the master's INSERT/etc statements. # we replay the master's INSERT/etc statements.
connection master; connection master;
set @a= _cp850 'Mller' collate cp850_general_ci; set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1; truncate table t1;
insert into t1 (b) values(collation(@a)); insert into t1 (b) values(collation(@a));
--disable_query_log --disable_query_log
...@@ -145,7 +145,7 @@ CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); ...@@ -145,7 +145,7 @@ CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255));
SET CHARACTER_SET_CLIENT=koi8r, SET CHARACTER_SET_CLIENT=koi8r,
CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_CONNECTION=cp1251,
CHARACTER_SET_RESULTS=koi8r; CHARACTER_SET_RESULTS=koi8r;
INSERT INTO t1 (c1, c2) VALUES (', ',', '); INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
sync_slave_with_master; sync_slave_with_master;
select hex(c1), hex(c2) from t1; select hex(c1), hex(c2) from t1;
...@@ -157,3 +157,15 @@ connection master; ...@@ -157,3 +157,15 @@ connection master;
drop table t1; drop table t1;
sync_slave_with_master; sync_slave_with_master;
#
# BUG#6676: Derivation of variables must be correct on slave
#
connection master;
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
) engine=myisam default charset=latin1;
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
sync_slave_with_master;
...@@ -1450,7 +1450,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) ...@@ -1450,7 +1450,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli)
thd->query_id = next_query_id(); thd->query_id = next_query_id();
VOID(pthread_mutex_unlock(&LOCK_thread_count)); VOID(pthread_mutex_unlock(&LOCK_thread_count));
thd->variables.pseudo_thread_id= thread_id; // for temp tables thd->variables.pseudo_thread_id= thread_id; // for temp tables
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
DBUG_PRINT("query",("%s",thd->query)); DBUG_PRINT("query",("%s",thd->query));
if (ignored_error_code((expected_error= error_code)) || if (ignored_error_code((expected_error= error_code)) ||
...@@ -1535,6 +1534,10 @@ START SLAVE; . Query: '%s'", expected_error, thd->query); ...@@ -1535,6 +1534,10 @@ START SLAVE; . Query: '%s'", expected_error, thd->query);
goto end; goto end;
} }
/* If the query was not ignored, it is printed to the general log */
if (thd->net.last_errno != ER_SLAVE_IGNORED_TABLE)
mysql_log.write(thd,COM_QUERY,"%s",thd->query);
compare_errors: compare_errors:
/* /*
...@@ -3470,7 +3473,12 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) ...@@ -3470,7 +3473,12 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
0 can be passed as last argument (reference on item) 0 can be passed as last argument (reference on item)
*/ */
e.fix_fields(thd, 0, 0); e.fix_fields(thd, 0, 0);
e.update_hash(val, val_len, type, charset, DERIVATION_NONE); /*
A variable can just be considered as a table with
a single record and with a single column. Thus, like
a column value, it could always have IMPLICIT derivation.
*/
e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT);
free_root(thd->mem_root,0); free_root(thd->mem_root,0);
rli->inc_event_relay_log_pos(); rli->inc_event_relay_log_pos();
......
...@@ -254,6 +254,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; ...@@ -254,6 +254,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
/* The rest of the file is included in the server only */ /* The rest of the file is included in the server only */
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
/* If set to 0, then the thread will ignore all warnings with level notes.
Set by executing SET SQL_NOTES=1 */
#define OPTION_SQL_NOTES (1L << 31)
/* Bits for different SQL modes modes (including ANSI mode) */ /* Bits for different SQL modes modes (including ANSI mode) */
#define MODE_REAL_AS_FLOAT 1 #define MODE_REAL_AS_FLOAT 1
#define MODE_PIPES_AS_CONCAT 2 #define MODE_PIPES_AS_CONCAT 2
......
...@@ -5782,7 +5782,8 @@ static void mysql_init_variables(void) ...@@ -5782,7 +5782,8 @@ static void mysql_init_variables(void)
language_ptr= language; language_ptr= language;
mysql_data_home= mysql_real_data_home; mysql_data_home= mysql_real_data_home;
thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL | thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL |
OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE); OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE |
OPTION_SQL_NOTES);
protocol_version= PROTOCOL_VERSION; protocol_version= PROTOCOL_VERSION;
what_to_log= ~ (1L << (uint) COM_TIME); what_to_log= ~ (1L << (uint) COM_TIME);
refresh_version= flush_version= 1L; /* Increments on each reload */ refresh_version= flush_version= 1L; /* Increments on each reload */
......
...@@ -459,6 +459,9 @@ static sys_var_thd_bit sys_log_binlog("sql_log_bin", ...@@ -459,6 +459,9 @@ static sys_var_thd_bit sys_log_binlog("sql_log_bin",
static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0, static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0,
set_option_bit, set_option_bit,
OPTION_WARNINGS); OPTION_WARNINGS);
static sys_var_thd_bit sys_sql_notes("sql_notes", 0,
set_option_bit,
OPTION_SQL_NOTES);
static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0, static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0,
set_option_bit, set_option_bit,
OPTION_AUTO_IS_NULL); OPTION_AUTO_IS_NULL);
...@@ -653,6 +656,7 @@ sys_var *sys_variables[]= ...@@ -653,6 +656,7 @@ sys_var *sys_variables[]=
&sys_sql_max_join_size, &sys_sql_max_join_size,
&sys_sql_mode, &sys_sql_mode,
&sys_sql_warnings, &sys_sql_warnings,
&sys_sql_notes,
&sys_storage_engine, &sys_storage_engine,
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
&sys_sync_binlog_period, &sys_sync_binlog_period,
...@@ -927,6 +931,8 @@ struct show_var_st init_vars[]= { ...@@ -927,6 +931,8 @@ struct show_var_st init_vars[]= {
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS}, {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS}, {sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS}, {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
{"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL},
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL},
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
{sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS}, {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
{sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS}, {sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS},
......
...@@ -43,7 +43,6 @@ This file contains the implementation of error and warnings related ...@@ -43,7 +43,6 @@ This file contains the implementation of error and warnings related
***********************************************************************/ ***********************************************************************/
#include "mysql_priv.h" #include "mysql_priv.h"
#include "sp_rcontext.h"
/* /*
Store a new message in an error object Store a new message in an error object
...@@ -106,27 +105,11 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, ...@@ -106,27 +105,11 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
MYSQL_ERROR *err= 0; MYSQL_ERROR *err= 0;
DBUG_ENTER("push_warning"); DBUG_ENTER("push_warning");
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_SQL_NOTES))
return(0);
if (thd->query_id != thd->warn_id) if (thd->query_id != thd->warn_id)
mysql_reset_errors(thd); mysql_reset_errors(thd);
thd->got_warning= 1;
if (thd->spcont &&
thd->spcont->find_handler(code,
((int) level >=
(int) MYSQL_ERROR::WARN_LEVEL_WARN &&
thd->really_abort_on_warning()) ?
MYSQL_ERROR::WARN_LEVEL_ERROR : level))
{
DBUG_RETURN(NULL);
}
/* Abort if we are using strict mode and we are not using IGNORE */
if ((int) level >= (int) MYSQL_ERROR::WARN_LEVEL_WARN &&
thd->really_abort_on_warning())
{
thd->killed= THD::KILL_BAD_DATA;
my_message(code, msg, MYF(0));
DBUG_RETURN(NULL);
}
if (thd->warn_list.elements < thd->variables.max_error_count) if (thd->warn_list.elements < thd->variables.max_error_count)
{ {
...@@ -136,7 +119,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, ...@@ -136,7 +119,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
*/ */
MEM_ROOT *old_root= thd->mem_root; MEM_ROOT *old_root= thd->mem_root;
thd->mem_root= &thd->warn_root; thd->mem_root= &thd->warn_root;
if ((err= new MYSQL_ERROR(thd, code, level, msg))) err= new MYSQL_ERROR(thd, code, level, msg);
if (err)
thd->warn_list.push_back(err); thd->warn_list.push_back(err);
thd->mem_root= old_root; thd->mem_root= old_root;
} }
...@@ -184,14 +168,14 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level, ...@@ -184,14 +168,14 @@ void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
Takes into account the current LIMIT Takes into account the current LIMIT
RETURN VALUES RETURN VALUES
FALSE ok 0 ok
TRUE Error sending data to client 1 Error sending data to client
*/ */
static const char *warning_level_names[]= {"Note", "Warning", "Error", "?"}; static const char *warning_level_names[]= {"Note", "Warning", "Error", "?"};
static int warning_level_length[]= { 4, 7, 5, 1 }; static int warning_level_length[]= { 4, 7, 5, 1 };
bool mysqld_show_warnings(THD *thd, ulong levels_to_show) my_bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
{ {
List<Item> field_list; List<Item> field_list;
DBUG_ENTER("mysqld_show_warnings"); DBUG_ENTER("mysqld_show_warnings");
...@@ -200,9 +184,8 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show) ...@@ -200,9 +184,8 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
field_list.push_back(new Item_return_int("Code",4, MYSQL_TYPE_LONG)); field_list.push_back(new Item_return_int("Code",4, MYSQL_TYPE_LONG));
field_list.push_back(new Item_empty_string("Message",MYSQL_ERRMSG_SIZE)); field_list.push_back(new Item_empty_string("Message",MYSQL_ERRMSG_SIZE));
if (thd->protocol->send_fields(&field_list, if (thd->protocol->send_fields(&field_list,1))
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(1);
DBUG_RETURN(TRUE);
MYSQL_ERROR *err; MYSQL_ERROR *err;
SELECT_LEX *sel= &thd->lex->select_lex; SELECT_LEX *sel= &thd->lex->select_lex;
...@@ -226,10 +209,10 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show) ...@@ -226,10 +209,10 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show)
protocol->store((uint32) err->code); protocol->store((uint32) err->code);
protocol->store(err->msg, strlen(err->msg), system_charset_info); protocol->store(err->msg, strlen(err->msg), system_charset_info);
if (protocol->write()) if (protocol->write())
DBUG_RETURN(TRUE); DBUG_RETURN(1);
if (!--limit) if (!--limit)
break; break;
} }
send_eof(thd); send_eof(thd);
DBUG_RETURN(FALSE); DBUG_RETURN(0);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment