Commit e2bd6c6b authored by unknown's avatar unknown

Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.1-opt

into  gleb.loc:/home/uchum/work/bk/5.1-opt


mysql-test/r/type_decimal.result:
  Auto merged
mysql-test/t/type_decimal.test:
  Auto merged
sql/item.cc:
  Auto merged
parents 321b1b61 130f9b9f
......@@ -5,9 +5,9 @@ CREATE TABLE t3 (b INT AUTO_INCREMENT PRIMARY KEY);
CREATE VIEW v1(a,b) AS SELECT a,b FROM t2,t3;
INSERT INTO t1 SELECT UUID();
Warnings:
Warning 1591 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
SHOW WARNINGS;
Level Warning
Code 1591
Code 1592
Message Statement is not safe to log in statement format.
DROP TABLE t1,t2,t3;
......@@ -31,7 +31,7 @@ create event e_55 on schedule at 10000101000000 do drop table t;
ERROR HY000: Incorrect AT value: '10000101000000'
create event e_55 on schedule at 20000101000000 do drop table t;
Warnings:
Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
Note 1588 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t;
......@@ -457,22 +457,22 @@ CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
DO
SELECT 1;
Warnings:
Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
Note 1588 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' DISABLE
DO
SELECT 1;
Warnings:
Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
Note 1588 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO
SELECT 1;
Warnings:
Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
Note 1588 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE
DO
SELECT 1;
Warnings:
Note 1587 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
Note 1588 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
......@@ -482,19 +482,19 @@ The following should succeed giving a warning.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE;
Warnings:
Note 1543 Event execution time is in the past. Event has been disabled
Note 1544 Event execution time is in the past. Event has been disabled
CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE
DO
SELECT 1;
Warnings:
Note 1543 Event execution time is in the past. Event has been disabled
Note 1544 Event execution time is in the past. Event has been disabled
CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00'
ON COMPLETION PRESERVE
DO
SELECT 1;
Warnings:
Note 1543 Event execution time is in the past. Event has been disabled
Note 1544 Event execution time is in the past. Event has been disabled
The following should succeed without warnings.
ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00';
ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
......
......@@ -63,7 +63,7 @@ begin work;
insert into t1 (a) values ("OK: create event if not exists");
create event if not exists e1 on schedule every 2 day do select 2;
Warnings:
Note 1536 Event 'e1' already exists
Note 1537 Event 'e1' already exists
rollback work;
select * from t1;
a
......
DROP TABLE IF EXISTS t1, t2;
#
# Bug#31663 FIELDS TERMINATED BY special character
#
CREATE TABLE t1 (i1 int, i2 int, c1 VARCHAR(256), c2 VARCHAR(256));
INSERT INTO t1 VALUES (101, 202, '-r-', '=raker=');
# FIELDS TERMINATED BY 'raker', warning:
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS TERMINATED BY 'raker' FROM t1;
Warnings:
Warning 1475 First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY
SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
101raker202raker-r-raker=raker=
CREATE TABLE t2 SELECT * FROM t1;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS TERMINATED BY 'raker';
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
SELECT * FROM t2;
i1 i2 c1 c2
101 202 -r- =raker=
101 202 -r- =
DROP TABLE t2;
# Only numeric fields, FIELDS TERMINATED BY 'r', no warnings:
SELECT i1, i2 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS TERMINATED BY 'r' FROM t1;
SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
101r202
CREATE TABLE t2 SELECT i1, i2 FROM t1;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS TERMINATED BY 'r';
SELECT i1, i2 FROM t2;
i1 i2
101 202
101 202
DROP TABLE t2;
# FIELDS TERMINATED BY '0', warning:
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS TERMINATED BY '0' FROM t1;
Warnings:
Warning 1475 First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY
SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
10102020-r-0=raker=
CREATE TABLE t2 SELECT * FROM t1;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS TERMINATED BY '0';
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
SELECT * FROM t2;
i1 i2 c1 c2
101 202 -r- =raker=
1 1 2 2
DROP TABLE t2;
# FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0', warning:
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0' FROM t1;
Warnings:
Warning 1475 First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY
SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
10102020"-r-"0"=raker="
CREATE TABLE t2 SELECT * FROM t1;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0';
Warnings:
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
SELECT * FROM t2;
i1 i2 c1 c2
101 202 -r- =raker=
1 1 2 2
DROP TABLE t2;
# Only string fields, FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0', no warnings:
SELECT c1, c2 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0' FROM t1;
SELECT LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt');
LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug31663.txt')
"-r-"0"=raker="
CREATE TABLE t2 SELECT c1, c2 FROM t1;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0';
SELECT c1, c2 FROM t2;
c1 c2
-r- =raker=
-r- =raker=
DROP TABLE t2;
DROP TABLE t1;
# End of 5.0 tests.
......@@ -4062,25 +4062,23 @@ x
1
Warnings:
Warning 1466 Leading spaces are removed from name ' x'
CREATE VIEW v1 AS SELECT 1 AS ``;
ERROR 42000: Incorrect column name ''
CREATE VIEW v1 AS SELECT 1 AS ` `;
Warnings:
Warning 1474 Name ' ' has become ''
SELECT `` FROM v1;
1
CREATE VIEW v2 AS SELECT 1 AS ` `;
Warnings:
Warning 1474 Name ' ' has become ''
SELECT `` FROM v2;
1
CREATE VIEW v3 AS SELECT 1 AS ` x`;
ERROR 42000: Incorrect column name ' '
CREATE VIEW v1 AS SELECT 1 AS ` `;
ERROR 42000: Incorrect column name ' '
CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `);
ERROR 42000: Incorrect column name ' '
CREATE VIEW v1 AS SELECT 1 AS ` x`;
Warnings:
Warning 1466 Leading spaces are removed from name ' x'
SELECT `x` FROM v3;
SELECT `x` FROM v1;
x
1
DROP VIEW v1, v2, v3;
ALTER VIEW v1 AS SELECT 1 AS ` `;
ERROR 42000: Incorrect column name ' '
DROP VIEW v1;
End of 5.0 tests
create table t1(a INT, KEY (a));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
......
......@@ -7,11 +7,11 @@ return 1;
create function x() returns int
return 2;
Warnings:
Note 1584 This function 'x' has the same name as a native function
Note 1585 This function 'x' has the same name as a native function
create function y() returns int
return 3;
Warnings:
Note 1584 This function 'y' has the same name as a native function
Note 1585 This function 'y' has the same name as a native function
select a();
a()
1
......
......@@ -647,32 +647,32 @@ select extractValue('<a>a','/a');
extractValue('<a>a','/a')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT'
select extractValue('<a>a<','/a');
extractValue('<a>a<','/a')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)'
select extractValue('<a>a</','/a');
extractValue('<a>a</','/a')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 7: END-OF-INPUT unexpected (ident wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 7: END-OF-INPUT unexpected (ident wanted)'
select extractValue('<a>a</a','/a');
extractValue('<a>a</a','/a')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 8: END-OF-INPUT unexpected ('>' wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 8: END-OF-INPUT unexpected ('>' wanted)'
select extractValue('<a>a</a></b>','/a');
extractValue('<a>a</a></b>','/a')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 12: '</b>' unexpected (END-OF-INPUT wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 12: '</b>' unexpected (END-OF-INPUT wanted)'
select extractValue('<a b=>a</a>','/a');
extractValue('<a b=>a</a>','/a')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)'
select extractValue('<e>1</e>','position()');
ERROR HY000: XPATH syntax error: ''
select extractValue('<e>1</e>','last()');
......@@ -723,17 +723,17 @@ select extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','//*
extractValue('<zot><tim0><01>10:39:15</01><02>140</02></tim0></zot>','//*')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)'
select extractValue('<.>test</.>','//*');
extractValue('<.>test</.>','//*')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
select extractValue('<->test</->','//*');
extractValue('<->test</->','//*')
NULL
Warnings:
Warning 1524 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)'
select extractValue('<:>test</:>','//*');
extractValue('<:>test</:>','//*')
test
......
......@@ -8,20 +8,20 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=MYISAM;
Warnings:
Error 1477 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=XYZ;
Warnings:
Warning 1286 Unknown table engine 'XYZ'
Error 1477 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M;
Warnings:
Error 1477 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
Error 1478 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
set storage_engine=ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
......
......@@ -16,7 +16,7 @@ ERROR HY000: Failed to create LOGFILE GROUP
SHOW WARNINGS;
Level Code Message
Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB
Error 1527 Failed to create LOGFILE GROUP
Error 1528 Failed to create LOGFILE GROUP
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 1M
......
......@@ -463,7 +463,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
......@@ -1013,7 +1013,7 @@ drop table t1;
End of 4.1 tests
CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY);
Warnings:
Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK'
INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))'));
INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))'));
......
......@@ -8,7 +8,7 @@ ENGINE=NDB;
ERROR HY000: Can't create table 'test.t1' (errno: 138)
SHOW WARNINGS;
Level Code Message
Error 1477 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
Error 1478 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute'
Error 1005 Can't create table 'test.t1' (errno: 138)
CREATE TABLE t1
( a INT KEY,
......
......@@ -11,7 +11,7 @@ ERROR HY000: Failed to create LOGFILE GROUP
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1527 Failed to create LOGFILE GROUP
Error 1528 Failed to create LOGFILE GROUP
create table t1 (a int key, b int unique, c int) engine ndb;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
......@@ -27,14 +27,14 @@ ERROR HY000: Failed to create TABLESPACE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1527 Failed to create TABLESPACE
Error 1528 Failed to create TABLESPACE
DROP LOGFILE GROUP lg1
ENGINE =NDB;
ERROR HY000: Failed to drop LOGFILE GROUP
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1528 Failed to drop LOGFILE GROUP
Error 1529 Failed to drop LOGFILE GROUP
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
......@@ -47,7 +47,7 @@ ERROR HY000: Failed to alter: DROP DATAFILE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1532 Failed to alter: DROP DATAFILE
Error 1533 Failed to alter: DROP DATAFILE
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE NDB;
......@@ -57,7 +57,7 @@ ERROR HY000: Failed to drop TABLESPACE
show warnings;
Level Code Message
Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB
Error 1528 Failed to drop TABLESPACE
Error 1529 Failed to drop TABLESPACE
DROP TABLESPACE ts1
ENGINE NDB;
DROP LOGFILE GROUP lg1
......
......@@ -44,7 +44,7 @@ Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1589
Last_Errno 1590
Last_Error The incident LOST_EVENTS occured on the master. Message: <none>
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -62,7 +62,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 1589
Last_SQL_Errno 1590
Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: <none>
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
......
......@@ -65,7 +65,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1592
Last_Errno 1593
Last_Error Fatal error: Not enough memory
Skip_Counter 0
Exec_Master_Log_Pos 325
......@@ -83,7 +83,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1592
Last_SQL_Errno 1593
Last_SQL_Error Fatal error: Not enough memory
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
......
......@@ -182,19 +182,19 @@ CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
affected rows: 0
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
Warnings:
Warning 1591 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
Warnings:
Warning 1591 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
Warnings:
Warning 1591 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
affected rows: 1
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
Warnings:
Warning 1591 Statement is not safe to log in statement format.
Warning 1592 Statement is not safe to log in statement format.
affected rows: 1
SELECT * FROM t1 ORDER BY sum;
sum price
......
......@@ -72,7 +72,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -90,7 +90,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
STOP SLAVE;
RESET SLAVE;
......@@ -139,7 +139,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -157,7 +157,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -201,7 +201,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -219,7 +219,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -263,7 +263,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -281,7 +281,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -324,7 +324,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -342,7 +342,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
*** Drop t6 ***
......@@ -436,7 +436,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -454,7 +454,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -497,7 +497,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -515,7 +515,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......@@ -823,7 +823,7 @@ Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 1534
Last_Errno 1535
Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
Skip_Counter 0
Exec_Master_Log_Pos #
......@@ -841,7 +841,7 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 1534
Last_SQL_Errno 1535
Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
START SLAVE;
......
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
--echo #
--echo # Bug#31663 FIELDS TERMINATED BY special character
--echo #
CREATE TABLE t1 (i1 int, i2 int, c1 VARCHAR(256), c2 VARCHAR(256));
INSERT INTO t1 VALUES (101, 202, '-r-', '=raker=');
--let $fields=*
--let $clauses=FIELDS TERMINATED BY 'raker'
--echo # $clauses, warning:
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
--eval SELECT $fields FROM t2
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
DROP TABLE t2;
--let $fields=i1, i2
--let $clauses=FIELDS TERMINATED BY 'r'
--echo # Only numeric fields, $clauses, no warnings:
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
--eval SELECT $fields FROM t2
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
DROP TABLE t2;
--let $fields=*
--let $clauses=FIELDS TERMINATED BY '0'
--echo # $clauses, warning:
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
--eval SELECT $fields FROM t2
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
DROP TABLE t2;
--let $fields=*
--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
--echo # $clauses, warning:
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
--eval SELECT $fields FROM t2
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
DROP TABLE t2;
--let $fields=c1, c2
--let $clauses=FIELDS OPTIONALLY ENCLOSED BY '"' TERMINATED BY '0'
--echo # Only string fields, $clauses, no warnings:
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT $fields INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' $clauses FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT LOAD_FILE('$MYSQLTEST_VARDIR/tmp/bug31663.txt')
--eval CREATE TABLE t2 SELECT $fields FROM t1
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/bug31663.txt' INTO TABLE t2 $clauses
--eval SELECT $fields FROM t2
--remove_file $MYSQLTEST_VARDIR/tmp/bug31663.txt
DROP TABLE t2;
DROP TABLE t1;
--echo # End of 5.0 tests.
......@@ -3455,23 +3455,30 @@ DROP TABLE t1;
#
--disable_ps_protocol
SELECT 1 AS ` `;
SELECT 1 AS ` `;
SELECT 1 AS ` x`;
--enable_ps_protocol
--error 1166
CREATE VIEW v1 AS SELECT 1 AS ``;
--error 1166
CREATE VIEW v1 AS SELECT 1 AS ` `;
SELECT `` FROM v1;
CREATE VIEW v2 AS SELECT 1 AS ` `;
SELECT `` FROM v2;
--error 1166
CREATE VIEW v1 AS SELECT 1 AS ` `;
CREATE VIEW v3 AS SELECT 1 AS ` x`;
SELECT `x` FROM v3;
--error 1166
CREATE VIEW v1 AS SELECT (SELECT 1 AS ` `);
DROP VIEW v1, v2, v3;
CREATE VIEW v1 AS SELECT 1 AS ` x`;
SELECT `x` FROM v1;
--enable_ps_protocol
--error 1166
ALTER VIEW v1 AS SELECT 1 AS ` `;
DROP VIEW v1;
--echo End of 5.0 tests
......
......@@ -5658,6 +5658,8 @@ ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT
eng "Too high level of nesting for select"
ER_NAME_BECOMES_EMPTY
eng "Name '%-.64s' has become ''"
ER_AMBIGUOUS_FIELD_TERM
eng "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY"
ER_FOREIGN_SERVER_EXISTS
eng "The foreign server, %s, you are trying to create already exists."
ER_FOREIGN_SERVER_DOESNT_EXIST
......
......@@ -1540,6 +1540,7 @@ int
select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
{
bool blob_flag=0;
bool string_results= FALSE, non_string_results= FALSE;
unit= u;
if ((uint) strlen(exchange->file_name) + NAME_LEN >= FN_REFLEN)
strmake(path,exchange->file_name,FN_REFLEN-1);
......@@ -1557,13 +1558,18 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
blob_flag=1;
break;
}
if (item->result_type() == STRING_RESULT)
string_results= TRUE;
else
non_string_results= TRUE;
}
}
field_term_length=exchange->field_term->length();
field_term_char= field_term_length ? (*exchange->field_term)[0] : INT_MAX;
if (!exchange->line_term->length())
exchange->line_term=exchange->field_term; // Use this if it exists
field_sep_char= (exchange->enclosed->length() ? (*exchange->enclosed)[0] :
field_term_length ? (*exchange->field_term)[0] : INT_MAX);
field_term_char);
escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1);
is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char));
is_unsafe_field_sep= test(strchr(NUMERIC_CHARS, field_sep_char));
......@@ -1575,12 +1581,25 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
exchange->opt_enclosed=1; // A little quicker loop
fixed_row_size= (!field_term_length && !exchange->enclosed->length() &&
!blob_flag);
if ((is_ambiguous_field_sep && exchange->enclosed->is_empty() &&
(string_results || is_unsafe_field_sep)) ||
(exchange->opt_enclosed && non_string_results &&
field_term_length && strchr(NUMERIC_CHARS, field_term_char)))
{
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_AMBIGUOUS_FIELD_TERM, ER(ER_AMBIGUOUS_FIELD_TERM));
is_ambiguous_field_term= TRUE;
}
else
is_ambiguous_field_term= FALSE;
return 0;
}
#define NEED_ESCAPING(x) ((int) (uchar) (x) == escape_char || \
(int) (uchar) (x) == field_sep_char || \
(enclosed ? (int) (uchar) (x) == field_sep_char \
: (int) (uchar) (x) == field_term_char) || \
(int) (uchar) (x) == line_sep_char || \
!(x))
......@@ -1609,8 +1628,10 @@ bool select_export::send_data(List<Item> &items)
while ((item=li++))
{
Item_result result_type=item->result_type();
bool enclosed = (exchange->enclosed->length() &&
(!exchange->opt_enclosed || result_type == STRING_RESULT));
res=item->str_result(&tmp);
if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
if (res && enclosed)
{
if (my_b_write(&cache,(uchar*) exchange->enclosed->ptr(),
exchange->enclosed->length()))
......@@ -1701,11 +1722,16 @@ bool select_export::send_data(List<Item> &items)
DBUG_ASSERT before the loop makes that sure.
*/
if (NEED_ESCAPING(*pos) ||
(check_second_byte &&
my_mbcharlen(character_set_client, (uchar) *pos) == 2 &&
pos + 1 < end &&
NEED_ESCAPING(pos[1])))
if ((NEED_ESCAPING(*pos) ||
(check_second_byte &&
my_mbcharlen(character_set_client, (uchar) *pos) == 2 &&
pos + 1 < end &&
NEED_ESCAPING(pos[1]))) &&
/*
Don't escape field_term_char by doubling - doubling is only
valid for ENCLOSED BY characters:
*/
(enclosed || !is_ambiguous_field_term || *pos != field_term_char))
{
char tmp_buff[2];
tmp_buff[0]= ((int) *pos == field_sep_char &&
......@@ -1744,7 +1770,7 @@ bool select_export::send_data(List<Item> &items)
goto err;
}
}
if (res && (!exchange->opt_enclosed || result_type == STRING_RESULT))
if (res && enclosed)
{
if (my_b_write(&cache, (uchar*) exchange->enclosed->ptr(),
exchange->enclosed->length()))
......
......@@ -2070,12 +2070,19 @@ class select_to_file :public select_result_interceptor {
class select_export :public select_to_file {
uint field_term_length;
int field_sep_char,escape_char,line_sep_char;
int field_term_char; // first char of FIELDS TERMINATED BY or MAX_INT
/*
The is_ambiguous_field_sep field is true if a value of the field_sep_char
field is one of the 'n', 't', 'r' etc characters
(see the READ_INFO::unescape method and the ESCAPE_CHARS constant value).
*/
bool is_ambiguous_field_sep;
/*
The is_ambiguous_field_term is true if field_sep_char contains the first
char of the FIELDS TERMINATED BY (ENCLOSED BY is empty), and items can
contain this character.
*/
bool is_ambiguous_field_term;
/*
The is_unsafe_field_sep field is true if a value of the field_sep_char
field is one of the '0'..'9', '+', '-', '.' and 'e' characters
......
......@@ -6323,6 +6323,12 @@ select_item:
MYSQL_YYABORT;
if ($4.str)
{
if (Lex->sql_command == SQLCOM_CREATE_VIEW &&
check_column_name($4.str))
{
my_error(ER_WRONG_COLUMN_NAME, MYF(0), $4.str);
MYSQL_YYABORT;
}
$2->is_autogenerated_name= FALSE;
$2->set_name($4.str, $4.length, system_charset_info);
}
......
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