#At file:///MySQL/REPO/V60/push-6.0/ based on revid:joerg@strippedtn0
3181 Joerg Bruehe 2009-05-07 [merge]
Merge main 6.0 into 6.0-build
(includes solving 64 conflicts).
removed:
mysql-test/suite/rpl/t/rpl_000015-slave.sh
added:
mysql-test/collections/mysql-6.0-bugteam.push
mysql-test/include/diff_master_slave.inc
mysql-test/include/kill_query.inc
mysql-test/include/kill_query_and_diff_master_slave.inc
mysql-test/r/myisam_debug.result
mysql-test/r/parser_not_embedded.result
mysql-test/std_data/bug37631.MYD
mysql-test/std_data/bug37631.MYI
mysql-test/std_data/bug37631.frm
mysql-test/suite/bugs/r/rpl_bug38205.result
mysql-test/suite/bugs/t/rpl_bug38205.test
mysql-test/suite/ibmdb2i/
mysql-test/suite/ibmdb2i/include/
mysql-test/suite/ibmdb2i/include/have_i61.inc
mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc
mysql-test/suite/ibmdb2i/r/
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result
mysql-test/suite/ibmdb2i/t/
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test
mysql-test/suite/rpl/r/rpl_bug38694.result
mysql-test/suite/rpl/r/rpl_killed_ddl.result
mysql-test/suite/rpl/t/rpl_bug38694-slave.opt
mysql-test/suite/rpl/t/rpl_bug38694.test
mysql-test/suite/rpl/t/rpl_killed_ddl-master.opt
mysql-test/suite/rpl/t/rpl_killed_ddl.test
mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt
mysql-test/t/myisam_debug.test
mysql-test/t/parser_not_embedded.test
renamed:
mysql-test/r/rpl_name_const.result => mysql-test/suite/rpl/r/rpl_name_const.result
mysql-test/t/rpl_name_const.test => mysql-test/suite/rpl/t/rpl_name_const.test
modified:
client/mysql.cc
cmd-line-utils/libedit/term.c
extra/libevent/epoll.c
include/thr_lock.h
mysql-test/include/handler.inc
mysql-test/mysql-test-run.pl
mysql-test/r/count_distinct3.result
mysql-test/r/fulltext.result
mysql-test/r/func_des_encrypt.result
mysql-test/r/func_encrypt.result
mysql-test/r/func_sapdb.result
mysql-test/r/func_set.result
mysql-test/r/func_str.result
mysql-test/r/gis-rtree.result
mysql-test/r/gis.result
mysql-test/r/handler_innodb.result
mysql-test/r/handler_myisam.result
mysql-test/r/insert.result
mysql-test/r/merge.result
mysql-test/r/myisam.result
mysql-test/r/mysqldump.result
mysql-test/r/not_embedded_server.result
mysql-test/r/parser.result
mysql-test/r/partition_mgm.result
mysql-test/r/perror.result
mysql-test/r/repair.result
mysql-test/r/shm.result
mysql-test/r/sp-ucs2.result
mysql-test/r/sp.result
mysql-test/r/type_time.result
mysql-test/r/upgrade.result
mysql-test/r/varbinary.result
mysql-test/r/variables-notembedded.result
mysql-test/suite/funcs_2/charset/charset_master.test
mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
mysql-test/suite/rpl/r/rpl_idempotency.result
mysql-test/suite/rpl/r/rpl_skip_error.result
mysql-test/suite/rpl/r/rpl_start_stop_slave.result
mysql-test/suite/rpl/r/rpl_sync.result
mysql-test/suite/rpl/t/disabled.def
mysql-test/suite/rpl/t/rpl_binlog_corruption.test
mysql-test/suite/rpl/t/rpl_idempotency.test
mysql-test/suite/rpl/t/rpl_skip_error.test
mysql-test/suite/rpl/t/rpl_start_stop_slave.test
mysql-test/suite/rpl/t/rpl_sync.test
mysql-test/t/count_distinct3.test
mysql-test/t/fulltext.test
mysql-test/t/func_des_encrypt.test
mysql-test/t/func_encrypt.test
mysql-test/t/func_sapdb.test
mysql-test/t/func_set.test
mysql-test/t/func_str.test
mysql-test/t/gis-rtree.test
mysql-test/t/gis.test
mysql-test/t/insert.test
mysql-test/t/merge.test
mysql-test/t/myisam.test
mysql-test/t/mysqldump.test
mysql-test/t/not_embedded_server.test
mysql-test/t/parser.test
mysql-test/t/partition_mgm.test
mysql-test/t/plugin_notembedded.test
mysql-test/t/shm.test
mysql-test/t/sp-ucs2.test
mysql-test/t/sp.test
mysql-test/t/sp_trans_log.test
mysql-test/t/type_time.test
mysql-test/t/upgrade.test
mysql-test/t/variables-notembedded-master.opt
mysys/mf_keycache.c
mysys/my_init.c
scripts/mysqlhotcopy.sh
sql/events.cc
sql/item_cmpfunc.cc
sql/item_func.cc
sql/item_geofunc.cc
sql/item_strfunc.cc
sql/item_strfunc.h
sql/item_timefunc.cc
sql/log.cc
sql/log_event.cc
sql/parse_file.cc
sql/parse_file.h
sql/rpl_filter.cc
sql/share/errmsg.txt
sql/slave.cc
sql/sp.cc
sql/sp_head.cc
sql/sp_head.h
sql/sp_pcontext.cc
sql/sp_pcontext.h
sql/sql_acl.cc
sql/sql_base.cc
sql/sql_crypt.cc
sql/sql_crypt.h
sql/sql_db.cc
sql/sql_handler.cc
sql/sql_lex.cc
sql/sql_lex.h
sql/sql_rename.cc
sql/sql_repl.cc
sql/sql_select.cc
sql/sql_table.cc
sql/sql_test.cc
sql/sql_view.cc
sql/sql_view.h
sql/sql_yacc.yy
storage/ibmdb2i/db2i_collationSupport.cc
storage/ibmdb2i/db2i_misc.h
storage/ibmdb2i/ha_ibmdb2i.cc
storage/myisam/ft_boolean_search.c
storage/myisam/ha_myisam.cc
storage/myisam/mi_delete.c
storage/myisam/mi_dynrec.c
storage/myisam/mi_open.c
storage/myisam/mi_packrec.c
storage/myisam/mi_write.c
storage/myisam/myisamchk.c
storage/myisammrg/ha_myisammrg.cc
storage/ndb/tools/restore/consumer_restore.cpp
storage/ndb/tools/restore/consumer_restorem.cpp
win/Makefile.am
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc 2009-04-29 19:26:03 +0000
+++ b/client/mysql.cc 2009-05-07 20:48:24 +0000
@@ -252,7 +252,7 @@ typedef struct {
static COMMANDS commands[] = {
{ "?", '?', com_help, 1, "Synonym for `help'." },
- { "clear", 'c', com_clear, 0, "Clear command."},
+ { "clear", 'c', com_clear, 0, "Clear the current input statement."},
{ "connect",'r', com_connect,1,
"Reconnect to the server. Optional arguments are db and host." },
{ "delimiter", 'd', com_delimiter, 1,
=== modified file 'cmd-line-utils/libedit/term.c'
--- a/cmd-line-utils/libedit/term.c 2009-04-14 21:07:28 +0000
+++ b/cmd-line-utils/libedit/term.c 2009-05-07 20:48:24 +0000
@@ -60,7 +60,7 @@ static char sccsid[] = "@(#)term.c 8.2 (
#elif HAVE_NCURSES_H
#include <ncurses.h>
#endif
-/* Solaris's term.h does horrid things. */
+/* Don't use Solaris's term.h. */
#if (defined(HAVE_TERM_H) && !defined(__SunOS))
#include <term.h>
#endif
=== modified file 'extra/libevent/epoll.c'
--- a/extra/libevent/epoll.c 2008-04-28 17:52:20 +0000
+++ b/extra/libevent/epoll.c 2009-04-16 09:53:06 +0000
@@ -112,9 +112,8 @@ epoll_init(struct event_base *base)
if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
rl.rlim_cur != RLIM_INFINITY) {
/*
- * Solaris is somewhat retarded - it's important to drop
- * backwards compatibility when making changes. So, don't
- * dare to put rl.rlim_cur here.
+ * Solaris kernel changes are not backward compatible.
+ * So, don't dare to put rl.rlim_cur here.
*/
nfiles = rl.rlim_cur - 1;
}
=== modified file 'include/thr_lock.h'
--- a/include/thr_lock.h 2009-04-01 20:48:42 +0000
+++ b/include/thr_lock.h 2009-04-14 21:58:44 +0000
@@ -30,6 +30,8 @@ extern ulong locks_immediate,locks_waite
/**
Lock types are used to request a lock on a table. Changes in this enumeration
might affect transactional locks as well.
+ Important: if a new lock type is added, a matching lock description
+ must be added to sql_test.cc's lock_descriptions array.
@see set_handler_table_locks
@see read_lock_type_for_table
*/
=== added file 'mysql-test/collections/mysql-6.0-bugteam.push'
--- a/mysql-test/collections/mysql-6.0-bugteam.push 1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/mysql-6.0-bugteam.push 2009-04-28 06:32:50 +0000
@@ -0,0 +1,7 @@
+perl mysql-test-run.pl --comment=n_mix --mysqld=--binlog-format=mixed --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=embedded --embedded --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=ps_stm_threadpool --ps-protocol --mysqld=--binlog-format=statement --mysqld=--thread-handling=pool-of-threads --suite=main,backup,backup_engines,backup_ptr,binlog,federated,rpl,maria --experimental=collections/default.experimental --timer --force
+perl mysql-test-run.pl --comment=falcon --suite=falcon --experimental=collections/default.experimental --timer --force
=== added file 'mysql-test/include/diff_master_slave.inc'
--- a/mysql-test/include/diff_master_slave.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/diff_master_slave.inc 2009-03-27 05:19:50 +0000
@@ -0,0 +1,21 @@
+# ==== Purpose ====
+#
+# Diff the output of a statement on master and slave
+#
+# ==== Usage =====
+#
+# let $diff_statement= SELECT * FROM t1 WHERE a < 100;
+# source include/diff_master_slave.inc;
+
+--echo source include/diff_master_slave.inc;
+disable_query_log;
+disable_result_log;
+
+exec $MYSQL test -e "$diff_statement" > $MYSQLTEST_VARDIR/tmp/diff_master.out;
+sync_slave_with_master;
+exec $MYSQL_SLAVE test -e "$diff_statement" > $MYSQLTEST_VARDIR/tmp/diff_slave.out;
+
+diff_files $MYSQLTEST_VARDIR/tmp/diff_master.out $MYSQLTEST_VARDIR/tmp/diff_slave.out;
+
+enable_result_log;
+enable_query_log;
=== modified file 'mysql-test/include/handler.inc'
--- a/mysql-test/include/handler.inc 2009-02-26 17:02:36 +0000
+++ b/mysql-test/include/handler.inc 2009-04-17 09:14:33 +0000
@@ -731,3 +731,11 @@ drop table t1;
disconnect con1;
disconnect con2;
connection default;
+
+#
+# Bug#44151 using handler commands on information_schema tables crashes server
+#
+USE information_schema;
+--error ER_WRONG_USAGE
+HANDLER COLUMNS OPEN;
+USE test;
=== added file 'mysql-test/include/kill_query.inc'
--- a/mysql-test/include/kill_query.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/kill_query.inc 2009-03-27 05:19:50 +0000
@@ -0,0 +1,68 @@
+# ==== Purpose ====
+#
+# Kill a query in the master connection, and then try to reap the
+# result of the killed query.
+#
+# ==== Usage ====
+#
+# The following variables should be set before sourcing this file.
+#
+# $debug_lock: name of the debug user lock, if set, will release/lock
+# the specified debug lock accordingly, and before
+# sourcing this, connection 'master' should get the user
+# lock and run a query in another thread, which will
+# block before creating statement event.
+#
+# $connection_name: name of the connection that is waiting for the
+# lock, this can not be 'master'
+#
+# $connection_id: id of the connection that is waiting for the lock
+#
+# Example:
+# let $debug_lock=;
+# connection master1;
+# let $connection_name= master1;
+# let $connection_id= `SELECT CONNECTION_ID()`;
+# send CREATE TABLE t1;
+# source kill_query.inc;
+#
+# let $debug_lock= "debug_lock.before_query_log_event";
+# connection master;
+# eval SELECT GET_LOCK($debug_lock, 10);
+# connection master1;
+# let $connection_name= master1;
+# let $connection_id= `SELECT CONNECTION_ID()`;
+# send CREATE TABLE t1;
+# source kill_query.inc;
+
+
+--echo source include/kill_query.inc;
+disable_query_log;
+disable_result_log;
+connection master;
+
+# kill the query that is waiting
+eval kill query $connection_id;
+
+if (`SELECT '$debug_lock' != ''`)
+{
+ # release the lock to allow binlog continue
+ eval SELECT RELEASE_LOCK($debug_lock);
+}
+
+# reap the result of the waiting query
+connection $connection_name;
+error 0, 1317, 1307, 1306, 1334, 1305;
+reap;
+
+connection master;
+
+if (`SELECT '$debug_lock' != ''`)
+{
+ # get lock again to make the next query wait
+ eval SELECT GET_LOCK($debug_lock, 10);
+}
+
+connection $connection_name;
+enable_query_log;
+enable_result_log;
=== added file 'mysql-test/include/kill_query_and_diff_master_slave.inc'
--- a/mysql-test/include/kill_query_and_diff_master_slave.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/kill_query_and_diff_master_slave.inc 2009-03-27 05:19:50 +0000
@@ -0,0 +1,43 @@
+# ==== Purpose ====
+#
+# Kill a query, sync master with slave, and diff the output of a
+# statement on master and slave to check if statement is correctly
+# replicated.
+#
+# ==== Usage ====
+#
+# connection <CONNECTION>;
+# let $connection_name=<CONNECTION>
+# let $connection_id=`SELECT CONNECTION_ID()`;
+# let $diff_statement=<SQL COMMAND>;
+# send <SQL COMMAND>;
+# source include/kill_query_and_diff_master_slave.inc;
+#
+# Note: <CONNECTION> must not be 'master'.
+#
+# See also kill_query.inc and diff_master_slave.inc for more
+# information
+
+source include/kill_query.inc;
+
+# Release the debug lock if used, so that the statements in
+# diff_master_slave.inc will not be blocked.
+connection master;
+disable_query_log;
+disable_result_log;
+if (`SELECT '$debug_lock' != ''`)
+{
+ eval SELECT RELEASE_LOCK($debug_lock);
+}
+enable_result_log;
+enable_query_log;
+
+source include/diff_master_slave.inc;
+
+# Acquire the debug lock again if used
+connection master;
+disable_query_log; disable_result_log; if (`SELECT '$debug_lock' !=
+''`) { eval SELECT GET_LOCK($debug_lock, 10); } enable_result_log;
+enable_query_log;
+
+connection $connection_name;
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2009-04-29 19:26:03 +0000
+++ b/mysql-test/mysql-test-run.pl 2009-05-07 20:48:24 +0000
@@ -1603,14 +1603,40 @@ sub client_debug_arg($$) {
}
-sub client_arguments ($) {
+sub mysql_fix_arguments () {
+
+ return "" if ( IS_WINDOWS );
+
+ my $exe=
+ mtr_script_exists("$basedir/scripts/mysql_fix_privilege_tables",
+ "$path_client_bindir/mysql_fix_privilege_tables");
+ my $args;
+ mtr_init_args(\$args);
+ mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
+
+ mtr_add_arg($args, "--basedir=%s", $basedir);
+ mtr_add_arg($args, "--bindir=%s", $path_client_bindir);
+ mtr_add_arg($args, "--verbose");
+ return mtr_args2str($exe, @$args);
+}
+
+
+sub client_arguments ($;$) {
my $client_name= shift;
+ my $group_suffix= shift;
my $client_exe= mtr_exe_exists("$path_client_bindir/$client_name");
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--defaults-file=%s", $path_config_file);
- client_debug_arg($args, $client_name);
+ if (defined($group_suffix)) {
+ mtr_add_arg($args, "--defaults-group-suffix=%s", $group_suffix);
+ client_debug_arg($args, "$client_name-$group_suffix");
+ }
+ else
+ {
+ client_debug_arg($args, $client_name);
+ }
return mtr_args2str($client_exe, @$args);
}
@@ -1908,6 +1934,7 @@ sub environment_setup {
$ENV{'MYSQL_BACKUP'}= client_arguments("mysqlbackup");
$ENV{'MYSQL_BINLOG'}= mysqlbinlog_arguments();
$ENV{'MYSQL'}= client_arguments("mysql");
+ $ENV{'MYSQL_SLAVE'}= client_arguments("mysql", ".2");
$ENV{'MYSQL_UPGRADE'}= client_arguments("mysql_upgrade");
$ENV{'MYSQLADMIN'}= native_path($exe_mysqladmin);
$ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments();
=== modified file 'mysql-test/r/count_distinct3.result'
--- a/mysql-test/r/count_distinct3.result 2003-11-20 23:53:01 +0000
+++ b/mysql-test/r/count_distinct3.result 2009-04-16 17:47:44 +0000
@@ -2,7 +2,8 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (id INTEGER, grp TINYINT, id_rev INTEGER);
SELECT COUNT(*) FROM t1;
COUNT(*)
-4181000
+4201000
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
+# Begin cleanup
+SET session myisam_sort_buffer_size = @orig_myisam_sort_buffer_size;
DROP TABLE t1;
-set @@read_buffer_size=default;
=== modified file 'mysql-test/r/fulltext.result'
--- a/mysql-test/r/fulltext.result 2009-04-01 21:36:07 +0000
+++ b/mysql-test/r/fulltext.result 2009-04-30 14:57:39 +0000
@@ -535,6 +535,14 @@ CREATE TABLE t1(a TEXT);
SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE);
ERROR HY000: Incorrect arguments to AGAINST
DROP TABLE t1;
+CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a));
+INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd');
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('+awrd bwrd* +cwrd*' IN BOOLEAN MODE);
+a
+awrd bwrd cwrd
+awrd bwrd cwrd
+awrd bwrd cwrd
+DROP TABLE t1;
create table t1(a text,b date,fulltext index(a))engine=myisam;
insert into t1 set a='water',b='2008-08-04';
select 1 from t1 where match(a) against ('water' in boolean mode) and b>='2008-08-01';
=== modified file 'mysql-test/r/func_des_encrypt.result'
--- a/mysql-test/r/func_des_encrypt.result 2005-07-07 18:49:44 +0000
+++ b/mysql-test/r/func_des_encrypt.result 2009-04-17 15:52:57 +0000
@@ -1,3 +1,37 @@
select des_encrypt('hello');
des_encrypt('hello')
��2nV��
+#
+# Bug #11643: des_encrypt() causes server to die
+#
+CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
+UPDATE t1 SET des=DES_ENCRYPT('1234');
+SELECT LENGTH(des) FROM t1;
+LENGTH(des)
+9
+9
+9
+9
+SELECT DES_DECRYPT(des) FROM t1;
+DES_DECRYPT(des)
+1234
+1234
+1234
+1234
+SELECT
+LENGTH(DES_ENCRYPT('1234')),
+LENGTH(DES_ENCRYPT('12345')),
+LENGTH(DES_ENCRYPT('123456')),
+LENGTH(DES_ENCRYPT('1234567'));
+LENGTH(DES_ENCRYPT('1234')) LENGTH(DES_ENCRYPT('12345')) LENGTH(DES_ENCRYPT('123456')) LENGTH(DES_ENCRYPT('1234567'))
+9 9 9 9
+SELECT
+DES_DECRYPT(DES_ENCRYPT('1234')),
+DES_DECRYPT(DES_ENCRYPT('12345')),
+DES_DECRYPT(DES_ENCRYPT('123456')),
+DES_DECRYPT(DES_ENCRYPT('1234567'));
+DES_DECRYPT(DES_ENCRYPT('1234')) DES_DECRYPT(DES_ENCRYPT('12345')) DES_DECRYPT(DES_ENCRYPT('123456')) DES_DECRYPT(DES_ENCRYPT('1234567'))
+1234 12345 123456 1234567
+DROP TABLE t1;
+End of 5.0 tests
=== modified file 'mysql-test/r/func_encrypt.result'
--- a/mysql-test/r/func_encrypt.result 2008-07-14 12:49:19 +0000
+++ b/mysql-test/r/func_encrypt.result 2009-04-27 10:07:08 +0000
@@ -183,3 +183,10 @@ id select_type table type possible_keys
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select des_decrypt(des_encrypt('hello',4),'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt('hello','hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
+drop table if exists t1;
+create table t1 (f1 smallint(6) default null, f2 mediumtext character set utf8)
+engine=myisam default charset=latin1;
+insert into t1 values (null,'contraction\'s');
+insert into t1 values (-15818,'requirement\'s');
+select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
+drop table t1;
=== modified file 'mysql-test/r/func_sapdb.result'
--- a/mysql-test/r/func_sapdb.result 2009-02-07 16:00:57 +0000
+++ b/mysql-test/r/func_sapdb.result 2009-04-14 21:36:40 +0000
@@ -282,3 +282,33 @@ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00
TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
1Eq 1NEq1 1NEq2 2Eq 2NEq1 2NEq2 3Eq 3NEq1 3NEq2 Time0 Time00 Literal0000 TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')) TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'))
1 0 0 1 0 0 1 0 0 00:00:00 00:00:00 00:00:00 00:59:00 -00:59:00
+SELECT sec_to_time(3020399)=TIME('838:59:59');
+sec_to_time(3020399)=TIME('838:59:59')
+1
+SELECT sec_to_time(-3020399)=TIME('-838:59:59');
+sec_to_time(-3020399)=TIME('-838:59:59')
+1
+SELECT sec_to_time(-3020399)='-838:59:59';
+sec_to_time(-3020399)='-838:59:59'
+1
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:59');
+time(sec_to_time(-3020399))=TIME('-838:59:59')
+1
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:58');
+time(sec_to_time(-3020399))=TIME('-838:59:58')
+0
+SELECT maketime(-1,0,1)='-01:00:01';
+maketime(-1,0,1)='-01:00:01'
+1
+SELECT TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME);
+TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME)
+1
+SELECT maketime(-1,0,1)=CAST('-01:00:01' AS TIME);
+maketime(-1,0,1)=CAST('-01:00:01' AS TIME)
+1
+SELECT maketime(1,0,1)=CAST('01:00:01' AS TIME);
+maketime(1,0,1)=CAST('01:00:01' AS TIME)
+1
+SELECT maketime(1,0,1)=CAST('01:00:02' AS TIME);
+maketime(1,0,1)=CAST('01:00:02' AS TIME)
+0
=== modified file 'mysql-test/r/func_set.result'
--- a/mysql-test/r/func_set.result 2008-02-12 19:09:16 +0000
+++ b/mysql-test/r/func_set.result 2009-04-23 07:50:34 +0000
@@ -103,3 +103,46 @@ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(N
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL))
8
End of 5.0 tests
+drop table if exists t1;
+create table t1 (f1 set('test1','test2','test3') character set utf8 default null)
+engine=myisam default charset=latin1;
+insert into t1 values (''),(null),(null),(''),(''),('');
+select find_in_set(f1,f1) as a from t1,(select find_in_set(f1,f1) as b from t1) a;
+a
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+drop table t1;
=== modified file 'mysql-test/r/func_str.result'
--- a/mysql-test/r/func_str.result 2009-02-14 09:23:20 +0000
+++ b/mysql-test/r/func_str.result 2009-04-23 08:42:37 +0000
@@ -2529,3 +2529,17 @@ h i
31.12.2008 AAAAAA, aaaaaa
DROP TABLE t1;
End of 5.0 tests
+drop table if exists t1;
+create table t1(f1 tinyint default null)engine=myisam;
+insert into t1 values (-1),(null);
+explain select 1 as a from t1,(select decode(f1,f1) as b from t1) a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join buffer
+2 DERIVED t1 ALL NULL NULL NULL NULL 2
+explain select 1 as a from t1,(select encode(f1,f1) as b from t1) a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join buffer
+2 DERIVED t1 ALL NULL NULL NULL NULL 2
+drop table t1;
=== modified file 'mysql-test/r/gis-rtree.result'
--- a/mysql-test/r/gis-rtree.result 2007-10-23 08:44:14 +0000
+++ b/mysql-test/r/gis-rtree.result 2009-04-29 02:59:10 +0000
@@ -186,106 +186,106 @@ CREATE TABLE t2 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL
) ENGINE=MyISAM;
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))));
-INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)));
+INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)));
ALTER TABLE t2 ADD SPATIAL KEY(g);
SHOW CREATE TABLE t2;
Table Create Table
@@ -309,406 +309,406 @@ fid AsText(g)
56 LINESTRING(41 41,50 50)
45 LINESTRING(51 51,60 60)
55 LINESTRING(41 51,50 60)
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))));
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-99
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-98
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-97
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-96
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-95
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-94
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-93
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-92
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-91
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-90
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-89
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-88
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-87
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-86
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-85
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-84
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-83
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-82
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-81
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-80
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-79
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-78
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-77
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-76
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-75
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-74
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-73
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-72
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-71
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-70
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-69
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-68
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-67
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-66
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-65
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-64
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-63
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-62
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-61
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-60
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-59
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-58
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-57
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-56
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-55
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-54
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-53
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-52
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-51
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-50
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-49
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-48
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-47
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-46
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-45
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-44
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-43
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-42
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-41
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-40
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-39
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-38
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-37
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-36
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-35
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-34
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-33
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-32
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-31
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-30
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-29
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-28
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-27
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-26
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-25
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-24
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-23
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-22
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-21
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-20
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-19
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-18
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-17
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-16
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-15
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-14
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-13
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-12
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-11
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-10
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))));
SELECT count(*) FROM t2;
count(*)
-9
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))));
SELECT count(*) FROM t2;
count(*)
-8
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))));
SELECT count(*) FROM t2;
count(*)
-7
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))));
SELECT count(*) FROM t2;
count(*)
-6
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))));
SELECT count(*) FROM t2;
count(*)
-5
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))));
SELECT count(*) FROM t2;
count(*)
-4
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))));
SELECT count(*) FROM t2;
count(*)
-3
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))));
SELECT count(*) FROM t2;
count(*)
-2
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))));
SELECT count(*) FROM t2;
count(*)
-1
-DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))));
+100
+DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))));
SELECT count(*) FROM t2;
count(*)
-0
+100
DROP TABLE t2;
drop table if exists t1;
Warnings:
@@ -863,11 +863,11 @@ Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1)));
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0)));
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1)));
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0)));
-SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
+INSERT INTO t1 (foo) VALUES (POINT(1,1));
+INSERT INTO t1 (foo) VALUES (POINT(1,0));
+INSERT INTO t1 (foo) VALUES (POINT(0,1));
+INSERT INTO t1 (foo) VALUES (POINT(0,0));
+SELECT 1 FROM t1 WHERE foo != POINT(0,0);
1
1
1
@@ -1426,35 +1426,35 @@ Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
create table t1 (a geometry not null, spatial index(a));
-insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072)));
-insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284)));
-insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0)));
-insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53)));
-insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111)));
-insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241)));
-insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111)));
-insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251)));
-insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231)));
-insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260)));
-insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236)));
-insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125)));
-insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275)));
-insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29)));
-insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86)));
-insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270)));
-insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19)));
-insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255)));
-insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130)));
-insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39)));
-insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159)));
-insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270)));
-insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82)));
-insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34)));
-insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53)));
-insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183)));
-insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192)));
-insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159)));
-insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178)));
+insert into t1 values (POINT(1.1517219314031e+164, 131072));
+insert into t1 values (POINT(9.1248812352444e+192, 2.9740338169556e+284));
+insert into t1 values (POINT(4.7783097267365e-299, -0));
+insert into t1 values (POINT(1.49166814624e-154, 2.0880974297595e-53));
+insert into t1 values (POINT(4.0917382598702e+149, 1.2024538023802e+111));
+insert into t1 values (POINT(2.0349165139404e+236, 2.9993936277913e-241));
+insert into t1 values (POINT(2.5243548967072e-29, 1.2024538023802e+111));
+insert into t1 values (POINT(0, 6.9835074892995e-251));
+insert into t1 values (POINT(2.0880974297595e-53, 3.1050361846014e+231));
+insert into t1 values (POINT(2.8728483499323e-188, 2.4600631144627e+260));
+insert into t1 values (POINT(3.0517578125e-05, 2.0349165139404e+236));
+insert into t1 values (POINT(1.1517219314031e+164, 1.1818212630766e-125));
+insert into t1 values (POINT(2.481040258324e-265, 5.7766220027675e-275));
+insert into t1 values (POINT(2.0880974297595e-53, 2.5243548967072e-29));
+insert into t1 values (POINT(5.7766220027675e-275, 9.9464647281957e+86));
+insert into t1 values (POINT(2.2181357552967e+130, 3.7857669957337e-270));
+insert into t1 values (POINT(4.5767114681874e-246, 3.6893488147419e+19));
+insert into t1 values (POINT(4.5767114681874e-246, 3.7537584144024e+255));
+insert into t1 values (POINT(3.7857669957337e-270, 1.8033161362863e-130));
+insert into t1 values (POINT(0, 5.8774717541114e-39));
+insert into t1 values (POINT(1.1517219314031e+164, 2.2761049594727e-159));
+insert into t1 values (POINT(6.243497100632e+144, 3.7857669957337e-270));
+insert into t1 values (POINT(3.7857669957337e-270, 2.6355494858076e-82));
+insert into t1 values (POINT(2.0349165139404e+236, 3.8518598887745e-34));
+insert into t1 values (POINT(4.6566128730774e-10, 2.0880974297595e-53));
+insert into t1 values (POINT(2.0880974297595e-53, 1.8827498946116e-183));
+insert into t1 values (POINT(1.8033161362863e-130, 9.1248812352444e+192));
+insert into t1 values (POINT(4.7783097267365e-299, 2.2761049594727e-159));
+insert into t1 values (POINT(1.94906280228e+289, 1.2338789709327e-178));
drop table t1;
CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1(foo) VALUES (NULL);
=== modified file 'mysql-test/r/gis.result'
--- a/mysql-test/r/gis.result 2009-02-14 09:23:20 +0000
+++ b/mysql-test/r/gis.result 2009-04-29 03:50:14 +0000
@@ -47,26 +47,26 @@ INSERT INTO gis_point VALUES
INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
-(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));
INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
-(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))));
INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
-(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));
INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
-(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));
INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
-(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));
INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
-(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))));
INSERT into gis_geometry SELECT * FROM gis_point;
INSERT into gis_geometry SELECT * FROM gis_line;
INSERT into gis_geometry SELECT * FROM gis_polygon;
=== modified file 'mysql-test/r/handler_innodb.result'
--- a/mysql-test/r/handler_innodb.result 2009-02-24 10:22:54 +0000
+++ b/mysql-test/r/handler_innodb.result 2009-04-17 09:14:33 +0000
@@ -741,3 +741,7 @@ handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;
+USE information_schema;
+HANDLER COLUMNS OPEN;
+ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
+USE test;
=== modified file 'mysql-test/r/handler_myisam.result'
--- a/mysql-test/r/handler_myisam.result 2009-02-24 10:22:54 +0000
+++ b/mysql-test/r/handler_myisam.result 2009-04-17 09:14:33 +0000
@@ -739,3 +739,7 @@ handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;
+USE information_schema;
+HANDLER COLUMNS OPEN;
+ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
+USE test;
=== modified file 'mysql-test/r/insert.result'
--- a/mysql-test/r/insert.result 2009-02-13 16:30:54 +0000
+++ b/mysql-test/r/insert.result 2009-04-09 09:51:50 +0000
@@ -625,4 +625,9 @@ SELECT * FROM t2;
c1
15449237462
DROP TABLE t1, t2;
+CREATE TABLE t1(f1 FLOAT);
+INSERT INTO t1 VALUES (1.23);
+CREATE TABLE t2(f1 CHAR(1));
+INSERT INTO t2 SELECT f1 FROM t1;
+DROP TABLE t1, t2;
End of 5.0 tests.
=== modified file 'mysql-test/r/merge.result'
--- a/mysql-test/r/merge.result 2009-04-01 21:36:07 +0000
+++ b/mysql-test/r/merge.result 2009-04-22 10:02:28 +0000
@@ -2015,6 +2015,18 @@ insert into m1 (col1) values (1);
insert into m1 (col1) values (1);
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
drop table m1, t1;
+CREATE TABLE t1 (
+col1 INT(10)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE VIEW v1 as SELECT * FROM t1;
+CREATE TABLE m1 (
+col1 INT(10)
+)ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(v1);
+#Select should detect that the child table is a view and fail.
+SELECT * FROM m1;
+ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+DROP VIEW v1;
+DROP TABLE m1, t1;
End of 5.1 tests
#
# An additional test case for Bug#27430 Crash in subquery code
=== modified file 'mysql-test/r/myisam.result'
--- a/mysql-test/r/myisam.result 2009-02-23 14:53:18 +0000
+++ b/mysql-test/r/myisam.result 2009-04-30 10:27:29 +0000
@@ -2268,4 +2268,30 @@ checksum table t3;
Table Checksum
test.t3 326284887
drop table t1,t2,t3;
+CREATE TABLE t1 (
+c INT,
+d bit(1),
+e INT,
+f VARCHAR(1),
+g BIT(1),
+h BIT(1),
+KEY (h, d, e, g)
+);
+INSERT INTO t1 VALUES
+( 3, 1, 1, 'a', 0, 0 ),
+( 3, 1, 5, 'a', 0, 0 ),
+( 10, 1, 2, 'a', 0, 1 ),
+( 10, 1, 3, 'a', 0, 1 ),
+( 10, 1, 4, 'a', 0, 1 );
+SELECT f FROM t1 WHERE d = 1 AND e = 2 AND g = 0 AND h = 1;
+f
+a
+SELECT h+0, d + 0, e, g + 0 FROM t1;
+h+0 d + 0 e g + 0
+0 1 1 0
+0 1 5 0
+1 1 2 0
+1 1 3 0
+1 1 4 0
+DROP TABLE t1;
End of 5.1 tests
=== added file 'mysql-test/r/myisam_debug.result'
--- a/mysql-test/r/myisam_debug.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/myisam_debug.result 2009-04-30 11:03:44 +0000
@@ -0,0 +1,39 @@
+#
+# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
+#
+CREATE TABLE `t1` (
+`id` BIGINT(20) ,
+`id1` BIGINT(20) AUTO_INCREMENT,
+KEY(id1), KEY(id)
+) ENGINE=MyISAM;
+CREATE TABLE `t2` (
+`id` BIGINT(20) ,
+`id1` BIGINT(20) AUTO_INCREMENT,
+KEY (id1), KEY(id)
+) ENGINE=MyISAM;
+INSERT INTO t2 (id) VALUES (123);
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+INSERT INTO t2 (id) SELECT id FROM t2;
+# Switch to insert Connection
+SET SESSION debug='+d,wait_in_enable_indexes';
+# Send insert data
+INSERT INTO t1(id) SELECT id FROM t2;
+# Switch to default Connection
+# Wait for insert data to reach the debug point
+SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE STATE = 'wait_in_enable_indexes' AND
+INFO = "INSERT INTO t1(id) SELECT id FROM t2"
+INTO @thread_id;
+KILL QUERY @thread_id;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1,t2;
=== modified file 'mysql-test/r/mysqldump.result'
--- a/mysql-test/r/mysqldump.result 2009-04-05 16:11:17 +0000
+++ b/mysql-test/r/mysqldump.result 2009-04-30 14:35:36 +0000
@@ -3816,7 +3816,6 @@ DROP TABLE t1,t2;
-- Dump completed on DATE
-SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
#
# Bug #42635: mysqldump includes views that were excluded using
# the --ignore-table option
=== modified file 'mysql-test/r/not_embedded_server.result'
--- a/mysql-test/r/not_embedded_server.result 2009-03-18 12:49:07 +0000
+++ b/mysql-test/r/not_embedded_server.result 2009-04-30 10:33:07 +0000
@@ -1,3 +1,6 @@
+SHOW VARIABLES like 'slave_skip_errors';
+Variable_name Value
+slave_skip_errors OFF
#
# WL#4284: Transactional DDL locking
#
=== modified file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result 2009-02-14 16:10:30 +0000
+++ b/mysql-test/r/parser.result 2009-04-17 20:33:59 +0000
@@ -627,3 +627,6 @@ BACKUP DATABASE *, test to 'broken.bak';
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 ' test to 'broken.bak'' at line 1
BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
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 ' db1, db2, db3 to 'broken.bak'' at line 1
+#
+# End of 5.1 tests
+#
=== added file 'mysql-test/r/parser_not_embedded.result'
--- a/mysql-test/r/parser_not_embedded.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/parser_not_embedded.result 2009-04-17 20:00:53 +0000
@@ -0,0 +1,49 @@
+#
+# Bug#39559: dump of stored procedures / functions with C-style
+# comment can't be read back
+#
++----------+--------+
+| expected | result |
++----------+--------+
+| 2 | 2 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 1 | 1 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 3 | 3 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 2 | 2 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 7 | 7 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 8 | 8 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 7 | 7 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 4 | 4 |
++----------+--------+
++----------+--------+
+| expected | result |
++----------+--------+
+| 4 | 4 |
++----------+--------+
=== modified file 'mysql-test/r/partition_mgm.result'
--- a/mysql-test/r/partition_mgm.result 2009-02-04 14:48:13 +0000
+++ b/mysql-test/r/partition_mgm.result 2009-04-17 20:33:59 +0000
@@ -58,7 +58,14 @@ CREATE TABLE t1 (a INT)
of multi-line
comment */
PARTITIONS 5 */;
-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 '*/' at line 6
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+PARTITIONS 5 */
+DROP TABLE t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
-- with a single line comment embedded
=== modified file 'mysql-test/r/perror.result'
--- a/mysql-test/r/perror.result 2008-08-05 23:26:18 +0000
+++ b/mysql-test/r/perror.result 2009-04-14 14:29:45 +0000
@@ -2,5 +2,5 @@ Illegal error code: 10000
MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MySQL error code 1076 (ER_READY): %s: ready for connections.
Version: '%s' socket: '%s' port: %d
-MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Table upgrade required. Please do "REPAIR TABLE `%-.32s`" to fix it!
+MySQL error code 1459 (ER_TABLE_NEEDS_UPGRADE): Table upgrade required. Please do "REPAIR TABLE `%-.32s`" or dump/reload to fix it!
MySQL error code 1461 (ER_MAX_PREPARED_STMT_COUNT_REACHED): Can't create more than max_prepared_stmt_count statements (current value: %lu)
=== modified file 'mysql-test/r/repair.result'
--- a/mysql-test/r/repair.result 2009-02-27 15:52:30 +0000
+++ b/mysql-test/r/repair.result 2009-04-14 14:29:45 +0000
@@ -126,7 +126,7 @@ id
# Run CHECK TABLE, it should indicate table need a REPAIR TABLE
CHECK TABLE t1 FOR UPGRADE;
Table Op Msg_type Msg_text
-test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" to fix it!
+test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
# REPAIR old table USE_FRM should fail
REPAIR TABLE t1 USE_FRM;
Table Op Msg_type Msg_text
=== modified file 'mysql-test/r/shm.result'
--- a/mysql-test/r/shm.result 2009-03-26 23:30:56 +0000
+++ b/mysql-test/r/shm.result 2009-05-06 12:54:50 +0000
@@ -2156,7 +2156,8 @@ SET @max_allowed_packet= @@global.max_al
SET @net_buffer_length= @@global.net_buffer_length;
SET GLOBAL max_allowed_packet= 1024;
SET GLOBAL net_buffer_length= 1024;
-ERROR 1153 (08S01) at line 1: Got a packet bigger than 'max_allowed_packet' bytes
+# The following test is disabled until Bug#41860
+# "Without Windows named pipe" is fixed
SET GLOBAL max_allowed_packet= @max_allowed_packet;
SET GLOBAL net_buffer_length= @net_buffer_length;
End of 5.0 tests.
=== modified file 'mysql-test/r/sp-ucs2.result'
--- a/mysql-test/r/sp-ucs2.result 2009-04-06 12:56:41 +0000
+++ b/mysql-test/r/sp-ucs2.result 2009-04-08 10:34:06 +0000
@@ -96,10 +96,10 @@ SET f1='str';
CALL p1(f1, f2);
RETURN f2;
END|
-SELECT f1();
-DROP PROCEDURE p1|
+SELECT f1()|
f1()
ucs2_czech_ci ucs2_polish_ci
+DROP PROCEDURE p1|
DROP FUNCTION f1|
CREATE FUNCTION f(f1 VARCHAR(64) COLLATE ucs2_unicode_ci)
RETURNS VARCHAR(64) CHARACTER SET ucs2
=== modified file 'mysql-test/r/sp.result'
--- a/mysql-test/r/sp.result 2009-04-01 09:28:23 +0000
+++ b/mysql-test/r/sp.result 2009-04-30 10:14:32 +0000
@@ -6927,6 +6927,21 @@ select name from mysql.proc where name =
name
p
drop procedure p;
+CREATE DEFINER = 'root'@'localhost' PROCEDURE p1()
+NOT DETERMINISTIC
+CONTAINS SQL
+SQL SECURITY DEFINER
+COMMENT ''
+BEGIN
+SHOW TABLE STATUS like 't1';
+END;//
+CREATE TABLE t1 (f1 INT);
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
=== modified file 'mysql-test/r/type_time.result'
--- a/mysql-test/r/type_time.result 2007-07-18 12:56:29 +0000
+++ b/mysql-test/r/type_time.result 2009-04-14 19:17:53 +0000
@@ -85,6 +85,7 @@ sec_to_time(time_to_sec(t))
13:00:00
09:00:00
drop table t1;
+End of 4.1 tests
select cast('100:55:50' as time) < cast('24:00:00' as time);
cast('100:55:50' as time) < cast('24:00:00' as time)
0
@@ -128,3 +129,27 @@ SELECT sum(f3) FROM t1 where f2='2007-07
sum(f3)
3
drop table t1;
+CREATE TABLE t1 (f1 TIME);
+INSERT INTO t1 VALUES ('24:00:00');
+SELECT '24:00:00' = (SELECT f1 FROM t1);
+'24:00:00' = (SELECT f1 FROM t1)
+1
+SELECT CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1)
+1
+SELECT CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1)
+0
+TRUNCATE t1;
+INSERT INTO t1 VALUES ('-24:00:00');
+SELECT CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1)
+0
+SELECT CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1)
+1
+SELECT '-24:00:00' = (SELECT f1 FROM t1);
+'-24:00:00' = (SELECT f1 FROM t1)
+1
+DROP TABLE t1;
+End of 5.0 tests
=== modified file 'mysql-test/r/upgrade.result'
--- a/mysql-test/r/upgrade.result 2007-09-10 22:10:37 +0000
+++ b/mysql-test/r/upgrade.result 2009-04-30 12:46:49 +0000
@@ -57,6 +57,18 @@ s1
1
drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`;
+#
+# Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
+#
+# copy table created using mysql4.0 into the data dir
+# check the table created using mysql 4.0
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
+# query the table created using mysql 4.0
+SELECT * FROM t1;
+c1 c2 c3
+DROP TABLE t1;
truncate t1;
drop table t1;
drop database if exists `tabc`;
@@ -84,3 +96,23 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin2
drop database `a-b-c`;
drop database `tabc`;
+use `#mysql50#a-b-c`;
+create table t1(f1 char(10));
+show databases like '%a-b-c%';
+Database (%a-b-c%)
+#mysql50#a-b-c
+ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;
+show databases like '%a-b-c%';
+Database (%a-b-c%)
+a-b-c
+show create view `a-b-c`.v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `a`.`f1` AS `f1` from (`a-b-c`.`t1` `a` join `information_schema`.`tables` `b`) where (convert(`a`.`f1` using utf8) = `b`.`TABLE_NAME`) utf8 utf8_general_ci
+Warnings:
+Note 1600 Creation context of view `a-b-c`.`v1' is invalid
+select * from `a-b-c`.v1;
+f1
+Warnings:
+Note 1600 Creation context of view `a-b-c`.`v1' is invalid
+drop database `a-b-c`;
+use test;
=== modified file 'mysql-test/r/varbinary.result'
--- a/mysql-test/r/varbinary.result 2008-08-16 05:15:49 +0000
+++ b/mysql-test/r/varbinary.result 2009-04-28 18:48:38 +0000
@@ -38,7 +38,7 @@ length(a) length(b)
255 3
CHECK TABLE t1 FOR UPGRADE;
Table Op Msg_type Msg_text
-test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" to fix it!
+test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
=== modified file 'mysql-test/r/variables-notembedded.result'
--- a/mysql-test/r/variables-notembedded.result 2008-12-15 12:41:31 +0000
+++ b/mysql-test/r/variables-notembedded.result 2009-04-14 11:24:22 +0000
@@ -11,7 +11,7 @@ Variable_name Value
slave_load_tmpdir SLAVE_LOAD_TMPDIR
show variables like 'slave_skip_errors';
Variable_name Value
-slave_skip_errors 3,100,137,643,1752
+slave_skip_errors 0,3,100,137,643,1752
---- Clean Up ----
set global slave_net_timeout=default;
set global sql_slave_skip_counter= 0;
@@ -98,12 +98,12 @@ ERROR HY000: Variable 'slave_load_tmpdir
#
SHOW VARIABLES like 'slave_skip_errors';
Variable_name Value
-slave_skip_errors 3,100,137,643,1752
+slave_skip_errors 0,3,100,137,643,1752
SELECT @@session.slave_skip_errors;
ERROR HY000: Variable 'slave_skip_errors' is a GLOBAL variable
SELECT @@global.slave_skip_errors;
@@global.slave_skip_errors
-3,100,137,643,1752
+0,3,100,137,643,1752
SET @@session.slave_skip_errors= 7;
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
SET @@global.slave_skip_errors= 7;
=== added file 'mysql-test/std_data/bug37631.MYD'
=== added file 'mysql-test/std_data/bug37631.MYI'
Files a/mysql-test/std_data/bug37631.MYI 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug37631.MYI 2009-04-30 12:46:49 +0000 differ
=== added file 'mysql-test/std_data/bug37631.frm'
Files a/mysql-test/std_data/bug37631.frm 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug37631.frm 2009-04-30 12:46:49 +0000 differ
=== added file 'mysql-test/suite/bugs/r/rpl_bug38205.result'
--- a/mysql-test/suite/bugs/r/rpl_bug38205.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/r/rpl_bug38205.result 2009-04-09 13:05:41 +0000
@@ -0,0 +1,56 @@
+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 t1i(n int primary key) engine=innodb;
+create table t2m(n int primary key) engine=myisam;
+begin;
+insert into t1i values (1);
+insert into t1i values (2);
+insert into t1i values (3);
+commit;
+begin;
+insert into t1i values (5);
+begin;
+insert into t1i values (4);
+insert into t2m values (1);
+update t1i set n = 5 where n = 4;
+commit;
+zero
+0
+*** kill sql thread ***
+rollback;
+*** sql thread is *not* running: No ***
+*** the prove: the killed slave has not finished the current transaction ***
+three
+3
+one
+1
+zero
+0
+delete from t2m;
+start slave sql_thread;
+delete from t1i;
+delete from t2m;
+begin;
+insert into t1i values (5);
+begin;
+insert into t1i values (4);
+update t1i set n = 5 where n = 4;
+commit;
+zero
+0
+stop slave sql_thread;
+rollback;
+*** sql thread is *not* running: No ***
+*** the prove: the stopped slave has rolled back the current transaction ***
+zero
+0
+zero
+0
+one
+1
+start slave sql_thread;
+drop table t1i, t2m;
=== added file 'mysql-test/suite/bugs/t/rpl_bug38205.test'
--- a/mysql-test/suite/bugs/t/rpl_bug38205.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/t/rpl_bug38205.test 2009-04-09 13:05:41 +0000
@@ -0,0 +1,166 @@
+#
+# Bug #38205 Row-based Replication (RBR) causes inconsistencies: HA_ERR_FOUND_DUPP_KEY
+# Bug#319 if while a non-transactional slave is replicating a transaction possible problem
+#
+# Verifying the fact that STOP SLAVE in the middle of a group execution waits
+# for the end of the group before the slave sql thread will stop.
+# The patch refines STOP SLAVE to not interrupt a transaction or other type of
+# the replication events group (the part I).
+# Killing the sql thread continues to provide a "hard" stop (the part II).
+#
+# Non-deterministic tests
+#
+
+source include/master-slave.inc;
+source include/have_innodb.inc;
+
+
+#
+# Part II, killed sql slave leaves instantly
+#
+
+# A. multi-statement transaction as the replication group
+
+connection master;
+
+create table t1i(n int primary key) engine=innodb;
+create table t2m(n int primary key) engine=myisam;
+
+sync_slave_with_master;
+
+connection master;
+
+begin;
+insert into t1i values (1);
+insert into t1i values (2);
+insert into t1i values (3);
+commit;
+
+sync_slave_with_master;
+
+#
+# todo: first challenge is to find out the SQL thread id
+# the following is not fully reliable
+#
+
+let $id=`SELECT id from information_schema.processlist where user like 'system user' and state like '%Has read all relay log%' or user like 'system user' and state like '%Reading event from the relay log%'`;
+connection slave;
+begin;
+insert into t1i values (5);
+
+connection master;
+let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+begin;
+insert into t1i values (4);
+insert into t2m values (1); # non-ta update
+update t1i set n = 5 where n = 4; # to block at. can't be played with killed
+commit;
+let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+# slave sql thread must be locked out by the conn `slave' explicit lock
+let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval select $pos0_master - $pos0_slave as zero;
+--enable_query_log
+
+connection slave1;
+
+let $count= 1;
+let $table= t2m;
+source include/wait_until_rows_count.inc;
+#
+# todo: may fail as said above
+#
+--echo *** kill sql thread ***
+--disable_query_log
+eval kill connection $id;
+--enable_query_log
+
+connection slave;
+rollback; # release the sql thread
+
+connection slave1;
+
+source include/wait_for_slave_sql_to_stop.inc;
+let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
+--echo *** sql thread is *not* running: $sql_status ***
+let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+
+connection slave;
+--echo *** the prove: the killed slave has not finished the current transaction ***
+
+--disable_query_log
+select count(*) as three from t1i;
+eval select $pos1_master > $pos1_slave as one;
+eval select $pos1_slave - $pos0_slave as zero;
+--enable_query_log
+
+delete from t2m; # remove the row to be able to replay
+start slave sql_thread;
+
+#
+# Part I: B The homogenous transaction remains interuptable in between
+#
+
+connection master;
+delete from t1i;
+delete from t2m;
+
+sync_slave_with_master;
+begin;
+insert into t1i values (5);
+
+connection master;
+let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+begin;
+insert into t1i values (4);
+update t1i set n = 5 where n = 4; # to block at. not to be played
+commit;
+let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+
+connection slave1;
+# slave sql can't advance as must be locked by the conn `slave' trans
+let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval select $pos0_master - $pos0_slave as zero;
+--enable_query_log
+
+#
+# the replicated trans is blocked by the slave's local.
+# However, it's not easy to catch the exact moment when it happens.
+# The test issues sleep which makes the test either non-deterministic or
+# wasting too much time.
+#
+--sleep 3
+
+send stop slave sql_thread;
+
+connection slave;
+rollback; # release the sql thread
+
+connection slave1;
+reap;
+source include/wait_for_slave_sql_to_stop.inc;
+let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
+--echo *** sql thread is *not* running: $sql_status ***
+
+let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+
+--echo *** the prove: the stopped slave has rolled back the current transaction ***
+
+--disable_query_log
+select count(*) as zero from t1i;
+eval select $pos0_master - $pos0_slave as zero;
+eval select $pos1_master > $pos0_slave as one;
+--enable_query_log
+
+start slave sql_thread;
+
+# clean-up
+
+connection master;
+drop table t1i, t2m;
+
+sync_slave_with_master;
=== modified file 'mysql-test/suite/funcs_2/charset/charset_master.test'
--- a/mysql-test/suite/funcs_2/charset/charset_master.test 2008-07-23 08:52:08 +0000
+++ b/mysql-test/suite/funcs_2/charset/charset_master.test 2009-04-24 17:02:40 +0000
@@ -86,6 +86,15 @@ let $check_std_csets= 1;
let $check_ucs2_csets= 1;
let $check_utf8_csets= 1;
+# Bug#32784: Timeout in test "innodb_charset": InnoDB much slower
+# than other handlers
+# NOTE: We turn autocommit off to improve the performance of the innodb variant
+# of this test. Per Innobase's recommendation.
+
+--disable_query_log
+SET autocommit=0;
+--enable_query_log
+
#
# Check all charsets/collation combinations
#
=== added directory 'mysql-test/suite/ibmdb2i'
=== added directory 'mysql-test/suite/ibmdb2i/include'
=== added file 'mysql-test/suite/ibmdb2i/include/have_i61.inc'
--- a/mysql-test/suite/ibmdb2i/include/have_i61.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/include/have_i61.inc 2009-04-14 11:02:55 +0000
@@ -0,0 +1,20 @@
+# Check for IBM i 6.1 or later
+--disable_query_log
+system uname -rv > $MYSQLTEST_VARDIR/tmp/version;
+--disable_warnings
+drop table if exists uname_vr;
+--enable_warnings
+create temporary table uname_vr (r int, v int);
+--disable_warnings
+eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/version" into table uname_vr fields terminated by ' ';
+--enable_warnings
+let $ok = `select count(*) from uname_vr where v > 5`;
+drop table uname_vr;
+remove_file $MYSQLTEST_VARDIR/tmp/version;
+--enable_query_log
+if (!$ok)
+{
+ skip "Need IBM i 6.1 or later";
+}
+
+
=== added file 'mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc'
--- a/mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/include/have_ibmdb2i.inc 2009-04-14 11:02:55 +0000
@@ -0,0 +1,6 @@
+if (!`SELECT count(*) FROM information_schema.engines WHERE
+ (support = 'YES' OR support = 'DEFAULT') AND
+ engine = 'ibmdb2i'`)
+{
+ skip Need ibmdb2i engine;
+}
=== added directory 'mysql-test/suite/ibmdb2i/r'
=== added file 'mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result'
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44020.result 2009-04-14 11:02:55 +0000
@@ -0,0 +1,11 @@
+create schema `A12345_@$#`;
+create table `A12345_@$#`.t1 (i int) engine=ibmdb2i;
+show create table `A12345_@$#`.t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `i` int(11) DEFAULT NULL
+) ENGINE=IBMDB2I DEFAULT CHARSET=latin1
+select * from `A12345_@$#`.t1;
+i
+drop table `A12345_@$#`.t1;
+drop schema `A12345_@$#`;
=== added file 'mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result'
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44025.result 2009-04-14 11:02:55 +0000
@@ -0,0 +1,4 @@
+create table t1 (c char(10) collate utf8_swedish_ci, index(c)) engine=ibmdb2i;
+drop table t1;
+create table t1 (c char(10) collate ucs2_swedish_ci, index(c)) engine=ibmdb2i;
+drop table t1;
=== added directory 'mysql-test/suite/ibmdb2i/t'
=== added file 'mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test'
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44020.test 2009-04-14 11:02:55 +0000
@@ -0,0 +1,9 @@
+source suite/ibmdb2i/include/have_ibmdb2i.inc;
+source include/have_case_sensitive_file_system.inc;
+
+create schema `A12345_@$#`;
+create table `A12345_@$#`.t1 (i int) engine=ibmdb2i;
+show create table `A12345_@$#`.t1;
+select * from `A12345_@$#`.t1;
+drop table `A12345_@$#`.t1;
+drop schema `A12345_@$#`;
=== added file 'mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test'
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44025.test 2009-04-14 11:02:55 +0000
@@ -0,0 +1,9 @@
+source suite/ibmdb2i/include/have_ibmdb2i.inc;
+source suite/ibmdb2i/include/have_i61.inc;
+
+
+create table t1 (c char(10) collate utf8_swedish_ci, index(c)) engine=ibmdb2i;
+drop table t1;
+
+create table t1 (c char(10) collate ucs2_swedish_ci, index(c)) engine=ibmdb2i;
+drop table t1;
=== modified file 'mysql-test/suite/rpl/include/rpl_mixed_ddl.inc'
--- a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc 2007-09-04 18:08:56 +0000
+++ b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc 2009-04-28 22:19:38 +0000
@@ -83,4 +83,4 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
+--diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
=== added file 'mysql-test/suite/rpl/r/rpl_bug38694.result'
--- a/mysql-test/suite/rpl/r/rpl_bug38694.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_bug38694.result 2009-04-30 13:20:38 +0000
@@ -0,0 +1,6 @@
+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;
=== modified file 'mysql-test/suite/rpl/r/rpl_idempotency.result'
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result 2008-11-13 19:19:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result 2009-04-05 12:03:04 +0000
@@ -141,9 +141,9 @@ select * from ti1 order by b /* must be
b
2
3
-*** slave must stop
+*** slave must stop (Trying to delete a referenced foreing key)
Last_SQL_Error
-0
+1451
select * from ti1 order by b /* must be (1),(2),(3) - not deleted */;
b
1
@@ -159,7 +159,7 @@ set global slave_exec_mode='STRICT';
*** conspire future problem
delete from ti1 where b=3;
insert into ti2 set a=3, b=3 /* offending write event */;
-*** slave must stop
+*** slave must stop (Trying to insert an invalid foreign key)
Last_SQL_Error
1452
select * from ti2 order by b /* must be (2,2) */;
@@ -179,7 +179,7 @@ a b
*** conspiring query
insert into ti1 set b=1;
insert into ti1 set b=1 /* offending write event */;
-*** slave must stop
+*** slave must stop (Trying to insert a dupliacte key)
Last_SQL_Error
1062
set foreign_key_checks= 0;
@@ -195,32 +195,32 @@ INSERT INTO t2 VALUES (-1),(-2),(-3);
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
DELETE FROM t1 WHERE a = -2;
-*** slave must stop
+*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
DELETE FROM t2 WHERE a = -2;
-*** slave must stop
+*** slave must stop (Key was not found)
Last_SQL_Error
-0
+1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
UPDATE t1 SET a = 1 WHERE a = -1;
-*** slave must stop
+*** slave must stop (Key was not found)
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
set global slave_exec_mode='STRICT';
UPDATE t2 SET a = 1 WHERE a = -1;
-*** slave must stop
+*** slave must stop (Key was not found)
Last_SQL_Error
-0
+1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
=== added file 'mysql-test/suite/rpl/r/rpl_killed_ddl.result'
--- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result 2009-04-08 23:42:51 +0000
@@ -0,0 +1,169 @@
+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;
+DROP DATABASE IF EXISTS d1;
+DROP DATABASE IF EXISTS d2;
+DROP DATABASE IF EXISTS d3;
+DROP DATABASE IF EXISTS d4;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e2;
+DROP EVENT IF EXISTS e3;
+DROP EVENT IF EXISTS e4;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+DROP SERVER IF EXISTS s1;
+DROP SERVER IF EXISTS s2;
+DROP SERVER IF EXISTS s3;
+DROP SERVER IF EXISTS s4;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+DROP TRIGGER IF EXISTS tr1;
+DROP TRIGGER IF EXISTS tr2;
+DROP TRIGGER IF EXISTS tr3;
+DROP TRIGGER IF EXISTS tr4;
+CREATE DATABASE d1;
+CREATE EVENT e1
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
+DO INSERT INTO test.t1 VALUES (1);
+CREATE FUNCTION f1 () RETURNS INT DETERMINISTIC
+RETURN 1;
+CREATE PROCEDURE p1 (OUT rows INT)
+BEGIN
+SELECT COUNT(*) INTO rows FROM t1;
+END;
+//
+CREATE SERVER s1
+FOREIGN DATA WRAPPER mysql
+OPTIONS (USER 'user1', HOST '192.168.1.106', DATABASE 'test');
+CREATE TABLE t1 (a int);
+CREATE TABLE t3 (a int);
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+FOR EACH ROW BEGIN
+DELETE FROM t4 WHERE a=NEW.a;
+END;
+//
+CREATE INDEX i1 ON t1 (a);
+CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
+[on master]
+[on master1]
+CREATE DATABASE d2;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP DATABASE d1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP DATABASE d2;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+CREATE EVENT e2
+ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
+DO INSERT INTO test.t1 VALUES (2);
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP EVENT e1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP EVENT IF EXISTS e2;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
+RETURN 1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+ALTER FUNCTION f1 SQL SECURITY INVOKER;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP FUNCTION f1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+CREATE PROCEDURE p2 (OUT rows INT)
+BEGIN
+SELECT COUNT(*) INTO rows FROM t2;
+END;
+//
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP PROCEDURE p1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+CREATE TABLE t2 (b int);
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+ALTER TABLE t1 ADD (d int);
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+RENAME TABLE t3 TO t4;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+CREATE INDEX i2 on t1 (a);
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP INDEX i1 on t1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+CREATE TRIGGER tr2 BEFORE INSERT ON t4
+FOR EACH ROW BEGIN
+DELETE FROM t1 WHERE a=NEW.a;
+END;
+//
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP TRIGGER tr1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP TRIGGER IF EXISTS tr2;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP VIEW v1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP VIEW IF EXISTS v2;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP TABLE t1;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP TABLE IF EXISTS t2;
+source include/kill_query.inc;
+source include/diff_master_slave.inc;
+DROP DATABASE IF EXISTS d1;
+DROP DATABASE IF EXISTS d2;
+DROP DATABASE IF EXISTS d3;
+DROP DATABASE IF EXISTS d4;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e2;
+DROP EVENT IF EXISTS e3;
+DROP EVENT IF EXISTS e4;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+DROP SERVER IF EXISTS s1;
+DROP SERVER IF EXISTS s2;
+DROP SERVER IF EXISTS s3;
+DROP SERVER IF EXISTS s4;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
=== renamed file 'mysql-test/r/rpl_name_const.result' => 'mysql-test/suite/rpl/r/rpl_name_const.result'
=== modified file 'mysql-test/suite/rpl/r/rpl_skip_error.result'
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result 2009-04-03 18:32:34 +0000
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result 2009-04-08 21:11:14 +0000
@@ -76,19 +76,16 @@ Master_Server_Id 1
drop table t1;
create table t1(a int primary key);
insert into t1 values (1),(2);
-delete from t1 where @@server_id=1;
-Warnings:
-Note 1592 Statement is not safe to log in statement format.
+SET SQL_LOG_BIN=0;
+delete from t1;
+SET SQL_LOG_BIN=1;
set sql_mode=strict_trans_tables;
-insert into t1 values (7), (8), (9);
+insert into t1 values (1), (2), (3);
[on slave]
select * from t1;
a
1
2
-7
-8
-9
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
@@ -132,3 +129,66 @@ Replicate_Ignore_Server_Ids
Master_Server_Id 1
==== Clean Up ====
drop table t1;
+==== Using Innodb ====
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `data` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SET SQL_LOG_BIN=1;
+CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `data` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(1, 1);
+INSERT INTO t1 VALUES(2, 1);
+INSERT INTO t1 VALUES(3, 1);
+INSERT INTO t1 VALUES(4, 1);
+SET SQL_LOG_BIN=0;
+DELETE FROM t1 WHERE id = 4;
+SET SQL_LOG_BIN=1;
+UPDATE t1 SET id= id + 3, data = 2;
+
+**** We cannot execute a select as there are differences in the
+**** behavior between STMT and RBR.
+==== Using MyIsam ====
+SET SQL_LOG_BIN=0;
+CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `data` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SET SQL_LOG_BIN=1;
+CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `data` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t2 VALUES(1, 1);
+INSERT INTO t2 VALUES(2, 1);
+INSERT INTO t2 VALUES(3, 1);
+INSERT INTO t2 VALUES(5, 1);
+SET SQL_LOG_BIN=0;
+DELETE FROM t2 WHERE id = 5;
+SET SQL_LOG_BIN=1;
+UPDATE t2 SET id= id + 3, data = 2;
+
+**** We cannot execute a select as there are differences in the
+**** behavior between STMT and RBR.
+==== Clean Up ====
+DROP TABLE t1;
+DROP TABLE t2;
=== modified file 'mysql-test/suite/rpl/r/rpl_start_stop_slave.result'
--- a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result 2007-12-06 15:27:10 +0000
+++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result 2009-04-09 13:05:41 +0000
@@ -10,3 +10,31 @@ start slave;
stop slave io_thread;
start slave io_thread;
drop table t1;
+create table t1i(n int primary key) engine=innodb;
+create table t2m(n int primary key) engine=myisam;
+begin;
+insert into t1i values (1);
+insert into t1i values (2);
+insert into t1i values (3);
+commit;
+begin;
+insert into t1i values (5);
+begin;
+insert into t1i values (4);
+insert into t2m values (1);
+insert into t1i values (5);
+commit;
+zero
+0
+stop slave;
+rollback;
+*** sql thread is *not* running: No ***
+*** the prove: the stopped slave has finished the current transaction ***
+five
+5
+zero
+0
+one
+1
+include/start_slave.inc
+drop table t1i, t2m;
=== modified file 'mysql-test/suite/rpl/r/rpl_sync.result'
--- a/mysql-test/suite/rpl/r/rpl_sync.result 2009-03-16 11:56:39 +0000
+++ b/mysql-test/suite/rpl/r/rpl_sync.result 2009-04-28 11:58:45 +0000
@@ -17,7 +17,6 @@ insert into t1(a) values(5);
insert into t1(a) values(6);
=====Removing relay log files and crashing/recoverying the slave=======;
stop slave IO_THREAD;
-failure
SET SESSION debug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
ERROR HY000: Lost connection to MySQL server during query
=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def 2009-04-29 19:26:03 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def 2009-05-07 20:48:24 +0000
@@ -12,11 +12,10 @@
rpl_extraColmaster_innodb : BUG#41097 2008-12-12 sven result files for rpl_extraColmaster_myisam, rpl_extraColmaster_innodb are gone
rpl_extraColmaster_myisam : BUG#41097 2008-12-12 sven result files for rpl_extraColmaster_myisam, rpl_extraColmaster_innodb are gone
-rpl_binlog_corruption : BUG#41793 2008-12-30 sven rpl_binlog_corruption disabled in main (needs new mtr)
-rpl_temp_table_mix_row : BUG#43440 2009-03-23 joro rpl.rpl_temp_table_mix_row fails sporadicly
rpl_cross_version : BUG#42311 2009-03-27 joro rpl_cross_version fails on macosx
rpl_extraCol_falcon : Bug#40930 2008-11-21 johnemb rpl.rpl_extraCol_falcon fails doing STOP SLAVE (on Windows PB2)
rpl_cross_version : Bug#42311 2009-01-23 aelkin
rpl_heartbeat_basic : Bug#43828 Sporadic failures (Serge.Kozlov@stripped)
+rpl_heartbeat_2slaves : Bug#43828 Sporadic failrues (Serge.Kozlov@stripped)
rpl_failed_optimize : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table).
rpl_read_only : WL#4284: Setting Read only won't succeed until all metadata locks are released.
=== removed file 'mysql-test/suite/rpl/t/rpl_000015-slave.sh'
--- a/mysql-test/suite/rpl/t/rpl_000015-slave.sh 2008-06-22 20:05:19 +0000
+++ b/mysql-test/suite/rpl/t/rpl_000015-slave.sh 1970-01-01 00:00:00 +0000
@@ -1 +0,0 @@
-rm -f $MYSQLTEST_VARDIR/slave-data/master.info
=== modified file 'mysql-test/suite/rpl/t/rpl_binlog_corruption.test'
--- a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test 2008-12-29 16:04:10 +0000
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test 2009-04-15 11:43:17 +0000
@@ -34,6 +34,7 @@ source include/setup_fake_relay_log.inc;
--echo ==== Test ====
START SLAVE SQL_THREAD;
+let $slave_sql_errno= 1594; # ER_SLAVE_RELAY_LOG_READ_FAILURE
source include/wait_for_slave_sql_error.inc;
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $error
=== added file 'mysql-test/suite/rpl/t/rpl_bug38694-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_bug38694-slave.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_bug38694-slave.opt 2009-04-30 13:20:38 +0000
@@ -0,0 +1 @@
+--loose-debug=d,simulate_slave_delay_at_terminate_bug38694
=== added file 'mysql-test/suite/rpl/t/rpl_bug38694.test'
--- a/mysql-test/suite/rpl/t/rpl_bug38694.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_bug38694.test 2009-04-30 13:20:38 +0000
@@ -0,0 +1,10 @@
+# Testing replication threads stopping concurrency issue
+# at the server shutdown
+# Related bugs: bug#38694, bug#29968, bug#25306
+# The test checks if a delay at the termination phase of slave threads
+# DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5););
+# could cause any issue.
+
+source include/master-slave.inc;
+
+# End of tests
=== modified file 'mysql-test/suite/rpl/t/rpl_idempotency.test'
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test 2008-11-13 19:19:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test 2009-04-05 12:03:04 +0000
@@ -208,7 +208,7 @@ select * from ti1 order by b /* must be
# foreign key: row is referenced
---echo *** slave must stop
+--echo *** slave must stop (Trying to delete a referenced foreing key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
@@ -242,7 +242,7 @@ delete from ti1 where b=3;
connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
---echo *** slave must stop
+--echo *** slave must stop (Trying to insert an invalid foreign key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
@@ -281,7 +281,7 @@ insert into ti1 set b=1;
connection master;
insert into ti1 set b=1 /* offending write event */;
---echo *** slave must stop
+--echo *** slave must stop (Trying to insert a dupliacte key)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
@@ -316,7 +316,7 @@ DELETE FROM t2 WHERE a = -2;
connection master;
DELETE FROM t1 WHERE a = -2;
---echo *** slave must stop
+--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
@@ -333,8 +333,8 @@ sync_slave_with_master;
set global slave_exec_mode='STRICT';
connection master;
-DELETE FROM t2 WHERE a = -2;
---echo *** slave must stop
+DELETE FROM t2 WHERE a = -2;
+--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
@@ -356,7 +356,7 @@ UPDATE t2 SET a = 1 WHERE a = -1;
connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
---echo *** slave must stop
+--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
@@ -376,7 +376,7 @@ set global slave_exec_mode='STRICT';
connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
---echo *** slave must stop
+--echo *** slave must stop (Key was not found)
connection slave;
source include/wait_for_slave_sql_to_stop.inc;
=== added file 'mysql-test/suite/rpl/t/rpl_killed_ddl-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl-master.opt 2009-04-08 23:42:51 +0000
@@ -0,0 +1 @@
+--debug=d,debug_lock_before_query_log_event
=== added file 'mysql-test/suite/rpl/t/rpl_killed_ddl.test'
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test 2009-04-08 23:42:51 +0000
@@ -0,0 +1,352 @@
+# ==== Purpose ====
+#
+# This test check if DDL statements are correctly binlogged when the
+# thread is killed
+#
+# ==== Method ====
+#
+# Start a DDL query and kill it, check if the error code of the binlog
+# event is correct.
+#
+# DDL statements tested:
+# CREATE/ALTER/RENAME/DROP DATABASE
+# CREATE/ALTER/DROP EVENT
+# CREATE/ALTER/DROP FUNCTION
+# CREATE/ALTER/DROP PROCEDURE
+# CREATE/ALTER/DROP SERVER
+# CREATE/ALTER/RENAME/DROP TABLE
+# CREATE/DROP TRIGGER
+# CREATE/ALTER/DROP VIEW
+#
+# ==== Bugs =====
+#
+# BUG#37145
+#
+# ==== TODO ====
+#
+# There are some part of the test are temporarily disabled because of
+# the following bugs, please enable then once they get fixed:
+# - BUG#44041
+# - BUG#43353
+# - BUG#25705
+# - BUG#44171
+
+source include/have_debug.inc;
+source include/master-slave.inc;
+
+# Use the DBUG_SYNC_POINT to make sure the thread running the DDL is
+# waiting before creating the query log event
+
+let $debug_lock= "debug_lock.before_query_log_event";
+
+######## INITIALIZATION ########
+
+disable_warnings;
+DROP DATABASE IF EXISTS d1;
+DROP DATABASE IF EXISTS d2;
+DROP DATABASE IF EXISTS d3;
+DROP DATABASE IF EXISTS d4;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e2;
+DROP EVENT IF EXISTS e3;
+DROP EVENT IF EXISTS e4;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+DROP SERVER IF EXISTS s1;
+DROP SERVER IF EXISTS s2;
+DROP SERVER IF EXISTS s3;
+DROP SERVER IF EXISTS s4;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+DROP TRIGGER IF EXISTS tr1;
+DROP TRIGGER IF EXISTS tr2;
+DROP TRIGGER IF EXISTS tr3;
+DROP TRIGGER IF EXISTS tr4;
+enable_warnings;
+
+CREATE DATABASE d1;
+
+CREATE EVENT e1
+ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
+ DO INSERT INTO test.t1 VALUES (1);
+
+CREATE FUNCTION f1 () RETURNS INT DETERMINISTIC
+ RETURN 1;
+
+DELIMITER //;
+CREATE PROCEDURE p1 (OUT rows INT)
+ BEGIN
+ SELECT COUNT(*) INTO rows FROM t1;
+ END;
+ //
+DELIMITER ;//
+
+CREATE SERVER s1
+FOREIGN DATA WRAPPER mysql
+OPTIONS (USER 'user1', HOST '192.168.1.106', DATABASE 'test');
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t3 (a int);
+
+DELIMITER //;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1
+ FOR EACH ROW BEGIN
+ DELETE FROM t4 WHERE a=NEW.a;
+ END;
+ //
+DELIMITER ;//
+
+CREATE INDEX i1 ON t1 (a);
+
+CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
+
+sync_slave_with_master;
+
+connection master1;
+let $connection_name= master1;
+let $connection_id= `SELECT CONNECTION_ID()`;
+
+connection master;
+echo [on master];
+
+# This will block the execution of a statement at the DBUG_SYNC_POINT
+# with given lock name
+if (`SELECT '$debug_lock' != ''`)
+{
+ disable_query_log;
+ disable_result_log;
+ eval SELECT IS_FREE_LOCK($debug_lock);
+ eval SELECT GET_LOCK($debug_lock, 10);
+ eval SELECT IS_FREE_LOCK($debug_lock);
+ enable_query_log;
+ enable_result_log;
+}
+
+######## START TEST ########
+
+connection master1;
+echo [on master1];
+
+disable_warnings;
+
+######## DATABASE ########
+
+let $diff_statement= SHOW DATABASES LIKE 'd%';
+
+send CREATE DATABASE d2;
+source include/kill_query_and_diff_master_slave.inc;
+
+# Temporarily disabled, see BUG#44041, the ALTER DATABASE can affect the
+# collation of other database on slave
+#send ALTER DATABASE d1
+# DEFAULT CHARACTER SET = 'utf8';
+#source include/kill_query_and_diff_master_slave.inc;
+
+send DROP DATABASE d1;
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP DATABASE d2;
+source include/kill_query_and_diff_master_slave.inc;
+
+######## EVENT ########
+
+let $diff_statement= SELECT event_name, event_body, execute_at
+ FROM information_schema.events where event_name like 'e%';
+
+send CREATE EVENT e2
+ ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
+ DO INSERT INTO test.t1 VALUES (2);
+source include/kill_query_and_diff_master_slave.inc;
+
+# Temporarily disabled because of BUG#44171, killing ALTER EVENT can
+# crash the server
+#send ALTER EVENT e1
+# ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 DAY;
+#source include/kill_query_and_diff_master_slave.inc;
+
+send DROP EVENT e1;
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP EVENT IF EXISTS e2;
+source include/kill_query_and_diff_master_slave.inc;
+
+######## FUNCTION ########
+
+let $diff_statement= SHOW FUNCTION STATUS LIKE 'f%';
+
+send CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
+ RETURN 1;
+source include/kill_query_and_diff_master_slave.inc;
+
+send ALTER FUNCTION f1 SQL SECURITY INVOKER;
+source include/kill_query_and_diff_master_slave.inc;
+
+# function f1 probably does not exist because the ALTER query was
+# killed
+send DROP FUNCTION f1;
+source include/kill_query_and_diff_master_slave.inc;
+
+# function f2 probably does not exist because the CREATE query was
+# killed
+#
+# Temporarily disabled. Because of BUG#43353, KILL the query may
+# result in function not found, and for 5.1, DROP statements will be
+# logged if the function is not found on master, so the following DROP
+# FUNCTION statement may be interrupted and not drop the function on
+# master, but still get logged and executed on slave and cause
+# inconsistence. Also disable the following DROP PROCEDURE IF EXITS
+# below.
+#send DROP FUNCTION IF EXISTS f2;
+#source include/kill_query_and_diff_master_slave.inc;
+
+######## PROCEDURE ########
+
+let $diff_statement= SHOW PROCEDURE STATUS LIKE 'p%';
+
+DELIMITER //;
+send CREATE PROCEDURE p2 (OUT rows INT)
+ BEGIN
+ SELECT COUNT(*) INTO rows FROM t2;
+ END;
+ //
+DELIMITER ;//
+source include/kill_query_and_diff_master_slave.inc;
+
+send ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP PROCEDURE p1;
+source include/kill_query_and_diff_master_slave.inc;
+
+# Temporarily disabled, see comment above for DROP FUNCTION IF EXISTS
+#send DROP PROCEDURE IF EXISTS p2;
+#source include/kill_query_and_diff_master_slave.inc;
+
+######## TABLE ########
+
+let $diff_statement= SHOW TABLES LIKE 't%';
+
+send CREATE TABLE t2 (b int);
+source include/kill_query_and_diff_master_slave.inc;
+
+send ALTER TABLE t1 ADD (d int);
+source include/kill_query_and_diff_master_slave.inc;
+
+send RENAME TABLE t3 TO t4;
+source include/kill_query_and_diff_master_slave.inc;
+
+######## INDEX ########
+
+let $diff_statement= SHOW INDEX FROM t1;
+
+send CREATE INDEX i2 on t1 (a);
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP INDEX i1 on t1;
+source include/kill_query_and_diff_master_slave.inc;
+
+
+######## SERVER ########
+
+# Tempoarily disabled, see bug#25705
+
+# let $diff_statement= SELECT * FROM mysql.server WHERE name like 's%';
+
+# send CREATE SERVER s2
+# FOREIGN DATA WRAPPER mysql
+# OPTIONS (USER 'user2', HOST '192.168.1.108', DATABASE 'test');
+# source include/kill_query_and_diff_master_slave.inc;
+
+# send ALTER SERVER s1
+# OPTIONS (DATABASE 'test1');
+# source include/kill_query_and_diff_master_slave.inc;
+
+# send DROP SERVER s1;
+# source include/kill_query_and_diff_master_slave.inc;
+
+# send DROP SERVER IF EXIST s1;
+# source include/kill_query_and_diff_master_slave.inc;
+
+######## TRIGGER ########
+
+let $diff_statement= SHOW TRIGGERS LIKE 'v%';
+
+DELIMITER //;
+send CREATE TRIGGER tr2 BEFORE INSERT ON t4
+ FOR EACH ROW BEGIN
+ DELETE FROM t1 WHERE a=NEW.a;
+ END;
+ //
+DELIMITER ;//
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP TRIGGER tr1;
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP TRIGGER IF EXISTS tr2;
+source include/kill_query_and_diff_master_slave.inc;
+
+######## VIEW ########
+
+let $diff_statement= SHOW TABLES LIKE 'v%';
+
+send CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP VIEW v1;
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP VIEW IF EXISTS v2;
+source include/kill_query_and_diff_master_slave.inc;
+
+######## DROP TABLE ########
+
+let $diff_statement= SHOW TABLES LIKE 't%';
+
+send DROP TABLE t1;
+source include/kill_query_and_diff_master_slave.inc;
+
+send DROP TABLE IF EXISTS t2;
+source include/kill_query_and_diff_master_slave.inc;
+
+######## CLEAN UP ########
+
+connection master;
+
+# The DROP statements above are killed during the process, so they
+# does not make sure the objects are dropped.
+
+disable_warnings;
+DROP DATABASE IF EXISTS d1;
+DROP DATABASE IF EXISTS d2;
+DROP DATABASE IF EXISTS d3;
+DROP DATABASE IF EXISTS d4;
+DROP EVENT IF EXISTS e1;
+DROP EVENT IF EXISTS e2;
+DROP EVENT IF EXISTS e3;
+DROP EVENT IF EXISTS e4;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+DROP SERVER IF EXISTS s1;
+DROP SERVER IF EXISTS s2;
+DROP SERVER IF EXISTS s3;
+DROP SERVER IF EXISTS s4;
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+DROP TABLE IF EXISTS t3;
+DROP TABLE IF EXISTS t4;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+enable_warnings;
=== renamed file 'mysql-test/t/rpl_name_const.test' => 'mysql-test/suite/rpl/t/rpl_name_const.test'
=== modified file 'mysql-test/suite/rpl/t/rpl_skip_error.test'
--- a/mysql-test/suite/rpl/t/rpl_skip_error.test 2008-03-14 16:52:57 +0000
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test 2009-04-08 21:11:14 +0000
@@ -8,18 +8,23 @@
# ==== Method ====
#
# We run the slave with --slave-skip-errors=1062 (the code for
-# duplicate key). On slave, we insert value 1 in a table, and then,
-# on master, we insert value 1 in the table. The error should be
-# ignored on slave.
-#
+# duplicate key). Then we have two set of tests. In the first
+# set, we insert value 1 in a table on the slave, and then, on
+# master, we insert value 1 in the table. In the second set, we
+# insert several values on the master, disable the binlog and
+# delete one of the values and re-enable the binlog. Right after,
+# we perform an update on the set of values in order to generate
+# a duplicate key on the slave. The errors should be ignored on
+# the slave.
+#
# ==== Related bugs ====
#
# BUG#28839: Errors in strict mode silently stop SQL thread if --slave-skip-errors exists
-# bug in this test: BUG#30594: rpl.rpl_skip_error is nondeterministic
+# bug in this test: BUG#30594: rpl.rpl_skip_error is nondeterministic:
+# BUG#39393: slave-skip-errors does not work when using ROW based replication
source include/master-slave.inc;
-source include/have_binlog_format_statement.inc;
-
+source include/have_innodb.inc;
--echo ==== Test Without sql_mode=strict_trans_tables ====
@@ -64,9 +69,11 @@ sync_slave_with_master;
connection master;
create table t1(a int primary key);
insert into t1 values (1),(2);
-delete from t1 where @@server_id=1;
+SET SQL_LOG_BIN=0;
+delete from t1;
+SET SQL_LOG_BIN=1;
set sql_mode=strict_trans_tables;
-insert into t1 values (7), (8), (9);
+insert into t1 values (1), (2), (3);
--echo [on slave]
sync_slave_with_master;
@@ -80,3 +87,83 @@ connection master;
drop table t1;
sync_slave_with_master;
# End of 5.0 tests
+
+#
+# BUG#39393: slave-skip-errors does not work when using ROW based replication
+#
+--echo ==== Using Innodb ====
+
+connection master;
+
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
+SHOW CREATE TABLE t1;
+SET SQL_LOG_BIN=1;
+
+connection slave;
+
+CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
+SHOW CREATE TABLE t1;
+
+connection master;
+
+INSERT INTO t1 VALUES(1, 1);
+INSERT INTO t1 VALUES(2, 1);
+INSERT INTO t1 VALUES(3, 1);
+INSERT INTO t1 VALUES(4, 1);
+
+SET SQL_LOG_BIN=0;
+DELETE FROM t1 WHERE id = 4;
+SET SQL_LOG_BIN=1;
+UPDATE t1 SET id= id + 3, data = 2;
+
+sync_slave_with_master;
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+echo $error;
+
+--echo **** We cannot execute a select as there are differences in the
+--echo **** behavior between STMT and RBR.
+
+--echo ==== Using MyIsam ====
+
+connection master;
+
+SET SQL_LOG_BIN=0;
+CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
+SHOW CREATE TABLE t2;
+SET SQL_LOG_BIN=1;
+
+connection slave;
+
+CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
+SHOW CREATE TABLE t2;
+
+connection master;
+
+INSERT INTO t2 VALUES(1, 1);
+INSERT INTO t2 VALUES(2, 1);
+INSERT INTO t2 VALUES(3, 1);
+INSERT INTO t2 VALUES(5, 1);
+
+SET SQL_LOG_BIN=0;
+DELETE FROM t2 WHERE id = 5;
+SET SQL_LOG_BIN=1;
+UPDATE t2 SET id= id + 3, data = 2;
+
+sync_slave_with_master;
+
+let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+echo $error;
+
+--echo **** We cannot execute a select as there are differences in the
+--echo **** behavior between STMT and RBR.
+
+--echo ==== Clean Up ====
+
+connection master;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+sync_slave_with_master;
=== added file 'mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave-slave.opt 2009-03-26 08:25:06 +0000
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=60
=== modified file 'mysql-test/suite/rpl/t/rpl_start_stop_slave.test'
--- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test 2008-12-12 13:06:40 +0000
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test 2009-04-21 09:48:03 +0000
@@ -1,4 +1,5 @@
source include/master-slave.inc;
+source include/have_innodb.inc;
#
# Bug#6148 ()
@@ -33,4 +34,88 @@ connection master;
drop table t1;
sync_slave_with_master;
-# End of 4.1 tests
+
+#
+# Bug#38205 Row-based Replication (RBR) causes inconsistencies...
+# Bug#319 if while a non-transactional slave is replicating a transaction...
+#
+# Verifying that STOP SLAVE does not interrupt excution of a group
+# execution of events if the group can not roll back.
+# Killing the sql thread continues to provide a "hard" stop (the
+# part II, moved to the bugs suite as it's hard to make it
+# deterministic with KILL).
+#
+
+#
+# Part I. The being stopped sql thread finishes first the current group of
+# events if the group contains an event on a non-transaction table.
+
+connection master;
+create table t1i(n int primary key) engine=innodb;
+create table t2m(n int primary key) engine=myisam;
+begin;
+insert into t1i values (1);
+insert into t1i values (2);
+insert into t1i values (3);
+commit;
+
+sync_slave_with_master;
+connection slave;
+begin;
+insert into t1i values (5);
+
+connection master;
+let $pos0_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+begin;
+insert into t1i values (4);
+insert into t2m values (1); # non-ta update to process
+insert into t1i values (5); # to block at. to be played with stopped
+commit;
+
+connection slave;
+# slave sql thread must be locked out by the conn `slave' explicit lock
+let $pos0_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+--disable_query_log
+eval select $pos0_master - $pos0_slave as zero;
+--enable_query_log
+
+connection slave1;
+let $count= 1;
+let $table= t2m;
+source include/wait_until_rows_count.inc;
+send stop slave;
+
+connection slave;
+rollback; # release the sql thread
+
+connection slave1;
+reap;
+source include/wait_for_slave_to_stop.inc;
+let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
+--echo *** sql thread is *not* running: $sql_status ***
+
+
+connection master;
+let $pos1_master= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+connection slave;
+
+let $pos1_slave= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
+
+--echo *** the prove: the stopped slave has finished the current transaction ***
+
+--disable_query_log
+select count(*) as five from t1i;
+eval select $pos1_master - $pos1_slave as zero;
+eval select $pos1_slave > $pos0_slave as one;
+--enable_query_log
+
+source include/start_slave.inc;
+
+# clean-up
+connection master;
+drop table t1i, t2m;
+
+sync_slave_with_master;
+
+# End of tests
=== modified file 'mysql-test/suite/rpl/t/rpl_sync.test'
--- a/mysql-test/suite/rpl/t/rpl_sync.test 2009-03-16 11:56:39 +0000
+++ b/mysql-test/suite/rpl/t/rpl_sync.test 2009-04-28 11:58:45 +0000
@@ -66,7 +66,6 @@ source include/wait_for_slave_io_to_stop
let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
--exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file
---exec cat $MYSQLD_SLAVE_DATADIR/$file
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
SET SESSION debug="d,crash_before_rotate_relaylog";
@@ -106,6 +105,22 @@ connection slave;
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
--exec cat $MYSQLD_SLAVE_DATADIR/master.backup > $MYSQLD_SLAVE_DATADIR/master.info
+let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
+
+--perl
+use strict;
+use warnings;
+my $src= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.backup";
+my $dst= "$ENV{'MYSQLD_SLAVE_DATADIR'}/master.info";
+open(FILE, "<", $src) or die;
+my @content= <FILE>;
+close FILE;
+open(FILE, ">", $dst) or die;
+binmode FILE;
+print FILE @content;
+close FILE;
+EOF
+
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
SET SESSION debug="d,crash_before_rotate_relaylog";
--error 2013
=== modified file 'mysql-test/t/count_distinct3.test'
--- a/mysql-test/t/count_distinct3.test 2006-10-03 07:03:35 +0000
+++ b/mysql-test/t/count_distinct3.test 2009-04-16 17:47:44 +0000
@@ -1,4 +1,4 @@
-#
+# Bug #958 a big table without indices and select with group by doesnt work
# this is a test for error 1032 in count(distinct) + group by, introduced in
# mysql-4.1
#
@@ -21,27 +21,16 @@ while ($1)
INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev);
dec $1;
}
-set @@read_buffer_size=2*1024*1024;
-CREATE TABLE t2 SELECT * FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-DROP TABLE t2;
+
+# We increase the size of t1 here.
+SET @orig_myisam_sort_buffer_size = @@session.myisam_sort_buffer_size;
+SET session myisam_sort_buffer_size=20000000;
+INSERT INTO t1
+SELECT A.id, A.grp, A.id_rev
+FROM
+ t1 A,
+ (SELECT * FROM t1 B LIMIT 100) B,
+ (SELECT * FROM t1 Z LIMIT 42) Z;
--enable_query_log
SELECT COUNT(*) FROM t1;
@@ -49,12 +38,12 @@ SELECT COUNT(*) FROM t1;
# As t1 contains random numbers, results are different from test to test.
# That's okay, because we test only that select doesn't yield an
# error. Note, that --disable_result_log doesn't suppress error output.
-
--disable_result_log
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
--enable_result_log
-DROP TABLE t1;
-set @@read_buffer_size=default;
+--echo # Begin cleanup
+SET session myisam_sort_buffer_size = @orig_myisam_sort_buffer_size;
+DROP TABLE t1;
# End of 4.1 tests
=== modified file 'mysql-test/t/fulltext.test'
--- a/mysql-test/t/fulltext.test 2009-04-01 21:36:07 +0000
+++ b/mysql-test/t/fulltext.test 2009-04-30 14:57:39 +0000
@@ -464,6 +464,14 @@ SELECT GROUP_CONCAT(a) AS st FROM t1 HAV
DROP TABLE t1;
#
+# BUG#42907 - Multi-term boolean fulltext query containing a single
+# quote fails in 5.1.x
+CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a));
+INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd');
+SELECT * FROM t1 WHERE MATCH(a) AGAINST('+awrd bwrd* +cwrd*' IN BOOLEAN MODE);
+DROP TABLE t1;
+
+#
# bug#34374 - mysql generates incorrect warning
#
create table t1(a text,b date,fulltext index(a))engine=myisam;
=== modified file 'mysql-test/t/func_des_encrypt.test'
--- a/mysql-test/t/func_des_encrypt.test 2007-12-07 14:35:28 +0000
+++ b/mysql-test/t/func_des_encrypt.test 2009-04-17 20:14:25 +0000
@@ -9,3 +9,31 @@
select des_encrypt('hello');
# End of 4.1 tests
+
+--echo #
+--echo # Bug #11643: des_encrypt() causes server to die
+--echo #
+
+CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
+
+INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
+
+UPDATE t1 SET des=DES_ENCRYPT('1234');
+
+SELECT LENGTH(des) FROM t1;
+SELECT DES_DECRYPT(des) FROM t1;
+
+SELECT
+ LENGTH(DES_ENCRYPT('1234')),
+ LENGTH(DES_ENCRYPT('12345')),
+ LENGTH(DES_ENCRYPT('123456')),
+ LENGTH(DES_ENCRYPT('1234567'));
+SELECT
+ DES_DECRYPT(DES_ENCRYPT('1234')),
+ DES_DECRYPT(DES_ENCRYPT('12345')),
+ DES_DECRYPT(DES_ENCRYPT('123456')),
+ DES_DECRYPT(DES_ENCRYPT('1234567'));
+
+DROP TABLE t1;
+
+--Echo End of 5.0 tests
=== modified file 'mysql-test/t/func_encrypt.test'
--- a/mysql-test/t/func_encrypt.test 2007-12-07 14:35:28 +0000
+++ b/mysql-test/t/func_encrypt.test 2009-04-27 10:07:08 +0000
@@ -88,3 +88,18 @@ select hex(des_decrypt(des_encrypt("hell
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
# End of 4.1 tests
+
+#
+# Bug#44365 valgrind warnings with encrypt() function
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (f1 smallint(6) default null, f2 mediumtext character set utf8)
+engine=myisam default charset=latin1;
+insert into t1 values (null,'contraction\'s');
+insert into t1 values (-15818,'requirement\'s');
+--disable_result_log
+select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
+--enable_result_log
+drop table t1;
=== modified file 'mysql-test/t/func_sapdb.test'
--- a/mysql-test/t/func_sapdb.test 2009-02-07 15:50:31 +0000
+++ b/mysql-test/t/func_sapdb.test 2009-04-14 19:17:53 +0000
@@ -169,4 +169,26 @@ SELECT TIMEDIFF(TIME('17:00:00'),TIME('1
TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
+#
+# Bug#42661 - sec_to_time() and signedness
+#
+
+SELECT sec_to_time(3020399)=TIME('838:59:59');
+SELECT sec_to_time(-3020399)=TIME('-838:59:59');
+SELECT sec_to_time(-3020399)='-838:59:59';
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:59');
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:58');
+
+#
+# Bug#42662 - maketime() and signedness
+#
+
+# TIME(...) and CAST(... AS TIME) go through the same code-path here,
+# but we'll explicitly show show that both work in case the ever changes.
+SELECT maketime(-1,0,1)='-01:00:01';
+SELECT TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME);
+SELECT maketime(-1,0,1)=CAST('-01:00:01' AS TIME);
+SELECT maketime(1,0,1)=CAST('01:00:01' AS TIME);
+SELECT maketime(1,0,1)=CAST('01:00:02' AS TIME);
+
# End of 5.0 tests
=== modified file 'mysql-test/t/func_set.test'
--- a/mysql-test/t/func_set.test 2007-11-23 12:30:06 +0000
+++ b/mysql-test/t/func_set.test 2009-04-23 07:50:34 +0000
@@ -72,3 +72,15 @@ SELECT INTERVAL(0.0, CAST(DATE(NULL) AS
CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL));
--echo End of 5.0 tests
+
+#
+# Bug#44367 valgrind warnings with find_in_set() functions
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (f1 set('test1','test2','test3') character set utf8 default null)
+engine=myisam default charset=latin1;
+insert into t1 values (''),(null),(null),(''),(''),('');
+select find_in_set(f1,f1) as a from t1,(select find_in_set(f1,f1) as b from t1) a;
+drop table t1;
=== modified file 'mysql-test/t/func_str.test'
--- a/mysql-test/t/func_str.test 2009-02-13 16:20:56 +0000
+++ b/mysql-test/t/func_str.test 2009-04-23 07:43:42 +0000
@@ -1283,3 +1283,15 @@ SELECT DATE_FORMAT(c, GET_FORMAT(DATE, '
DROP TABLE t1;
--echo End of 5.0 tests
+
+#
+# Bug#44358 valgrind errors with decode() function
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1(f1 tinyint default null)engine=myisam;
+insert into t1 values (-1),(null);
+explain select 1 as a from t1,(select decode(f1,f1) as b from t1) a;
+explain select 1 as a from t1,(select encode(f1,f1) as b from t1) a;
+drop table t1;
=== modified file 'mysql-test/t/gis-rtree.test'
--- a/mysql-test/t/gis-rtree.test 2007-10-05 10:43:15 +0000
+++ b/mysql-test/t/gis-rtree.test 2009-04-29 02:59:10 +0000
@@ -41,7 +41,7 @@ while ($1)
let $2=10;
while ($2)
{
- eval INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))));
+ eval INSERT INTO t2 (g) VALUES (LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10)));
dec $2;
}
dec $1;
@@ -61,7 +61,7 @@ while ($1)
let $2=10;
while ($2)
{
- eval DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10)))));
+ eval DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))));
SELECT count(*) FROM t2;
dec $2;
}
@@ -235,11 +235,11 @@ DROP TABLE t1;
# Bug #21888: Query on GEOMETRY field using PointFromWKB() results in lost connection
#
CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1)));
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0)));
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1)));
-INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0)));
-SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
+INSERT INTO t1 (foo) VALUES (POINT(1,1));
+INSERT INTO t1 (foo) VALUES (POINT(1,0));
+INSERT INTO t1 (foo) VALUES (POINT(0,1));
+INSERT INTO t1 (foo) VALUES (POINT(0,0));
+SELECT 1 FROM t1 WHERE foo != POINT(0,0);
DROP TABLE t1;
#
@@ -802,35 +802,35 @@ DROP TABLE t1;
#
create table t1 (a geometry not null, spatial index(a));
-insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072)));
-insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284)));
-insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0)));
-insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53)));
-insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111)));
-insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241)));
-insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111)));
-insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251)));
-insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231)));
-insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260)));
-insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236)));
-insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125)));
-insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275)));
-insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29)));
-insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86)));
-insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270)));
-insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19)));
-insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255)));
-insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130)));
-insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39)));
-insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159)));
-insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270)));
-insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82)));
-insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34)));
-insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53)));
-insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183)));
-insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192)));
-insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159)));
-insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178)));
+insert into t1 values (POINT(1.1517219314031e+164, 131072));
+insert into t1 values (POINT(9.1248812352444e+192, 2.9740338169556e+284));
+insert into t1 values (POINT(4.7783097267365e-299, -0));
+insert into t1 values (POINT(1.49166814624e-154, 2.0880974297595e-53));
+insert into t1 values (POINT(4.0917382598702e+149, 1.2024538023802e+111));
+insert into t1 values (POINT(2.0349165139404e+236, 2.9993936277913e-241));
+insert into t1 values (POINT(2.5243548967072e-29, 1.2024538023802e+111));
+insert into t1 values (POINT(0, 6.9835074892995e-251));
+insert into t1 values (POINT(2.0880974297595e-53, 3.1050361846014e+231));
+insert into t1 values (POINT(2.8728483499323e-188, 2.4600631144627e+260));
+insert into t1 values (POINT(3.0517578125e-05, 2.0349165139404e+236));
+insert into t1 values (POINT(1.1517219314031e+164, 1.1818212630766e-125));
+insert into t1 values (POINT(2.481040258324e-265, 5.7766220027675e-275));
+insert into t1 values (POINT(2.0880974297595e-53, 2.5243548967072e-29));
+insert into t1 values (POINT(5.7766220027675e-275, 9.9464647281957e+86));
+insert into t1 values (POINT(2.2181357552967e+130, 3.7857669957337e-270));
+insert into t1 values (POINT(4.5767114681874e-246, 3.6893488147419e+19));
+insert into t1 values (POINT(4.5767114681874e-246, 3.7537584144024e+255));
+insert into t1 values (POINT(3.7857669957337e-270, 1.8033161362863e-130));
+insert into t1 values (POINT(0, 5.8774717541114e-39));
+insert into t1 values (POINT(1.1517219314031e+164, 2.2761049594727e-159));
+insert into t1 values (POINT(6.243497100632e+144, 3.7857669957337e-270));
+insert into t1 values (POINT(3.7857669957337e-270, 2.6355494858076e-82));
+insert into t1 values (POINT(2.0349165139404e+236, 3.8518598887745e-34));
+insert into t1 values (POINT(4.6566128730774e-10, 2.0880974297595e-53));
+insert into t1 values (POINT(2.0880974297595e-53, 1.8827498946116e-183));
+insert into t1 values (POINT(1.8033161362863e-130, 9.1248812352444e+192));
+insert into t1 values (POINT(4.7783097267365e-299, 2.2761049594727e-159));
+insert into t1 values (POINT(1.94906280228e+289, 1.2338789709327e-178));
drop table t1;
# End of 4.1 tests
=== modified file 'mysql-test/t/gis.test'
--- a/mysql-test/t/gis.test 2009-02-16 10:30:55 +0000
+++ b/mysql-test/t/gis.test 2009-04-29 03:50:14 +0000
@@ -37,32 +37,32 @@ INSERT INTO gis_point VALUES
INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
-(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+(107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));
INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
-(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+(110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))));
INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
-(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+(113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));
INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
-(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+(116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));
INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
-(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+(119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));
INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
-(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+(121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))));
INSERT into gis_geometry SELECT * FROM gis_point;
INSERT into gis_geometry SELECT * FROM gis_line;
=== modified file 'mysql-test/t/insert.test'
--- a/mysql-test/t/insert.test 2009-02-13 16:30:54 +0000
+++ b/mysql-test/t/insert.test 2009-04-09 09:51:50 +0000
@@ -482,5 +482,14 @@ SELECT * FROM t2;
DROP TABLE t1, t2;
+#
+# Bug#43833 Simple INSERT crashes the server
+#
+CREATE TABLE t1(f1 FLOAT);
+INSERT INTO t1 VALUES (1.23);
+CREATE TABLE t2(f1 CHAR(1));
+INSERT INTO t2 SELECT f1 FROM t1;
+DROP TABLE t1, t2;
+
--echo End of 5.0 tests.
=== modified file 'mysql-test/t/merge.test'
--- a/mysql-test/t/merge.test 2009-04-01 21:36:07 +0000
+++ b/mysql-test/t/merge.test 2009-04-22 10:02:28 +0000
@@ -1376,6 +1376,27 @@ insert into m1 (col1) values (1);
insert into m1 (col1) values (1);
drop table m1, t1;
+
+#
+#Bug #44040 MySQL allows creating a MERGE table upon VIEWs but crashes
+#when using it
+#
+
+CREATE TABLE t1 (
+ col1 INT(10)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+CREATE VIEW v1 as SELECT * FROM t1;
+CREATE TABLE m1 (
+ col1 INT(10)
+)ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(v1);
+
+--echo #Select should detect that the child table is a view and fail.
+--error ER_WRONG_MRG_TABLE
+SELECT * FROM m1;
+
+DROP VIEW v1;
+DROP TABLE m1, t1;
--echo End of 5.1 tests
--echo #
=== modified file 'mysql-test/t/myisam.test'
--- a/mysql-test/t/myisam.test 2009-02-13 16:30:54 +0000
+++ b/mysql-test/t/myisam.test 2009-04-30 10:27:29 +0000
@@ -1515,4 +1515,30 @@ checksum table t2;
CREATE TABLE t3 select * from t1;
checksum table t3;
drop table t1,t2,t3;
+
+#
+# Bug#43737: Select query return bad result
+#
+CREATE TABLE t1 (
+ c INT,
+ d bit(1),
+ e INT,
+ f VARCHAR(1),
+ g BIT(1),
+ h BIT(1),
+ KEY (h, d, e, g)
+);
+INSERT INTO t1 VALUES
+ ( 3, 1, 1, 'a', 0, 0 ),
+ ( 3, 1, 5, 'a', 0, 0 ),
+ ( 10, 1, 2, 'a', 0, 1 ),
+ ( 10, 1, 3, 'a', 0, 1 ),
+ ( 10, 1, 4, 'a', 0, 1 );
+
+SELECT f FROM t1 WHERE d = 1 AND e = 2 AND g = 0 AND h = 1;
+
+SELECT h+0, d + 0, e, g + 0 FROM t1;
+
+DROP TABLE t1;
+
--echo End of 5.1 tests
=== added file 'mysql-test/t/myisam_debug.test'
--- a/mysql-test/t/myisam_debug.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/myisam_debug.test 2009-05-04 09:05:16 +0000
@@ -0,0 +1,57 @@
+--source include/have_debug.inc
+
+# We disable this test in embedded mode because of BUG#43733
+--source include/not_embedded.inc
+
+--echo #
+--echo # BUG#40827 - Killing insert-select to MyISAM can cause table corruption
+--echo #
+
+CONNECT (insertConn, localhost, root,,);
+
+CREATE TABLE `t1` (
+`id` BIGINT(20) ,
+`id1` BIGINT(20) AUTO_INCREMENT,
+ KEY(id1), KEY(id)
+) ENGINE=MyISAM;
+
+CREATE TABLE `t2` (
+`id` BIGINT(20) ,
+`id1` BIGINT(20) AUTO_INCREMENT,
+ KEY (id1), KEY(id)
+) ENGINE=MyISAM;
+
+INSERT INTO t2 (id) VALUES (123);
+
+let $i = 10;
+while ($i)
+{
+ INSERT INTO t2 (id) SELECT id FROM t2;
+ dec $i;
+}
+
+--echo # Switch to insert Connection
+CONNECTION insertConn;
+SET SESSION debug='+d,wait_in_enable_indexes';
+--echo # Send insert data
+SEND INSERT INTO t1(id) SELECT id FROM t2;
+
+--echo # Switch to default Connection
+CONNECTION default;
+--echo # Wait for insert data to reach the debug point
+
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE STATE = "wait_in_enable_indexes" AND
+ INFO = "INSERT INTO t1(id) SELECT id FROM t2";
+--source include/wait_condition.inc
+
+SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE STATE = 'wait_in_enable_indexes' AND
+INFO = "INSERT INTO t1(id) SELECT id FROM t2"
+INTO @thread_id;
+
+KILL QUERY @thread_id;
+CHECK TABLE t1;
+DROP TABLE t1,t2;
+DISCONNECT insertConn;
=== modified file 'mysql-test/t/mysqldump.test'
--- a/mysql-test/t/mysqldump.test 2009-04-01 21:36:07 +0000
+++ b/mysql-test/t/mysqldump.test 2009-04-21 10:32:28 +0000
@@ -1647,9 +1647,6 @@ DROP TABLE t1,t2;
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
--exec $MYSQL_DUMP test
-# We reset concurrent_inserts value to whatever it was at the start of the test
-SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
-
--echo #
--echo # Bug #42635: mysqldump includes views that were excluded using
--echo # the --ignore-table option
@@ -1681,7 +1678,6 @@ CREATE TABLE `כדשגכחךלדגכחש
DROP TABLE `כדשגכחךלדגכחש
--echo #
--echo # End of 5.0 tests
--echo #
@@ -1954,6 +1950,7 @@ DROP DATABASE mysqldump_test_db;
--echo
# We reset concurrent_inserts value to whatever it was at the start of the test
+# This line must be executed _after_ all test cases.
SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
=== modified file 'mysql-test/t/not_embedded_server.test'
--- a/mysql-test/t/not_embedded_server.test 2009-03-18 12:49:07 +0000
+++ b/mysql-test/t/not_embedded_server.test 2009-04-30 10:33:07 +0000
@@ -30,6 +30,12 @@
#execute stmt1;
#deallocate prepare stmt1;
+#
+# Bug#43835: SHOW VARIABLES does not include 0 for slave_skip_errors
+#
+
+SHOW VARIABLES like 'slave_skip_errors';
+
# End of 5.1 tests
--echo #
=== modified file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test 2008-07-21 03:01:19 +0000
+++ b/mysql-test/t/parser.test 2009-04-17 20:33:59 +0000
@@ -764,3 +764,6 @@ BACKUP DATABASE *, test to 'broken.bak';
--error ER_PARSE_ERROR
BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
+--echo #
+--echo # End of 5.1 tests
+--echo #
=== added file 'mysql-test/t/parser_not_embedded.test'
--- a/mysql-test/t/parser_not_embedded.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/parser_not_embedded.test 2009-04-17 20:00:53 +0000
@@ -0,0 +1,26 @@
+--source include/not_embedded.inc
+
+###########################################################################
+--echo #
+--echo # Bug#39559: dump of stored procedures / functions with C-style
+--echo # comment can't be read back
+--echo #
+
+--write_file $MYSQLTEST_VARDIR/tmp/bug39559.sql
+select 2 as expected, /*!01000/**/*/ 2 as result;
+select 1 as expected, /*!99998/**/*/ 1 as result;
+select 3 as expected, /*!01000 1 + */ 2 as result;
+select 2 as expected, /*!99990 1 + */ 2 as result;
+select 7 as expected, /*!01000 1 + /* 8 + */ 2 + */ 4 as result;
+select 8 as expected, /*!99998 1 + /* 2 + */ 4 + */ 8 as result;
+select 7 as expected, /*!01000 1 + /*!01000 8 + */ 2 + */ 4 as result;
+select 7 as expected, /*!01000 1 + /*!99998 8 + */ 2 + */ 4 as result;
+select 4 as expected, /*!99998 1 + /*!99998 8 + */ 2 + */ 4 as result;
+select 4 as expected, /*!99998 1 + /*!01000 8 + */ 2 + */ 4 as result;
+select 7 as expected, /*!01000 1 + /*!01000 8 + /*!01000 error */ 16 + */ 2 + */ 4 as result;
+select 4 as expected, /* 1 + /*!01000 8 + */ 2 + */ 4;
+EOF
+
+--exec $MYSQL --comment --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/bug39559.sql
+
=== modified file 'mysql-test/t/partition_mgm.test'
--- a/mysql-test/t/partition_mgm.test 2009-02-04 13:08:05 +0000
+++ b/mysql-test/t/partition_mgm.test 2009-04-17 20:33:59 +0000
@@ -72,13 +72,14 @@ drop table t1;
#
# Verification tests for bug#14326
#
---error ER_PARSE_ERROR
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
/* Test
of multi-line
comment */
PARTITIONS 5 */;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
-- with a single line comment embedded
=== modified file 'mysql-test/t/plugin_notembedded.test'
--- a/mysql-test/t/plugin_notembedded.test 2009-04-16 15:17:31 +0000
+++ b/mysql-test/t/plugin_notembedded.test 2009-04-29 09:55:27 +0000
@@ -4,7 +4,8 @@
--error 1193
SELECT @@global.example_enum_var = 'e2';
-INSTALL PLUGIN example SONAME 'ha_example.so';
+--replace_regex /\.dll/.so/
+eval INSTALL PLUGIN example SONAME $HA_EXAMPLE_SO;
SELECT @@global.example_enum_var = 'e2';
=== modified file 'mysql-test/t/shm.test'
--- a/mysql-test/t/shm.test 2009-03-26 23:17:27 +0000
+++ b/mysql-test/t/shm.test 2009-05-06 12:54:50 +0000
@@ -29,8 +29,10 @@ SET @net_buffer_length= @@global.net_buf
SET GLOBAL max_allowed_packet= 1024;
SET GLOBAL net_buffer_length= 1024;
---error 1
---exec echo SELECT '$stmt'| $MYSQL --protocol=memory --shared-memory-base-name=$name 2>&1
+--echo # The following test is disabled until Bug#41860
+--echo # "Without Windows named pipe" is fixed
+#--error 1
+#--exec echo SELECT '$stmt'| $MYSQL --protocol=memory --shared-memory-base-name=$name 2>&1
SET GLOBAL max_allowed_packet= @max_allowed_packet;
SET GLOBAL net_buffer_length= @net_buffer_length;
=== modified file 'mysql-test/t/sp-ucs2.test'
--- a/mysql-test/t/sp-ucs2.test 2009-04-06 12:56:41 +0000
+++ b/mysql-test/t/sp-ucs2.test 2009-04-08 10:34:06 +0000
@@ -106,7 +106,7 @@ BEGIN
END|
-SELECT f1();
+SELECT f1()|
DROP PROCEDURE p1|
DROP FUNCTION f1|
=== modified file 'mysql-test/t/sp.test'
--- a/mysql-test/t/sp.test 2009-04-01 09:28:23 +0000
+++ b/mysql-test/t/sp.test 2009-04-30 10:14:32 +0000
@@ -8255,6 +8255,33 @@ select replace(@full_mode, 'ALLOW_INVALI
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
drop procedure p;
+#
+# Bug#43962 "Packets out of order" calling a SHOW TABLE STATUS
+#
+DELIMITER //;
+CREATE DEFINER = 'root'@'localhost' PROCEDURE p1()
+NOT DETERMINISTIC
+CONTAINS SQL
+SQL SECURITY DEFINER
+COMMENT ''
+BEGIN
+ SHOW TABLE STATUS like 't1';
+END;//
+DELIMITER ;//
+
+
+CREATE TABLE t1 (f1 INT);
+--disable_result_log
+let $tab_count= 4;
+while ($tab_count)
+{
+ EVAL CALL p1();
+ dec $tab_count ;
+}
+--enable_result_log
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
=== modified file 'mysql-test/t/sp_trans_log.test'
--- a/mysql-test/t/sp_trans_log.test 2008-06-10 22:27:52 +0000
+++ b/mysql-test/t/sp_trans_log.test 2009-04-28 18:48:38 +0000
@@ -8,17 +8,17 @@
delimiter |;
#
-# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
-# Bug #23333 stored function + non-transac table + transac table =
-# breaks stmt-based binlog
-# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
+# Bug#13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
+# Bug#23333 stored function + non-transac table + transac table =
+# breaks stmt-based binlog
+# Bug#27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
#
--disable_warnings
drop function if exists bug23333|
drop table if exists t1,t2|
--enable_warnings
- CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
- CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
+CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
+CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
insert into t2 values (1,1)|
=== modified file 'mysql-test/t/type_time.test'
--- a/mysql-test/t/type_time.test 2007-07-15 17:51:36 +0000
+++ b/mysql-test/t/type_time.test 2009-02-09 18:37:45 +0000
@@ -39,7 +39,7 @@ drop table t1;
# SELECT CAST(0.2359591234567e+30 AS TIME);
# ##########################################################
-# End of 4.1 tests
+--echo End of 4.1 tests
#
# Bug#29555: Comparing time values as strings may lead to a wrong result.
@@ -77,3 +77,21 @@ insert into t1 values('2007-07-02', 1);
insert into t1 values('2007-07-02', 2);
SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
drop table t1;
+
+#
+# Bug#42664 - Sign ignored for TIME types when not comparing as longlong
+#
+
+CREATE TABLE t1 (f1 TIME);
+INSERT INTO t1 VALUES ('24:00:00');
+SELECT '24:00:00' = (SELECT f1 FROM t1);
+SELECT CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1);
+SELECT CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1);
+TRUNCATE t1;
+INSERT INTO t1 VALUES ('-24:00:00');
+SELECT CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1);
+SELECT CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1);
+SELECT '-24:00:00' = (SELECT f1 FROM t1);
+DROP TABLE t1;
+
+--echo End of 5.0 tests
=== modified file 'mysql-test/t/upgrade.test'
--- a/mysql-test/t/upgrade.test 2009-03-27 12:03:30 +0000
+++ b/mysql-test/t/upgrade.test 2009-04-30 12:55:05 +0000
@@ -48,6 +48,20 @@ select * from `txu#p#p1`;
drop table `txu@0023p@0023p1`;
drop table `txu#p#p1`;
+--echo #
+--echo # Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
+--echo #
+--echo # copy table created using mysql4.0 into the data dir
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+copy_file std_data/bug37631.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/bug37631.MYD $MYSQLD_DATADIR/test/t1.MYD;
+copy_file std_data/bug37631.MYI $MYSQLD_DATADIR/test/t1.MYI;
+--echo # check the table created using mysql 4.0
+CHECK TABLE t1;
+--echo # query the table created using mysql 4.0
+SELECT * FROM t1;
+DROP TABLE t1;
+
#
# Check if old tables work
#
@@ -87,3 +101,35 @@ show create table `a-b-c`.`t1`;
drop database `a-b-c`;
drop database `tabc`;
+#
+# Bug#43385 Cannot ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME when Views exist
+#
+let $MYSQLD_DATADIR= `select @@datadir`;
+--mkdir $MYSQLD_DATADIR/a-b-c
+use `#mysql50#a-b-c`;
+create table t1(f1 char(10));
+
+--write_file $MYSQLD_DATADIR/a-b-c/v1.frm
+TYPE=VIEW
+query=select `a`.`f1` AS `f1` from `a-b-c`.`t1` `a` join `information_schema`.`tables` `b` where (convert(`a`.`f1` using utf8) = `b`.`TABLE_NAME`)
+md5=068271f1c657fe115e497856ca0fa493
+updatable=0
+algorithm=0
+definer_user=root
+definer_host=localhost
+suid=2
+with_check_option=0
+timestamp=2009-04-10 11:53:37
+create-version=1
+source=select f1 from `a-b-c`.t1 a, information_schema.tables b\nwhere a.f1 = b.table_name
+EOF
+
+show databases like '%a-b-c%';
+ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;
+show databases like '%a-b-c%';
+show create view `a-b-c`.v1;
+--disable_ps_protocol
+select * from `a-b-c`.v1;
+--enable_ps_protocol
+drop database `a-b-c`;
+use test;
=== modified file 'mysql-test/t/variables-notembedded-master.opt'
--- a/mysql-test/t/variables-notembedded-master.opt 2008-02-15 12:54:04 +0000
+++ b/mysql-test/t/variables-notembedded-master.opt 2009-04-06 11:42:33 +0000
@@ -1 +1 @@
---loose-slave-skip-errors=3,100,137,643,1752
+--loose-slave-skip-errors=3,100,137,0,643,1752
=== modified file 'mysys/mf_keycache.c'
--- a/mysys/mf_keycache.c 2009-04-16 10:14:49 +0000
+++ b/mysys/mf_keycache.c 2009-04-30 14:35:36 +0000
@@ -2084,13 +2084,15 @@ restart:
}
else
{
+ size_t block_mem_offset;
/* There are some never used blocks, take first of them */
DBUG_ASSERT(keycache->blocks_used <
(ulong) keycache->disk_blocks);
block= &keycache->block_root[keycache->blocks_used];
+ block_mem_offset=
+ ((size_t) keycache->blocks_used) * keycache->key_cache_block_size;
block->buffer= ADD_TO_PTR(keycache->block_mem,
- ((ulong) keycache->blocks_used*
- keycache->key_cache_block_size),
+ block_mem_offset,
uchar*);
keycache->blocks_used++;
DBUG_ASSERT(!block->next_used);
=== modified file 'mysys/my_init.c'
--- a/mysys/my_init.c 2009-03-11 17:17:00 +0000
+++ b/mysys/my_init.c 2009-04-09 15:29:28 +0000
@@ -142,6 +142,10 @@ void my_end(int infoflag)
*/
FILE *info_file= DBUG_FILE;
my_bool print_info= (info_file != stderr);
+
+ if (!my_init_done)
+ return;
+
/*
We do not use DBUG_ENTER here, as after cleanup DBUG is no longer
operational, so we cannot use DBUG_RETURN.
=== modified file 'scripts/mysqlhotcopy.sh'
--- a/scripts/mysqlhotcopy.sh 2008-03-07 20:45:40 +0000
+++ b/scripts/mysqlhotcopy.sh 2009-04-28 16:16:17 +0000
@@ -49,11 +49,11 @@ $0 Ver $VERSION
Usage: $0 db_name[./table_regex/] [new_db_name | directory]
- -?, --help display this helpscreen and exit
+ -?, --help display this help-screen and exit
-u, --user=# user for database login if not current user
-p, --password=# password to use when connecting to server (if not set
in my.cnf, which is recommended)
- -h, --host=# Hostname for local server when connecting over TCP/IP
+ -h, --host=# hostname for local server when connecting over TCP/IP
-P, --port=# port to use when connecting to local server with TCP/IP
-S, --socket=# socket to use when connecting to local server
@@ -86,7 +86,7 @@ sub usage {
# Do not initialize user or password options; that way, any user/password
# options specified in option files will be used. If no values are specified
-# all, the defaults will be used (login name, no password).
+# at all, the defaults will be used (login name, no password).
my %opt = (
noindices => 0,
@@ -95,7 +95,7 @@ my %opt = (
method => "cp",
flushlog => 0,
);
-Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P
+Getopt::Long::Configure(qw(no_ignore_case)); # disambiguate -p and -P
GetOptions( \%opt,
"help",
"host|h=s",
@@ -453,7 +453,7 @@ else {
printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet};
$hc_started = time; # count from time lock is granted
- # flush tables to make on-disk copy uptodate
+ # flush tables to make on-disk copy up to date
$start = time;
$dbh->do("FLUSH TABLES /*!32323 $hc_tables */");
printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet};
@@ -895,7 +895,7 @@ tables and you don't want to have all th
whole duration.
In this situation, I<if> you are happy for groups of tables to be
-backed up separately (and thus possibly not be logically consistant
+backed up separately (and thus possibly not be logically consistent
with one another) then you can run mysqlhotcopy several times on
the same database each with different db_name./table_regex/.
All but the first should use the --addtodest option so the tables
@@ -920,7 +920,7 @@ server in a mutual replication setup.
=item --regexp pattern
-Copy all databases with names matching the pattern
+Copy all databases with names matching the pattern.
=item --regexp /pattern1/./pattern2/
@@ -933,7 +933,7 @@ names begin with 'bar' from all database
=item db_name./pattern/
Copy only tables matching pattern. Shell metacharacters ( (, ), |, !,
-etc.) have to be escaped (e.g. \). For example, to select all tables
+etc.) have to be escaped (e.g., \). For example, to select all tables
in database db1 whose names begin with 'foo' or 'bar':
mysqlhotcopy --indices --method=cp db1./^\(foo\|bar\)/
@@ -947,19 +947,19 @@ that do not begin with foo nor bar:
=item -?, --help
-Display helpscreen and exit
+Display help-screen and exit.
=item -u, --user=#
-user for database login if not current user
+User for database login if not current user.
=item -p, --password=#
-password to use when connecting to the server. Note that you are strongly
+Password to use when connecting to the server. Note that you are strongly
encouraged *not* to use this option as every user would be able to see the
password in the process list. Instead use the '[mysqlhotcopy]' section in
one of the config files, normally /etc/my.cnf or your personal ~/.my.cnf.
-(See the chapter 'my.cnf Option Files' in the manual)
+(See the chapter 'my.cnf Option Files' in the manual.)
=item -h, -h, --host=#
@@ -968,12 +968,12 @@ different from 'localhost' will trigger
=item -P, --port=#
-port to use when connecting to MySQL server with TCP/IP. This is only used
+Port to use when connecting to MySQL server with TCP/IP. This is only used
when using the --host option.
=item -S, --socket=#
-UNIX domain socket to use when connecting to local server
+UNIX domain socket to use when connecting to local server.
=item --noindices
@@ -983,7 +983,7 @@ on the backup.
=item --method=#
-method for copy (only "cp" currently supported). Alpha support for
+Method for copy (only "cp" currently supported). Alpha support for
"scp" was added in November 2000. Your experience with the scp method
will vary with your ability to understand how scp works. 'man scp'
and 'man ssh' are your friends.
@@ -1000,15 +1000,15 @@ scp or rsync the files at your leisure.
=item -q, --quiet
-be silent except for errors
+Be silent except for errors.
=item --debug
-Debug messages are displayed
+Debug messages are displayed.
=item -n, --dryrun
-Display commands without actually doing them
+Display commands without actually doing them.
=back
@@ -1030,18 +1030,18 @@ to be specified on the command line:
mysqlhotcopy db newdb t1 t2 /^foo_/ : t3 /^bar_/ : +
where ":" delimits the subsets, the /^foo_/ indicates all tables
-with names begining with "foo_" and the "+" indicates all tables
+with names beginning with "foo_" and the "+" indicates all tables
not copied by the previous subsets.
-newdb is either another not existing database or a full path to a directory
-where we can create a directory 'db'
+'newdb' is either the name of the new database, or the full path name
+of the new database file. The database should not already exist.
Add option to lock each table in turn for people who don\'t need
cross-table integrity.
Add option to FLUSH STATUS just before UNLOCK TABLES.
-Add support for other copy methods (eg tar to single file?).
+Add support for other copy methods (e.g., tar to single file?).
Add support for forthcoming MySQL ``RAID'' table subdirectory layouts.
@@ -1049,26 +1049,26 @@ Add support for forthcoming MySQL ``RAID
Tim Bunce
-Martin Waite - added checkpoint, flushlog, regexp and dryrun options
+Martin Waite - Added checkpoint, flushlog, regexp and dryrun options.
Fixed cleanup of targets when hotcopy fails.
- Added --record_log_pos.
+ Added --record_log_pos.
RAID tables are now copied (don't know if this works over scp).
-Ralph Corderoy - added synonyms for commands
+Ralph Corderoy - Added synonyms for commands.
-Scott Wiersdorf - added table regex and scp support
+Scott Wiersdorf - Added table regex and scp support.
-Monty - working --noindex (copy only first 2048 bytes of index file)
- Fixes for --method=scp
+Monty - Working --noindex (copy only first 2048 bytes of index file).
+ Fixes for --method=scp.
Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again.
Emil S. Hansen - Added resetslave and resetmaster.
-Jeremy D. Zawodny - Removed depricated DBI calls. Fixed bug which
+Jeremy D. Zawodny - Removed deprecated DBI calls. Fixed bug which
resulted in nothing being copied when a regexp was specified but no
database name(s).
Martin Waite - Fix to handle database name that contains space.
-Paul DuBois - Remove end '/' from directory names
+Paul DuBois - Remove end '/' from directory names.
=== modified file 'sql/events.cc'
--- a/sql/events.cc 2009-03-17 20:07:27 +0000
+++ b/sql/events.cc 2009-04-09 06:24:18 +0000
@@ -402,6 +402,7 @@ Events::create_event(THD *thd, Event_par
if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists)))
{
Event_queue_element *new_element;
+ bool dropped= 0;
if (!(new_element= new Event_queue_element()))
ret= TRUE; // OOM
@@ -409,8 +410,9 @@ Events::create_event(THD *thd, Event_par
parse_data->name,
new_element)))
{
- db_repository->drop_event(thd, parse_data->dbname, parse_data->name,
- TRUE);
+ if (!db_repository->drop_event(thd, parse_data->dbname, parse_data->name,
+ TRUE))
+ dropped= 1;
delete new_element;
}
else
@@ -419,6 +421,12 @@ Events::create_event(THD *thd, Event_par
bool created;
if (event_queue)
event_queue->create_event(thd, new_element, &created);
+ }
+ /*
+ binlog the create event unless it's been successfully dropped
+ */
+ if (!dropped)
+ {
/* Binlog the create event. */
DBUG_ASSERT(thd->query && thd->query_length);
write_bin_log(thd, TRUE, thd->query, thd->query_length);
=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc 2009-04-01 21:36:07 +0000
+++ b/sql/item_cmpfunc.cc 2009-04-14 21:36:40 +0000
@@ -821,7 +821,8 @@ get_time_value(THD *thd, Item ***item_ar
else
{
*is_null= item->get_time(<ime);
- value= !*is_null ? (longlong) TIME_to_ulonglong_datetime(<ime) : 0;
+ value= !*is_null ? (longlong) TIME_to_ulonglong_datetime(<ime) *
+ (ltime.neg ? -1 : 1) : 0;
}
/*
Do not cache GET_USER_VAR() function as its const_item() may return TRUE
=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc 2009-04-29 19:26:03 +0000
+++ b/sql/item_func.cc 2009-05-07 20:48:24 +0000
@@ -2767,7 +2767,7 @@ longlong Item_func_find_in_set::val_int(
if ((int) (buffer->length() - find->length()) >= 0)
{
- my_wc_t wc;
+ my_wc_t wc= 0;
CHARSET_INFO *cs= cmp_collation.collation;
const char *str_begin= buffer->ptr();
const char *str_end= buffer->ptr();
=== modified file 'sql/item_geofunc.cc'
--- a/sql/item_geofunc.cc 2007-12-21 20:10:05 +0000
+++ b/sql/item_geofunc.cc 2009-04-29 03:50:14 +0000
@@ -78,10 +78,17 @@ String *Item_func_geometry_from_wkb::val
{
DBUG_ASSERT(fixed == 1);
String arg_val;
- String *wkb= args[0]->val_str(&arg_val);
+ String *wkb;
Geometry_buffer buffer;
uint32 srid= 0;
+ if (args[0]->field_type() == MYSQL_TYPE_GEOMETRY)
+ {
+ return args[0]->val_str(str);
+ }
+
+ wkb= args[0]->val_str(&arg_val);
+
if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int();
@@ -91,8 +98,8 @@ String *Item_func_geometry_from_wkb::val
str->length(0);
str->q_append(srid);
if ((null_value=
- (args[0]->null_value ||
- !Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length(), str))))
+ (args[0]->null_value ||
+ !Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length(), str))))
return 0;
return str;
}
@@ -345,14 +352,16 @@ String *Item_func_point::val_str(String
DBUG_ASSERT(fixed == 1);
double x= args[0]->val_real();
double y= args[1]->val_real();
+ uint32 srid= 0;
if ((null_value= (args[0]->null_value ||
args[1]->null_value ||
- str->realloc(1 + 4 + SIZEOF_STORED_DOUBLE*2))))
+ str->realloc(4/*SRID*/ + 1 + 4 + SIZEOF_STORED_DOUBLE*2))))
return 0;
str->set_charset(&my_charset_bin);
str->length(0);
+ str->q_append(srid);
str->q_append((char)Geometry::wkb_ndr);
str->q_append((uint32)Geometry::wkb_point);
str->q_append(x);
@@ -376,12 +385,14 @@ String *Item_func_spatial_collection::va
DBUG_ASSERT(fixed == 1);
String arg_value;
uint i;
+ uint32 srid= 0;
str->set_charset(&my_charset_bin);
str->length(0);
- if (str->reserve(1 + 4 + 4, 512))
+ if (str->reserve(4/*SRID*/ + 1 + 4 + 4, 512))
goto err;
+ str->q_append(srid);
str->q_append((char) Geometry::wkb_ndr);
str->q_append((uint32) coll_type);
str->q_append((uint32) arg_count);
@@ -399,13 +410,13 @@ String *Item_func_spatial_collection::va
In the case of GeometryCollection we don't need any checkings
for item types, so just copy them into target collection
*/
- if (str->append(res->ptr(), len, (uint32) 512))
+ if (str->append(res->ptr() + 4/*SRID*/, len - 4/*SRID*/, (uint32) 512))
goto err;
}
else
{
enum Geometry::wkbType wkb_type;
- const char *data= res->ptr() + 1;
+ const char *data= res->ptr() + 4/*SRID*/ + 1;
/*
In the case of named collection we must check that items
@@ -414,7 +425,7 @@ String *Item_func_spatial_collection::va
wkb_type= (Geometry::wkbType) uint4korr(data);
data+= 4;
- len-= 5;
+ len-= 5 + 4/*SRID*/;
if (wkb_type != item_type)
goto err;
=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc 2009-04-29 19:26:03 +0000
+++ b/sql/item_strfunc.cc 2009-05-07 20:48:24 +0000
@@ -648,17 +648,21 @@ String *Item_func_des_encrypt::val_str(S
string marking change of string length.
*/
- tail= (8-(res_length) % 8); // 1..8 marking extra length
+ tail= 8 - (res_length % 8); // 1..8 marking extra length
res_length+=tail;
+ tmp_arg.realloc(res_length);
+ tmp_arg.length(0);
+ tmp_arg.append(res->ptr(), res->length());
code= ER_OUT_OF_RESOURCES;
- if (tail && res->append(append_str, tail) || tmp_value.alloc(res_length+1))
+ if (tmp_arg.append(append_str, tail) || tmp_value.alloc(res_length+1))
goto error;
- (*res)[res_length-1]=tail; // save extra length
+ tmp_arg[res_length-1]=tail; // save extra length
+ tmp_value.realloc(res_length+1);
tmp_value.length(res_length+1);
tmp_value[0]=(char) (128 | key_number);
// Real encryption
bzero((char*) &ivec,sizeof(ivec));
- DES_ede3_cbc_encrypt((const uchar*) (res->ptr()),
+ DES_ede3_cbc_encrypt((const uchar*) (tmp_arg.ptr()),
(uchar*) (tmp_value.ptr()+1),
res_length,
&keyschedule.ks1,
@@ -1833,10 +1837,10 @@ String *Item_func_encrypt::val_str(Strin
String *salt_str=args[1]->val_str(&tmp_value);
if ((null_value= (args[1]->null_value || salt_str->length() < 2)))
return 0;
- salt_ptr= salt_str->c_ptr();
+ salt_ptr= salt_str->c_ptr_safe();
}
pthread_mutex_lock(&LOCK_crypt);
- char *tmp= crypt(res->c_ptr(),salt_ptr);
+ char *tmp= crypt(res->c_ptr_safe(),salt_ptr);
if (!tmp)
{
pthread_mutex_unlock(&LOCK_crypt);
@@ -1882,7 +1886,7 @@ String *Item_func_encode::val_str(String
null_value=0;
res=copy_if_not_alloced(str,res,res->length());
- SQL_CRYPT sql_crypt(password->ptr());
+ SQL_CRYPT sql_crypt(password->ptr(), password->length());
sql_crypt.init();
sql_crypt.encode((char*) res->ptr(),res->length());
res->set_charset(&my_charset_bin);
@@ -1911,7 +1915,7 @@ String *Item_func_decode::val_str(String
null_value=0;
res=copy_if_not_alloced(str,res,res->length());
- SQL_CRYPT sql_crypt(password->ptr());
+ SQL_CRYPT sql_crypt(password->ptr(), password->length());
sql_crypt.init();
sql_crypt.decode((char*) res->ptr(),res->length());
return res;
=== modified file 'sql/item_strfunc.h'
--- a/sql/item_strfunc.h 2009-03-17 20:26:16 +0000
+++ b/sql/item_strfunc.h 2009-04-17 20:14:25 +0000
@@ -305,13 +305,17 @@ public:
class Item_func_des_encrypt :public Item_str_func
{
- String tmp_value;
+ String tmp_value,tmp_arg;
public:
Item_func_des_encrypt(Item *a) :Item_str_func(a) {}
Item_func_des_encrypt(Item *a, Item *b): Item_str_func(a,b) {}
String *val_str(String *);
void fix_length_and_dec()
- { maybe_null=1; max_length = args[0]->max_length+8; }
+ {
+ maybe_null=1;
+ /* 9 = MAX ((8- (arg_len % 8)) + 1) */
+ max_length = args[0]->max_length + 9;
+ }
const char *func_name() const { return "des_encrypt"; }
};
@@ -322,7 +326,12 @@ public:
Item_func_des_decrypt(Item *a) :Item_str_func(a) {}
Item_func_des_decrypt(Item *a, Item *b): Item_str_func(a,b) {}
String *val_str(String *);
- void fix_length_and_dec() { maybe_null=1; max_length = args[0]->max_length; }
+ void fix_length_and_dec()
+ {
+ maybe_null=1;
+ /* 9 = MAX ((8- (arg_len % 8)) + 1) */
+ max_length = args[0]->max_length - 9;
+ }
const char *func_name() const { return "des_decrypt"; }
};
=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc 2009-03-17 20:07:27 +0000
+++ b/sql/item_timefunc.cc 2009-04-14 21:36:40 +0000
@@ -1792,7 +1792,7 @@ longlong Item_func_sec_to_time::val_int(
sec_to_time(arg_val, args[0]->unsigned_flag, <ime);
return (ltime.neg ? -1 : 1) *
- ((ltime.hour)*10000 + ltime.minute*100 + ltime.second);
+ (longlong) ((ltime.hour)*10000 + ltime.minute*100 + ltime.second);
}
@@ -2603,7 +2603,8 @@ longlong Item_time_typecast::val_int()
null_value= 1;
return 0;
}
- return ltime.hour * 10000L + ltime.minute * 100 + ltime.second;
+ return (ltime.neg ? -1 : 1) *
+ (longlong) ((ltime.hour)*10000 + ltime.minute*100 + ltime.second);
}
String *Item_time_typecast::val_str(String *str)
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2009-04-29 19:26:03 +0000
+++ b/sql/log.cc 2009-05-07 20:48:24 +0000
@@ -1707,6 +1707,7 @@ void LOGGER::cleanup_base()
{
table_log_handler->cleanup();
delete table_log_handler;
+ table_log_handler= NULL;
}
if (file_log_handler)
file_log_handler->cleanup();
@@ -1717,7 +1718,11 @@ void LOGGER::cleanup_end()
{
DBUG_ASSERT(inited == 1);
if (file_log_handler)
+ {
delete file_log_handler;
+ file_log_handler=NULL;
+ }
+ inited= 0;
}
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2009-04-29 19:26:03 +0000
+++ b/sql/log_event.cc 2009-05-07 20:48:24 +0000
@@ -279,6 +279,47 @@ static void clear_all_errors(THD *thd, R
rli->clear_error();
}
+inline int idempotent_error_code(int err_code)
+{
+ int ret= 0;
+
+ switch (err_code)
+ {
+ case 0:
+ ret= 1;
+ break;
+ /*
+ The following list of "idempotent" errors
+ means that an error from the list might happen
+ because of idempotent (more than once)
+ applying of a binlog file.
+ Notice, that binlog has a ddl operation its
+ second applying may cause
+
+ case HA_ERR_TABLE_DEF_CHANGED:
+ case HA_ERR_CANNOT_ADD_FOREIGN:
+
+ which are not included into to the list.
+
+ Note that HA_ERR_RECORD_DELETED is not in the list since
+ do_exec_row() should not return that error code.
+ */
+ case HA_ERR_RECORD_CHANGED:
+ case HA_ERR_KEY_NOT_FOUND:
+ case HA_ERR_END_OF_FILE:
+ case HA_ERR_FOUND_DUPP_KEY:
+ case HA_ERR_FOUND_DUPP_UNIQUE:
+ case HA_ERR_FOREIGN_DUPLICATE_KEY:
+ case HA_ERR_NO_REFERENCED_ROW:
+ case HA_ERR_ROW_IS_REFERENCED:
+ ret= 1;
+ break;
+ default:
+ ret= 0;
+ break;
+ }
+ return (ret);
+}
/**
Ignore error code specified on command line.
@@ -303,14 +344,36 @@ inline int ignored_error_code(int err_co
return ((err_code == ER_SLAVE_IGNORED_TABLE) ||
(use_slave_mask && bitmap_is_set(&slave_error_mask, err_code)));
}
-#endif
+/*
+ This function converts an engine's error to a server error.
+
+ If the thread does not have an error already reported, it tries to
+ define it by calling the engine's method print_error. However, if a
+ mapping is not found, it uses the ER_UNKNOWN_ERROR and prints out a
+ warning message.
+*/
+int convert_handler_error(int error, THD* thd, TABLE *table)
+{
+ uint actual_error= (thd->is_error() ? thd->stmt_da->sql_errno() :
+ 0);
+ if (actual_error == 0)
+ {
+ table->file->print_error(error, MYF(0));
+ actual_error= (thd->is_error() ? thd->stmt_da->sql_errno() :
+ ER_UNKNOWN_ERROR);
+ if (actual_error == ER_UNKNOWN_ERROR)
+ if (global_system_variables.log_warnings)
+ sql_print_warning("Unknown error detected %d in handler", error);
+ }
+
+ return (actual_error);
+}
/*
pretty_print_str()
*/
-#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
static char *pretty_print_str(char *packet, const char *str, int len)
{
const char *end= str + len;
@@ -2297,7 +2360,16 @@ Query_log_event::Query_log_event(THD* th
(thd_arg->is_error() ? thd_arg->stmt_da->sql_errno() : 0) :
((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ? 0 :
thd_arg->killed_errno());
-
+
+ /* thd_arg->main_da.sql_errno() might be ER_SERVER_SHUTDOWN or
+ ER_QUERY_INTERRUPTED, So here we need to make sure that
+ error_code is not set to these errors when specified NOT_KILLED
+ by the caller
+ */
+ if ((killed_status_arg == THD::NOT_KILLED) &&
+ (error_code == ER_SERVER_SHUTDOWN || error_code == ER_QUERY_INTERRUPTED))
+ error_code= 0;
+
time(&end_time);
exec_time = (ulong) (end_time - thd_arg->start_time);
/**
@@ -7158,7 +7230,12 @@ int Rows_log_event::do_apply_event(Relay
*/
lex_start(thd);
mysql_reset_thd_for_next_command(thd);
-
+ /*
+ The current statement is just about to begin and
+ has not yet modified anything. Note, all.modified is reset
+ by mysql_reset_thd_for_next_command.
+ */
+ thd->transaction.stmt.modified_non_trans_table= FALSE;
/*
Check if the slave is set to use SBR. If so, it should switch
to using RBR until the end of the "statement", i.e., next
@@ -7195,7 +7272,9 @@ int Rows_log_event::do_apply_event(Relay
{
/*
Error reporting borrowed from Query_log_event with many excessive
- simplifications (we don't honour --slave-skip-errors)
+ simplifications.
+ We should not honour --slave-skip-errors at this point as we are
+ having severe errors which should not be skiped.
*/
rli->report(ERROR_LEVEL, actual_error,
"Error '%s' on opening tables",
@@ -7221,6 +7300,10 @@ int Rows_log_event::do_apply_event(Relay
{
if (ptr->m_tabledef.compatible_with(rli, ptr->table))
{
+ /*
+ We should not honour --slave-skip-errors at this point as we are
+ having severe errors which should not be skiped.
+ */
mysql_unlock_tables(thd, thd->lock);
thd->lock= 0;
thd->is_slave_error= 1;
@@ -7261,6 +7344,7 @@ int Rows_log_event::do_apply_event(Relay
if (table)
{
+ bool transactional_table= table->file->has_transactions();
/*
table == NULL means that this table should not be replicated
(this was set up by Table_map_log_event::do_apply_event()
@@ -7350,48 +7434,27 @@ int Rows_log_event::do_apply_event(Relay
DBUG_ASSERT(error != HA_ERR_RECORD_DELETED);
table->in_use = old_thd;
- switch (error)
- {
- case 0:
- break;
- /*
- The following list of "idempotent" errors
- means that an error from the list might happen
- because of idempotent (more than once)
- applying of a binlog file.
- Notice, that binlog has a ddl operation its
- second applying may cause
-
- case HA_ERR_TABLE_DEF_CHANGED:
- case HA_ERR_CANNOT_ADD_FOREIGN:
-
- which are not included into to the list.
- Note that HA_ERR_RECORD_DELETED is not in the list since
- do_exec_row() should not return that error code.
- */
- case HA_ERR_RECORD_CHANGED:
- case HA_ERR_KEY_NOT_FOUND:
- case HA_ERR_END_OF_FILE:
- case HA_ERR_FOUND_DUPP_KEY:
- case HA_ERR_FOUND_DUPP_UNIQUE:
- case HA_ERR_FOREIGN_DUPLICATE_KEY:
- case HA_ERR_NO_REFERENCED_ROW:
- case HA_ERR_ROW_IS_REFERENCED:
+ if (error)
+ {
+ int actual_error= convert_handler_error(error, thd, table);
+ bool idempotent_error= (idempotent_error_code(error) &&
+ ((bit_is_set(slave_exec_mode,
+ SLAVE_EXEC_MODE_IDEMPOTENT)) == 1));
+ bool ignored_error= (idempotent_error == 0 ?
+ ignored_error_code(actual_error) : 0);
- if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1)
+ if (idempotent_error || ignored_error)
{
if (global_system_variables.log_warnings)
slave_rows_error_report(WARNING_LEVEL, error, rli, thd, table,
get_type_str(),
RPL_LOG_NAME, (ulong) log_pos);
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
error= 0;
+ if (idempotent_error == 0)
+ break;
}
- break;
-
- default:
- thd->is_slave_error= 1;
- break;
}
/*
@@ -7405,7 +7468,7 @@ int Rows_log_event::do_apply_event(Relay
(ulong) m_curr_row, (ulong) m_curr_row_end, (ulong) m_rows_end));
if (!m_curr_row_end && !error)
- unpack_current_row(rli, &m_cols);
+ error= unpack_current_row(rli, &m_cols);
// at this moment m_curr_row_end should be set
DBUG_ASSERT(error || m_curr_row_end != NULL);
@@ -7414,11 +7477,26 @@ int Rows_log_event::do_apply_event(Relay
m_curr_row= m_curr_row_end;
+ if (error == 0 && !transactional_table)
+ thd->transaction.all.modified_non_trans_table=
+ thd->transaction.stmt.modified_non_trans_table= TRUE;
} // row processing loop
DBUG_EXECUTE_IF("STOP_SLAVE_after_first_Rows_event",
const_cast<Relay_log_info*>(rli)->abort_slave= 1;);
- error= do_after_row_operations(rli, error);
+
+ if ((error= do_after_row_operations(rli, error)) &&
+ ignored_error_code(convert_handler_error(error, thd, table)))
+ {
+
+ if (global_system_variables.log_warnings)
+ slave_rows_error_report(WARNING_LEVEL, error, rli, thd, table,
+ get_type_str(),
+ RPL_LOG_NAME, (ulong) log_pos);
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
+ error= 0;
+ }
+
if (!cache_stmt)
{
DBUG_PRINT("info", ("Marked that we need to keep log"));
@@ -7430,36 +7508,21 @@ int Rows_log_event::do_apply_event(Relay
thd->options&= ~OPTION_ALLOW_BATCH;
if (error)
- { /* error has occured during the transaction */
- slave_rows_error_report(ERROR_LEVEL, error, rli, thd, table,
- get_type_str(), RPL_LOG_NAME, (ulong) log_pos);
- }
- if (error)
{
- /*
- If one day we honour --skip-slave-errors in row-based replication, and
- the error should be skipped, then we would clear mappings, rollback,
- close tables, but the slave SQL thread would not stop and then may
- assume the mapping is still available, the tables are still open...
- So then we should clear mappings/rollback/close here only if this is a
- STMT_END_F.
- For now we code, knowing that error is not skippable and so slave SQL
- thread is certainly going to stop.
- rollback at the caller along with sbr.
- */
+ slave_rows_error_report(ERROR_LEVEL, error, rli, thd, table,
+ get_type_str(),
+ RPL_LOG_NAME, (ulong) log_pos);
thd->reset_current_stmt_binlog_row_based();
const_cast<Relay_log_info*>(rli)->cleanup_context(thd, error);
thd->is_slave_error= 1;
- DBUG_RETURN(error);
}
-
/*
This code would ideally be placed in do_update_pos() instead, but
since we have no access to table there, we do the setting of
last_event_start_time here instead.
*/
- if (table && (table->s->primary_key == MAX_KEY) &&
- !cache_stmt && get_flags(STMT_END_F) == RLE_NO_FLAGS)
+ else if (table && (table->s->primary_key == MAX_KEY) &&
+ !cache_stmt && get_flags(STMT_END_F) == RLE_NO_FLAGS)
{
/*
------------ Temporary fix until WL#2975 is implemented ---------
@@ -7480,7 +7543,7 @@ int Rows_log_event::do_apply_event(Relay
const_cast<Relay_log_info*>(rli)->last_event_start_time= my_time(0);
}
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
Log_event::enum_skip_reason
@@ -9269,7 +9332,7 @@ Incident_log_event::Incident_log_event(c
// If the incident is not recognized, this binlog event is
// invalid. If we set incident_number to INCIDENT_NONE, the
// invalidity will be detected by is_valid().
- incident_number= INCIDENT_NONE;
+ m_incident= INCIDENT_NONE;
DBUG_VOID_RETURN;
}
m_incident= static_cast<Incident>(incident_number);
=== modified file 'sql/parse_file.cc'
--- a/sql/parse_file.cc 2009-03-17 20:07:27 +0000
+++ b/sql/parse_file.cc 2009-04-13 13:28:23 +0000
@@ -302,6 +302,7 @@ err_w_file:
@thd thread handler
@param schema name of given schema
@param old_name original file name
+ @param new_db new schema
@param new_name new file name
@retval
@@ -311,14 +312,14 @@ err_w_file:
*/
my_bool rename_in_schema_file(THD *thd,
const char *schema, const char *old_name,
- const char *new_name)
+ const char *new_db, const char *new_name)
{
char old_path[FN_REFLEN], new_path[FN_REFLEN], arc_path[FN_REFLEN];
build_table_filename(old_path, sizeof(old_path) - 1,
schema, old_name, reg_ext, 0);
build_table_filename(new_path, sizeof(new_path) - 1,
- schema, new_name, reg_ext, 0);
+ new_db, new_name, reg_ext, 0);
if (my_rename(old_path, new_path, MYF(MY_WME)))
return 1;
=== modified file 'sql/parse_file.h'
--- a/sql/parse_file.h 2009-01-15 18:11:25 +0000
+++ b/sql/parse_file.h 2009-04-13 13:09:10 +0000
@@ -83,7 +83,7 @@ sql_create_definition_file(const LEX_STR
uchar* base, File_option *parameters);
my_bool rename_in_schema_file(THD *thd,
const char *schema, const char *old_name,
- const char *new_name);
+ const char *new_db, const char *new_name);
class File_parser: public Sql_alloc
{
=== modified file 'sql/rpl_filter.cc'
--- a/sql/rpl_filter.cc 2009-01-27 02:08:48 +0000
+++ b/sql/rpl_filter.cc 2009-04-29 03:50:14 +0000
@@ -340,8 +340,7 @@ Rpl_filter::add_wild_table_rule(DYNAMIC_
e->tbl_name= e->db + (dot - table_spec) + 1;
e->key_len= len;
memcpy(e->db, table_spec, len);
- insert_dynamic(a, (uchar*)&e);
- return 0;
+ return insert_dynamic(a, (uchar*)&e);
}
=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt 2009-04-03 17:58:04 +0000
+++ b/sql/share/errmsg.txt 2009-04-30 14:35:36 +0000
@@ -5608,7 +5608,7 @@ ER_SP_WRONG_NAME 42000
eng "Incorrect routine name '%-.192s'"
ger "Ung�r Routinenname '%-.192s'"
ER_TABLE_NEEDS_UPGRADE
- eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!"
+ eng "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" or dump/reload to fix it!"
ger "Tabellenaktualisierung erforderlich. Bitte zum Reparieren \"REPAIR TABLE `%-.32s`\" eingeben!"
ER_SP_NO_AGGREGATE 42000
eng "AGGREGATE is not supported for stored functions"
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc 2009-04-29 19:26:03 +0000
+++ b/sql/slave.cc 2009-05-07 20:48:24 +0000
@@ -133,6 +133,7 @@ static bool wait_for_relay_log_space(Rel
static inline bool io_slave_killed(THD* thd,Master_info* mi);
static inline bool sql_slave_killed(THD* thd,Relay_log_info* rli);
static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type);
+static void print_slave_skip_errors(void);
static int safe_connect(THD* thd, MYSQL* mysql, Master_info* mi);
static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,
bool suppress_warnings);
@@ -144,8 +145,8 @@ static int get_master_version_and_clock(
static Log_event* next_event(Relay_log_info* rli);
static int queue_event(Master_info* mi,const char* buf,ulong event_len);
static int terminate_slave_thread(THD *thd,
- pthread_mutex_t* term_lock,
- pthread_cond_t* term_cond,
+ pthread_mutex_t *term_lock,
+ pthread_cond_t *term_cond,
volatile uint *slave_running,
bool skip_lock);
static bool check_io_slave_killed(THD *thd, Master_info *mi, const char *info);
@@ -251,6 +252,14 @@ int init_slave()
}
active_mi= new Master_info_file(master_info_file);
+ /*
+ If --slave-skip-errors=... was not used, the string value for the
+ system variable has not been set up yet. Do it now.
+ */
+ if (!use_slave_mask)
+ {
+ print_slave_skip_errors();
+ }
if (!active_mi)
{
@@ -474,7 +483,7 @@ static void print_slave_skip_errors(void
char *bend= buff + sizeof(slave_skip_error_names);
int errnum;
- for (errnum= 1; errnum < MAX_SLAVE_ERROR; errnum++)
+ for (errnum= 0; errnum < MAX_SLAVE_ERROR; errnum++)
{
if (bitmap_is_set(&slave_error_mask, errnum))
{
@@ -524,6 +533,7 @@ void init_slave_skip_errors(const char*
if (!my_strnncoll(system_charset_info,(uchar*)arg,4,(const uchar*)"all",4))
{
bitmap_set_all(&slave_error_mask);
+ print_slave_skip_errors();
DBUG_VOID_RETURN;
}
for (p= arg ; *p; )
@@ -551,22 +561,22 @@ int terminate_slave_threads(Master_info*
int error,force_all = (thread_mask & SLAVE_FORCE_ALL);
pthread_mutex_t *sql_lock = &mi->rli->run_lock, *io_lock = &mi->run_lock;
- if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)))
+ if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL))
{
DBUG_PRINT("info",("Terminating IO thread"));
mi->abort_slave=1;
- if ((error=terminate_slave_thread(mi->info_thd,io_lock,
+ if ((error=terminate_slave_thread(mi->info_thd, io_lock,
&mi->stop_cond,
&mi->slave_running,
skip_lock)) &&
!force_all)
DBUG_RETURN(error);
}
- if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)))
+ if (thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL))
{
DBUG_PRINT("info",("Terminating SQL thread"));
mi->rli->abort_slave=1;
- if ((error=terminate_slave_thread(mi->rli->info_thd,sql_lock,
+ if ((error=terminate_slave_thread(mi->rli->info_thd, sql_lock,
&mi->rli->stop_cond,
&mi->rli->slave_running,
skip_lock)) &&
@@ -576,7 +586,6 @@ int terminate_slave_threads(Master_info*
DBUG_RETURN(0);
}
-
/**
Wait for a slave thread to terminate.
@@ -604,29 +613,44 @@ int terminate_slave_threads(Master_info*
the condition. In this case, it is assumed that the calling
function acquires the lock before calling this function.
- @retval 0 All OK
+ @retval 0 All OK ER_SLAVE_NOT_RUNNING otherwise.
+
+ @note If the executing thread has to acquire term_lock (skip_lock
+ is false), the negative running status does not represent
+ any issue therefore no error is reported.
+
*/
static int
terminate_slave_thread(THD *thd,
- pthread_mutex_t* term_lock,
- pthread_cond_t* term_cond,
+ pthread_mutex_t *term_lock,
+ pthread_cond_t *term_cond,
volatile uint *slave_running,
bool skip_lock)
{
- int error;
-
DBUG_ENTER("terminate_slave_thread");
-
if (!skip_lock)
+ {
pthread_mutex_lock(term_lock);
-
- safe_mutex_assert_owner(term_lock);
-
+ }
+ else
+ {
+ safe_mutex_assert_owner(term_lock);
+ }
if (!*slave_running)
{
if (!skip_lock)
+ {
+ /*
+ if run_lock (term_lock) is acquired locally then either
+ slave_running status is fine
+ */
pthread_mutex_unlock(term_lock);
- DBUG_RETURN(ER_SLAVE_NOT_RUNNING);
+ DBUG_RETURN(0);
+ }
+ else
+ {
+ DBUG_RETURN(ER_SLAVE_NOT_RUNNING);
+ }
}
DBUG_ASSERT(thd != 0);
THD_CHECK_SENTRY(thd);
@@ -638,6 +662,7 @@ terminate_slave_thread(THD *thd,
while (*slave_running) // Should always be true
{
+ int error;
DBUG_PRINT("loop", ("killing slave thread"));
pthread_mutex_lock(&thd->LOCK_delete);
@@ -775,7 +800,7 @@ int start_slave_threads(bool need_slave_
&mi->rli->slave_running, &mi->rli->slave_run_id,
mi);
if (error)
- terminate_slave_threads(mi, thread_mask & SLAVE_IO, 0);
+ terminate_slave_threads(mi, thread_mask & SLAVE_IO, !need_slave_mutex);
}
DBUG_RETURN(error);
}
@@ -848,6 +873,9 @@ static bool sql_slave_killed(THD* thd, R
DBUG_ASSERT(rli->slave_running == 1);// tracking buffer overrun
if (abort_loop || thd->killed || rli->abort_slave)
{
+ if (rli->abort_slave && rli->is_in_group() &&
+ thd->transaction.all.modified_non_trans_table)
+ DBUG_RETURN(0);
/*
If we are in an unsafe situation (stopping could corrupt replication),
we give one minute to the slave SQL thread of grace before really
@@ -2791,6 +2819,7 @@ err:
delete the mi structure leading to a crash! (see BUG#25306 for details)
*/
pthread_cond_broadcast(&mi->stop_cond); // tell the world we are done
+ DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5););
pthread_mutex_unlock(&mi->run_lock);
my_thread_end();
pthread_exit(0);
@@ -3147,6 +3176,7 @@ the slave SQL thread with \"SLAVE START\
delete the mi structure leading to a crash! (see BUG#25306 for details)
*/
pthread_cond_broadcast(&rli->stop_cond);
+ DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5););
pthread_mutex_unlock(&rli->run_lock); // tell the world we are done
my_thread_end();
=== modified file 'sql/sp.cc'
--- a/sql/sp.cc 2009-04-06 12:56:41 +0000
+++ b/sql/sp.cc 2009-04-08 23:46:45 +0000
@@ -953,7 +953,8 @@ sp_create_routine(THD *thd, int type, sp
thd->variables.sql_mode= saved_mode;
/* Such a statement can always go directly to binlog, no trans cache */
thd->binlog_query(THD::MYSQL_QUERY_TYPE,
- log_query.c_ptr(), log_query.length(), FALSE, FALSE);
+ log_query.c_ptr(), log_query.length(),
+ FALSE, FALSE, THD::NOT_KILLED);
thd->variables.sql_mode= 0;
}
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2009-04-13 13:24:28 +0000
+++ b/sql/sp_head.cc 2009-04-30 14:35:36 +0000
@@ -207,6 +207,7 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STORAGE_ENGINES:
case SQLCOM_SHOW_TABLES:
+ case SQLCOM_SHOW_TABLE_STATUS:
case SQLCOM_SHOW_VARIABLES:
case SQLCOM_SHOW_WARNS:
case SQLCOM_REPAIR:
@@ -2150,17 +2151,16 @@ sp_head::restore_lex(THD *thd)
/**
Put the instruction on the backpatch list, associated with the label.
*/
-void
+int
sp_head::push_backpatch(sp_instr *i, sp_label_t *lab)
{
bp_t *bp= (bp_t *)sql_alloc(sizeof(bp_t));
- if (bp)
- {
- bp->lab= lab;
- bp->instr= i;
- (void)m_backpatch.push_front(bp);
- }
+ if (!bp)
+ return 1;
+ bp->lab= lab;
+ bp->instr= i;
+ return m_backpatch.push_front(bp);
}
/**
@@ -2237,7 +2237,7 @@ sp_head::fill_field_definition(THD *thd,
}
-void
+int
sp_head::new_cont_backpatch(sp_instr_opt_meta *i)
{
m_cont_level+= 1;
@@ -2245,15 +2245,17 @@ sp_head::new_cont_backpatch(sp_instr_opt
{
/* Use the cont. destination slot to store the level */
i->m_cont_dest= m_cont_level;
- (void)m_cont_backpatch.push_front(i);
+ if (m_cont_backpatch.push_front(i))
+ return 1;
}
+ return 0;
}
-void
+int
sp_head::add_cont_backpatch(sp_instr_opt_meta *i)
{
i->m_cont_dest= m_cont_level;
- (void)m_cont_backpatch.push_front(i);
+ return m_cont_backpatch.push_front(i);
}
void
@@ -2487,7 +2489,7 @@ sp_head::show_create_routine(THD *thd, i
@param instr Instruction
*/
-void sp_head::add_instr(sp_instr *instr)
+int sp_head::add_instr(sp_instr *instr)
{
instr->free_list= m_thd->free_list;
m_thd->free_list= 0;
@@ -2498,7 +2500,7 @@ void sp_head::add_instr(sp_instr *instr)
entire stored procedure, as their life span is equal.
*/
instr->mem_root= &main_mem_root;
- insert_dynamic(&m_instr, (uchar*)&instr);
+ return insert_dynamic(&m_instr, (uchar*)&instr);
}
=== modified file 'sql/sp_head.h'
--- a/sql/sp_head.h 2009-03-17 20:07:27 +0000
+++ b/sql/sp_head.h 2009-04-29 03:50:14 +0000
@@ -308,7 +308,7 @@ public:
bool
show_create_routine(THD *thd, int type);
- void
+ int
add_instr(sp_instr *instr);
inline uint
@@ -344,7 +344,7 @@ public:
restore_lex(THD *thd);
/// Put the instruction on the backpatch list, associated with the label.
- void
+ int
push_backpatch(sp_instr *, struct sp_label *);
/// Update all instruction with this label in the backpatch list to
@@ -353,11 +353,11 @@ public:
backpatch(struct sp_label *);
/// Start a new cont. backpatch level. If 'i' is NULL, the level is just incr.
- void
+ int
new_cont_backpatch(sp_instr_opt_meta *i);
/// Add an instruction to the current level
- void
+ int
add_cont_backpatch(sp_instr_opt_meta *i);
/// Backpatch (and pop) the current level to the current position.
=== modified file 'sql/sp_pcontext.cc'
--- a/sql/sp_pcontext.cc 2008-08-22 11:16:08 +0000
+++ b/sql/sp_pcontext.cc 2009-04-29 03:50:14 +0000
@@ -266,8 +266,8 @@ sp_pcontext::push_variable(LEX_STRING *n
p->mode= mode;
p->offset= current_var_count();
p->dflt= NULL;
- insert_dynamic(&m_vars, (uchar*)&p);
-
+ if (insert_dynamic(&m_vars, (uchar*)&p))
+ return NULL;
return p;
}
@@ -311,18 +311,17 @@ sp_pcontext::find_label(char *name)
return NULL;
}
-void
+int
sp_pcontext::push_cond(LEX_STRING *name, sp_cond_type_t *val)
{
sp_cond_t *p= (sp_cond_t *)sql_alloc(sizeof(sp_cond_t));
- if (p)
- {
- p->name.str= name->str;
- p->name.length= name->length;
- p->val= val;
- insert_dynamic(&m_conds, (uchar*)&p);
- }
+ if (p == NULL)
+ return 1;
+ p->name.str= name->str;
+ p->name.length= name->length;
+ p->val= val;
+ return insert_dynamic(&m_conds, (uchar *)&p);
}
/*
@@ -385,7 +384,7 @@ sp_pcontext::find_handler(sp_cond_type_t
return FALSE;
}
-void
+int
sp_pcontext::push_cursor(LEX_STRING *name)
{
LEX_STRING n;
@@ -394,7 +393,7 @@ sp_pcontext::push_cursor(LEX_STRING *nam
m_max_cursor_index+= 1;
n.str= name->str;
n.length= name->length;
- insert_dynamic(&m_cursors, (uchar*)&n);
+ return insert_dynamic(&m_cursors, (uchar *)&n);
}
/*
=== modified file 'sql/sp_pcontext.h'
--- a/sql/sp_pcontext.h 2008-08-27 22:14:03 +0000
+++ b/sql/sp_pcontext.h 2009-04-29 03:50:14 +0000
@@ -323,7 +323,7 @@ public:
// Conditions
//
- void
+ int
push_cond(LEX_STRING *name, sp_cond_type_t *val);
inline void
@@ -365,7 +365,7 @@ public:
// Cursors
//
- void
+ int
push_cursor(LEX_STRING *name);
my_bool
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2009-04-29 19:26:03 +0000
+++ b/sql/sql_acl.cc 2009-05-07 20:48:24 +0000
@@ -1647,7 +1647,8 @@ bool change_password(THD *thd, const cha
acl_user->host.hostname ? acl_user->host.hostname : "",
new_password));
thd->clear_error();
- thd->binlog_query(THD::MYSQL_QUERY_TYPE, buff, query_length, FALSE, FALSE);
+ thd->binlog_query(THD::MYSQL_QUERY_TYPE, buff, query_length,
+ FALSE, FALSE, THD::NOT_KILLED);
}
end:
close_thread_tables(thd);
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2009-04-29 19:26:03 +0000
+++ b/sql/sql_base.cc 2009-05-07 20:48:24 +0000
@@ -1656,19 +1656,8 @@ void close_temporary_tables(THD *thd)
thd->variables.character_set_client= system_charset_info;
Query_log_event qinfo(thd, s_query.ptr(),
s_query.length() - 1 /* to remove trailing ',' */,
- 0, FALSE);
+ 0, FALSE, THD::NOT_KILLED);
thd->variables.character_set_client= cs_save;
- /*
- Imagine the thread had created a temp table, then was doing a
- SELECT, and the SELECT was killed. Then it's not clever to
- mark the statement above as "killed", because it's not really
- a statement updating data, and there are 99.99% chances it
- will succeed on slave. If a real update (one updating a
- persistent table) was killed on the master, then this real
- update will be logged with error_code=killed, rightfully
- causing the slave to stop.
- */
- qinfo.error_code= 0;
mysql_bin_log.write(&qinfo);
thd->variables.pseudo_thread_id= save_pseudo_thread_id;
}
@@ -2641,6 +2630,16 @@ bool open_table(THD *thd, TABLE_LIST *ta
if (share->is_view)
{
/*
+ If parent_l of the table_list is non null then a merge table
+ has this view as child table, which is not supported.
+ */
+ if (table_list->parent_l)
+ {
+ my_error(ER_WRONG_MRG_TABLE, MYF(0));
+ goto err_unlock;
+ }
+
+ /*
This table is a view. Validate its metadata version: in particular,
that it was a view when the statement was prepared.
*/
@@ -3392,7 +3391,8 @@ static bool open_table_entry_fini(THD *t
end = strxmov(strmov(query, "DELETE FROM `"),
share->db.str,"`.`",share->table_name.str,"`", NullS);
thd->binlog_query(THD::STMT_QUERY_TYPE,
- query, (ulong)(end-query), FALSE, FALSE);
+ query, (ulong)(end-query),
+ FALSE, FALSE, THD::NOT_KILLED);
my_free(query, MYF(0));
}
else
=== modified file 'sql/sql_crypt.cc'
--- a/sql/sql_crypt.cc 2009-03-17 20:07:27 +0000
+++ b/sql/sql_crypt.cc 2009-04-23 08:42:37 +0000
@@ -28,10 +28,10 @@
#include "mysql_priv.h"
-SQL_CRYPT::SQL_CRYPT(const char *password)
+SQL_CRYPT::SQL_CRYPT(const char *password, uint length)
{
ulong rand_nr[2];
- hash_password(rand_nr,password, strlen(password));
+ hash_password(rand_nr,password, length);
crypt_init(rand_nr);
}
=== modified file 'sql/sql_crypt.h'
--- a/sql/sql_crypt.h 2007-10-09 18:09:50 +0000
+++ b/sql/sql_crypt.h 2009-04-23 08:42:37 +0000
@@ -25,7 +25,7 @@ class SQL_CRYPT :public Sql_alloc
uint shift;
void crypt_init(ulong *seed);
public:
- SQL_CRYPT(const char *seed);
+ SQL_CRYPT(const char *seed, uint length);
SQL_CRYPT(ulong *seed)
{
crypt_init(seed);
=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc 2009-03-17 20:26:16 +0000
+++ b/sql/sql_db.cc 2009-04-08 23:46:45 +0000
@@ -181,7 +181,7 @@ uchar* dboptions_get_key(my_dbopt_t *opt
static inline void write_to_binlog(THD *thd, char *query, uint q_len,
char *db, uint db_len)
{
- Query_log_event qinfo(thd, query, q_len, 0, 0);
+ Query_log_event qinfo(thd, query, q_len, 0, 0, THD::NOT_KILLED);
qinfo.error_code= 0;
qinfo.db= db;
qinfo.db_len= db_len;
@@ -728,7 +728,7 @@ int mysql_create_db(THD *thd, char *db,
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, query, query_length, 0,
- /* suppress_use */ TRUE);
+ /* suppress_use */ TRUE, THD::NOT_KILLED);
/*
Write should use the database being created as the "current
@@ -819,7 +819,7 @@ bool mysql_alter_db(THD *thd, const char
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, thd->query, thd->query_length, 0,
- /* suppress_use */ TRUE);
+ /* suppress_use */ TRUE, THD::NOT_KILLED);
/*
Write should use the database being created as the "current
@@ -965,7 +965,7 @@ bool mysql_rm_db(THD *thd,char *db,bool
if (mysql_bin_log.is_open())
{
Query_log_event qinfo(thd, query, query_length, 0,
- /* suppress_use */ TRUE);
+ /* suppress_use */ TRUE, THD::NOT_KILLED);
/*
Write should use the database being created as the "current
database" and not the threads current database, which is the
@@ -1969,7 +1969,8 @@ bool mysql_upgrade_db(THD *thd, LEX_STRI
/* Step8: logging */
if (mysql_bin_log.is_open())
{
- Query_log_event qinfo(thd, thd->query, thd->query_length, 0, TRUE);
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ 0, TRUE, THD::NOT_KILLED);
thd->clear_error();
mysql_bin_log.write(&qinfo);
}
=== modified file 'sql/sql_handler.cc'
--- a/sql/sql_handler.cc 2009-03-24 14:24:44 +0000
+++ b/sql/sql_handler.cc 2009-04-17 09:14:33 +0000
@@ -201,6 +201,14 @@ bool mysql_ha_open(THD *thd, TABLE_LIST
tables->db, tables->table_name, tables->alias,
(int) reopen));
+ if (tables->schema_table)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "HANDLER OPEN",
+ INFORMATION_SCHEMA_NAME.str);
+ DBUG_PRINT("exit",("ERROR"));
+ DBUG_RETURN(TRUE);
+ }
+
if (! my_hash_inited(&thd->handler_tables_hash))
{
/*
=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc 2009-04-03 21:07:07 +0000
+++ b/sql/sql_lex.cc 2009-04-10 14:33:30 +0000
@@ -726,6 +726,52 @@ static inline uint int_token(const char
}
+/**
+ Given a stream that is advanced to the first contained character in
+ an open comment, consume the comment. Optionally, if we are allowed,
+ recurse so that we understand comments within this current comment.
+
+ At this level, we do not support version-condition comments. We might
+ have been called with having just passed one in the stream, though. In
+ that case, we probably want to tolerate mundane comments inside. Thus,
+ the case for recursion.
+
+ @retval Whether EOF reached before comment is closed.
+*/
+bool consume_comment(Lex_input_stream *lip, int remaining_recursions_permitted)
+{
+ reg1 uchar c;
+ while (! lip->eof())
+ {
+ c= lip->yyGet();
+
+ if (remaining_recursions_permitted > 0)
+ {
+ if ((c == '/') && (lip->yyPeek() == '*'))
+ {
+ lip->yySkip(); /* Eat asterisk */
+ consume_comment(lip, remaining_recursions_permitted-1);
+ continue;
+ }
+ }
+
+ if (c == '*')
+ {
+ if (lip->yyPeek() == '/')
+ {
+ lip->yySkip(); /* Eat slash */
+ return FALSE;
+ }
+ }
+
+ if (c == '\n')
+ lip->yylineno++;
+ }
+
+ return TRUE;
+}
+
+
/*
MYSQLlex remember the following states from the following MYSQLlex()
@@ -1272,6 +1318,8 @@ int lex_one_token(void *arg, void *yythd
/* Reject '/' '*', since we might need to turn off the echo */
lip->yyUnget();
+ lip->save_in_comment_state();
+
if (lip->yyPeekn(2) == '!')
{
lip->in_comment= DISCARD_COMMENT;
@@ -1314,11 +1362,17 @@ int lex_one_token(void *arg, void *yythd
/* Expand the content of the special comment as real code */
lip->set_echo(TRUE);
state=MY_LEX_START;
- break;
+ break; /* Do not treat contents as a comment. */
+ }
+ else
+ {
+ comment_closed= ! consume_comment(lip, 1);
+ /* version allowed to have one level of comment inside. */
}
}
else
{
+ /* Not a version comment. */
state=MY_LEX_START;
lip->set_echo(TRUE);
break;
@@ -1329,38 +1383,30 @@ int lex_one_token(void *arg, void *yythd
lip->in_comment= PRESERVE_COMMENT;
lip->yySkip(); // Accept /
lip->yySkip(); // Accept *
+ comment_closed= ! consume_comment(lip, 0);
+ /* regular comments can have zero comments inside. */
}
/*
Discard:
- regular '/' '*' comments,
- special comments '/' '*' '!' for a future version,
by scanning until we find a closing '*' '/' marker.
- Note: There is no such thing as nesting comments,
- the first '*' '/' sequence seen will mark the end.
+
+ Nesting regular comments isn't allowed. The first
+ '*' '/' returns the parser to the previous state.
+
+ /#!VERSI oned containing /# regular #/ is allowed #/
+
+ Inside one versioned comment, another versioned comment
+ is treated as a regular discardable comment. It gets
+ no special parsing.
*/
- comment_closed= FALSE;
- while (! lip->eof())
- {
- c= lip->yyGet();
- if (c == '*')
- {
- if (lip->yyPeek() == '/')
- {
- lip->yySkip();
- comment_closed= TRUE;
- state = MY_LEX_START;
- break;
- }
- }
- else if (c == '\n')
- lip->yylineno++;
- }
+
/* Unbalanced comments with a missing '*' '/' are a syntax error */
if (! comment_closed)
return (ABORT_SYM);
state = MY_LEX_START; // Try again
- lip->in_comment= NO_COMMENT;
- lip->set_echo(TRUE);
+ lip->restore_in_comment_state();
break;
case MY_LEX_END_LONG_COMMENT:
if ((lip->in_comment != NO_COMMENT) && lip->yyPeek() == '/')
=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h 2009-04-03 21:07:07 +0000
+++ b/sql/sql_lex.h 2009-04-10 14:33:30 +0000
@@ -1172,6 +1172,18 @@ public:
m_echo= echo;
}
+ void save_in_comment_state()
+ {
+ m_echo_saved= m_echo;
+ in_comment_saved= in_comment;
+ }
+
+ void restore_in_comment_state()
+ {
+ m_echo= m_echo_saved;
+ in_comment= in_comment_saved;
+ }
+
/**
Skip binary from the input stream.
@param n number of bytes to accept.
@@ -1440,6 +1452,7 @@ private:
/** Echo the parsed stream to the pre-processed buffer. */
bool m_echo;
+ bool m_echo_saved;
/** Pre-processed buffer. */
char *m_cpp_buf;
@@ -1506,6 +1519,7 @@ public:
/** State of the lexical analyser for comments. */
enum_comment_state in_comment;
+ enum_comment_state in_comment_saved;
/**
Starting position of the TEXT_STRING or IDENT in the pre-processed
=== modified file 'sql/sql_rename.cc'
--- a/sql/sql_rename.cc 2008-10-15 12:14:27 +0000
+++ b/sql/sql_rename.cc 2009-04-13 13:28:23 +0000
@@ -309,12 +309,17 @@ do_rename(THD *thd, TABLE_LIST *ren_tabl
}
break;
case FRMTYPE_VIEW:
- /* change of schema is not allowed */
- if (strcmp(ren_table->db, new_db))
+ /*
+ change of schema is not allowed
+ except of ALTER ...UPGRADE DATA DIRECTORY NAME command
+ because a view has valid internal db&table names in this case.
+ */
+ if (thd->lex->sql_command != SQLCOM_ALTER_DB_UPGRADE &&
+ strcmp(ren_table->db, new_db))
my_error(ER_FORBID_SCHEMA_CHANGE, MYF(0), ren_table->db,
new_db);
else
- rc= mysql_rename_view(thd, new_alias, ren_table);
+ rc= mysql_rename_view(thd, new_db, new_alias, ren_table);
break;
default:
DBUG_ASSERT(0); // should never happen
=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc 2009-04-13 13:24:28 +0000
+++ b/sql/sql_repl.cc 2009-04-30 14:51:06 +0000
@@ -1295,7 +1295,10 @@ int reset_slave(THD *thd, Master_info* m
if ((error= purge_relay_logs(mi->rli, thd,
1 /* just reset */,
&errmsg)))
+ {
+ sql_errno= ER_RELAY_LOG_FAIL;
goto err;
+ }
/* Clear master's log coordinates */
init_master_log_pos(mi);
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2009-04-29 19:26:03 +0000
+++ b/sql/sql_select.cc 2009-05-07 20:48:24 +0000
@@ -5219,14 +5219,6 @@ add_key_fields(JOIN *join, KEY_FIELD **k
}
}
-/**
- Add all keys with uses 'field' for some keypart.
-
- If field->and_level != and_level then only mark key_part as const_part.
-
- @todo
- ft-keys in non-ft queries. SerG
-*/
static uint
max_part_bit(key_part_map bits)
@@ -5236,7 +5228,16 @@ max_part_bit(key_part_map bits)
return found;
}
-static void
+/*
+ Add all keys with uses 'field' for some keypart
+ If field->and_level != and_level then only mark key_part as const_part
+
+ RETURN
+ 0 - OK
+ 1 - Out of memory.
+*/
+
+static bool
add_key_part(DYNAMIC_ARRAY *keyuse_array,KEY_FIELD *key_field)
{
Field *field=key_field->field;
@@ -5269,24 +5270,26 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array
keyuse.sj_pred_no= key_field->sj_pred_no;
/* This will be set accordingly in optimize_keyuse */
keyuse.ref_table_rows= ~(ha_rows) 0;
- (void) insert_dynamic(keyuse_array,(uchar*) &keyuse);
+ if (insert_dynamic(keyuse_array,(uchar*) &keyuse))
+ return TRUE;
}
}
}
}
+ return FALSE;
}
#define FT_KEYPART (MAX_REF_PARTS+10)
-static void
+static bool
add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
JOIN_TAB *stat,COND *cond,table_map usable_tables)
{
Item_func_match *cond_func=NULL;
if (!cond)
- return;
+ return FALSE;
if (cond->type() == Item::FUNC_ITEM)
{
@@ -5320,13 +5323,16 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
{
Item *item;
while ((item=li++))
- add_ft_keys(keyuse_array,stat,item,usable_tables);
+ {
+ if (add_ft_keys(keyuse_array,stat,item,usable_tables))
+ return TRUE;
+ }
}
}
if (!cond_func || cond_func->key == NO_SUCH_KEY ||
!(usable_tables & cond_func->table->map))
- return;
+ return FALSE;
KEYUSE keyuse;
keyuse.table= cond_func->table;
@@ -5337,7 +5343,7 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
keyuse.optimize= 0;
keyuse.keypart_map= 0;
keyuse.sj_pred_no= UINT_MAX;
- (void) insert_dynamic(keyuse_array,(uchar*) &keyuse);
+ return insert_dynamic(keyuse_array,(uchar*) &keyuse);
}
@@ -5505,7 +5511,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
sargables);
for (; field != end ; field++)
{
- add_key_part(keyuse,field);
+ if (add_key_part(keyuse,field))
+ return TRUE;
/* Mark that we can optimize LEFT JOIN */
if (field->val->type() == Item::NULL_ITEM &&
!field->field->real_maybe_null())
@@ -5543,11 +5550,15 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
/* fill keyuse with found key parts */
for ( ; field != end ; field++)
- add_key_part(keyuse,field);
+ {
+ if (add_key_part(keyuse,field))
+ return TRUE;
+ }
if (select_lex->ftfunc_list->elements)
{
- add_ft_keys(keyuse,join_tab,cond,normal_tables);
+ if (add_ft_keys(keyuse,join_tab,cond,normal_tables))
+ return TRUE;
}
/*
@@ -5568,7 +5579,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
(qsort_cmp) sort_keyuse);
bzero((char*) &key_end,sizeof(key_end)); /* Add for easy testing */
- (void) insert_dynamic(keyuse,(uchar*) &key_end);
+ if (insert_dynamic(keyuse,(uchar*) &key_end))
+ return TRUE;
use=save_pos=dynamic_element(keyuse,0,KEYUSE*);
prev= &key_end;
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2009-04-29 19:26:03 +0000
+++ b/sql/sql_table.cc 2009-05-07 20:48:24 +0000
@@ -1465,7 +1465,7 @@ void write_bin_log(THD *thd, bool clear_
if (clear_error)
thd->clear_error();
thd->binlog_query(THD::STMT_QUERY_TYPE,
- query, query_length, FALSE, FALSE);
+ query, query_length, FALSE, FALSE, THD::NOT_KILLED);
}
}
@@ -6726,7 +6726,8 @@ bool mysql_alter_table(THD *thd,char *ne
if (mysql_bin_log.is_open())
{
thd->clear_error();
- Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ 0, FALSE, THD::NOT_KILLED);
mysql_bin_log.write(&qinfo);
}
DBUG_EXECUTE_IF("sleep_alter_rename_view", my_sleep(6000000););
@@ -7830,6 +7831,10 @@ bool mysql_checksum_table(THD *thd, TABL
{
if (thd->killed)
{
+ /*
+ we've been killed; let handler clean up, and remove the
+ partial current row from the recordset (embedded lib)
+ */
t->file->ha_rnd_end();
thd->protocol->remove_last_row();
goto err;
=== modified file 'sql/sql_test.cc'
--- a/sql/sql_test.cc 2009-02-13 16:30:54 +0000
+++ b/sql/sql_test.cc 2009-04-14 21:58:44 +0000
@@ -33,18 +33,20 @@
static const char *lock_descriptions[] =
{
- "No lock",
- "Low priority read lock",
- "Shared Read lock",
- "High priority read lock",
- "Read lock without concurrent inserts",
- "Write lock that allows other writers",
- "Write lock, but allow reading",
- "Concurrent insert lock",
- "Lock Used by delayed insert",
- "Low priority write lock",
- "High priority write lock",
- "Highest priority write lock"
+ /* TL_UNLOCK */ "No lock",
+ /* TL_READ_DEFAULT */ NULL,
+ /* TL_READ */ "Low priority read lock",
+ /* TL_READ_WITH_SHARED_LOCKS */ "Shared read lock",
+ /* TL_READ_HIGH_PRIORITY */ "High priority read lock",
+ /* TL_READ_NO_INSERT */ "Read lock without concurrent inserts",
+ /* TL_WRITE_ALLOW_WRITE */ "Write lock that allows other writers",
+ /* TL_WRITE_ALLOW_READ */ "Write lock, but allow reading",
+ /* TL_WRITE_CONCURRENT_INSERT */ "Concurrent insert lock",
+ /* TL_WRITE_DELAYED */ "Lock used by delayed insert",
+ /* TL_WRITE_DEFAULT */ NULL,
+ /* TL_WRITE_LOW_PRIORITY */ "Low priority write lock",
+ /* TL_WRITE */ "High priority write lock",
+ /* TL_WRITE_ONLY */ "Highest priority write lock"
};
@@ -76,6 +78,8 @@ void print_cached_tables(void)
TABLE_SHARE *share;
TABLE *start_link, *lnk, *entry;
+ compile_time_assert(TL_WRITE_ONLY+1 == array_elements(lock_descriptions));
+
/* purecov: begin tested */
pthread_mutex_lock(&LOCK_open);
puts("DB Table Version Thread Open Lock");
=== modified file 'sql/sql_view.cc'
--- a/sql/sql_view.cc 2009-04-29 19:26:03 +0000
+++ b/sql/sql_view.cc 2009-05-07 20:48:24 +0000
@@ -661,7 +661,7 @@ bool mysql_create_view(THD *thd, TABLE_L
buff.append(views->source.str, views->source.length);
thd->binlog_query(THD::STMT_QUERY_TYPE,
- buff.ptr(), buff.length(), FALSE, FALSE);
+ buff.ptr(), buff.length(), FALSE, FALSE, THD::NOT_KILLED);
}
pthread_mutex_unlock(&LOCK_open);
@@ -1926,6 +1926,7 @@ int view_checksum(THD *thd, TABLE_LIST *
Parameters:
thd thread handler
+ new_db new name of database
new_name new name of view
view view
@@ -1935,6 +1936,7 @@ int view_checksum(THD *thd, TABLE_LIST *
*/
bool
mysql_rename_view(THD *thd,
+ const char *new_db,
const char *new_name,
TABLE_LIST *view)
{
@@ -1973,16 +1975,16 @@ mysql_rename_view(THD *thd,
goto err;
/* rename view and it's backups */
- if (rename_in_schema_file(thd, view->db, view->table_name, new_name))
+ if (rename_in_schema_file(thd, view->db, view->table_name, new_db, new_name))
goto err;
dir.str= dir_buff;
dir.length= build_table_filename(dir_buff, sizeof(dir_buff) - 1,
- view->db, "", "", 0);
+ new_db, "", "", 0);
pathstr.str= path_buff;
pathstr.length= build_table_filename(path_buff, sizeof(path_buff) - 1,
- view->db, new_name, reg_ext, 0);
+ new_db, new_name, reg_ext, 0);
file.str= pathstr.str + dir.length;
file.length= pathstr.length - dir.length;
@@ -1991,7 +1993,7 @@ mysql_rename_view(THD *thd,
(uchar*)&view_def, view_parameters))
{
/* restore renamed view in case of error */
- rename_in_schema_file(thd, view->db, new_name, view->table_name);
+ rename_in_schema_file(thd, new_db, new_name, view->db, view->table_name);
goto err;
}
} else
=== modified file 'sql/sql_view.h'
--- a/sql/sql_view.h 2008-02-22 01:21:52 +0000
+++ b/sql/sql_view.h 2009-04-13 13:09:10 +0000
@@ -37,7 +37,8 @@ int view_checksum(THD *thd, TABLE_LIST *
extern TYPELIB updatable_views_with_limit_typelib;
bool check_duplicate_names(List<Item>& item_list, bool gen_unique_view_names);
-bool mysql_rename_view(THD *thd, const char *new_name, TABLE_LIST *view);
+bool mysql_rename_view(THD *thd, const char *new_db, const char *new_name,
+ TABLE_LIST *view);
#define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL)
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2009-04-28 17:42:58 +0000
+++ b/sql/sql_yacc.yy 2009-05-07 20:48:24 +0000
@@ -279,9 +279,7 @@ int case_stmt_action_expr(LEX *lex, Item
parsing_ctx, case_expr_id, expr, lex);
sp->add_cont_backpatch(i);
- sp->add_instr(i);
-
- return 0;
+ return sp->add_instr(i);
}
/**
@@ -292,7 +290,7 @@ int case_stmt_action_expr(LEX *lex, Item
@param simple true for simple cases, false for searched cases
*/
-void case_stmt_action_when(LEX *lex, Item *when, bool simple)
+int case_stmt_action_when(LEX *lex, Item *when, bool simple)
{
sp_head *sp= lex->sphead;
sp_pcontext *ctx= lex->spcont;
@@ -324,9 +322,10 @@ void case_stmt_action_when(LEX *lex, Ite
(jump_if_not from instruction 2 to 5, 5 to 8 ... in the example)
*/
- sp->push_backpatch(i, ctx->push_label((char *)"", 0));
- sp->add_cont_backpatch(i);
- sp->add_instr(i);
+ return !test(i) ||
+ sp->push_backpatch(i, ctx->push_label((char *)"", 0)) ||
+ sp->add_cont_backpatch(i) ||
+ sp->add_instr(i);
}
/**
@@ -335,13 +334,14 @@ void case_stmt_action_when(LEX *lex, Ite
@param lex the parser lex context
*/
-void case_stmt_action_then(LEX *lex)
+int case_stmt_action_then(LEX *lex)
{
sp_head *sp= lex->sphead;
sp_pcontext *ctx= lex->spcont;
uint ip= sp->instructions();
sp_instr_jump *i = new sp_instr_jump(ip, ctx);
- sp->add_instr(i);
+ if (!test(i) || sp->add_instr(i))
+ return 1;
/*
BACKPATCH: Resolving forward jump from
@@ -357,7 +357,7 @@ void case_stmt_action_then(LEX *lex)
(jump from instruction 4 to 12, 7 to 12 ... in the example)
*/
- sp->push_backpatch(i, ctx->last_label());
+ return sp->push_backpatch(i, ctx->last_label());
}
/**
@@ -2534,10 +2534,9 @@ sp_decl:
var_type,
lex,
(i == num_vars - 1));
- if (is == NULL)
+ if (is == NULL ||
+ lex->sphead->add_instr(is))
MYSQL_YYABORT;
-
- lex->sphead->add_instr(is);
}
pctx->declare_var_boundary(0);
@@ -2556,7 +2555,8 @@ sp_decl:
my_error(ER_SP_DUP_COND, MYF(0), $2.str);
MYSQL_YYABORT;
}
- YYTHD->lex->spcont->push_cond(&$2, $5);
+ if(YYTHD->lex->spcont->push_cond(&$2, $5))
+ MYSQL_YYABORT;
$$.vars= $$.hndlrs= $$.curs= 0;
$$.conds= 1;
}
@@ -2571,10 +2571,10 @@ sp_decl:
sp_instr_hpush_jump *i=
new sp_instr_hpush_jump(sp->instructions(), ctx, $2,
ctx->current_var_count());
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i) ||
+ sp->push_backpatch(i, ctx->push_label((char *)"", 0)))
MYSQL_YYABORT;
- sp->add_instr(i);
- sp->push_backpatch(i, ctx->push_label((char *)"", 0));
}
sp_hcond_list sp_proc_stmt
{
@@ -2588,17 +2588,17 @@ sp_decl:
{
i= new sp_instr_hreturn(sp->instructions(), ctx,
ctx->current_var_count());
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
else
{ /* EXIT or UNDO handler, just jump to the end of the block */
i= new sp_instr_hreturn(sp->instructions(), ctx, 0);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i) ||
+ sp->push_backpatch(i, lex->spcont->last_label())) /* Block end */
MYSQL_YYABORT;
- sp->add_instr(i);
- sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */
}
lex->sphead->backpatch(hlab);
@@ -2624,10 +2624,10 @@ sp_decl:
}
i= new sp_instr_cpush(sp->instructions(), ctx, $5,
ctx->current_cursor_count());
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i) ||
+ ctx->push_cursor(&$2))
MYSQL_YYABORT;
- sp->add_instr(i);
- ctx->push_cursor(&$2);
$$.vars= $$.conds= $$.hndlrs= 0;
$$.curs= 1;
}
@@ -3029,10 +3029,11 @@ sp_proc_stmt_statement:
i->m_query.length= lip->get_ptr() - sp->m_tmp_query;
else
i->m_query.length= lip->get_tok_end() - sp->m_tmp_query;
- i->m_query.str= strmake_root(thd->mem_root,
- sp->m_tmp_query,
- i->m_query.length);
- sp->add_instr(i);
+ if (!(i->m_query.str= strmake_root(thd->mem_root,
+ sp->m_tmp_query,
+ i->m_query.length)) ||
+ sp->add_instr(i))
+ MYSQL_YYABORT;
}
sp->restore_lex(thd);
}
@@ -3057,9 +3058,9 @@ sp_proc_stmt_return:
i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3,
sp->m_return_field_def.sql_type, lex);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
sp->m_flags|= sp_head::HAS_RETURN;
}
sp->restore_lex(YYTHD);
@@ -3156,22 +3157,22 @@ sp_proc_stmt_iterate:
if (n)
{
sp_instr_hpop *hpop= new sp_instr_hpop(ip++, ctx, n);
- if (hpop == NULL)
+ if (hpop == NULL ||
+ sp->add_instr(hpop))
MYSQL_YYABORT;
- sp->add_instr(hpop);
}
n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */
if (n)
{
sp_instr_cpop *cpop= new sp_instr_cpop(ip++, ctx, n);
- if (cpop == NULL)
+ if (cpop == NULL ||
+ sp->add_instr(cpop))
MYSQL_YYABORT;
- sp->add_instr(cpop);
}
i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
}
;
@@ -3190,9 +3191,9 @@ sp_proc_stmt_open:
MYSQL_YYABORT;
}
i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
;
@@ -3210,9 +3211,9 @@ sp_proc_stmt_fetch:
MYSQL_YYABORT;
}
i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
sp_fetch_list
{}
@@ -3232,9 +3233,9 @@ sp_proc_stmt_close:
MYSQL_YYABORT;
}
i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
;
@@ -3297,12 +3298,12 @@ sp_if:
uint ip= sp->instructions();
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx,
$2, lex);
- if (i == NULL)
+ if (i == NULL ||
+ sp->push_backpatch(i, ctx->push_label((char *)"", 0)) ||
+ sp->add_cont_backpatch(i) ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->push_backpatch(i, ctx->push_label((char *)"", 0));
- sp->add_cont_backpatch(i);
- sp->add_instr(i);
sp->restore_lex(YYTHD);
}
sp_proc_stmts1
@@ -3311,10 +3312,10 @@ sp_if:
sp_pcontext *ctx= Lex->spcont;
uint ip= sp->instructions();
sp_instr_jump *i = new sp_instr_jump(ip, ctx);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
sp->backpatch(ctx->pop_label());
sp->push_backpatch(i, ctx->push_label((char *)"", 0));
}
@@ -3398,14 +3399,16 @@ simple_when_clause:
/* Simple case: <caseval> = <whenval> */
LEX *lex= Lex;
- case_stmt_action_when(lex, $3, true);
+ if (case_stmt_action_when(lex, $3, true))
+ MYSQL_YYABORT;
lex->sphead->restore_lex(YYTHD); /* For expr $3 */
}
THEN_SYM
sp_proc_stmts1
{
LEX *lex= Lex;
- case_stmt_action_then(lex);
+ if (case_stmt_action_then(lex))
+ MYSQL_YYABORT;
}
;
@@ -3417,14 +3420,16 @@ searched_when_clause:
expr
{
LEX *lex= Lex;
- case_stmt_action_when(lex, $3, false);
+ if (case_stmt_action_when(lex, $3, false))
+ MYSQL_YYABORT;
lex->sphead->restore_lex(YYTHD); /* For expr $3 */
}
THEN_SYM
sp_proc_stmts1
{
LEX *lex= Lex;
- case_stmt_action_then(lex);
+ if (case_stmt_action_then(lex))
+ MYSQL_YYABORT;
}
;
@@ -3436,9 +3441,9 @@ else_clause_opt:
uint ip= sp->instructions();
sp_instr_error *i= new sp_instr_error(ip, lex->spcont,
ER_SP_CASE_NOT_FOUND);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
| ELSE sp_proc_stmts1
;
@@ -3552,16 +3557,16 @@ sp_block_content:
if ($3.hndlrs)
{
i= new sp_instr_hpop(sp->instructions(), ctx, $3.hndlrs);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
if ($3.curs)
{
i= new sp_instr_cpop(sp->instructions(), ctx, $3.curs);
- if (i == NULL)
+ if (i == NULL ||
+ sp->add_instr(i))
MYSQL_YYABORT;
- sp->add_instr(i);
}
lex->spcont= ctx->pop_context();
}
@@ -3575,9 +3580,9 @@ sp_unlabeled_control:
uint ip= lex->sphead->instructions();
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
- if (i == NULL)
+ if (i == NULL ||
+ lex->sphead->add_instr(i))
MYSQL_YYABORT;
- lex->sphead->add_instr(i);
}
| WHILE_SYM
{ Lex->sphead->reset_lex(YYTHD); }
@@ -3588,12 +3593,12 @@ sp_unlabeled_control:
uint ip= sp->instructions();
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$3, lex);
- if (i == NULL)
- MYSQL_YYABORT;
+ if (i == NULL ||
/* Jumping forward */
- sp->push_backpatch(i, lex->spcont->last_label());
- sp->new_cont_backpatch(i);
- sp->add_instr(i);
+ sp->push_backpatch(i, lex->spcont->last_label()) ||
+ sp->new_cont_backpatch(i) ||
+ sp->add_instr(i))
+ MYSQL_YYABORT;
sp->restore_lex(YYTHD);
}
sp_proc_stmts1 END WHILE_SYM
@@ -3602,9 +3607,9 @@ sp_unlabeled_control:
uint ip= lex->sphead->instructions();
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
- if (i == NULL)
+ if (i == NULL ||
+ lex->sphead->add_instr(i))
MYSQL_YYABORT;
- lex->sphead->add_instr(i);
lex->sphead->do_cont_backpatch();
}
| REPEAT_SYM sp_proc_stmts1 UNTIL_SYM
@@ -3617,9 +3622,9 @@ sp_unlabeled_control:
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$5, lab->ip,
lex);
- if (i == NULL)
+ if (i == NULL ||
+ lex->sphead->add_instr(i))
MYSQL_YYABORT;
- lex->sphead->add_instr(i);
lex->sphead->restore_lex(YYTHD);
/* We can shortcut the cont_backpatch here */
i->m_cont_dest= ip+1;
@@ -12549,7 +12554,8 @@ option_type_value:
qbuff.length);
qbuff.length+= 4;
i->m_query= qbuff;
- sp->add_instr(i);
+ if (sp->add_instr(i))
+ MYSQL_YYABORT;
}
lex->sphead->restore_lex(thd);
}
@@ -12643,7 +12649,8 @@ sys_option_value:
(uchar **) &trg_fld->
next_trg_field);
- lex->sphead->add_instr(sp_fld);
+ if (lex->sphead->add_instr(sp_fld))
+ MYSQL_YYABORT;
}
else if ($2.var)
{ /* System variable */
@@ -12682,9 +12689,9 @@ sys_option_value:
}
sp_set= new sp_instr_set(lex->sphead->instructions(), ctx,
spv->offset, it, spv->type, lex, TRUE);
- if (sp_set == NULL)
+ if (sp_set == NULL ||
+ lex->sphead->add_instr(sp_set))
MYSQL_YYABORT;
- lex->sphead->add_instr(sp_set);
}
}
| option_type TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
=== modified file 'storage/ibmdb2i/db2i_collationSupport.cc'
--- a/storage/ibmdb2i/db2i_collationSupport.cc 2009-03-09 21:20:14 +0000
+++ b/storage/ibmdb2i/db2i_collationSupport.cc 2009-04-10 06:26:54 +0000
@@ -111,7 +111,7 @@ static const char* mySQLCollation[MAX_CO
{"ucs2_slovak"},
{"ucs2_slovenian"},
{"ucs2_spanish"},
- {"ucs2_spanish2"},
+ {"ucs2_swedish"},
{"ucs2_turkish"},
{"ucs2_unicode"},
{"ucs2"},
@@ -132,7 +132,7 @@ static const char* mySQLCollation[MAX_CO
{"utf8_slovak"},
{"utf8_slovenian"},
{"utf8_spanish"},
- {"utf8_spanish2"},
+ {"utf8_swedish"},
{"utf8_turkish"},
{"utf8_unicode"},
{"utf8"}
@@ -205,7 +205,7 @@ static const char* mySqlSortSequence[MAX
{"ASK"},
{"ASL"},
{"AES"},
- {"AES__TRADIT"},
+ {"ASW"},
{"ATR"},
{"AEN"},
{"*HEX"},
@@ -226,7 +226,7 @@ static const char* mySqlSortSequence[MAX
{"ASK"},
{"ASL"},
{"AES"},
- {"AES__TRADIT"},
+ {"ASW"},
{"ATR"},
{"AEN"},
{"*HEX"}
=== modified file 'storage/ibmdb2i/db2i_misc.h'
--- a/storage/ibmdb2i/db2i_misc.h 2009-03-09 21:20:14 +0000
+++ b/storage/ibmdb2i/db2i_misc.h 2009-04-10 07:48:07 +0000
@@ -92,11 +92,17 @@ bool convertMySQLNameToDB2Name(const cha
return (o <= outlen-1);
}
-bool isUpperOrQuote(const CHARSET_INFO* cs, const char* s)
+bool isOrdinaryIdentifier(const char* s)
{
while (*s)
{
- if (my_isupper(cs, *s) || (*s == '"'))
+ if (my_isupper(system_charset_info, *s) ||
+ my_isdigit(system_charset_info, *s) ||
+ (*s == '_') ||
+ (*s == '@') ||
+ (*s == '$') ||
+ (*s == '#') ||
+ (*s == '"'))
++s;
else
return false;
=== modified file 'storage/ibmdb2i/ha_ibmdb2i.cc'
--- a/storage/ibmdb2i/ha_ibmdb2i.cc 2009-03-09 21:20:14 +0000
+++ b/storage/ibmdb2i/ha_ibmdb2i.cc 2009-04-29 11:21:14 +0000
@@ -898,6 +898,8 @@ int ha_ibmdb2i::index_init(uint idx, boo
releaseIndexFile(idx);
}
+ rrnAssocHandle= 0;
+
DBUG_RETURN(rc);
}
@@ -1154,6 +1156,8 @@ int ha_ibmdb2i::rnd_init(bool scan)
releaseDataFile();
}
+ rrnAssocHandle= 0;
+
DBUG_RETURN(0); // MySQL sometimes does not check the return code, causing
// an assert in ha_rnd_end later on if we return a non-zero
// value here.
@@ -1251,7 +1255,8 @@ int ha_ibmdb2i::rnd_pos(uchar * buf, uch
int rc = 0;
- if (activeHandle != rrnAssocHandle)
+ if (rrnAssocHandle &&
+ (activeHandle != rrnAssocHandle))
{
if (activeHandle) releaseActiveHandle();
rc = useFileByHandle(QMY_UPDATABLE, rrnAssocHandle);
@@ -2122,7 +2127,7 @@ int ha_ibmdb2i::create(const char *name,
if (osVersion.v < 6)
{
if (strlen(libName) >
- MAX_DB2_V5R4_LIBNAME_LENGTH + (isUpperOrQuote(system_charset_info, libName) ? 2 : 0))
+ MAX_DB2_V5R4_LIBNAME_LENGTH + (isOrdinaryIdentifier(libName) ? 2 : 0))
{
getErrTxt(DB2I_ERR_TOO_LONG_SCHEMA,libName, MAX_DB2_V5R4_LIBNAME_LENGTH);
DBUG_RETURN(DB2I_ERR_TOO_LONG_SCHEMA);
@@ -2323,7 +2328,7 @@ int ha_ibmdb2i::create(const char *name,
if (!rc && !isTemporary)
{
db2i_table* temp = new db2i_table(table_arg->s, name);
- int32 rc = temp->fastInitForCreate(name);
+ rc = temp->fastInitForCreate(name);
delete temp;
if (rc)
delete_table(name);
=== modified file 'storage/myisam/ft_boolean_search.c'
--- a/storage/myisam/ft_boolean_search.c 2009-02-13 16:30:54 +0000
+++ b/storage/myisam/ft_boolean_search.c 2009-04-30 14:57:39 +0000
@@ -335,7 +335,23 @@ static int _ftb_no_dupes_cmp(void* not_u
return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b)));
}
-/* returns 1 if the search was finished (must-word wasn't found) */
+/*
+ When performing prefix search (a word with truncation operator), we
+ must preserve original prefix to ensure that characters which may be
+ expanded/contracted do not break the prefix. This is done by storing
+ newly found key immediatly after the original word in ftbw->word
+ buffer.
+
+ ftbw->word= LENGTH WORD [ LENGTH1 WORD1 ] WEIGHT REFERENCE
+ LENGTH - 1 byte, length of the WORD
+ WORD - LENGTH bytes, the word itself
+ LENGTH1 - 1 byte, length of the WORD1, present in case of prefix search
+ WORD1 - LENGTH bytes, the word itself, present in case of prefix search
+ WEIGHT - 4 bytes (HA_FT_WLEN), either weight or number of subkeys
+ REFERENCE - rec_reflength bytes, pointer to the record
+
+ returns 1 if the search was finished (must-word wasn't found)
+*/
static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
{
int r;
@@ -369,7 +385,8 @@ static int _ft2_search(FTB *ftb, FTB_WOR
if (ftbw->docid[0] < max_docid)
{
sflag|= SEARCH_SAME;
- _mi_dpointer(info, (uchar *)(ftbw->word + ftbw->len + HA_FT_WLEN),
+ _mi_dpointer(info, (uchar*) (lastkey_buf + HA_FT_WLEN +
+ (ftbw->off ? 0 : lastkey_buf[0] + 1)),
max_docid);
}
r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf,
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2009-04-29 19:26:03 +0000
+++ b/storage/myisam/ha_myisam.cc 2009-05-07 20:48:24 +0000
@@ -43,6 +43,28 @@ TYPELIB myisam_stats_method_typelib= {
array_elements(myisam_stats_method_names) - 1, "",
myisam_stats_method_names, NULL};
+#ifndef DBUG_OFF
+/**
+ Causes the thread to wait in a spin lock for a query kill signal.
+ This function is used by the test frame work to identify race conditions.
+
+ The signal is caught and ignored and the thread is not killed.
+*/
+
+static void debug_wait_for_kill(const char *info)
+{
+ DBUG_ENTER("debug_wait_for_kill");
+ const char *prev_info;
+ THD *thd;
+ thd= current_thd;
+ prev_info= thd_proc_info(thd, info);
+ while(!thd->killed)
+ my_sleep(1000);
+ DBUG_PRINT("info", ("Exit debug_wait_for_kill"));
+ thd_proc_info(thd, prev_info);
+ DBUG_VOID_RETURN;
+}
+#endif
/*****************************************************************************
** MyISAM tables
@@ -316,6 +338,7 @@ int table2myisam(TABLE *table_arg, MI_KE
t2_keys in Number of keys in second table
t2_recs in Number of records in second table
strict in Strict check switch
+ table in handle to the table object
DESCRIPTION
This function compares two MyISAM definitions. By intention it was done
@@ -331,6 +354,10 @@ int table2myisam(TABLE *table_arg, MI_KE
Otherwise 'strict' flag must be set to 1 and it is not required to pass
converted dot-frm definition as t1_*.
+ For compatibility reasons we relax some checks, specifically:
+ - 4.0 (and earlier versions) always set key_alg to 0.
+ - 4.0 (and earlier versions) have the same language for all keysegs.
+
RETURN VALUE
0 - Equal definitions.
1 - Different definitions.
@@ -345,10 +372,11 @@ int table2myisam(TABLE *table_arg, MI_KE
int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo,
uint t1_keys, uint t1_recs,
MI_KEYDEF *t2_keyinfo, MI_COLUMNDEF *t2_recinfo,
- uint t2_keys, uint t2_recs, bool strict)
+ uint t2_keys, uint t2_recs, bool strict, TABLE *table_arg)
{
uint i, j;
DBUG_ENTER("check_definition");
+ my_bool mysql_40_compat= table_arg && table_arg->s->frm_version < FRM_VER_TRUE_VARCHAR;
if ((strict ? t1_keys != t2_keys : t1_keys > t2_keys))
{
DBUG_PRINT("error", ("Number of keys differs: t1_keys=%u, t2_keys=%u",
@@ -387,8 +415,9 @@ int check_definition(MI_KEYDEF *t1_keyin
test(t2_keyinfo[i].flag & HA_SPATIAL)));
DBUG_RETURN(1);
}
- if (t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs ||
- t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg)
+ if ((!mysql_40_compat &&
+ t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg) ||
+ t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs)
{
DBUG_PRINT("error", ("Key %d has different definition", i));
DBUG_PRINT("error", ("t1_keysegs=%d, t1_key_alg=%d",
@@ -418,8 +447,9 @@ int check_definition(MI_KEYDEF *t1_keyin
t1_keysegs_j__type= HA_KEYTYPE_VARBINARY1; /* purecov: inspected */
}
- if (t1_keysegs_j__type != t2_keysegs[j].type ||
- t1_keysegs[j].language != t2_keysegs[j].language ||
+ if ((!mysql_40_compat &&
+ t1_keysegs[j].language != t2_keysegs[j].language) ||
+ t1_keysegs_j__type != t2_keysegs[j].type ||
t1_keysegs[j].null_bit != t2_keysegs[j].null_bit ||
t1_keysegs[j].length != t2_keysegs[j].length)
{
@@ -626,7 +656,8 @@ int ha_myisam::open(const char *name, in
}
if (check_definition(keyinfo, recinfo, table->s->keys, recs,
file->s->keyinfo, file->s->rec,
- file->s->base.keys, file->s->base.fields, true))
+ file->s->base.keys, file->s->base.fields,
+ true, table))
{
/* purecov: begin inspected */
my_errno= HA_ERR_CRASHED;
@@ -1250,6 +1281,9 @@ int ha_myisam::enable_indexes(uint mode)
{
int error;
+ DBUG_EXECUTE_IF("wait_in_enable_indexes",
+ debug_wait_for_kill("wait_in_enable_indexes"); );
+
if (mi_is_all_keys_active(file->s->state.key_map, file->s->base.keys))
{
/* All indexes are enabled already. */
@@ -1364,8 +1398,9 @@ void ha_myisam::start_bulk_insert(ha_row
/*
Only disable old index if the table was empty and we are inserting
a lot of rows.
- We should not do this for only a few rows as this is slower and
- we don't want to update the key statistics based of only a few rows.
+ Note that in end_bulk_insert() we may truncate the table if
+ enable_indexes() failed, thus it's essential that indexes are
+ disabled ONLY for an empty table.
*/
if (file->state->records == 0 && can_enable_indexes &&
(!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES))
@@ -1397,8 +1432,27 @@ int ha_myisam::end_bulk_insert(bool abor
{
mi_end_bulk_insert(file);
int err=mi_extra(file, HA_EXTRA_NO_CACHE, 0);
- return (err || abort ? err : can_enable_indexes ?
- enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE) : 0);
+ if (!err)
+ {
+ if (can_enable_indexes)
+ {
+ /*
+ Truncate the table when enable index operation is killed.
+ After truncating the table we don't need to enable the
+ indexes, because the last repair operation is aborted after
+ setting the indexes as active and trying to recreate them.
+ */
+
+ if (((err= enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE)) != 0) &&
+ current_thd->killed)
+ {
+ delete_all_rows();
+ /* not crashed, despite being killed during repair */
+ file->s->state.changed&= ~(STATE_CRASHED|STATE_CRASHED_ON_REPAIR);
+ }
+ }
+ }
+ return err;
}
=== modified file 'storage/myisam/mi_delete.c'
--- a/storage/myisam/mi_delete.c 2009-01-28 11:08:55 +0000
+++ b/storage/myisam/mi_delete.c 2009-04-29 03:50:14 +0000
@@ -251,7 +251,11 @@ static int d_search(register MI_INFO *in
if (info->ft1_to_ft2)
{
/* we're in ft1->ft2 conversion mode. Saving key data */
- insert_dynamic(info->ft1_to_ft2, (lastkey+off));
+ if (insert_dynamic(info->ft1_to_ft2, (lastkey+off)))
+ {
+ DBUG_PRINT("error",("Out of memory"));
+ DBUG_RETURN(-1);
+ }
}
else
{
=== modified file 'storage/myisam/mi_dynrec.c'
--- a/storage/myisam/mi_dynrec.c 2008-08-27 12:49:58 +0000
+++ b/storage/myisam/mi_dynrec.c 2009-04-09 09:02:37 +0000
@@ -66,7 +66,7 @@ static int _mi_cmp_buffer(File file, con
my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
{
DBUG_ENTER("mi_dynmap_file");
- if (size > (my_off_t) (~((size_t) 0)) - MEMMAP_EXTRA_MARGIN)
+ if (size > (my_off_t) (~((size_t) 0)))
{
DBUG_PRINT("warning", ("File is too large for mmap"));
DBUG_RETURN(1);
@@ -80,7 +80,7 @@ my_bool mi_dynmap_file(MI_INFO *info, my
upon a write if no physical memory is available.
*/
info->s->file_map= (uchar*)
- my_mmap(0, (size_t)(size + MEMMAP_EXTRA_MARGIN),
+ my_mmap(0, (size_t) size,
info->s->mode==O_RDONLY ? PROT_READ :
PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_NORESERVE,
@@ -112,8 +112,8 @@ void mi_remap_file(MI_INFO *info, my_off
{
if (info->s->file_map)
{
- (void) my_munmap((char*) info->s->file_map,
- (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN);
+ (void) (my_munmap((char*) info->s->file_map,
+ (size_t) info->s->mmaped_length));
mi_dynmap_file(info, size);
}
}
=== modified file 'storage/myisam/mi_open.c'
--- a/storage/myisam/mi_open.c 2009-03-17 20:26:16 +0000
+++ b/storage/myisam/mi_open.c 2009-04-29 17:51:22 +0000
@@ -1266,7 +1266,8 @@ uchar *mi_keyseg_read(uchar *ptr, HA_KEY
keyseg->bit_end= 0;
keyseg->charset=0; /* Will be filled in later */
if (keyseg->null_bit)
- keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == 7));
+ /* We adjust bit_pos if null_bit is last in the byte */
+ keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == (1 << 7)));
else
{
keyseg->bit_pos= (uint16)keyseg->null_pos;
=== modified file 'storage/myisam/mi_packrec.c'
--- a/storage/myisam/mi_packrec.c 2009-04-29 19:26:03 +0000
+++ b/storage/myisam/mi_packrec.c 2009-05-07 20:48:24 +0000
@@ -1503,7 +1503,9 @@ my_bool _mi_memmap_file(MI_INFO *info)
DBUG_PRINT("warning",("File isn't extended for memmap"));
DBUG_RETURN(0);
}
- if (mi_dynmap_file(info, share->state.state.data_file_length))
+ if (mi_dynmap_file(info,
+ share->state.state.data_file_length +
+ MEMMAP_EXTRA_MARGIN))
DBUG_RETURN(0);
}
info->opt_flag|= MEMMAP_USED;
=== modified file 'storage/myisam/mi_write.c'
--- a/storage/myisam/mi_write.c 2009-01-28 11:08:55 +0000
+++ b/storage/myisam/mi_write.c 2009-04-29 03:50:14 +0000
@@ -559,7 +559,14 @@ int _mi_insert(register MI_INFO *info, r
we cannot easily dispatch an empty page here */
b+=blen+ft2len+2;
for (a=anc_buff+a_length ; b < a ; b+=ft2len+2)
- insert_dynamic(info->ft1_to_ft2, b);
+ {
+ if (insert_dynamic(info->ft1_to_ft2, b))
+ {
+ mi_print_error(info->s, HA_ERR_OUT_OF_MEM);
+ my_errno= HA_ERR_OUT_OF_MEM;
+ DBUG_RETURN(-1);
+ }
+ }
/* fixing the page's length - it contains only one key now */
mi_putint(anc_buff,2+blen+ft2len+2,0);
=== modified file 'storage/myisam/myisamchk.c'
--- a/storage/myisam/myisamchk.c 2009-04-01 21:36:07 +0000
+++ b/storage/myisam/myisamchk.c 2009-04-09 08:09:25 +0000
@@ -1305,7 +1305,7 @@ static void descript(HA_CHECK *param, re
share->base.max_key_file_length != HA_OFFSET_ERROR)
printf("Max datafile length: %13s Max keyfile length: %13s\n",
llstr(share->base.max_data_file_length-1,llbuff),
- llstr(share->base.max_key_file_length-1,llbuff2));
+ ullstr(share->base.max_key_file_length - 1, llbuff2));
}
}
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc 2009-04-29 19:26:03 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc 2009-05-07 20:48:24 +0000
@@ -139,7 +139,8 @@ extern int check_definition(MI_KEYDEF *t
uint t1_keys, uint t1_recs,
MI_KEYDEF *t2_keyinfo,
MI_COLUMNDEF *t2_recinfo,
- uint t2_keys, uint t2_recs, bool strict);
+ uint t2_keys, uint t2_recs, bool strict,
+ TABLE *table_arg);
static void split_file_name(const char *file_name,
LEX_STRING *db, LEX_STRING *name);
@@ -728,7 +729,7 @@ int ha_myisammrg::attach_children(void)
if (check_definition(keyinfo, recinfo, keys, recs,
u_table->table->s->keyinfo, u_table->table->s->rec,
u_table->table->s->base.keys,
- u_table->table->s->base.fields, false))
+ u_table->table->s->base.fields, false, NULL))
{
DBUG_PRINT("error", ("table definition mismatch: '%s'",
u_table->table->s->unresolv_file_name));
=== modified file 'storage/ndb/tools/restore/consumer_restore.cpp'
--- a/storage/ndb/tools/restore/consumer_restore.cpp 2008-06-18 15:03:43 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.cpp 2009-04-16 09:53:06 +0000
@@ -1490,7 +1490,7 @@ BackupRestore::logEntry(const LogEntry &
NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL)
{
- // Deep shit, TODO: handle the error
+ // TODO: handle the error
err << "Cannot start transaction" << endl;
exitHandler();
} // if
@@ -1647,7 +1647,7 @@ BackupRestore::tuple(const TupleS & tup)
NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL)
{
- // Deep shit, TODO: handle the error
+ // TODO: handle the error
ndbout << "Cannot start transaction" << endl;
exitHandler();
} // if
=== modified file 'storage/ndb/tools/restore/consumer_restorem.cpp'
--- a/storage/ndb/tools/restore/consumer_restorem.cpp 2006-12-23 19:20:40 +0000
+++ b/storage/ndb/tools/restore/consumer_restorem.cpp 2009-04-16 09:47:21 +0000
@@ -374,7 +374,7 @@ BackupRestore::tuple(const TupleS & tup)
NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL)
{
- // Deep shit, TODO: handle the error
+ // TODO: handle the error
ndbout << "Cannot start transaction" << endl;
exit(-1);
} // if
@@ -463,7 +463,7 @@ BackupRestore::logEntry(const LogEntry &
NdbTransaction * trans = m_ndb->startTransaction();
if (trans == NULL)
{
- // Deep shit, TODO: handle the error
+ // TODO: handle the error
ndbout << "Cannot start transaction" << endl;
exit(-1);
} // if
=== modified file 'win/Makefile.am'
--- a/win/Makefile.am 2009-03-28 00:27:25 +0000
+++ b/win/Makefile.am 2009-04-30 14:35:36 +0000
@@ -14,5 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
## Process this file with automake to create Makefile.in
-EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat configure.js README \
- mysql_manifest.cmake create_manifest.js create_def_file.js
+EXTRA_DIST = build-vs71.bat build-vs8.bat build-vs8_x64.bat build-vs9.bat \
+ build-vs9_x64.bat configure.js README mysql_manifest.cmake \
+ create_manifest.js create_def_file.js
Attachment: [text/bzr-bundle] bzr/joerg@mysql.com-20090507204824-3cvw7fb740bz44g5.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (joerg:3181) | Joerg Bruehe | 7 May |