2668 Kristofer Pettersson 2008-07-22 [merge]
auto merge
2667 Kristofer Pettersson 2008-07-22
Disabled two test cases in 5.1 because of random failures.
modified:
mysql-test/t/disabled.def
2666 Kristofer Pettersson 2008-07-22 [merge]
merge 5.1->5.1-bugteam
removed:
mysql-test/r/parser.result
mysql-test/t/parser.test
added:
mysql-test/r/parser.result
mysql-test/suite/bugs/combinations
mysql-test/suite/bugs/r/rpl_bug37426.result
mysql-test/suite/bugs/t/rpl_bug37426.test
mysql-test/t/parser.test
modified:
include/my_sys.h
mysql-test/extra/rpl_tests/rpl_row_basic.test
mysql-test/mysql-test-run.pl
mysql-test/suite/binlog/r/binlog_base64_flag.result
mysql-test/suite/binlog/t/binlog_base64_flag.test
mysql-test/suite/funcs_1/triggers/triggers_03.inc
mysql-test/suite/funcs_1/triggers/triggers_08.inc
mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
mysql-test/t/system_mysql_db_fix50030.test
mysql-test/t/system_mysql_db_fix50117.test
mysys/default.c
mysys/mf_pack.c
scripts/make_binary_distribution.sh
sql/field.cc
sql/field.h
sql/rpl_utility.cc
sql/slave.cc
sql/slave.h
sql/sql_insert.cc
support-files/my-huge.cnf.sh
support-files/my-large.cnf.sh
support-files/my-medium.cnf.sh
2665 Kristofer Pettersson 2008-07-22 [merge]
(no message)
modified:
sql/log.cc
2664 Tatiana A. Nurnberg 2008-07-22 [merge]
auto-merge
modified:
mysql-test/suite/rpl/t/disabled.def
sql/log.cc
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h 2008-05-17 21:51:18 +0000
+++ b/include/my_sys.h 2008-07-17 17:45:08 +0000
@@ -693,6 +693,7 @@ extern char * fn_format(char * to,const
const char *form, uint flag);
extern size_t strlength(const char *str);
extern void pack_dirname(char * to,const char *from);
+extern size_t normalize_dirname(char * to, const char *from);
extern size_t unpack_dirname(char * to,const char *from);
extern size_t cleanup_dirname(char * to,const char *from);
extern size_t system_filename(char * to,const char *from);
=== modified file 'mysql-test/extra/rpl_tests/rpl_row_basic.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test 2008-06-19 13:02:04 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test 2008-07-11 18:51:10 +0000
@@ -259,7 +259,7 @@ DELETE FROM t1;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
sync_slave_with_master;
set @@global.slave_exec_mode= default;
-let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
+let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log;
@@ -288,3 +288,150 @@ SELECT * FROM t1;
connection master;
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
sync_slave_with_master;
+
+#
+# BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars
+#
+
+# We have 4 combinations to test with respect to the field length
+# (i.e., the number of bytes) of the CHAR fields:
+#
+# 1. Replicating from CHAR<256 to CHAR<256
+# 2. Replicating from CHAR<256 to CHAR>255
+# 3. Replicating from CHAR>255 to CHAR<256
+# 4. Replicating from CHAR>255 to CHAR>255
+
+# We also make a special case of using the max size of a field on the
+# master, i.e. CHAR(255) in UTF-8, giving another three cases.
+#
+# 5. Replicating UTF-8 CHAR(255) to CHAR(<256)
+# 6. Replicating UTF-8 CHAR(255) to CHAR(>255)
+# 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
+
+connection master;
+CREATE TABLE t1 (i INT NOT NULL,
+ c CHAR(16) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL);
+
+CREATE TABLE t2 (i INT NOT NULL,
+ c CHAR(16) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL);
+
+sync_slave_with_master;
+ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+CREATE TABLE t3 (i INT NOT NULL,
+ c CHAR(128) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL);
+sync_slave_with_master;
+ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+CREATE TABLE t4 (i INT NOT NULL,
+ c CHAR(128) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL);
+
+CREATE TABLE t5 (i INT NOT NULL,
+ c CHAR(255) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL);
+sync_slave_with_master;
+ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+CREATE TABLE t6 (i INT NOT NULL,
+ c CHAR(255) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL);
+sync_slave_with_master;
+ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+
+connection master;
+CREATE TABLE t7 (i INT NOT NULL,
+ c CHAR(255) CHARACTER SET utf8 NOT NULL,
+ j INT NOT NULL);
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t1 VALUES (1, "", 1);
+INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+
+let $diff_table_1=master:test.t1;
+let $diff_table_2=slave:test.t1;
+source include/diff_tables.inc;
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t2 VALUES (1, "", 1);
+INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+
+let $diff_table_1=master:test.t2;
+let $diff_table_2=slave:test.t2;
+source include/diff_tables.inc;
+
+--echo [expecting slave to stop]
+connection master;
+INSERT INTO t3 VALUES (1, "", 1);
+INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
+
+connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
+let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+disable_query_log;
+eval SELECT "$last_error" AS Last_SQL_Error;
+enable_query_log;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t4 VALUES (1, "", 1);
+INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+
+let $diff_table_1=master:test.t4;
+let $diff_table_2=slave:test.t4;
+source include/diff_tables.inc;
+
+--echo [expecting slave to stop]
+connection master;
+INSERT INTO t5 VALUES (1, "", 1);
+INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+
+connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
+let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+disable_query_log;
+eval SELECT "$last_error" AS Last_SQL_Error;
+enable_query_log;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+
+--echo [expecting slave to stop]
+connection master;
+INSERT INTO t6 VALUES (1, "", 1);
+INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+
+connection slave;
+source include/wait_for_slave_sql_to_stop.inc;
+let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+disable_query_log;
+eval SELECT "$last_error" AS Last_SQL_Error;
+enable_query_log;
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+source include/wait_for_slave_to_start.inc;
+
+--echo [expecting slave to replicate correctly]
+connection master;
+INSERT INTO t7 VALUES (1, "", 1);
+INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+
+let $diff_table_1=master:test.t7;
+let $diff_table_2=slave:test.t7;
+source include/diff_tables.inc;
+
+connection master;
+drop table t1, t2, t3, t4, t5, t6, t7;
+sync_slave_with_master;
+
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2008-06-13 13:48:17 +0000
+++ b/mysql-test/mysql-test-run.pl 2008-07-15 16:43:25 +0000
@@ -251,7 +251,7 @@ our $opt_sleep;
our $opt_testcase_timeout;
our $opt_suite_timeout;
my $default_testcase_timeout= 15; # 15 min max
-my $default_suite_timeout= 180; # 3 hours max
+my $default_suite_timeout= 300; # 5 hours max
our $opt_start_and_exit;
our $opt_start_dirty;
@@ -1579,13 +1579,15 @@ sub executable_setup_ndb () {
$exe_ndbd=
mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd",
- "$ndb_path/ndbd");
+ "$ndb_path/ndbd",
+ "$glob_basedir/libexec/ndbd");
$exe_ndb_mgm=
mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm",
"$ndb_path/ndb_mgm");
$exe_ndb_mgmd=
mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
- "$ndb_path/ndb_mgmd");
+ "$ndb_path/ndb_mgmd",
+ "$glob_basedir/libexec/ndb_mgmd");
$exe_ndb_waiter=
mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter",
"$ndb_path/ndb_waiter");
@@ -1682,7 +1684,8 @@ sub executable_setup () {
# Look for mysql_fix_privilege_tables.sql script
$file_mysql_fix_privilege_tables=
mtr_file_exists("$glob_basedir/scripts/mysql_fix_privilege_tables.sql",
- "$glob_basedir/share/mysql_fix_privilege_tables.sql");
+ "$glob_basedir/share/mysql_fix_privilege_tables.sql",
+ "$glob_basedir/share/mysql/mysql_fix_privilege_tables.sql");
if ( ! $opt_skip_ndbcluster and executable_setup_ndb())
{
=== added file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/parser.result 2008-07-19 08:31:33 +0000
@@ -0,0 +1,617 @@
+SET @save_sql_mode=@@sql_mode;
+set SQL_MODE='';
+create table ADDDATE(a int);
+drop table ADDDATE;
+create table ADDDATE (a int);
+drop table ADDDATE;
+create table BIT_AND(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1
+create table BIT_AND (a int);
+drop table BIT_AND;
+create table BIT_OR(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1
+create table BIT_OR (a int);
+drop table BIT_OR;
+create table BIT_XOR(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1
+create table BIT_XOR (a int);
+drop table BIT_XOR;
+create table CAST(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1
+create table CAST (a int);
+drop table CAST;
+create table COUNT(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1
+create table COUNT (a int);
+drop table COUNT;
+create table CURDATE(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1
+create table CURDATE (a int);
+drop table CURDATE;
+create table CURTIME(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1
+create table CURTIME (a int);
+drop table CURTIME;
+create table DATE_ADD(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1
+create table DATE_ADD (a int);
+drop table DATE_ADD;
+create table DATE_SUB(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1
+create table DATE_SUB (a int);
+drop table DATE_SUB;
+create table EXTRACT(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1
+create table EXTRACT (a int);
+drop table EXTRACT;
+create table GROUP_CONCAT(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1
+create table GROUP_CONCAT (a int);
+drop table GROUP_CONCAT;
+create table GROUP_UNIQUE_USERS(a int);
+drop table GROUP_UNIQUE_USERS;
+create table GROUP_UNIQUE_USERS (a int);
+drop table GROUP_UNIQUE_USERS;
+create table MAX(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1
+create table MAX (a int);
+drop table MAX;
+create table MID(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1
+create table MID (a int);
+drop table MID;
+create table MIN(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1
+create table MIN (a int);
+drop table MIN;
+create table NOW(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1
+create table NOW (a int);
+drop table NOW;
+create table POSITION(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1
+create table POSITION (a int);
+drop table POSITION;
+create table SESSION_USER(a int);
+drop table SESSION_USER;
+create table SESSION_USER (a int);
+drop table SESSION_USER;
+create table STD(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1
+create table STD (a int);
+drop table STD;
+create table STDDEV(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1
+create table STDDEV (a int);
+drop table STDDEV;
+create table STDDEV_POP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1
+create table STDDEV_POP (a int);
+drop table STDDEV_POP;
+create table STDDEV_SAMP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1
+create table STDDEV_SAMP (a int);
+drop table STDDEV_SAMP;
+create table SUBDATE(a int);
+drop table SUBDATE;
+create table SUBDATE (a int);
+drop table SUBDATE;
+create table SUBSTR(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1
+create table SUBSTR (a int);
+drop table SUBSTR;
+create table SUBSTRING(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1
+create table SUBSTRING (a int);
+drop table SUBSTRING;
+create table SUM(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1
+create table SUM (a int);
+drop table SUM;
+create table SYSDATE(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1
+create table SYSDATE (a int);
+drop table SYSDATE;
+create table SYSTEM_USER(a int);
+drop table SYSTEM_USER;
+create table SYSTEM_USER (a int);
+drop table SYSTEM_USER;
+create table TRIM(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1
+create table TRIM (a int);
+drop table TRIM;
+create table UNIQUE_USERS(a int);
+drop table UNIQUE_USERS;
+create table UNIQUE_USERS (a int);
+drop table UNIQUE_USERS;
+create table VARIANCE(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1
+create table VARIANCE (a int);
+drop table VARIANCE;
+create table VAR_POP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1
+create table VAR_POP (a int);
+drop table VAR_POP;
+create table VAR_SAMP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1
+create table VAR_SAMP (a int);
+drop table VAR_SAMP;
+set SQL_MODE='IGNORE_SPACE';
+create table ADDDATE(a int);
+drop table ADDDATE;
+create table ADDDATE (a int);
+drop table ADDDATE;
+create table BIT_AND(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1
+create table BIT_AND (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND (a int)' at line 1
+create table BIT_OR(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1
+create table BIT_OR (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR (a int)' at line 1
+create table BIT_XOR(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1
+create table BIT_XOR (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR (a int)' at line 1
+create table CAST(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1
+create table CAST (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST (a int)' at line 1
+create table COUNT(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1
+create table COUNT (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT (a int)' at line 1
+create table CURDATE(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1
+create table CURDATE (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE (a int)' at line 1
+create table CURTIME(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1
+create table CURTIME (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME (a int)' at line 1
+create table DATE_ADD(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1
+create table DATE_ADD (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD (a int)' at line 1
+create table DATE_SUB(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1
+create table DATE_SUB (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB (a int)' at line 1
+create table EXTRACT(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1
+create table EXTRACT (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT (a int)' at line 1
+create table GROUP_CONCAT(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1
+create table GROUP_CONCAT (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT (a int)' at line 1
+create table GROUP_UNIQUE_USERS(a int);
+drop table GROUP_UNIQUE_USERS;
+create table GROUP_UNIQUE_USERS (a int);
+drop table GROUP_UNIQUE_USERS;
+create table MAX(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1
+create table MAX (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX (a int)' at line 1
+create table MID(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1
+create table MID (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID (a int)' at line 1
+create table MIN(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1
+create table MIN (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN (a int)' at line 1
+create table NOW(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1
+create table NOW (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW (a int)' at line 1
+create table POSITION(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1
+create table POSITION (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION (a int)' at line 1
+create table SESSION_USER(a int);
+drop table SESSION_USER;
+create table SESSION_USER (a int);
+drop table SESSION_USER;
+create table STD(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1
+create table STD (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD (a int)' at line 1
+create table STDDEV(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1
+create table STDDEV (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV (a int)' at line 1
+create table STDDEV_POP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1
+create table STDDEV_POP (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP (a int)' at line 1
+create table STDDEV_SAMP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1
+create table STDDEV_SAMP (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP (a int)' at line 1
+create table SUBDATE(a int);
+drop table SUBDATE;
+create table SUBDATE (a int);
+drop table SUBDATE;
+create table SUBSTR(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1
+create table SUBSTR (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR (a int)' at line 1
+create table SUBSTRING(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1
+create table SUBSTRING (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING (a int)' at line 1
+create table SUM(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1
+create table SUM (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM (a int)' at line 1
+create table SYSDATE(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1
+create table SYSDATE (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE (a int)' at line 1
+create table SYSTEM_USER(a int);
+drop table SYSTEM_USER;
+create table SYSTEM_USER (a int);
+drop table SYSTEM_USER;
+create table TRIM(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1
+create table TRIM (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM (a int)' at line 1
+create table UNIQUE_USERS(a int);
+drop table UNIQUE_USERS;
+create table UNIQUE_USERS (a int);
+drop table UNIQUE_USERS;
+create table VARIANCE(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1
+create table VARIANCE (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE (a int)' at line 1
+create table VAR_POP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1
+create table VAR_POP (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP (a int)' at line 1
+create table VAR_SAMP(a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1
+create table VAR_SAMP (a int);
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP (a int)' at line 1
+DROP TABLE IF EXISTS table_25930_a;
+DROP TABLE IF EXISTS table_25930_b;
+SET SQL_MODE = 'ANSI_QUOTES';
+CREATE TABLE table_25930_a ( "blah" INT );
+CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
+desc table_25930_b;
+Field Type Null Key Default Extra
+"blah" - 1 bigint(12) YES NULL
+DROP TABLE table_25930_a;
+DROP TABLE table_25930_b;
+SET @@sql_mode=@save_sql_mode;
+DROP PROCEDURE IF EXISTS p26030;
+select "non terminated"$$
+non terminated
+non terminated
+select "terminated";$$
+terminated
+terminated
+select "non terminated, space" $$
+non terminated, space
+non terminated, space
+select "terminated, space"; $$
+terminated, space
+terminated, space
+select "non terminated, comment" /* comment */$$
+non terminated, comment
+non terminated, comment
+select "terminated, comment"; /* comment */$$
+terminated, comment
+terminated, comment
+select "stmt 1";select "stmt 2 non terminated"$$
+stmt 1
+stmt 1
+stmt 2 non terminated
+stmt 2 non terminated
+select "stmt 1";select "stmt 2 terminated";$$
+stmt 1
+stmt 1
+stmt 2 terminated
+stmt 2 terminated
+select "stmt 1";select "stmt 2 non terminated, space" $$
+stmt 1
+stmt 1
+stmt 2 non terminated, space
+stmt 2 non terminated, space
+select "stmt 1";select "stmt 2 terminated, space"; $$
+stmt 1
+stmt 1
+stmt 2 terminated, space
+stmt 2 terminated, space
+select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$
+stmt 1
+stmt 1
+stmt 2 non terminated, comment
+stmt 2 non terminated, comment
+select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$
+stmt 1
+stmt 1
+stmt 2 terminated, comment
+stmt 2 terminated, comment
+select "stmt 1"; select "space, stmt 2"$$
+stmt 1
+stmt 1
+space, stmt 2
+space, stmt 2
+select "stmt 1";/* comment */select "comment, stmt 2"$$
+stmt 1
+stmt 1
+comment, stmt 2
+comment, stmt 2
+DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030()
+$$
+1
+1
+DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030()
+$$
+1
+1
+DROP PROCEDURE p26030;
+select pi(3.14);
+ERROR 42000: Incorrect parameter count in the call to native function 'pi'
+select tan();
+ERROR 42000: Incorrect parameter count in the call to native function 'tan'
+select tan(1, 2);
+ERROR 42000: Incorrect parameter count in the call to native function 'tan'
+select makedate(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'makedate'
+select makedate(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'makedate'
+select maketime();
+ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
+select maketime(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
+select maketime(1, 2);
+ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
+select maketime(1, 2, 3, 4);
+ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
+select atan();
+ERROR 42000: Incorrect parameter count in the call to native function 'atan'
+select atan2(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'atan2'
+select concat();
+ERROR 42000: Incorrect parameter count in the call to native function 'concat'
+select concat("foo");
+concat("foo")
+foo
+select concat_ws();
+ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws'
+select concat_ws("foo");
+ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws'
+select encrypt();
+ERROR 42000: Incorrect parameter count in the call to native function 'encrypt'
+select encrypt(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'encrypt'
+select des_encrypt("p1", "p2", "not expected");
+ERROR 42000: Incorrect parameter count in the call to native function 'des_encrypt'
+select des_decrypt("p1", "p2", "not expected");
+ERROR 42000: Incorrect parameter count in the call to native function 'des_decrypt'
+select elt();
+ERROR 42000: Incorrect parameter count in the call to native function 'elt'
+select elt(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'elt'
+select export_set();
+ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
+select export_set("p1");
+ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
+select export_set("p1", "p2");
+ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
+select export_set("p1", "p2", "p3", "p4", "p5", "p6");
+ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
+select field();
+ERROR 42000: Incorrect parameter count in the call to native function 'field'
+select field("p1");
+ERROR 42000: Incorrect parameter count in the call to native function 'field'
+select from_unixtime();
+ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime'
+select from_unixtime(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime'
+select unix_timestamp(1, 2);
+ERROR 42000: Incorrect parameter count in the call to native function 'unix_timestamp'
+select greatest();
+ERROR 42000: Incorrect parameter count in the call to native function 'greatest'
+select greatest(12);
+ERROR 42000: Incorrect parameter count in the call to native function 'greatest'
+select last_insert_id(1, 2);
+ERROR 42000: Incorrect parameter count in the call to native function 'last_insert_id'
+select least();
+ERROR 42000: Incorrect parameter count in the call to native function 'least'
+select least(12);
+ERROR 42000: Incorrect parameter count in the call to native function 'least'
+select locate();
+ERROR 42000: Incorrect parameter count in the call to native function 'locate'
+select locate(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'locate'
+select locate(1, 2, 3, 4);
+ERROR 42000: Incorrect parameter count in the call to native function 'locate'
+select log();
+ERROR 42000: Incorrect parameter count in the call to native function 'log'
+select log(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'log'
+select make_set();
+ERROR 42000: Incorrect parameter count in the call to native function 'make_set'
+select make_set(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'make_set'
+select master_pos_wait();
+ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait'
+select master_pos_wait(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait'
+select master_pos_wait(1, 2, 3, 4);
+ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait'
+select rand(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'rand'
+select round(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'round'
+select yearweek();
+ERROR 42000: Incorrect parameter count in the call to native function 'yearweek'
+select yearweek(1, 2, 3);
+ERROR 42000: Incorrect parameter count in the call to native function 'yearweek'
+select abs(3);
+abs(3)
+3
+select abs(3 AS three);
+ERROR 42000: Incorrect parameters in the call to native function 'abs'
+select abs(3 three);
+ERROR 42000: Incorrect parameters in the call to native function 'abs'
+select abs(3 AS "three");
+ERROR 42000: Incorrect parameters in the call to native function 'abs'
+select abs(3 "three");
+ERROR 42000: Incorrect parameters in the call to native function 'abs'
+set @bar="bar";
+set @foobar="foobar";
+select instr("foobar", "bar");
+instr("foobar", "bar")
+4
+select instr("foobar" AS p1, "bar");
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar" p1, "bar");
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar" AS "p1", "bar");
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar" "p1", "bar");
+instr("foobar" "p1", "bar")
+4
+select instr(@foobar "p1", "bar");
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar", "bar" AS p2);
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar", "bar" p2);
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar", "bar" AS "p2");
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar", "bar" "p2");
+instr("foobar", "bar" "p2")
+0
+select instr("foobar", @bar "p2");
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select instr("foobar" AS p1, "bar" AS p2);
+ERROR 42000: Incorrect parameters in the call to native function 'instr'
+select conv(255, 10, 16);
+conv(255, 10, 16)
+FF
+select conv(255 AS p1, 10, 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255 p1, 10, 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255 AS "p1", 10, 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255 "p1", 10, 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10 AS p2, 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10 p2, 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10 AS "p2", 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10 "p2", 16);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10, 16 AS p3);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10, 16 p3);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10, 16 AS "p3");
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255, 10, 16 "p3");
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select conv(255 AS p1, 10 AS p2, 16 AS p3);
+ERROR 42000: Incorrect parameters in the call to native function 'conv'
+select atan(10);
+atan(10)
+1.4711276743037
+select atan(10 AS p1);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10 p1);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10 AS "p1");
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10 "p1");
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10, 20);
+atan(10, 20)
+0.46364760900081
+select atan(10 AS p1, 20);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10 p1, 20);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10 AS "p1", 20);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10 "p1", 20);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10, 20 AS p2);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10, 20 p2);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10, 20 AS "p2");
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10, 20 "p2");
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+select atan(10 AS p1, 20 AS p2);
+ERROR 42000: Incorrect parameters in the call to native function 'atan'
+DROP TABLE IF EXISTS t1;
+SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
+STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
+NULL
+SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
+STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE
+NULL
+SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
+"1997-12-31 23:59:59" + INTERVAL 1 SECOND
+1998-01-01 00:00:00
+SELECT 1 + INTERVAL(1,0,1,2) + 1;
+1 + INTERVAL(1,0,1,2) + 1
+4
+SELECT INTERVAL(1^1,0,1,2) + 1;
+INTERVAL(1^1,0,1,2) + 1
+2
+SELECT INTERVAL(1,0+1,2,3) * 5.5;
+INTERVAL(1,0+1,2,3) * 5.5
+5.5
+SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
+INTERVAL(3,3,1+3,4+4) / 0.5
+2.0000
+SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
+(INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2
+50.0000
+SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
+INTERVAL(1,0,1,2) + 1 5 * INTERVAL(1,0,1,2)
+3 10
+SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
+INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3)
+2
+SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND;
+1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND
+NULL
+SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND;
+1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND
+NULL
+CREATE TABLE t1 (a INT, b DATETIME);
+INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
+SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
+a b
+3 1998-01-01 00:00:00
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1,t2,t3;
+CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME);
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
+a1 a2 a3 a4
+SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
+a1 a2 a3 a4 a1 a2 a3 a4
+SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
+a1 a2 a3 a4 a1 a2 a3 a4
+SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)};
+a1 a2 a3 a4 a1 a2 a3 a4
+SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
+a1 a2 a3 a4 a1 a2 a3 a4
+SELECT {fn CONCAT(a1,a2)} FROM t1;
+{fn CONCAT(a1,a2)}
+UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
+SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
+a1 a4
+DROP TABLE t1, t2, t3;
=== removed file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result 2008-07-08 16:33:09 +0000
+++ b/mysql-test/r/parser.result 1970-01-01 00:00:00 +0000
@@ -1,617 +0,0 @@
-SET @save_sql_mode=@@sql_mode;
-set SQL_MODE='';
-create table ADDDATE(a int);
-drop table ADDDATE;
-create table ADDDATE (a int);
-drop table ADDDATE;
-create table BIT_AND(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1
-create table BIT_AND (a int);
-drop table BIT_AND;
-create table BIT_OR(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1
-create table BIT_OR (a int);
-drop table BIT_OR;
-create table BIT_XOR(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1
-create table BIT_XOR (a int);
-drop table BIT_XOR;
-create table CAST(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1
-create table CAST (a int);
-drop table CAST;
-create table COUNT(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1
-create table COUNT (a int);
-drop table COUNT;
-create table CURDATE(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1
-create table CURDATE (a int);
-drop table CURDATE;
-create table CURTIME(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1
-create table CURTIME (a int);
-drop table CURTIME;
-create table DATE_ADD(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1
-create table DATE_ADD (a int);
-drop table DATE_ADD;
-create table DATE_SUB(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1
-create table DATE_SUB (a int);
-drop table DATE_SUB;
-create table EXTRACT(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1
-create table EXTRACT (a int);
-drop table EXTRACT;
-create table GROUP_CONCAT(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1
-create table GROUP_CONCAT (a int);
-drop table GROUP_CONCAT;
-create table GROUP_UNIQUE_USERS(a int);
-drop table GROUP_UNIQUE_USERS;
-create table GROUP_UNIQUE_USERS (a int);
-drop table GROUP_UNIQUE_USERS;
-create table MAX(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1
-create table MAX (a int);
-drop table MAX;
-create table MID(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1
-create table MID (a int);
-drop table MID;
-create table MIN(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1
-create table MIN (a int);
-drop table MIN;
-create table NOW(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1
-create table NOW (a int);
-drop table NOW;
-create table POSITION(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1
-create table POSITION (a int);
-drop table POSITION;
-create table SESSION_USER(a int);
-drop table SESSION_USER;
-create table SESSION_USER (a int);
-drop table SESSION_USER;
-create table STD(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1
-create table STD (a int);
-drop table STD;
-create table STDDEV(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1
-create table STDDEV (a int);
-drop table STDDEV;
-create table STDDEV_POP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1
-create table STDDEV_POP (a int);
-drop table STDDEV_POP;
-create table STDDEV_SAMP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1
-create table STDDEV_SAMP (a int);
-drop table STDDEV_SAMP;
-create table SUBDATE(a int);
-drop table SUBDATE;
-create table SUBDATE (a int);
-drop table SUBDATE;
-create table SUBSTR(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1
-create table SUBSTR (a int);
-drop table SUBSTR;
-create table SUBSTRING(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1
-create table SUBSTRING (a int);
-drop table SUBSTRING;
-create table SUM(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1
-create table SUM (a int);
-drop table SUM;
-create table SYSDATE(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1
-create table SYSDATE (a int);
-drop table SYSDATE;
-create table SYSTEM_USER(a int);
-drop table SYSTEM_USER;
-create table SYSTEM_USER (a int);
-drop table SYSTEM_USER;
-create table TRIM(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1
-create table TRIM (a int);
-drop table TRIM;
-create table UNIQUE_USERS(a int);
-drop table UNIQUE_USERS;
-create table UNIQUE_USERS (a int);
-drop table UNIQUE_USERS;
-create table VARIANCE(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1
-create table VARIANCE (a int);
-drop table VARIANCE;
-create table VAR_POP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1
-create table VAR_POP (a int);
-drop table VAR_POP;
-create table VAR_SAMP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1
-create table VAR_SAMP (a int);
-drop table VAR_SAMP;
-set SQL_MODE='IGNORE_SPACE';
-create table ADDDATE(a int);
-drop table ADDDATE;
-create table ADDDATE (a int);
-drop table ADDDATE;
-create table BIT_AND(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND(a int)' at line 1
-create table BIT_AND (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_AND (a int)' at line 1
-create table BIT_OR(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR(a int)' at line 1
-create table BIT_OR (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_OR (a int)' at line 1
-create table BIT_XOR(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR(a int)' at line 1
-create table BIT_XOR (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BIT_XOR (a int)' at line 1
-create table CAST(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST(a int)' at line 1
-create table CAST (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CAST (a int)' at line 1
-create table COUNT(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT(a int)' at line 1
-create table COUNT (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COUNT (a int)' at line 1
-create table CURDATE(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE(a int)' at line 1
-create table CURDATE (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURDATE (a int)' at line 1
-create table CURTIME(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME(a int)' at line 1
-create table CURTIME (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURTIME (a int)' at line 1
-create table DATE_ADD(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD(a int)' at line 1
-create table DATE_ADD (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_ADD (a int)' at line 1
-create table DATE_SUB(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB(a int)' at line 1
-create table DATE_SUB (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATE_SUB (a int)' at line 1
-create table EXTRACT(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT(a int)' at line 1
-create table EXTRACT (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTRACT (a int)' at line 1
-create table GROUP_CONCAT(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT(a int)' at line 1
-create table GROUP_CONCAT (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP_CONCAT (a int)' at line 1
-create table GROUP_UNIQUE_USERS(a int);
-drop table GROUP_UNIQUE_USERS;
-create table GROUP_UNIQUE_USERS (a int);
-drop table GROUP_UNIQUE_USERS;
-create table MAX(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX(a int)' at line 1
-create table MAX (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX (a int)' at line 1
-create table MID(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID(a int)' at line 1
-create table MID (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MID (a int)' at line 1
-create table MIN(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN(a int)' at line 1
-create table MIN (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MIN (a int)' at line 1
-create table NOW(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW(a int)' at line 1
-create table NOW (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW (a int)' at line 1
-create table POSITION(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION(a int)' at line 1
-create table POSITION (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'POSITION (a int)' at line 1
-create table SESSION_USER(a int);
-drop table SESSION_USER;
-create table SESSION_USER (a int);
-drop table SESSION_USER;
-create table STD(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD(a int)' at line 1
-create table STD (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STD (a int)' at line 1
-create table STDDEV(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV(a int)' at line 1
-create table STDDEV (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV (a int)' at line 1
-create table STDDEV_POP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP(a int)' at line 1
-create table STDDEV_POP (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_POP (a int)' at line 1
-create table STDDEV_SAMP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP(a int)' at line 1
-create table STDDEV_SAMP (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'STDDEV_SAMP (a int)' at line 1
-create table SUBDATE(a int);
-drop table SUBDATE;
-create table SUBDATE (a int);
-drop table SUBDATE;
-create table SUBSTR(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR(a int)' at line 1
-create table SUBSTR (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTR (a int)' at line 1
-create table SUBSTRING(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING(a int)' at line 1
-create table SUBSTRING (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUBSTRING (a int)' at line 1
-create table SUM(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM(a int)' at line 1
-create table SUM (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SUM (a int)' at line 1
-create table SYSDATE(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE(a int)' at line 1
-create table SYSDATE (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SYSDATE (a int)' at line 1
-create table SYSTEM_USER(a int);
-drop table SYSTEM_USER;
-create table SYSTEM_USER (a int);
-drop table SYSTEM_USER;
-create table TRIM(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM(a int)' at line 1
-create table TRIM (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TRIM (a int)' at line 1
-create table UNIQUE_USERS(a int);
-drop table UNIQUE_USERS;
-create table UNIQUE_USERS (a int);
-drop table UNIQUE_USERS;
-create table VARIANCE(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE(a int)' at line 1
-create table VARIANCE (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIANCE (a int)' at line 1
-create table VAR_POP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP(a int)' at line 1
-create table VAR_POP (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_POP (a int)' at line 1
-create table VAR_SAMP(a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP(a int)' at line 1
-create table VAR_SAMP (a int);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VAR_SAMP (a int)' at line 1
-DROP TABLE IF EXISTS table_25930_a;
-DROP TABLE IF EXISTS table_25930_b;
-SET SQL_MODE = 'ANSI_QUOTES';
-CREATE TABLE table_25930_a ( "blah" INT );
-CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
-desc table_25930_b;
-Field Type Null Key Default Extra
-"blah" - 1 bigint(12) YES NULL
-DROP TABLE table_25930_a;
-DROP TABLE table_25930_b;
-SET @@sql_mode=@save_sql_mode;
-DROP PROCEDURE IF EXISTS p26030;
-select "non terminated"$$
-non terminated
-non terminated
-select "terminated";$$
-terminated
-terminated
-select "non terminated, space" $$
-non terminated, space
-non terminated, space
-select "terminated, space"; $$
-terminated, space
-terminated, space
-select "non terminated, comment" /* comment */$$
-non terminated, comment
-non terminated, comment
-select "terminated, comment"; /* comment */$$
-terminated, comment
-terminated, comment
-select "stmt 1";select "stmt 2 non terminated"$$
-stmt 1
-stmt 1
-stmt 2 non terminated
-stmt 2 non terminated
-select "stmt 1";select "stmt 2 terminated";$$
-stmt 1
-stmt 1
-stmt 2 terminated
-stmt 2 terminated
-select "stmt 1";select "stmt 2 non terminated, space" $$
-stmt 1
-stmt 1
-stmt 2 non terminated, space
-stmt 2 non terminated, space
-select "stmt 1";select "stmt 2 terminated, space"; $$
-stmt 1
-stmt 1
-stmt 2 terminated, space
-stmt 2 terminated, space
-select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$
-stmt 1
-stmt 1
-stmt 2 non terminated, comment
-stmt 2 non terminated, comment
-select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$
-stmt 1
-stmt 1
-stmt 2 terminated, comment
-stmt 2 terminated, comment
-select "stmt 1"; select "space, stmt 2"$$
-stmt 1
-stmt 1
-space, stmt 2
-space, stmt 2
-select "stmt 1";/* comment */select "comment, stmt 2"$$
-stmt 1
-stmt 1
-comment, stmt 2
-comment, stmt 2
-DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030()
-$$
-1
-1
-DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030()
-$$
-1
-1
-DROP PROCEDURE p26030;
-select pi(3.14);
-ERROR 42000: Incorrect parameter count in the call to native function 'pi'
-select tan();
-ERROR 42000: Incorrect parameter count in the call to native function 'tan'
-select tan(1, 2);
-ERROR 42000: Incorrect parameter count in the call to native function 'tan'
-select makedate(1);
-ERROR 42000: Incorrect parameter count in the call to native function 'makedate'
-select makedate(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'makedate'
-select maketime();
-ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
-select maketime(1);
-ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
-select maketime(1, 2);
-ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
-select maketime(1, 2, 3, 4);
-ERROR 42000: Incorrect parameter count in the call to native function 'maketime'
-select atan();
-ERROR 42000: Incorrect parameter count in the call to native function 'atan'
-select atan2(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'atan2'
-select concat();
-ERROR 42000: Incorrect parameter count in the call to native function 'concat'
-select concat("foo");
-concat("foo")
-foo
-select concat_ws();
-ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws'
-select concat_ws("foo");
-ERROR 42000: Incorrect parameter count in the call to native function 'concat_ws'
-select encrypt();
-ERROR 42000: Incorrect parameter count in the call to native function 'encrypt'
-select encrypt(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'encrypt'
-select des_encrypt("p1", "p2", "not expected");
-ERROR 42000: Incorrect parameter count in the call to native function 'des_encrypt'
-select des_decrypt("p1", "p2", "not expected");
-ERROR 42000: Incorrect parameter count in the call to native function 'des_decrypt'
-select elt();
-ERROR 42000: Incorrect parameter count in the call to native function 'elt'
-select elt(1);
-ERROR 42000: Incorrect parameter count in the call to native function 'elt'
-select export_set();
-ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
-select export_set("p1");
-ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
-select export_set("p1", "p2");
-ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
-select export_set("p1", "p2", "p3", "p4", "p5", "p6");
-ERROR 42000: Incorrect parameter count in the call to native function 'export_set'
-select field();
-ERROR 42000: Incorrect parameter count in the call to native function 'field'
-select field("p1");
-ERROR 42000: Incorrect parameter count in the call to native function 'field'
-select from_unixtime();
-ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime'
-select from_unixtime(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'from_unixtime'
-select unix_timestamp(1, 2);
-ERROR 42000: Incorrect parameter count in the call to native function 'unix_timestamp'
-select greatest();
-ERROR 42000: Incorrect parameter count in the call to native function 'greatest'
-select greatest(12);
-ERROR 42000: Incorrect parameter count in the call to native function 'greatest'
-select last_insert_id(1, 2);
-ERROR 42000: Incorrect parameter count in the call to native function 'last_insert_id'
-select least();
-ERROR 42000: Incorrect parameter count in the call to native function 'least'
-select least(12);
-ERROR 42000: Incorrect parameter count in the call to native function 'least'
-select locate();
-ERROR 42000: Incorrect parameter count in the call to native function 'locate'
-select locate(1);
-ERROR 42000: Incorrect parameter count in the call to native function 'locate'
-select locate(1, 2, 3, 4);
-ERROR 42000: Incorrect parameter count in the call to native function 'locate'
-select log();
-ERROR 42000: Incorrect parameter count in the call to native function 'log'
-select log(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'log'
-select make_set();
-ERROR 42000: Incorrect parameter count in the call to native function 'make_set'
-select make_set(1);
-ERROR 42000: Incorrect parameter count in the call to native function 'make_set'
-select master_pos_wait();
-ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait'
-select master_pos_wait(1);
-ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait'
-select master_pos_wait(1, 2, 3, 4);
-ERROR 42000: Incorrect parameter count in the call to native function 'master_pos_wait'
-select rand(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'rand'
-select round(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'round'
-select yearweek();
-ERROR 42000: Incorrect parameter count in the call to native function 'yearweek'
-select yearweek(1, 2, 3);
-ERROR 42000: Incorrect parameter count in the call to native function 'yearweek'
-select abs(3);
-abs(3)
-3
-select abs(3 AS three);
-ERROR 42000: Incorrect parameters in the call to native function 'abs'
-select abs(3 three);
-ERROR 42000: Incorrect parameters in the call to native function 'abs'
-select abs(3 AS "three");
-ERROR 42000: Incorrect parameters in the call to native function 'abs'
-select abs(3 "three");
-ERROR 42000: Incorrect parameters in the call to native function 'abs'
-set @bar="bar";
-set @foobar="foobar";
-select instr("foobar", "bar");
-instr("foobar", "bar")
-4
-select instr("foobar" AS p1, "bar");
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar" p1, "bar");
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar" AS "p1", "bar");
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar" "p1", "bar");
-instr("foobar" "p1", "bar")
-4
-select instr(@foobar "p1", "bar");
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar", "bar" AS p2);
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar", "bar" p2);
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar", "bar" AS "p2");
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar", "bar" "p2");
-instr("foobar", "bar" "p2")
-0
-select instr("foobar", @bar "p2");
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select instr("foobar" AS p1, "bar" AS p2);
-ERROR 42000: Incorrect parameters in the call to native function 'instr'
-select conv(255, 10, 16);
-conv(255, 10, 16)
-FF
-select conv(255 AS p1, 10, 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255 p1, 10, 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255 AS "p1", 10, 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255 "p1", 10, 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10 AS p2, 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10 p2, 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10 AS "p2", 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10 "p2", 16);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10, 16 AS p3);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10, 16 p3);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10, 16 AS "p3");
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255, 10, 16 "p3");
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select conv(255 AS p1, 10 AS p2, 16 AS p3);
-ERROR 42000: Incorrect parameters in the call to native function 'conv'
-select atan(10);
-atan(10)
-1.4711276743037
-select atan(10 AS p1);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10 p1);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10 AS "p1");
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10 "p1");
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10, 20);
-atan(10, 20)
-0.46364760900081
-select atan(10 AS p1, 20);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10 p1, 20);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10 AS "p1", 20);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10 "p1", 20);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10, 20 AS p2);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10, 20 p2);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10, 20 AS "p2");
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10, 20 "p2");
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-select atan(10 AS p1, 20 AS p2);
-ERROR 42000: Incorrect parameters in the call to native function 'atan'
-DROP TABLE IF EXISTS t1;
-SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
-STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
-NULL
-SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
-STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE
-NULL
-SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
-"1997-12-31 23:59:59" + INTERVAL 1 SECOND
-1998-01-01 00:00:00
-SELECT 1 + INTERVAL(1,0,1,2) + 1;
-1 + INTERVAL(1,0,1,2) + 1
-4
-SELECT INTERVAL(1^1,0,1,2) + 1;
-INTERVAL(1^1,0,1,2) + 1
-2
-SELECT INTERVAL(1,0+1,2,3) * 5.5;
-INTERVAL(1,0+1,2,3) * 5.5
-5.5
-SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
-INTERVAL(3,3,1+3,4+4) / 0.5
-2.0000
-SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
-(INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2
-50.0000
-SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
-INTERVAL(1,0,1,2) + 1 5 * INTERVAL(1,0,1,2)
-3 10
-SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
-INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3)
-2
-SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND;
-1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND
-NULL
-SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND;
-1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND
-NULL
-CREATE TABLE t1 (a INT, b DATETIME);
-INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
-SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
-a b
-3 1998-01-01 00:00:00
-DROP TABLE t1;
-DROP TABLE IF EXISTS t1,t2,t3;
-CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME);
-CREATE TABLE t2 LIKE t1;
-CREATE TABLE t3 LIKE t1;
-SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
-a1 a2 a3 a4
-SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
-a1 a2 a3 a4 a1 a2 a3 a4
-SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
-a1 a2 a3 a4 a1 a2 a3 a4
-SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)};
-a1 a2 a3 a4 a1 a2 a3 a4
-SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
-a1 a2 a3 a4 a1 a2 a3 a4
-SELECT {fn CONCAT(a1,a2)} FROM t1;
-{fn CONCAT(a1,a2)}
-UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
-SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
-a1 a4
-DROP TABLE t1, t2, t3;
=== modified file 'mysql-test/suite/binlog/r/binlog_base64_flag.result'
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result 2008-03-28 13:52:33 +0000
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result 2008-06-30 20:11:18 +0000
@@ -66,4 +66,28 @@ a
1
1
3
-drop table t1;
+CREATE TABLE char128_utf8 (
+i1 INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+i2 INT NOT NULL);
+CREATE TABLE char63_utf8 (
+i1 INT NOT NULL,
+c CHAR(63) CHARACTER SET utf8 NOT NULL,
+i2 INT NOT NULL);
+BINLOG '
+MuNkSA8BAAAAZgAAAGoAAAAAAAQANS4xLjI1LXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAy42RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
+';
+BINLOG '
+3u9kSBMBAAAANgAAAJYBAAAAABAAAAAAAAAABHRlc3QAC2NoYXI2M191dGY4AAMD/gMC/r0A
+3u9kSBcBAAAAKgAAAMABAAAQABAAAAAAAAEAA//4AQAAAAMxMjMBAAAA
+';
+SELECT * FROM char63_utf8;
+i1 c i2
+1 123 1
+BINLOG '
+iONkSBMBAAAANwAAAJkBAAAAABAAAAAAAAAABHRlc3QADGNoYXIxMjhfdXRmOAADA/4DAv6AAA==
+iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
+';
+ERROR HY000: master may suffer from http://bugs.mysql.com/bug.php?id=37426 so slave stops; check error log on slave for more info
+drop table t1, char63_utf8, char128_utf8;
=== modified file 'mysql-test/suite/binlog/t/binlog_base64_flag.test'
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test 2008-03-28 13:52:33 +0000
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test 2008-06-30 20:11:18 +0000
@@ -104,6 +104,49 @@ Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+
# the above line should fail and 5 should not be in the binlog.
select * from t1;
+# Test that BUG#37426 is triggered.
-# clean up
-drop table t1;
+CREATE TABLE char128_utf8 (
+ i1 INT NOT NULL,
+ c CHAR(128) CHARACTER SET utf8 NOT NULL,
+ i2 INT NOT NULL);
+CREATE TABLE char63_utf8 (
+ i1 INT NOT NULL,
+ c CHAR(63) CHARACTER SET utf8 NOT NULL,
+ i2 INT NOT NULL);
+
+#
+# This is the format description log event
+#
+
+BINLOG '
+MuNkSA8BAAAAZgAAAGoAAAAAAAQANS4xLjI1LXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAy42RIEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
+';
+
+# ... this event corresponding to
+#
+# INSERT INTO char63_utf8 VALUES ( 1, "123", 1 )
+#
+# The binlog event below shall not trigger the bug check
+
+BINLOG '
+3u9kSBMBAAAANgAAAJYBAAAAABAAAAAAAAAABHRlc3QAC2NoYXI2M191dGY4AAMD/gMC/r0A
+3u9kSBcBAAAAKgAAAMABAAAQABAAAAAAAAEAA//4AQAAAAMxMjMBAAAA
+';
+SELECT * FROM char63_utf8;
+
+# ... and this is an event corresponding to
+#
+# INSERT INTO char128_utf8 VALUES ( 1, "123", 1 )
+#
+# The binlog event below shall trigger the bug check and produce an error
+#
+
+error ER_UNKNOWN_ERROR;
+BINLOG '
+iONkSBMBAAAANwAAAJkBAAAAABAAAAAAAAAABHRlc3QADGNoYXIxMjhfdXRmOAADA/4DAv6AAA==
+iONkSBcBAAAAKwAAAMQBAAAQABAAAAAAAAEAA//4AQAAAAMAMTIzAQAAAA==
+';
+
+drop table t1, char63_utf8, char128_utf8;
=== added file 'mysql-test/suite/bugs/combinations'
--- a/mysql-test/suite/bugs/combinations 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/combinations 2008-06-30 20:11:18 +0000
@@ -0,0 +1,8 @@
+[row]
+--binlog-format=row
+
+[stmt]
+--binlog-format=statement
+
+[mix]
+--binlog-format=mixed
=== added file 'mysql-test/suite/bugs/r/rpl_bug37426.result'
--- a/mysql-test/suite/bugs/r/rpl_bug37426.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/r/rpl_bug37426.result 2008-06-30 20:11:18 +0000
@@ -0,0 +1,17 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE char128_utf8 (
+i1 INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+i2 INT NOT NULL);
+INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
+SELECT * FROM char128_utf8;
+i1 c i2
+1 123 1
+SELECT * FROM char128_utf8;
+i1 c i2
+1 123 1
=== added file 'mysql-test/suite/bugs/t/rpl_bug37426.test'
--- a/mysql-test/suite/bugs/t/rpl_bug37426.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/t/rpl_bug37426.test 2008-06-30 20:11:18 +0000
@@ -0,0 +1,22 @@
+#############################################################
+# Author: Mats Kindahl <mats@stripped>
+# Date: 2008-06-18
+# Purpose: Test for BUG#37426
+# RBR breaks for CHAR() UTF8 fields > 85 chars
+#############################################################
+
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+
+connection master;
+CREATE TABLE char128_utf8 (
+ i1 INT NOT NULL,
+ c CHAR(128) CHARACTER SET utf8 NOT NULL,
+ i2 INT NOT NULL);
+
+INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
+
+SELECT * FROM char128_utf8;
+sync_slave_with_master;
+
+SELECT * FROM char128_utf8;
=== modified file 'mysql-test/suite/funcs_1/triggers/triggers_03.inc'
--- a/mysql-test/suite/funcs_1/triggers/triggers_03.inc 2008-06-18 17:23:55 +0000
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03.inc 2008-07-19 08:31:33 +0000
@@ -13,6 +13,13 @@
USE test;
--source suite/funcs_1/include/tb3.inc
+# This test cannot be used for the embedded server because we check here
+# privilgeges.
+--source include/not_embedded.inc
+
+USE test;
+--source suite/funcs_1/include/tb3.inc
+
--disable_abort_on_error
###########################################
=== modified file 'mysql-test/suite/funcs_1/triggers/triggers_08.inc'
--- a/mysql-test/suite/funcs_1/triggers/triggers_08.inc 2008-06-03 10:21:48 +0000
+++ b/mysql-test/suite/funcs_1/triggers/triggers_08.inc 2008-07-19 08:31:33 +0000
@@ -8,6 +8,9 @@
USE test;
--source suite/funcs_1/include/tb3.inc
+USE test;
+--source suite/funcs_1/include/tb3.inc
+
# General setup for Trigger tests
let $message= Testcase: 3.5:;
--source include/show_msg.inc
=== modified file 'mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc'
--- a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc 2008-06-03 10:21:48 +0000
+++ b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc 2008-07-19 08:31:33 +0000
@@ -13,6 +13,14 @@ eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
+USE test;
+--source suite/funcs_1/include/tb3.inc
+
+--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
+eval
+load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
+into table tb3;
+
--disable_abort_on_error
##############################################
=== modified file 'mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result 2008-06-19 13:02:04 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result 2008-07-11 18:51:10 +0000
@@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
set @@global.slave_exec_mode= default;
Last_SQL_Error
-0
+
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
@@ -451,3 +451,66 @@ SELECT * FROM t1;
a b c
2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+CREATE TABLE t1 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+CREATE TABLE t2 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t3 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t4 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+CREATE TABLE t5 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t6 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t7 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+[expecting slave to replicate correctly]
+INSERT INTO t1 VALUES (1, "", 1);
+INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+Comparing tables master:test.t1 and slave:test.t1
+[expecting slave to replicate correctly]
+INSERT INTO t2 VALUES (1, "", 1);
+INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+Comparing tables master:test.t2 and slave:test.t2
+[expecting slave to stop]
+INSERT INTO t3 VALUES (1, "", 1);
+INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+[expecting slave to replicate correctly]
+INSERT INTO t4 VALUES (1, "", 1);
+INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+Comparing tables master:test.t4 and slave:test.t4
+[expecting slave to stop]
+INSERT INTO t5 VALUES (1, "", 1);
+INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+[expecting slave to stop]
+INSERT INTO t6 VALUES (1, "", 1);
+INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+[expecting slave to replicate correctly]
+INSERT INTO t7 VALUES (1, "", 1);
+INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+Comparing tables master:test.t7 and slave:test.t7
+drop table t1, t2, t3, t4, t5, t6, t7;
=== modified file 'mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result 2008-06-19 13:02:04 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result 2008-07-11 18:51:10 +0000
@@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
set @@global.slave_exec_mode= default;
Last_SQL_Error
-0
+
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
@@ -451,3 +451,66 @@ SELECT * FROM t1;
a b c
2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+CREATE TABLE t1 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+CREATE TABLE t2 (i INT NOT NULL,
+c CHAR(16) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t3 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t4 (i INT NOT NULL,
+c CHAR(128) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+CREATE TABLE t5 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t6 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+CREATE TABLE t7 (i INT NOT NULL,
+c CHAR(255) CHARACTER SET utf8 NOT NULL,
+j INT NOT NULL);
+[expecting slave to replicate correctly]
+INSERT INTO t1 VALUES (1, "", 1);
+INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+Comparing tables master:test.t1 and slave:test.t1
+[expecting slave to replicate correctly]
+INSERT INTO t2 VALUES (1, "", 1);
+INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+Comparing tables master:test.t2 and slave:test.t2
+[expecting slave to stop]
+INSERT INTO t3 VALUES (1, "", 1);
+INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+[expecting slave to replicate correctly]
+INSERT INTO t4 VALUES (1, "", 1);
+INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+Comparing tables master:test.t4 and slave:test.t4
+[expecting slave to stop]
+INSERT INTO t5 VALUES (1, "", 1);
+INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+[expecting slave to stop]
+INSERT INTO t6 VALUES (1, "", 1);
+INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+Last_SQL_Error
+Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size.
+SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8;
+START SLAVE;
+[expecting slave to replicate correctly]
+INSERT INTO t7 VALUES (1, "", 1);
+INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+Comparing tables master:test.t7 and slave:test.t7
+drop table t1, t2, t3, t4, t5, t6, t7;
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2008-07-15 11:42:21 +0000
+++ b/mysql-test/t/disabled.def 2008-07-22 11:04:32 +0000
@@ -94,3 +94,6 @@ tmp_table_size_basic_64 :
transaction_alloc_block_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
transaction_prealloc_size_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
wait_timeout_basic_64 : Bug #36522: Some tests of system variables have diffs on 64bit platorms
+log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows
+slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions
+
=== added file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/parser.test 2008-07-19 08:31:33 +0000
@@ -0,0 +1,726 @@
+#
+# This file contains tests covering the parser
+#
+
+#=============================================================================
+# LEXICAL PARSER (lex)
+#=============================================================================
+
+#
+# Maintainer: these tests are for the lexical parser, so every character,
+# even whitespace or comments, is significant here.
+#
+
+SET @save_sql_mode=@@sql_mode;
+
+#
+# Documenting the current behavior, to detect incompatible changes.
+# In each cases:
+# - no error is the correct result
+# - an error is the expected result with the current implementation,
+# and is a limitation.
+
+set SQL_MODE='';
+
+create table ADDDATE(a int);
+drop table ADDDATE;
+create table ADDDATE (a int);
+drop table ADDDATE;
+
+--error ER_PARSE_ERROR
+create table BIT_AND(a int);
+create table BIT_AND (a int);
+drop table BIT_AND;
+
+--error ER_PARSE_ERROR
+create table BIT_OR(a int);
+create table BIT_OR (a int);
+drop table BIT_OR;
+
+--error ER_PARSE_ERROR
+create table BIT_XOR(a int);
+create table BIT_XOR (a int);
+drop table BIT_XOR;
+
+--error ER_PARSE_ERROR
+create table CAST(a int);
+create table CAST (a int);
+drop table CAST;
+
+--error ER_PARSE_ERROR
+create table COUNT(a int);
+create table COUNT (a int);
+drop table COUNT;
+
+--error ER_PARSE_ERROR
+create table CURDATE(a int);
+create table CURDATE (a int);
+drop table CURDATE;
+
+--error ER_PARSE_ERROR
+create table CURTIME(a int);
+create table CURTIME (a int);
+drop table CURTIME;
+
+--error ER_PARSE_ERROR
+create table DATE_ADD(a int);
+create table DATE_ADD (a int);
+drop table DATE_ADD;
+
+--error ER_PARSE_ERROR
+create table DATE_SUB(a int);
+create table DATE_SUB (a int);
+drop table DATE_SUB;
+
+--error ER_PARSE_ERROR
+create table EXTRACT(a int);
+create table EXTRACT (a int);
+drop table EXTRACT;
+
+--error ER_PARSE_ERROR
+create table GROUP_CONCAT(a int);
+create table GROUP_CONCAT (a int);
+drop table GROUP_CONCAT;
+
+# Limitation removed in 5.1
+create table GROUP_UNIQUE_USERS(a int);
+drop table GROUP_UNIQUE_USERS;
+create table GROUP_UNIQUE_USERS (a int);
+drop table GROUP_UNIQUE_USERS;
+
+--error ER_PARSE_ERROR
+create table MAX(a int);
+create table MAX (a int);
+drop table MAX;
+
+--error ER_PARSE_ERROR
+create table MID(a int);
+create table MID (a int);
+drop table MID;
+
+--error ER_PARSE_ERROR
+create table MIN(a int);
+create table MIN (a int);
+drop table MIN;
+
+--error ER_PARSE_ERROR
+create table NOW(a int);
+create table NOW (a int);
+drop table NOW;
+
+--error ER_PARSE_ERROR
+create table POSITION(a int);
+create table POSITION (a int);
+drop table POSITION;
+
+create table SESSION_USER(a int);
+drop table SESSION_USER;
+create table SESSION_USER (a int);
+drop table SESSION_USER;
+
+--error ER_PARSE_ERROR
+create table STD(a int);
+create table STD (a int);
+drop table STD;
+
+--error ER_PARSE_ERROR
+create table STDDEV(a int);
+create table STDDEV (a int);
+drop table STDDEV;
+
+--error ER_PARSE_ERROR
+create table STDDEV_POP(a int);
+create table STDDEV_POP (a int);
+drop table STDDEV_POP;
+
+--error ER_PARSE_ERROR
+create table STDDEV_SAMP(a int);
+create table STDDEV_SAMP (a int);
+drop table STDDEV_SAMP;
+
+create table SUBDATE(a int);
+drop table SUBDATE;
+create table SUBDATE (a int);
+drop table SUBDATE;
+
+--error ER_PARSE_ERROR
+create table SUBSTR(a int);
+create table SUBSTR (a int);
+drop table SUBSTR;
+
+--error ER_PARSE_ERROR
+create table SUBSTRING(a int);
+create table SUBSTRING (a int);
+drop table SUBSTRING;
+
+--error ER_PARSE_ERROR
+create table SUM(a int);
+create table SUM (a int);
+drop table SUM;
+
+--error ER_PARSE_ERROR
+create table SYSDATE(a int);
+create table SYSDATE (a int);
+drop table SYSDATE;
+
+create table SYSTEM_USER(a int);
+drop table SYSTEM_USER;
+create table SYSTEM_USER (a int);
+drop table SYSTEM_USER;
+
+--error ER_PARSE_ERROR
+create table TRIM(a int);
+create table TRIM (a int);
+drop table TRIM;
+
+# Limitation removed in 5.1
+create table UNIQUE_USERS(a int);
+drop table UNIQUE_USERS;
+create table UNIQUE_USERS (a int);
+drop table UNIQUE_USERS;
+
+--error ER_PARSE_ERROR
+create table VARIANCE(a int);
+create table VARIANCE (a int);
+drop table VARIANCE;
+
+--error ER_PARSE_ERROR
+create table VAR_POP(a int);
+create table VAR_POP (a int);
+drop table VAR_POP;
+
+--error ER_PARSE_ERROR
+create table VAR_SAMP(a int);
+create table VAR_SAMP (a int);
+drop table VAR_SAMP;
+
+set SQL_MODE='IGNORE_SPACE';
+
+create table ADDDATE(a int);
+drop table ADDDATE;
+create table ADDDATE (a int);
+drop table ADDDATE;
+
+--error ER_PARSE_ERROR
+create table BIT_AND(a int);
+--error ER_PARSE_ERROR
+create table BIT_AND (a int);
+
+--error ER_PARSE_ERROR
+create table BIT_OR(a int);
+--error ER_PARSE_ERROR
+create table BIT_OR (a int);
+
+--error ER_PARSE_ERROR
+create table BIT_XOR(a int);
+--error ER_PARSE_ERROR
+create table BIT_XOR (a int);
+
+--error ER_PARSE_ERROR
+create table CAST(a int);
+--error ER_PARSE_ERROR
+create table CAST (a int);
+
+--error ER_PARSE_ERROR
+create table COUNT(a int);
+--error ER_PARSE_ERROR
+create table COUNT (a int);
+
+--error ER_PARSE_ERROR
+create table CURDATE(a int);
+--error ER_PARSE_ERROR
+create table CURDATE (a int);
+
+--error ER_PARSE_ERROR
+create table CURTIME(a int);
+--error ER_PARSE_ERROR
+create table CURTIME (a int);
+
+--error ER_PARSE_ERROR
+create table DATE_ADD(a int);
+--error ER_PARSE_ERROR
+create table DATE_ADD (a int);
+
+--error ER_PARSE_ERROR
+create table DATE_SUB(a int);
+--error ER_PARSE_ERROR
+create table DATE_SUB (a int);
+
+--error ER_PARSE_ERROR
+create table EXTRACT(a int);
+--error ER_PARSE_ERROR
+create table EXTRACT (a int);
+
+--error ER_PARSE_ERROR
+create table GROUP_CONCAT(a int);
+--error ER_PARSE_ERROR
+create table GROUP_CONCAT (a int);
+
+# Limitation removed in 5.1
+create table GROUP_UNIQUE_USERS(a int);
+drop table GROUP_UNIQUE_USERS;
+create table GROUP_UNIQUE_USERS (a int);
+drop table GROUP_UNIQUE_USERS;
+
+--error ER_PARSE_ERROR
+create table MAX(a int);
+--error ER_PARSE_ERROR
+create table MAX (a int);
+
+--error ER_PARSE_ERROR
+create table MID(a int);
+--error ER_PARSE_ERROR
+create table MID (a int);
+
+--error ER_PARSE_ERROR
+create table MIN(a int);
+--error ER_PARSE_ERROR
+create table MIN (a int);
+
+--error ER_PARSE_ERROR
+create table NOW(a int);
+--error ER_PARSE_ERROR
+create table NOW (a int);
+
+--error ER_PARSE_ERROR
+create table POSITION(a int);
+--error ER_PARSE_ERROR
+create table POSITION (a int);
+
+create table SESSION_USER(a int);
+drop table SESSION_USER;
+create table SESSION_USER (a int);
+drop table SESSION_USER;
+
+--error ER_PARSE_ERROR
+create table STD(a int);
+--error ER_PARSE_ERROR
+create table STD (a int);
+
+--error ER_PARSE_ERROR
+create table STDDEV(a int);
+--error ER_PARSE_ERROR
+create table STDDEV (a int);
+
+--error ER_PARSE_ERROR
+create table STDDEV_POP(a int);
+--error ER_PARSE_ERROR
+create table STDDEV_POP (a int);
+
+--error ER_PARSE_ERROR
+create table STDDEV_SAMP(a int);
+--error ER_PARSE_ERROR
+create table STDDEV_SAMP (a int);
+
+create table SUBDATE(a int);
+drop table SUBDATE;
+create table SUBDATE (a int);
+drop table SUBDATE;
+
+--error ER_PARSE_ERROR
+create table SUBSTR(a int);
+--error ER_PARSE_ERROR
+create table SUBSTR (a int);
+
+--error ER_PARSE_ERROR
+create table SUBSTRING(a int);
+--error ER_PARSE_ERROR
+create table SUBSTRING (a int);
+
+--error ER_PARSE_ERROR
+create table SUM(a int);
+--error ER_PARSE_ERROR
+create table SUM (a int);
+
+--error ER_PARSE_ERROR
+create table SYSDATE(a int);
+--error ER_PARSE_ERROR
+create table SYSDATE (a int);
+
+create table SYSTEM_USER(a int);
+drop table SYSTEM_USER;
+create table SYSTEM_USER (a int);
+drop table SYSTEM_USER;
+
+--error ER_PARSE_ERROR
+create table TRIM(a int);
+--error ER_PARSE_ERROR
+create table TRIM (a int);
+
+# Limitation removed in 5.1
+create table UNIQUE_USERS(a int);
+drop table UNIQUE_USERS;
+create table UNIQUE_USERS (a int);
+drop table UNIQUE_USERS;
+
+--error ER_PARSE_ERROR
+create table VARIANCE(a int);
+--error ER_PARSE_ERROR
+create table VARIANCE (a int);
+
+--error ER_PARSE_ERROR
+create table VAR_POP(a int);
+--error ER_PARSE_ERROR
+create table VAR_POP (a int);
+
+--error ER_PARSE_ERROR
+create table VAR_SAMP(a int);
+--error ER_PARSE_ERROR
+create table VAR_SAMP (a int);
+
+#
+# Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with
+# ANSI_QUOTES mode)
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS table_25930_a;
+DROP TABLE IF EXISTS table_25930_b;
+--enable_warnings
+
+SET SQL_MODE = 'ANSI_QUOTES';
+CREATE TABLE table_25930_a ( "blah" INT );
+CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
+
+# The lexer used to chop the first <">,
+# not marking the start of the token "blah" correctly.
+desc table_25930_b;
+
+DROP TABLE table_25930_a;
+DROP TABLE table_25930_b;
+
+
+SET @@sql_mode=@save_sql_mode;
+
+#
+# Bug#26030 (Parsing fails for stored routine w/multi-statement execution
+# enabled)
+#
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS p26030;
+--enable_warnings
+
+delimiter $$;
+
+select "non terminated"$$
+select "terminated";$$
+select "non terminated, space" $$
+select "terminated, space"; $$
+select "non terminated, comment" /* comment */$$
+select "terminated, comment"; /* comment */$$
+
+# Multi queries can not be used in --ps-protocol test mode
+--disable_ps_protocol
+
+select "stmt 1";select "stmt 2 non terminated"$$
+select "stmt 1";select "stmt 2 terminated";$$
+select "stmt 1";select "stmt 2 non terminated, space" $$
+select "stmt 1";select "stmt 2 terminated, space"; $$
+select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$
+select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$
+
+select "stmt 1"; select "space, stmt 2"$$
+select "stmt 1";/* comment */select "comment, stmt 2"$$
+
+DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030()
+$$
+
+DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030()
+$$
+
+--enable_ps_protocol
+
+delimiter ;$$
+DROP PROCEDURE p26030;
+
+#=============================================================================
+# SYNTACTIC PARSER (bison)
+#=============================================================================
+
+#
+#
+# Bug#21114 (Foreign key creation fails to table with name format)
+#
+
+# Test coverage with edge conditions
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select pi(3.14);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select tan();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select tan(1, 2);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select makedate(1);
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select makedate(1, 2, 3);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select maketime();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select maketime(1);
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select maketime(1, 2);
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select maketime(1, 2, 3, 4);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select atan();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select atan2(1, 2, 3);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select concat();
+select concat("foo");
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select concat_ws();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select concat_ws("foo");
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select encrypt();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select encrypt(1, 2, 3);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select des_encrypt("p1", "p2", "not expected");
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select des_decrypt("p1", "p2", "not expected");
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select elt();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select elt(1);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select export_set();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select export_set("p1");
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select export_set("p1", "p2");
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select export_set("p1", "p2", "p3", "p4", "p5", "p6");
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select field();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select field("p1");
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select from_unixtime();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select from_unixtime(1, 2, 3);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select unix_timestamp(1, 2);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select greatest();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select greatest(12);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select last_insert_id(1, 2);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select least();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select least(12);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select locate();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select locate(1);
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select locate(1, 2, 3, 4);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select log();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select log(1, 2, 3);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select make_set();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select make_set(1);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select master_pos_wait();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select master_pos_wait(1);
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select master_pos_wait(1, 2, 3, 4);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select rand(1, 2, 3);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select round(1, 2, 3);
+
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select yearweek();
+-- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select yearweek(1, 2, 3);
+
+#
+# Bug#24736: UDF functions parsed as Stored Functions
+#
+
+# Verify that the syntax for calling UDF : foo(expr AS param, ...)
+# can not be used when calling native functions
+
+# Native function with 1 argument
+
+select abs(3);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select abs(3 AS three);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select abs(3 three);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select abs(3 AS "three");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select abs(3 "three");
+
+# Native function with 2 arguments
+
+set @bar="bar";
+set @foobar="foobar";
+
+select instr("foobar", "bar");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar" AS p1, "bar");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar" p1, "bar");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar" AS "p1", "bar");
+## String concatenation, valid syntax
+select instr("foobar" "p1", "bar");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr(@foobar "p1", "bar");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar", "bar" AS p2);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar", "bar" p2);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar", "bar" AS "p2");
+## String concatenation, valid syntax
+select instr("foobar", "bar" "p2");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar", @bar "p2");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select instr("foobar" AS p1, "bar" AS p2);
+
+# Native function with 3 arguments
+
+select conv(255, 10, 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255 AS p1, 10, 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255 p1, 10, 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255 AS "p1", 10, 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255 "p1", 10, 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10 AS p2, 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10 p2, 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10 AS "p2", 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10 "p2", 16);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10, 16 AS p3);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10, 16 p3);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10, 16 AS "p3");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255, 10, 16 "p3");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select conv(255 AS p1, 10 AS p2, 16 AS p3);
+
+# Native function with a variable number of arguments
+
+select atan(10);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 AS p1);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 p1);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 AS "p1");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 "p1");
+
+select atan(10, 20);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 AS p1, 20);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 p1, 20);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 AS "p1", 20);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 "p1", 20);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10, 20 AS p2);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10, 20 p2);
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10, 20 AS "p2");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10, 20 "p2");
+-- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
+select atan(10 AS p1, 20 AS p2);
+
+#
+# Bug#22312 Syntax error in expression with INTERVAL()
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
+SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
+SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
+SELECT 1 + INTERVAL(1,0,1,2) + 1;
+SELECT INTERVAL(1^1,0,1,2) + 1;
+SELECT INTERVAL(1,0+1,2,3) * 5.5;
+SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
+SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
+SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
+SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
+
+--disable_warnings
+SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND;
+SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND;
+--enable_warnings
+
+CREATE TABLE t1 (a INT, b DATETIME);
+INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
+SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
+DROP TABLE t1;
+
+#
+# Bug#28317 Left Outer Join with {oj outer-join}
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+--enable_warnings
+CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME);
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
+SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
+SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
+SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)};
+SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
+SELECT {fn CONCAT(a1,a2)} FROM t1;
+UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
+SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
+DROP TABLE t1, t2, t3;
=== removed file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test 2008-07-08 16:33:09 +0000
+++ b/mysql-test/t/parser.test 1970-01-01 00:00:00 +0000
@@ -1,726 +0,0 @@
-#
-# This file contains tests covering the parser
-#
-
-#=============================================================================
-# LEXICAL PARSER (lex)
-#=============================================================================
-
-#
-# Maintainer: these tests are for the lexical parser, so every character,
-# even whitespace or comments, is significant here.
-#
-
-SET @save_sql_mode=@@sql_mode;
-
-#
-# Documenting the current behavior, to detect incompatible changes.
-# In each cases:
-# - no error is the correct result
-# - an error is the expected result with the current implementation,
-# and is a limitation.
-
-set SQL_MODE='';
-
-create table ADDDATE(a int);
-drop table ADDDATE;
-create table ADDDATE (a int);
-drop table ADDDATE;
-
---error ER_PARSE_ERROR
-create table BIT_AND(a int);
-create table BIT_AND (a int);
-drop table BIT_AND;
-
---error ER_PARSE_ERROR
-create table BIT_OR(a int);
-create table BIT_OR (a int);
-drop table BIT_OR;
-
---error ER_PARSE_ERROR
-create table BIT_XOR(a int);
-create table BIT_XOR (a int);
-drop table BIT_XOR;
-
---error ER_PARSE_ERROR
-create table CAST(a int);
-create table CAST (a int);
-drop table CAST;
-
---error ER_PARSE_ERROR
-create table COUNT(a int);
-create table COUNT (a int);
-drop table COUNT;
-
---error ER_PARSE_ERROR
-create table CURDATE(a int);
-create table CURDATE (a int);
-drop table CURDATE;
-
---error ER_PARSE_ERROR
-create table CURTIME(a int);
-create table CURTIME (a int);
-drop table CURTIME;
-
---error ER_PARSE_ERROR
-create table DATE_ADD(a int);
-create table DATE_ADD (a int);
-drop table DATE_ADD;
-
---error ER_PARSE_ERROR
-create table DATE_SUB(a int);
-create table DATE_SUB (a int);
-drop table DATE_SUB;
-
---error ER_PARSE_ERROR
-create table EXTRACT(a int);
-create table EXTRACT (a int);
-drop table EXTRACT;
-
---error ER_PARSE_ERROR
-create table GROUP_CONCAT(a int);
-create table GROUP_CONCAT (a int);
-drop table GROUP_CONCAT;
-
-# Limitation removed in 5.1
-create table GROUP_UNIQUE_USERS(a int);
-drop table GROUP_UNIQUE_USERS;
-create table GROUP_UNIQUE_USERS (a int);
-drop table GROUP_UNIQUE_USERS;
-
---error ER_PARSE_ERROR
-create table MAX(a int);
-create table MAX (a int);
-drop table MAX;
-
---error ER_PARSE_ERROR
-create table MID(a int);
-create table MID (a int);
-drop table MID;
-
---error ER_PARSE_ERROR
-create table MIN(a int);
-create table MIN (a int);
-drop table MIN;
-
---error ER_PARSE_ERROR
-create table NOW(a int);
-create table NOW (a int);
-drop table NOW;
-
---error ER_PARSE_ERROR
-create table POSITION(a int);
-create table POSITION (a int);
-drop table POSITION;
-
-create table SESSION_USER(a int);
-drop table SESSION_USER;
-create table SESSION_USER (a int);
-drop table SESSION_USER;
-
---error ER_PARSE_ERROR
-create table STD(a int);
-create table STD (a int);
-drop table STD;
-
---error ER_PARSE_ERROR
-create table STDDEV(a int);
-create table STDDEV (a int);
-drop table STDDEV;
-
---error ER_PARSE_ERROR
-create table STDDEV_POP(a int);
-create table STDDEV_POP (a int);
-drop table STDDEV_POP;
-
---error ER_PARSE_ERROR
-create table STDDEV_SAMP(a int);
-create table STDDEV_SAMP (a int);
-drop table STDDEV_SAMP;
-
-create table SUBDATE(a int);
-drop table SUBDATE;
-create table SUBDATE (a int);
-drop table SUBDATE;
-
---error ER_PARSE_ERROR
-create table SUBSTR(a int);
-create table SUBSTR (a int);
-drop table SUBSTR;
-
---error ER_PARSE_ERROR
-create table SUBSTRING(a int);
-create table SUBSTRING (a int);
-drop table SUBSTRING;
-
---error ER_PARSE_ERROR
-create table SUM(a int);
-create table SUM (a int);
-drop table SUM;
-
---error ER_PARSE_ERROR
-create table SYSDATE(a int);
-create table SYSDATE (a int);
-drop table SYSDATE;
-
-create table SYSTEM_USER(a int);
-drop table SYSTEM_USER;
-create table SYSTEM_USER (a int);
-drop table SYSTEM_USER;
-
---error ER_PARSE_ERROR
-create table TRIM(a int);
-create table TRIM (a int);
-drop table TRIM;
-
-# Limitation removed in 5.1
-create table UNIQUE_USERS(a int);
-drop table UNIQUE_USERS;
-create table UNIQUE_USERS (a int);
-drop table UNIQUE_USERS;
-
---error ER_PARSE_ERROR
-create table VARIANCE(a int);
-create table VARIANCE (a int);
-drop table VARIANCE;
-
---error ER_PARSE_ERROR
-create table VAR_POP(a int);
-create table VAR_POP (a int);
-drop table VAR_POP;
-
---error ER_PARSE_ERROR
-create table VAR_SAMP(a int);
-create table VAR_SAMP (a int);
-drop table VAR_SAMP;
-
-set SQL_MODE='IGNORE_SPACE';
-
-create table ADDDATE(a int);
-drop table ADDDATE;
-create table ADDDATE (a int);
-drop table ADDDATE;
-
---error ER_PARSE_ERROR
-create table BIT_AND(a int);
---error ER_PARSE_ERROR
-create table BIT_AND (a int);
-
---error ER_PARSE_ERROR
-create table BIT_OR(a int);
---error ER_PARSE_ERROR
-create table BIT_OR (a int);
-
---error ER_PARSE_ERROR
-create table BIT_XOR(a int);
---error ER_PARSE_ERROR
-create table BIT_XOR (a int);
-
---error ER_PARSE_ERROR
-create table CAST(a int);
---error ER_PARSE_ERROR
-create table CAST (a int);
-
---error ER_PARSE_ERROR
-create table COUNT(a int);
---error ER_PARSE_ERROR
-create table COUNT (a int);
-
---error ER_PARSE_ERROR
-create table CURDATE(a int);
---error ER_PARSE_ERROR
-create table CURDATE (a int);
-
---error ER_PARSE_ERROR
-create table CURTIME(a int);
---error ER_PARSE_ERROR
-create table CURTIME (a int);
-
---error ER_PARSE_ERROR
-create table DATE_ADD(a int);
---error ER_PARSE_ERROR
-create table DATE_ADD (a int);
-
---error ER_PARSE_ERROR
-create table DATE_SUB(a int);
---error ER_PARSE_ERROR
-create table DATE_SUB (a int);
-
---error ER_PARSE_ERROR
-create table EXTRACT(a int);
---error ER_PARSE_ERROR
-create table EXTRACT (a int);
-
---error ER_PARSE_ERROR
-create table GROUP_CONCAT(a int);
---error ER_PARSE_ERROR
-create table GROUP_CONCAT (a int);
-
-# Limitation removed in 5.1
-create table GROUP_UNIQUE_USERS(a int);
-drop table GROUP_UNIQUE_USERS;
-create table GROUP_UNIQUE_USERS (a int);
-drop table GROUP_UNIQUE_USERS;
-
---error ER_PARSE_ERROR
-create table MAX(a int);
---error ER_PARSE_ERROR
-create table MAX (a int);
-
---error ER_PARSE_ERROR
-create table MID(a int);
---error ER_PARSE_ERROR
-create table MID (a int);
-
---error ER_PARSE_ERROR
-create table MIN(a int);
---error ER_PARSE_ERROR
-create table MIN (a int);
-
---error ER_PARSE_ERROR
-create table NOW(a int);
---error ER_PARSE_ERROR
-create table NOW (a int);
-
---error ER_PARSE_ERROR
-create table POSITION(a int);
---error ER_PARSE_ERROR
-create table POSITION (a int);
-
-create table SESSION_USER(a int);
-drop table SESSION_USER;
-create table SESSION_USER (a int);
-drop table SESSION_USER;
-
---error ER_PARSE_ERROR
-create table STD(a int);
---error ER_PARSE_ERROR
-create table STD (a int);
-
---error ER_PARSE_ERROR
-create table STDDEV(a int);
---error ER_PARSE_ERROR
-create table STDDEV (a int);
-
---error ER_PARSE_ERROR
-create table STDDEV_POP(a int);
---error ER_PARSE_ERROR
-create table STDDEV_POP (a int);
-
---error ER_PARSE_ERROR
-create table STDDEV_SAMP(a int);
---error ER_PARSE_ERROR
-create table STDDEV_SAMP (a int);
-
-create table SUBDATE(a int);
-drop table SUBDATE;
-create table SUBDATE (a int);
-drop table SUBDATE;
-
---error ER_PARSE_ERROR
-create table SUBSTR(a int);
---error ER_PARSE_ERROR
-create table SUBSTR (a int);
-
---error ER_PARSE_ERROR
-create table SUBSTRING(a int);
---error ER_PARSE_ERROR
-create table SUBSTRING (a int);
-
---error ER_PARSE_ERROR
-create table SUM(a int);
---error ER_PARSE_ERROR
-create table SUM (a int);
-
---error ER_PARSE_ERROR
-create table SYSDATE(a int);
---error ER_PARSE_ERROR
-create table SYSDATE (a int);
-
-create table SYSTEM_USER(a int);
-drop table SYSTEM_USER;
-create table SYSTEM_USER (a int);
-drop table SYSTEM_USER;
-
---error ER_PARSE_ERROR
-create table TRIM(a int);
---error ER_PARSE_ERROR
-create table TRIM (a int);
-
-# Limitation removed in 5.1
-create table UNIQUE_USERS(a int);
-drop table UNIQUE_USERS;
-create table UNIQUE_USERS (a int);
-drop table UNIQUE_USERS;
-
---error ER_PARSE_ERROR
-create table VARIANCE(a int);
---error ER_PARSE_ERROR
-create table VARIANCE (a int);
-
---error ER_PARSE_ERROR
-create table VAR_POP(a int);
---error ER_PARSE_ERROR
-create table VAR_POP (a int);
-
---error ER_PARSE_ERROR
-create table VAR_SAMP(a int);
---error ER_PARSE_ERROR
-create table VAR_SAMP (a int);
-
-#
-# Bug#25930 (CREATE TABLE x SELECT ... parses columns wrong when ran with
-# ANSI_QUOTES mode)
-#
-
---disable_warnings
-DROP TABLE IF EXISTS table_25930_a;
-DROP TABLE IF EXISTS table_25930_b;
---enable_warnings
-
-SET SQL_MODE = 'ANSI_QUOTES';
-CREATE TABLE table_25930_a ( "blah" INT );
-CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a;
-
-# The lexer used to chop the first <">,
-# not marking the start of the token "blah" correctly.
-desc table_25930_b;
-
-DROP TABLE table_25930_a;
-DROP TABLE table_25930_b;
-
-
-SET @@sql_mode=@save_sql_mode;
-
-#
-# Bug#26030 (Parsing fails for stored routine w/multi-statement execution
-# enabled)
-#
-
---disable_warnings
-DROP PROCEDURE IF EXISTS p26030;
---enable_warnings
-
-delimiter $$;
-
-select "non terminated"$$
-select "terminated";$$
-select "non terminated, space" $$
-select "terminated, space"; $$
-select "non terminated, comment" /* comment */$$
-select "terminated, comment"; /* comment */$$
-
-# Multi queries can not be used in --ps-protocol test mode
---disable_ps_protocol
-
-select "stmt 1";select "stmt 2 non terminated"$$
-select "stmt 1";select "stmt 2 terminated";$$
-select "stmt 1";select "stmt 2 non terminated, space" $$
-select "stmt 1";select "stmt 2 terminated, space"; $$
-select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$
-select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$
-
-select "stmt 1"; select "space, stmt 2"$$
-select "stmt 1";/* comment */select "comment, stmt 2"$$
-
-DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030()
-$$
-
-DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030()
-$$
-
---enable_ps_protocol
-
-delimiter ;$$
-DROP PROCEDURE p26030;
-
-#=============================================================================
-# SYNTACTIC PARSER (bison)
-#=============================================================================
-
-#
-#
-# Bug#21114 (Foreign key creation fails to table with name format)
-#
-
-# Test coverage with edge conditions
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select pi(3.14);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select tan();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select tan(1, 2);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select makedate(1);
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select makedate(1, 2, 3);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select maketime();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select maketime(1);
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select maketime(1, 2);
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select maketime(1, 2, 3, 4);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select atan();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select atan2(1, 2, 3);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select concat();
-select concat("foo");
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select concat_ws();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select concat_ws("foo");
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select encrypt();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select encrypt(1, 2, 3);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select des_encrypt("p1", "p2", "not expected");
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select des_decrypt("p1", "p2", "not expected");
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select elt();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select elt(1);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select export_set();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select export_set("p1");
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select export_set("p1", "p2");
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select export_set("p1", "p2", "p3", "p4", "p5", "p6");
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select field();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select field("p1");
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select from_unixtime();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select from_unixtime(1, 2, 3);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select unix_timestamp(1, 2);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select greatest();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select greatest(12);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select last_insert_id(1, 2);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select least();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select least(12);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select locate();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select locate(1);
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select locate(1, 2, 3, 4);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select log();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select log(1, 2, 3);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select make_set();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select make_set(1);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select master_pos_wait();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select master_pos_wait(1);
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select master_pos_wait(1, 2, 3, 4);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select rand(1, 2, 3);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select round(1, 2, 3);
-
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select yearweek();
--- error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
-select yearweek(1, 2, 3);
-
-#
-# Bug#24736: UDF functions parsed as Stored Functions
-#
-
-# Verify that the syntax for calling UDF : foo(expr AS param, ...)
-# can not be used when calling native functions
-
-# Native function with 1 argument
-
-select abs(3);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select abs(3 AS three);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select abs(3 three);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select abs(3 AS "three");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select abs(3 "three");
-
-# Native function with 2 arguments
-
-set @bar="bar";
-set @foobar="foobar";
-
-select instr("foobar", "bar");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar" AS p1, "bar");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar" p1, "bar");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar" AS "p1", "bar");
-## String concatenation, valid syntax
-select instr("foobar" "p1", "bar");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr(@foobar "p1", "bar");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar", "bar" AS p2);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar", "bar" p2);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar", "bar" AS "p2");
-## String concatenation, valid syntax
-select instr("foobar", "bar" "p2");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar", @bar "p2");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select instr("foobar" AS p1, "bar" AS p2);
-
-# Native function with 3 arguments
-
-select conv(255, 10, 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255 AS p1, 10, 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255 p1, 10, 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255 AS "p1", 10, 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255 "p1", 10, 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10 AS p2, 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10 p2, 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10 AS "p2", 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10 "p2", 16);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10, 16 AS p3);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10, 16 p3);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10, 16 AS "p3");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255, 10, 16 "p3");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select conv(255 AS p1, 10 AS p2, 16 AS p3);
-
-# Native function with a variable number of arguments
-
-select atan(10);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 AS p1);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 p1);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 AS "p1");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 "p1");
-
-select atan(10, 20);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 AS p1, 20);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 p1, 20);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 AS "p1", 20);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 "p1", 20);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10, 20 AS p2);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10, 20 p2);
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10, 20 AS "p2");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10, 20 "p2");
--- error ER_WRONG_PARAMETERS_TO_NATIVE_FCT
-select atan(10 AS p1, 20 AS p2);
-
-#
-# Bug#22312 Syntax error in expression with INTERVAL()
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
-SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
-SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
-SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
-SELECT 1 + INTERVAL(1,0,1,2) + 1;
-SELECT INTERVAL(1^1,0,1,2) + 1;
-SELECT INTERVAL(1,0+1,2,3) * 5.5;
-SELECT INTERVAL(3,3,1+3,4+4) / 0.5;
-SELECT (INTERVAL(1,0,1,2) + 5) * 7 + INTERVAL(1,0,1,2) / 2;
-SELECT INTERVAL(1,0,1,2) + 1, 5 * INTERVAL(1,0,1,2);
-SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);
-
---disable_warnings
-SELECT 1^1 + INTERVAL 1+1 SECOND & 1 + INTERVAL 1+1 SECOND;
-SELECT 1%2 - INTERVAL 1^1 SECOND | 1%2 - INTERVAL 1^1 SECOND;
---enable_warnings
-
-CREATE TABLE t1 (a INT, b DATETIME);
-INSERT INTO t1 VALUES (INTERVAL(3,2,1) + 1, "1997-12-31 23:59:59" + INTERVAL 1 SECOND);
-SELECT * FROM t1 WHERE a = INTERVAL(3,2,1) + 1;
-DROP TABLE t1;
-
-#
-# Bug#28317 Left Outer Join with {oj outer-join}
-#
-
---disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3;
---enable_warnings
-CREATE TABLE t1 (a1 INT, a2 INT, a3 INT, a4 DATETIME);
-CREATE TABLE t2 LIKE t1;
-CREATE TABLE t3 LIKE t1;
-SELECT t1.* FROM t1 AS t0, { OJ t2 INNER JOIN t1 ON (t1.a1=t2.a1) } WHERE t0.a3=2;
-SELECT t1.*,t2.* FROM { OJ ((t1 INNER JOIN t2 ON (t1.a1=t2.a2)) LEFT OUTER JOIN t3 ON t3.a3=t2.a1)};
-SELECT t1.*,t2.* FROM { OJ ((t1 LEFT OUTER JOIN t2 ON t1.a3=t2.a2) INNER JOIN t3 ON (t3.a1=t2.a2))};
-SELECT t1.*,t2.* FROM { OJ (t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a2) CROSS JOIN t3 ON (t3.a2=t2.a3)};
-SELECT * FROM {oj t1 LEFT OUTER JOIN t2 ON t1.a1=t2.a3} WHERE t1.a2 > 10;
-SELECT {fn CONCAT(a1,a2)} FROM t1;
-UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
-SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
-DROP TABLE t1, t2, t3;
=== modified file 'mysql-test/t/system_mysql_db_fix50030.test'
--- a/mysql-test/t/system_mysql_db_fix50030.test 2006-12-11 16:44:03 +0000
+++ b/mysql-test/t/system_mysql_db_fix50030.test 2008-07-15 16:43:25 +0000
@@ -1,6 +1,13 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
+# to the location of mysql_fix_privilege_tables.sql
+if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+{
+ skip Test needs MYSQL_FIX_PRIVILEGE_TABLES;
+}
+
#
# This is the test for mysql_fix_privilege_tables
# It checks that a system tables from mysql 5.0.30
=== modified file 'mysql-test/t/system_mysql_db_fix50117.test'
--- a/mysql-test/t/system_mysql_db_fix50117.test 2008-02-07 10:47:39 +0000
+++ b/mysql-test/t/system_mysql_db_fix50117.test 2008-07-15 16:43:25 +0000
@@ -1,6 +1,13 @@
# Embedded server doesn't support external clients
--source include/not_embedded.inc
+# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
+# to the location of mysql_fix_privilege_tables.sql
+if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
+{
+ skip Test needs MYSQL_FIX_PRIVILEGE_TABLES;
+}
+
#
# This is the test for mysql_fix_privilege_tables
# It checks that a system tables from mysql 5.1.17
=== modified file 'mysys/default.c'
--- a/mysys/default.c 2008-07-18 12:00:45 +0000
+++ b/mysys/default.c 2008-07-22 11:33:37 +0000
@@ -974,8 +974,7 @@ static int add_directory(MEM_ROOT *alloc
char *p;
my_bool err __attribute__((unused));
- /* Normalize directory name */
- len= unpack_dirname(buf, dir);
+ len= normalize_dirname(buf, dir);
if (!(p= strmake_root(alloc, buf, len)))
return 1; /* Failure */
/* Should never fail if DEFAULT_DIRS_SIZE is correct size */
=== modified file 'mysys/mf_pack.c'
--- a/mysys/mf_pack.c 2007-12-17 08:16:47 +0000
+++ b/mysys/mf_pack.c 2008-07-17 17:45:08 +0000
@@ -277,22 +277,64 @@ void symdirget(char *dir)
#endif /* USE_SYMDIR */
-/*
- Fixes a directroy name so that can be used by open()
+/**
+ Convert a directory name to a format which can be compared as strings
- SYNOPSIS
- unpack_dirname()
- to result-buffer, FN_REFLEN characters. may be == from
- from 'Packed' directory name (may contain ~)
-
- IMPLEMENTATION
- Make that last char of to is '/' if from not empty and
- from doesn't end in FN_DEVCHAR
- Uses cleanup_dirname and changes ~/.. to home_dir/..
+ @param to result buffer, FN_REFLEN chars in length; may be == from
+ @param from 'packed' directory name, in whatever format
+ @returns size of the normalized name
+
+ @details
+ - Ensures that last char is FN_LIBCHAR, unless it is FN_DEVCHAR
+ - Uses cleanup_dirname
+
+ It does *not* expand ~/ (although, see cleanup_dirname). Nor does it do
+ any case folding. All case-insensitive normalization should be done by
+ the caller.
+*/
- Changes a UNIX filename to system filename (replaces / with \ on windows)
+size_t normalize_dirname(char *to, const char *from)
+{
+ size_t length;
+ char buff[FN_REFLEN];
+ DBUG_ENTER("normalize_dirname");
- RETURN
+ /*
+ Despite the name, this actually converts the name to the system's
+ format (TODO: rip out the non-working VMS stuff and name this
+ properly).
+ */
+ (void) intern_filename(buff, from);
+ length= strlen(buff); /* Fix that '/' is last */
+ if (length &&
+#ifdef FN_DEVCHAR
+ buff[length - 1] != FN_DEVCHAR &&
+#endif
+ buff[length - 1] != FN_LIBCHAR && buff[length - 1] != '/')
+ {
+ buff[length]= FN_LIBCHAR;
+ buff[length + 1]= '\0';
+ }
+
+ length=cleanup_dirname(to, buff);
+
+ DBUG_RETURN(length);
+}
+
+
+/**
+ Fixes a directory name so that can be used by open()
+
+ @param to Result buffer, FN_REFLEN characters. May be == from
+ @param from 'Packed' directory name (may contain ~)
+
+ @details
+ - Uses normalize_dirname()
+ - Expands ~/... to home_dir/...
+ - Resolves MySQL's fake "foo.sym" symbolic directory names (if USE_SYMDIR)
+ - Changes a UNIX filename to system filename (replaces / with \ on windows)
+
+ @returns
Length of new directory name (= length of to)
*/
@@ -302,19 +344,8 @@ size_t unpack_dirname(char * to, const c
char buff[FN_REFLEN+1+4],*suffix,*tilde_expansion;
DBUG_ENTER("unpack_dirname");
- (void) intern_filename(buff,from); /* Change to intern name */
- length= strlen(buff); /* Fix that '/' is last */
- if (length &&
-#ifdef FN_DEVCHAR
- buff[length-1] != FN_DEVCHAR &&
-#endif
- buff[length-1] != FN_LIBCHAR && buff[length-1] != '/')
- {
- buff[length]=FN_LIBCHAR;
- buff[length+1]= '\0';
- }
+ length= normalize_dirname(buff, from);
- length=cleanup_dirname(buff,buff);
if (buff[0] == FN_HOMELIB)
{
suffix=buff+1; tilde_expansion=expand_tilde(&suffix);
=== modified file 'scripts/make_binary_distribution.sh'
--- a/scripts/make_binary_distribution.sh 2008-06-18 01:04:10 +0000
+++ b/scripts/make_binary_distribution.sh 2008-06-27 17:36:45 +0000
@@ -92,6 +92,7 @@ if [ x"$PLATFORM" = x"" ] ; then
system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
+ system=`echo $system | sed -e 's/darwin9.*/osx10.5/g'`
system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
=== modified file 'sql/field.cc'
--- a/sql/field.cc 2008-05-13 12:01:02 +0000
+++ b/sql/field.cc 2008-06-30 20:11:18 +0000
@@ -27,6 +27,8 @@
#include "mysql_priv.h"
#include "sql_select.h"
+#include "rpl_rli.h" // Pull in Relay_log_info
+#include "slave.h" // Pull in rpl_master_has_bug()
#include <m_ctype.h>
#include <errno.h>
#ifdef HAVE_FCONVERT
@@ -1375,7 +1377,8 @@ bool Field::send_binary(Protocol *protoc
@retval 0 if this field's size is < the source field's size
@retval 1 if this field's size is >= the source field's size
*/
-int Field::compatible_field_size(uint field_metadata)
+int Field::compatible_field_size(uint field_metadata,
+ const Relay_log_info *rli_arg __attribute__((unused)))
{
uint const source_size= pack_length_from_metadata(field_metadata);
uint const destination_size= row_pack_length();
@@ -2837,7 +2840,8 @@ uint Field_new_decimal::pack_length_from
@retval 0 if this field's size is < the source field's size
@retval 1 if this field's size is >= the source field's size
*/
-int Field_new_decimal::compatible_field_size(uint field_metadata)
+int Field_new_decimal::compatible_field_size(uint field_metadata,
+ const Relay_log_info * __attribute__((unused)))
{
int compatible= 0;
uint const source_precision= (field_metadata >> 8U) & 0x00ff;
@@ -4037,7 +4041,6 @@ Field_real::pack(uchar *to, const uchar
{
DBUG_ENTER("Field_real::pack");
DBUG_ASSERT(max_length >= pack_length());
- DBUG_PRINT("debug", ("pack_length(): %u", pack_length()));
#ifdef WORDS_BIGENDIAN
if (low_byte_first != table->s->db_low_byte_first)
{
@@ -4056,7 +4059,6 @@ Field_real::unpack(uchar *to, const ucha
uint param_data, bool low_byte_first)
{
DBUG_ENTER("Field_real::unpack");
- DBUG_PRINT("debug", ("pack_length(): %u", pack_length()));
#ifdef WORDS_BIGENDIAN
if (low_byte_first != table->s->db_low_byte_first)
{
@@ -6638,6 +6640,36 @@ my_decimal *Field_string::val_decimal(my
}
+struct Check_field_param {
+ Field *field;
+};
+
+static bool
+check_field_for_37426(const void *param_arg)
+{
+ Check_field_param *param= (Check_field_param*) param_arg;
+ DBUG_ASSERT(param->field->real_type() == MYSQL_TYPE_STRING);
+ DBUG_PRINT("debug", ("Field %s - type: %d, size: %d",
+ param->field->field_name,
+ param->field->real_type(),
+ param->field->row_pack_length()));
+ return param->field->row_pack_length() > 255;
+}
+
+
+int Field_string::compatible_field_size(uint field_metadata,
+ const Relay_log_info *rli_arg)
+{
+#ifdef HAVE_REPLICATION
+ const Check_field_param check_param = { this };
+ if (rpl_master_has_bug(rli_arg, 37426, TRUE,
+ check_field_for_37426, &check_param))
+ return FALSE; // Not compatible field sizes
+#endif
+ return Field::compatible_field_size(field_metadata, rli_arg);
+}
+
+
int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
uint a_len, b_len;
@@ -6724,6 +6756,9 @@ uchar *Field_string::pack(uchar *to, con
@c param_data argument contains the result of field->real_type() from
the master.
+ @note For information about how the length is packed, see @c
+ Field_string::do_save_field_metadata
+
@param to Destination of the data
@param from Source of the data
@param param_data Real type (upper) and length (lower) values
@@ -6736,10 +6771,24 @@ Field_string::unpack(uchar *to,
uint param_data,
bool low_byte_first __attribute__((unused)))
{
- uint from_length=
- param_data ? min(param_data & 0x00ff, field_length) : field_length;
- uint length;
+ uint from_length, length;
+
+ /*
+ Compute the declared length of the field on the master. This is
+ used to decide if one or two bytes should be read as length.
+ */
+ if (param_data)
+ from_length= (((param_data >> 4) & 0x300) ^ 0x300) + (param_data & 0x00ff);
+ else
+ from_length= field_length;
+ DBUG_PRINT("debug",
+ ("param_data: 0x%x, field_length: %u, from_length: %u",
+ param_data, field_length, from_length));
+ /*
+ Compute the actual length of the data by reading one or two bits
+ (depending on the declared field length on the master).
+ */
if (from_length > 255)
{
length= uint2korr(from);
@@ -6762,14 +6811,37 @@ Field_string::unpack(uchar *to,
second byte of the field metadata array at index of *metadata_ptr and
*(metadata_ptr + 1).
+ @note In order to be able to handle lengths exceeding 255 and be
+ backwards-compatible with pre-5.1.26 servers, an extra two bits of
+ the length has been added to the metadata in such a way that if
+ they are set, a new unrecognized type is generated. This will
+ cause pre-5.1-26 servers to stop due to a field type mismatch,
+ while new servers will be able to extract the extra bits. If the
+ length is <256, there will be no difference and both a new and an
+ old server will be able to handle it.
+
+ @note The extra two bits are added to bits 13 and 14 of the
+ parameter data (with 1 being the least siginficant bit and 16 the
+ most significant bit of the word) by xoring the extra length bits
+ with the real type. Since all allowable types have 0xF as most
+ significant bits of the metadata word, lengths <256 will not affect
+ the real type at all, while all other values will result in a
+ non-existant type in the range 17-244.
+
+ @see Field_string::unpack
+
@param metadata_ptr First byte of field metadata
@returns number of bytes written to metadata_ptr
*/
int Field_string::do_save_field_metadata(uchar *metadata_ptr)
{
- *metadata_ptr= real_type();
- *(metadata_ptr + 1)= field_length;
+ DBUG_ASSERT(field_length < 1024);
+ DBUG_ASSERT((real_type() & 0xF0) == 0xF0);
+ DBUG_PRINT("debug", ("field_length: %u, real_type: %u",
+ field_length, real_type()));
+ *metadata_ptr= (real_type() ^ ((field_length & 0x300) >> 4));
+ *(metadata_ptr + 1)= field_length & 0xFF;
return 2;
}
@@ -9118,7 +9190,8 @@ uint Field_bit::pack_length_from_metadat
@retval 0 if this field's size is < the source field's size
@retval 1 if this field's size is >= the source field's size
*/
-int Field_bit::compatible_field_size(uint field_metadata)
+int Field_bit::compatible_field_size(uint field_metadata,
+ const Relay_log_info * __attribute__((unused)))
{
int compatible= 0;
uint const source_size= pack_length_from_metadata(field_metadata);
=== modified file 'sql/field.h'
--- a/sql/field.h 2008-06-19 13:02:04 +0000
+++ b/sql/field.h 2008-07-11 18:51:10 +0000
@@ -30,6 +30,8 @@ const uint32 max_field_size= (uint32) 42
class Send_field;
class Protocol;
class Create_field;
+class Relay_log_info;
+
struct st_cache_field;
int field_conv(Field *to,Field *from);
@@ -162,7 +164,8 @@ public:
table, which is located on disk).
*/
virtual uint32 pack_length_in_rec() const { return pack_length(); }
- virtual int compatible_field_size(uint field_metadata);
+ virtual int compatible_field_size(uint field_metadata,
+ const Relay_log_info *);
virtual uint pack_length_from_metadata(uint field_metadata)
{ return field_metadata; }
/*
@@ -787,7 +790,8 @@ public:
uint32 pack_length() const { return (uint32) bin_size; }
uint pack_length_from_metadata(uint field_metadata);
uint row_pack_length() { return pack_length(); }
- int compatible_field_size(uint field_metadata);
+ int compatible_field_size(uint field_metadata,
+ const Relay_log_info *rli);
uint is_equal(Create_field *new_field);
virtual const uchar *unpack(uchar* to, const uchar *from,
uint param_data, bool low_byte_first);
@@ -1475,7 +1479,14 @@ public:
virtual const uchar *unpack(uchar* to, const uchar *from,
uint param_data, bool low_byte_first);
uint pack_length_from_metadata(uint field_metadata)
- { return (field_metadata & 0x00ff); }
+ {
+ DBUG_PRINT("debug", ("field_metadata: 0x%04x", field_metadata));
+ if (field_metadata == 0)
+ return row_pack_length();
+ return (((field_metadata >> 4) & 0x300) ^ 0x300) + (field_metadata & 0x00ff);
+ }
+ int compatible_field_size(uint field_metadata,
+ const Relay_log_info *rli);
uint row_pack_length() { return (field_length + 1); }
int pack_cmp(const uchar *a,const uchar *b,uint key_length,
my_bool insert_or_update);
@@ -1928,7 +1939,8 @@ public:
uint pack_length_from_metadata(uint field_metadata);
uint row_pack_length()
{ return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); }
- int compatible_field_size(uint field_metadata);
+ int compatible_field_size(uint field_metadata,
+ const Relay_log_info *rli);
void sql_type(String &str) const;
virtual uchar *pack(uchar *to, const uchar *from,
uint max_length, bool low_byte_first);
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2008-07-21 14:41:17 +0000
+++ b/sql/log.cc 2008-07-22 10:41:55 +0000
@@ -3096,7 +3096,7 @@ int MYSQL_BIN_LOG::purge_logs(const char
/*
It's not fatal if we can't stat a log file that does not exist;
If we could not stat, we won't delete.
- */
+ */
if (thd)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
@@ -3235,6 +3235,7 @@ int MYSQL_BIN_LOG::purge_logs_before_dat
LOG_INFO log_info;
MY_STAT stat_area;
THD *thd= current_thd;
+
DBUG_ENTER("purge_logs_before_date");
pthread_mutex_lock(&LOCK_index);
@@ -3263,8 +3264,8 @@ int MYSQL_BIN_LOG::purge_logs_before_dat
ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
log_info.log_file_name);
}
- sql_print_information("Failed to execute my_stat on file '%s'",
- log_info.log_file_name);
+ sql_print_information("Failed to execute my_stat on file '%s'",
+ log_info.log_file_name);
my_errno= 0;
}
else
=== modified file 'sql/rpl_utility.cc'
--- a/sql/rpl_utility.cc 2008-01-30 16:35:25 +0000
+++ b/sql/rpl_utility.cc 2008-06-30 20:11:18 +0000
@@ -188,7 +188,8 @@ table_def::compatible_with(Relay_log_inf
for (uint col= 0 ; col < cols_to_check ; ++col)
{
- if (table->field[col]->type() != type(col))
+ Field *const field= table->field[col];
+ if (field->type() != type(col))
{
DBUG_ASSERT(col < size() && col < tsh->fields);
DBUG_ASSERT(tsh->db.str && tsh->table_name.str);
@@ -197,15 +198,15 @@ table_def::compatible_with(Relay_log_inf
my_snprintf(buf, sizeof(buf), "Column %d type mismatch - "
"received type %d, %s.%s has type %d",
col, type(col), tsh->db.str, tsh->table_name.str,
- table->field[col]->type());
+ field->type());
rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF,
ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf);
}
/*
Check the slave's field size against that of the master.
*/
- if (!error &&
- !table->field[col]->compatible_field_size(field_metadata(col)))
+ if (!error &&
+ !field->compatible_field_size(field_metadata(col), rli_arg))
{
error= 1;
char buf[256];
@@ -213,10 +214,9 @@ table_def::compatible_with(Relay_log_inf
"master has size %d, %s.%s on slave has size %d."
" Master's column size should be <= the slave's "
"column size.", col,
- table->field[col]->pack_length_from_metadata(
- m_field_metadata[col]),
- tsh->db.str, tsh->table_name.str,
- table->field[col]->row_pack_length());
+ field->pack_length_from_metadata(m_field_metadata[col]),
+ tsh->db.str, tsh->table_name.str,
+ field->row_pack_length());
rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF,
ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf);
}
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc 2008-06-19 18:47:59 +0000
+++ b/sql/slave.cc 2008-06-30 20:11:18 +0000
@@ -4057,9 +4057,17 @@ end:
@param rli Relay_log_info which tells the master's version
@param bug_id Number of the bug as found in bugs.mysql.com
@param report bool report error message, default TRUE
+
+ @param pred Predicate function that will be called with @c param to
+ check for the bug. If the function return @c true, the bug is present,
+ otherwise, it is not.
+
+ @param param State passed to @c pred function.
+
@return TRUE if master has the bug, FALSE if it does not.
*/
-bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report)
+bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
+ bool (*pred)(const void *), const void *param)
{
struct st_version_range_for_one_bug {
uint bug_id;
@@ -4072,6 +4080,7 @@ bool rpl_master_has_bug(Relay_log_info *
{24432, { 5, 1, 12 }, { 5, 1, 17 } },
{33029, { 5, 0, 0 }, { 5, 0, 58 } },
{33029, { 5, 1, 0 }, { 5, 1, 12 } },
+ {37426, { 5, 1, 0 }, { 5, 1, 26 } },
};
const uchar *master_ver=
rli->relay_log.description_event_for_exec->server_version_split;
@@ -4085,11 +4094,11 @@ bool rpl_master_has_bug(Relay_log_info *
*fixed_in= versions_for_all_bugs[i].fixed_in;
if ((versions_for_all_bugs[i].bug_id == bug_id) &&
(memcmp(introduced_in, master_ver, 3) <= 0) &&
- (memcmp(fixed_in, master_ver, 3) > 0))
+ (memcmp(fixed_in, master_ver, 3) > 0) &&
+ (pred == NULL || (*pred)(param)))
{
if (!report)
return TRUE;
-
// a short message for SHOW SLAVE STATUS (message length constraints)
my_printf_error(ER_UNKNOWN_ERROR, "master may suffer from"
" http://bugs.mysql.com/bug.php?id=%u"
@@ -4137,7 +4146,7 @@ bool rpl_master_erroneous_autoinc(THD *t
{
Relay_log_info *rli= &active_mi->rli;
DBUG_EXECUTE_IF("simulate_bug33029", return TRUE;);
- return rpl_master_has_bug(rli, 33029, FALSE);
+ return rpl_master_has_bug(rli, 33029, FALSE, NULL, NULL);
}
return FALSE;
}
=== modified file 'sql/slave.h'
--- a/sql/slave.h 2008-03-29 12:19:53 +0000
+++ b/sql/slave.h 2008-06-30 20:11:18 +0000
@@ -165,7 +165,8 @@ int fetch_master_table(THD* thd, const c
bool show_master_info(THD* thd, Master_info* mi);
bool show_binlog_info(THD* thd);
-bool rpl_master_has_bug(Relay_log_info *rli, uint bug_id, bool report=TRUE);
+bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
+ bool (*pred)(const void *), const void *param);
bool rpl_master_erroneous_autoinc(THD* thd);
const char *print_slave_db_safe(const char *db);
=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc 2008-06-03 11:25:41 +0000
+++ b/sql/sql_insert.cc 2008-07-11 18:51:10 +0000
@@ -695,7 +695,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *t
if (thd->slave_thread &&
(info.handle_duplicates == DUP_UPDATE) &&
(table->next_number_field != NULL) &&
- rpl_master_has_bug(&active_mi->rli, 24432))
+ rpl_master_has_bug(&active_mi->rli, 24432, TRUE, NULL, NULL))
goto abort;
#endif
@@ -2967,7 +2967,7 @@ select_insert::prepare(List<Item> &value
if (thd->slave_thread &&
(info.handle_duplicates == DUP_UPDATE) &&
(table->next_number_field != NULL) &&
- rpl_master_has_bug(&active_mi->rli, 24432))
+ rpl_master_has_bug(&active_mi->rli, 24432, TRUE, NULL, NULL))
DBUG_RETURN(1);
#endif
=== modified file 'support-files/my-huge.cnf.sh'
--- a/support-files/my-huge.cnf.sh 2008-07-09 22:13:42 +0000
+++ b/support-files/my-huge.cnf.sh 2008-07-19 08:31:33 +0000
@@ -46,6 +46,9 @@ thread_concurrency = 8
#
#skip-networking
+# Disable Federated by default
+skip-federated
+
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
=== modified file 'support-files/my-large.cnf.sh'
--- a/support-files/my-large.cnf.sh 2008-07-09 22:13:42 +0000
+++ b/support-files/my-large.cnf.sh 2008-07-19 08:31:33 +0000
@@ -46,6 +46,9 @@ thread_concurrency = 8
#
#skip-networking
+# Disable Federated by default
+skip-federated
+
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
=== modified file 'support-files/my-medium.cnf.sh'
--- a/support-files/my-medium.cnf.sh 2008-07-09 22:13:42 +0000
+++ b/support-files/my-medium.cnf.sh 2008-07-19 08:31:33 +0000
@@ -44,6 +44,9 @@ myisam_sort_buffer_size = 8M
#
#skip-networking
+# Disable Federated by default
+skip-federated
+
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
| Thread |
|---|
| • bzr push into mysql-5.1 branch (kpettersson:2664 to 2668) | Kristofer Pettersson | 22 Jul |