2835 Georgi Kodinov 2008-09-12
Bug#38342 -backup_myisam1 test fails on Windows
The problem is that this test, uses file locking and myisam unlocks
the same file region twice. Unix my_lock implementation based on fcntl()
does not return error in this case, but Windows UnlockFile() returns
ERROR_NOT_LOCKED.
Fixed by ignoring ERROR_NOT_LOCKED from UnlockFile(). This fix does
not make myisam better, but at least the implementation of my_lock()
compatible to *nix.
modified:
mysys/my_lock.c
2834 Georgi Kodinov 2008-09-12
added a missing result file (merge 6.0-main to 6.0-bugteam)
added:
mysql-test/suite/rpl/r/rpl_colSize.result
2833 Georgi Kodinov 2008-09-12 [merge]
merged 6.0-main to 6.0-bugteam
removed:
mysql-test/r/innodb_bug34053.result
mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data
mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data
mysql-test/suite/rpl/r/rpl_colSize.result
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
mysql-test/t/innodb_bug34053.test
added:
mysql-test/r/innodb_bug34053.result
mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data
mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data
mysql-test/t/innodb_bug34053.test
win/build-vs9.bat
win/build-vs9_x64.bat
renamed:
win/build-vs9.bat => win/build-vs9.bat.moved
win/build-vs9_x64.bat => win/build-vs9_x64.bat.moved
modified:
.bzr-mysql/default.conf
sql/ha_ndbcluster.cc
sql/handler.h
sql/mysql_priv.h.pp
sql/sql_insert.cc
sql/sql_show.cc
sql/table.h
2832 Timothy Smith 2008-09-11 [merge]
Auto merge 5.1-bugteam -> 6.0-bugteam (empty, no changes)
2831 Timothy Smith 2008-09-11 [merge]
Merge 6.0-build -> 6.0-bugteam. This was a fairly ugly merge: lots of bogus
path conflicts, several foo.moved files had been checked in by mistake, some
test files had just been removed during a previous merge, etc.
No serious *content* conflicts were present. I've double-checked the
"removed", "added", and "renamed" files for sanity. It appears that bzr still
doesn't handle our present procedures well; of course, part of it may just be
people unused to the tool and making mistakes. Hopefully I've managed to
avoid mistakes during this merge; but I can't prove it. ;-)
removed:
include/atomic/x86-msvc.h
mysql-test/r/innodb_bug34053.result.moved
mysql-test/r/merge-big.result
mysql-test/suite/funcs_1/t/ndb_storedproc_06.tes
mysql-test/suite/funcs_1/t/ndb_storedproc_08.tes
mysql-test/t/innodb_bug34053.test.moved
mysql-test/t/merge-big.test
added:
mysql-test/suite/large_tests/r/lock_tables_big.result
mysql-test/suite/large_tests/t/lock_tables_big.test
mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result
mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test
mysys/my_winerr.c
mysys/my_winfile.c
renamed:
mysql-test/r/slave_allow_batching_basic.result => mysql-test/r/rpl_slave_allow_batching_basic.result
mysql-test/r/slave_compressed_protocol_basic.result => mysql-test/r/rpl_slave_compressed_protocol_basic.result
mysql-test/r/slave_exec_mode_basic.result => mysql-test/r/rpl_slave_exec_mode_basic.result
mysql-test/r/slave_net_timeout_basic.result => mysql-test/r/rpl_slave_net_timeout_basic.result
mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result => mysql-test/suite/funcs_1/r/is_collation_charset_applic.result
mysql-test/suite/funcs_1/t/is_collation_character_set_applicability.test => mysql-test/suite/funcs_1/t/is_collation_charset_applic.test
mysql-test/suite/ndb/r/ndb_binlog_format.result => mysql-test/suite/ndb_team/r/ndb_binlog_format.result
mysql-test/suite/ndb/t/ndb_binlog_format.test => mysql-test/suite/ndb_team/t/ndb_binlog_format.test
mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2innodb.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2myisam.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2ndb.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2other.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_UUID.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_apply_status.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_auto_inc.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_bank.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_blob.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_blob2.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_circular_simplex.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_commit_afterflush.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_ctype_ucs2_def.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_dd_partitions.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_ddl.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_delete_nowhere.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_do_db.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_do_table.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_func003.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_innodb_trans.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_insert_ignore.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_load.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_log.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_multi.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_multi_update2.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_multi_update3.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_myisam2ndb.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_relayrotate.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_rep_ignore.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_row_001.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_sp003.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_sp006.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_stm_innodb.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_sync.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_transaction.result
mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndb_trig004.result
mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result => mysql-test/suite/rpl_ndb_big/r/rpl_ndbapi_multi.result
mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result => mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result
mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result => mysql-test/suite/rpl_ndb_big/r/rpl_truncate_7ndb.result
mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2innodb-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2innodb-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2innodb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2myisam-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2myisam-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2myisam.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2ndb-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2ndb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2other-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2other.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_UUID.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_apply_status-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_apply_status.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_auto_inc.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_bank.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_blob.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_blob2.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_circular_simplex.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_commit_afterflush.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_ctype_ucs2_def-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_ctype_ucs2_def.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_dd_partitions-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_dd_partitions-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_dd_partitions.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_ddl.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_delete_nowhere.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_db-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_db.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_table-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_table.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_func003.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_innodb_trans-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_innodb_trans.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_insert_ignore.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_load.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_log-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_log.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi_update2-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi_update2.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi_update3.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_myisam2ndb-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_myisam2ndb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_relayrotate-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_relayrotate.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_rep_ignore-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_rep_ignore.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_row_001.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_sp003.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_sp006.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_stm_innodb-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_stm_innodb.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_sync.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction-master.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-slave.opt => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction-slave.opt
mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction.test
mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndb_trig004.test
mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test => mysql-test/suite/rpl_ndb_big/t/rpl_ndbapi_multi.test
mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test => mysql-test/suite/rpl_ndb_big/t/rpl_row_basic_7ndb.test
mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test => mysql-test/suite/rpl_ndb_big/t/rpl_truncate_7ndb.test
mysql-test/t/slave_allow_batching_basic.test => mysql-test/t/rpl_slave_allow_batching_basic.test
mysql-test/t/slave_compressed_protocol_basic.test => mysql-test/t/rpl_slave_compressed_protocol_basic.test
mysql-test/t/slave_exec_mode_basic.test => mysql-test/t/rpl_slave_exec_mode_basic.test
mysql-test/t/slave_net_timeout_basic.test => mysql-test/t/rpl_slave_net_timeout_basic.test
modified:
CMakeLists.txt
client/mysqlbinlog.cc
client/mysqlslap.c
client/readline.cc
include/config-win.h
include/my_dir.h
include/my_global.h
include/my_sys.h
libmysql/CMakeLists.txt
mysys/CMakeLists.txt
mysys/Makefile.am
mysys/default_modify.c
mysys/my_chsize.c
mysys/my_create.c
mysys/my_delete.c
mysys/my_dup.c
mysys/my_file.c
mysys/my_fopen.c
mysys/my_fstream.c
mysys/my_getncpus.c
mysys/my_lib.c
mysys/my_lock.c
mysys/my_mmap.c
mysys/my_open.c
mysys/my_pread.c
mysys/my_quick.c
mysys/my_read.c
mysys/my_seek.c
mysys/my_static.c
mysys/my_sync.c
mysys/my_write.c
mysys/mysys_priv.h
scripts/make_win_bin_dist
sql/discover.cc
sql/log.cc
sql/mysqld.cc
sql/parse_file.cc
sql/set_var.cc
sql/sql_connect.cc
storage/archive/ha_archive.cc
storage/csv/ha_tina.cc
storage/falcon/Interlock.h
storage/innobase/handler/ha_innodb.cc
storage/maria/CMakeLists.txt
storage/myisam/mi_locking.c
storage/myisam/myisam_ftdump.c
vio/viosocket.c
win/README
2830 Timothy Smith 2008-09-11 [merge]
Up-merge from 5.1-bugteam to 6.0-bugteam. This pulls up the 5.1-build
changes. For some reason, bzr (--weave/lca/plain 3-way) merge of 6.0-build
into 6.0-bugteam resulted in many conflicts. Pulling up from 5.1 had just
one. So it was easy to re-do the merge that has already been done in
6.0-build.
modified:
configure.in
extra/Makefile.am
man/Makefile.am
scripts/make_binary_distribution.sh
support-files/mysql.spec.sh
win/create_manifest.js
zlib/gzio.c
2829 Georgi Kodinov 2008-09-10 [merge]
merged 6.0-5.1.29-rc to 6.0-bugteam
modified:
mysql-test/t/slave_allow_batching_basic.test
mysql-test/t/slave_compressed_protocol_basic.test
mysql-test/t/slave_exec_mode_basic.test
=== modified file '.bzrignore'
--- a/.bzrignore 2008-08-26 10:20:41 +0000
+++ b/.bzrignore 2008-09-11 08:01:28 +0000
@@ -1891,3 +1891,8 @@ zlib/*.vcproj
extra/libevent/event-config.h
libmysqld/ddl_blocker.cc
libmysqld/mdl.cc
+mysql-test/bug36522-64.tar
+mysql-test/bug36522.tar
+mysql-test/t.log
+mysql-test/tps.log
+libmysqld/event_parse_data.cc
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt 2008-09-01 17:51:15 +0000
+++ b/CMakeLists.txt 2008-09-09 19:02:38 +0000
@@ -102,9 +102,6 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/suppo
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-small.cnf.sh
${CMAKE_SOURCE_DIR}/support-files/my-small.ini @ONLY)
-IF(__NT__)
- ADD_DEFINITIONS(-D__NT__)
-ENDIF(__NT__)
IF(CYBOZU)
ADD_DEFINITIONS(-DCYBOZU)
ENDIF(CYBOZU)
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc 2008-08-22 06:48:55 +0000
+++ b/client/mysqlbinlog.cc 2008-09-09 19:02:38 +0000
@@ -1854,7 +1854,7 @@ static Exit_status dump_local_log_entrie
return ERROR_STOP;
}
#endif
- if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
+ if (init_io_cache(file, my_fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
{
error("Failed to init IO cache.");
=== modified file 'client/mysqlslap.c'
--- a/client/mysqlslap.c 2008-04-25 16:43:25 +0000
+++ b/client/mysqlslap.c 2008-07-14 14:24:32 +0000
@@ -1331,7 +1331,7 @@ get_options(int *argc,char ***argv)
if (opt_csv_str[0] == '-')
{
- csv_file= fileno(stdout);
+ csv_file= my_fileno(stdout);
}
else
{
@@ -1547,9 +1547,9 @@ get_options(int *argc,char ***argv)
fprintf(stderr,"%s: Could not open create file\n", my_progname);
exit(1);
}
- tmp_string= (char *)my_malloc(sbuf.st_size + 1,
+ tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
parse_delimiter(tmp_string, &create_statements, delimiter[0]);
@@ -1584,9 +1584,9 @@ get_options(int *argc,char ***argv)
fprintf(stderr,"%s: Could not open query supplied file\n", my_progname);
exit(1);
}
- tmp_string= (char *)my_malloc(sbuf.st_size + 1,
+ tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_query)
@@ -1615,9 +1615,9 @@ get_options(int *argc,char ***argv)
fprintf(stderr,"%s: Could not open query supplied file\n", my_progname);
exit(1);
}
- tmp_string= (char *)my_malloc(sbuf.st_size + 1,
+ tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_pre_statements)
@@ -1646,9 +1646,9 @@ get_options(int *argc,char ***argv)
fprintf(stderr,"%s: Could not open query supplied file\n", my_progname);
exit(1);
}
- tmp_string= (char *)my_malloc(sbuf.st_size + 1,
+ tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_post_statements)
=== modified file 'client/readline.cc'
--- a/client/readline.cc 2007-05-10 09:59:39 +0000
+++ b/client/readline.cc 2008-06-17 23:37:23 +0000
@@ -33,7 +33,7 @@ LINE_BUFFER *batch_readline_init(ulong m
if (!(line_buff=(LINE_BUFFER*)
my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
return 0;
- if (init_line_buffer(line_buff,fileno(file),IO_SIZE,max_size))
+ if (init_line_buffer(line_buff,my_fileno(file),IO_SIZE,max_size))
{
my_free(line_buff,MYF(0));
return 0;
=== modified file 'configure.in'
--- a/configure.in 2008-09-08 07:13:09 +0000
+++ b/configure.in 2008-09-12 08:58:52 +0000
@@ -9,7 +9,7 @@ AC_CANONICAL_SYSTEM
# remember to also update version.c in ndb
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 6.0.7-alpha)
+AM_INIT_AUTOMAKE(mysql, 6.0.8-alpha)
AM_CONFIG_HEADER([include/config.h:config.h.in])
NDB_VERSION_MAJOR=6
@@ -2750,6 +2750,9 @@ then
sql_server="vio sql"
fi
+# "innochecksum" is not in the "innobase/" subdirectory, but should be switched
+AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes])
+
# IMPORTANT - do not modify LIBS past this line - this hack is the only way
# I know to add the static NSS magic if we have static NSS libraries with
# glibc - Sasha
=== modified file 'extra/Makefile.am'
--- a/extra/Makefile.am 2008-06-26 17:48:42 +0000
+++ b/extra/Makefile.am 2008-09-11 08:01:28 +0000
@@ -44,7 +44,12 @@ $(top_builddir)/include/mysqld_ername.h:
$(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h
bin_PROGRAMS = replace perror resolveip my_print_defaults \
- resolve_stack_dump mysql_waitpid innochecksum
+ resolve_stack_dump mysql_waitpid
+# "innochecksum" should be switched
+if BUILD_INNODB_TOOLS
+bin_PROGRAMS += innochecksum
+endif
+
noinst_PROGRAMS = charset2html
EXTRA_DIST = CMakeLists.txt
=== removed file 'include/atomic/x86-msvc.h'
--- a/include/atomic/x86-msvc.h 2006-12-27 01:23:51 +0000
+++ b/include/atomic/x86-msvc.h 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
-/* Copyright (C) 2006 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/*
- XXX 64-bit atomic operations can be implemented using
- cmpxchg8b, if necessary
-*/
-
-// Would it be better to use intrinsics ?
-// (InterlockedCompareExchange, InterlockedCompareExchange16
-// InterlockedExchangeAdd, InterlockedExchange)
-
-#ifndef _atomic_h_cleanup_
-#define _atomic_h_cleanup_ "atomic/x86-msvc.h"
-
-#define MY_ATOMIC_MODE "msvc-x86" LOCK
-
-#define make_atomic_add_body(S) \
- _asm { \
- _asm mov reg_ ## S, v \
- _asm LOCK xadd *a, reg_ ## S \
- _asm movzx v, reg_ ## S \
- }
-#define make_atomic_cas_body(S) \
- _asm { \
- _asm mov areg_ ## S, *cmp \
- _asm mov reg2_ ## S, set \
- _asm LOCK cmpxchg *a, reg2_ ## S \
- _asm mov *cmp, areg_ ## S \
- _asm setz al \
- _asm movzx ret, al \
- }
-#define make_atomic_swap_body(S) \
- _asm { \
- _asm mov reg_ ## S, v \
- _asm xchg *a, reg_ ## S \
- _asm mov v, reg_ ## S \
- }
-
-#ifdef MY_ATOMIC_MODE_DUMMY
-#define make_atomic_load_body(S) ret=*a
-#define make_atomic_store_body(S) *a=v
-#else
-/*
- Actually 32-bit reads/writes are always atomic on x86
- But we add LOCK here anyway to force memory barriers
-*/
-#define make_atomic_load_body(S) \
- _asm { \
- _asm mov areg_ ## S, 0 \
- _asm mov reg2_ ## S, areg_ ## S \
- _asm LOCK cmpxchg *a, reg2_ ## S \
- _asm mov ret, areg_ ## S \
- }
-#define make_atomic_store_body(S) \
- _asm { \
- _asm mov reg_ ## S, v \
- _asm xchg *a, reg_ ## S \
- }
-#endif
-
-#define reg_8 al
-#define reg_16 ax
-#define reg_32 eax
-#define areg_8 al
-#define areg_16 ax
-#define areg_32 eax
-#define reg2_8 bl
-#define reg2_16 bx
-#define reg2_32 ebx
-
-#else /* cleanup */
-
-#undef reg_8
-#undef reg_16
-#undef reg_32
-#undef areg_8
-#undef areg_16
-#undef areg_32
-#undef reg2_8
-#undef reg2_16
-#undef reg2_32
-#endif
-
=== modified file 'include/config-win.h'
--- a/include/config-win.h 2008-07-09 07:12:43 +0000
+++ b/include/config-win.h 2008-07-23 08:52:08 +0000
@@ -75,7 +75,6 @@
#endif
/* File and lock constants */
-#define O_SHARE 0x1000 /* Open file in sharing mode */
#ifdef __BORLANDC__
#define F_RDLCK LK_NBLCK /* read lock */
#define F_WRLCK LK_NBRLCK /* write lock */
@@ -216,7 +215,7 @@ typedef SSIZE_T ssize_t;
#define SIZEOF_CHARP 4
#endif
#define HAVE_BROKEN_NETINET_INCLUDES
-#ifdef __NT__
+#ifdef _WIN32
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
#endif
@@ -325,7 +324,7 @@ inline double ulonglong2double(ulonglong
#define strcasecmp stricmp
#define strncasecmp strnicmp
-#ifndef __NT__
+#ifndef _WIN32
#undef FILE_SHARE_DELETE
#define FILE_SHARE_DELETE 0 /* Not implemented on Win 98/ME */
#endif
@@ -371,13 +370,13 @@ inline double ulonglong2double(ulonglong
#define FN_DEVCHAR ':'
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
-#define OS_FILE_LIMIT 2048
+#define OS_FILE_LIMIT UINT_MAX /* No limit*/
#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
/* The following is only used for statistics, so it should be good enough */
-#ifdef __NT__ /* This should also work on Win98 but .. */
+#ifdef _WIN32 /* This should also work on Win98 but .. */
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
#endif
=== modified file 'include/my_dir.h'
--- a/include/my_dir.h 2006-12-23 19:17:15 +0000
+++ b/include/my_dir.h 2008-06-20 00:27:48 +0000
@@ -69,7 +69,11 @@ typedef struct my_stat
#else
+#if(_MSC_VER)
+#define MY_STAT struct _stati64 /* 64 bit file size */
+#else
#define MY_STAT struct stat /* Orginal struct have what we need */
+#endif
#endif /* USE_MY_STAT_STRUCT */
=== modified file 'include/my_global.h'
--- a/include/my_global.h 2008-08-13 09:18:28 +0000
+++ b/include/my_global.h 2008-09-09 19:02:38 +0000
@@ -480,15 +480,17 @@ C_MODE_END
#include <assert.h>
/* an assert that works at compile-time. only for constant expression */
-#ifndef __GNUC__
-#define compile_time_assert(X) do { } while(0)
-#else
+#if (_MSC_VER >=1400)
+#define compile_time_assert(X) do { C_ASSERT(X); } while(0)
+#elif defined (___GNUC__)
#define compile_time_assert(X) \
do \
{ \
char compile_time_assert[(X) ? 1 : -1] \
__attribute__ ((unused)); \
} while(0)
+#else
+#define compile_time_assert(X) do { } while(0)
#endif
/* Go around some bugs in different OS and compilers */
@@ -772,7 +774,41 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_LIBCHAR '/'
#define FN_ROOTDIR "/"
#endif
-#define MY_NFILE 64 /* This is only used to save filenames */
+
+/*
+ MY_FILE_MIN is Windows speciality and is used to quickly detect
+ the mismatch of CRT and mysys file IO usage on Windows at runtime.
+ CRT file descriptors can be in the range 0-2047, whereas descriptors returned
+ by my_open() will start with 2048. If a file descriptor with value less then
+ MY_FILE_MIN is passed to mysys IO function, chances are it stemms from
+ open()/fileno() and not my_open()/my_fileno.
+
+ For Posix, mysys functions are light wrappers around libc, and MY_FILE_MIN
+ is logically 0.
+*/
+
+#ifdef _WIN32
+#define MY_FILE_MIN 2048
+#else
+#define MY_FILE_MIN 0
+#endif
+
+/*
+ MY_NFILE is the default size of my_file_info array.
+
+ It is larger on Windows, because it all file handles are stored in my_file_info
+ Default size is 16384 and this should be enough for most cases.If it is not
+ enough, --max-open-files with larger value can be used.
+
+ For Posix , my_file_info array is only used to store filenames for
+ error reporting and its size is not a limitation for number of open files.
+*/
+#ifdef _WIN32
+#define MY_NFILE (16384 + MY_FILE_MIN)
+#else
+#define MY_NFILE 64
+#endif
+
#ifndef OS_FILE_LIMIT
#define OS_FILE_LIMIT 65535
#endif
@@ -809,9 +845,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* Some things that this system doesn't have */
#define NO_HASH /* Not needed anymore */
-#ifdef __WIN__
-#define NO_DIR_LIBRARY /* Not standar dir-library */
-#define USE_MY_STAT_STRUCT /* For my_lib */
+#ifdef _WIN32
+#define NO_DIR_LIBRARY /* Not standard dir-library */
#endif
/* Some defines of functions for portability */
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h 2008-08-24 16:12:12 +0000
+++ b/include/my_sys.h 2008-09-09 19:02:38 +0000
@@ -329,9 +329,13 @@ enum file_type
struct st_my_file_info
{
- char * name;
- enum file_type type;
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(__WIN__)
+ char *name;
+#ifdef _WIN32
+ HANDLE fhandle; /* win32 file handle */
+ int oflag; /* open flags, e.g O_APPEND */
+#endif
+ enum file_type type;
+#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
pthread_mutex_t mutex;
#endif
};
@@ -648,22 +652,29 @@ extern void *my_memmem(const void *hayst
const void *needle, size_t needlelen);
-#ifdef __WIN__
-extern int my_access(const char *path, int amode);
-extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
+#ifdef _WIN32
+extern int my_access(const char *path, int amode);
#else
#define my_access access
#endif
+
extern int check_if_legal_filename(const char *path);
extern int check_if_legal_tablename(const char *path);
-#if defined(__WIN__) && defined(__NT__)
+#ifdef _WIN32
extern int nt_share_delete(const char *name,myf MyFlags);
#define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags))
#else
#define my_delete_allow_opened(fname,flags) my_delete((fname),(flags))
#endif
+#ifdef _WIN32
+/* Windows-only functions (CRT equivalents)*/
+extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
+extern HANDLE my_get_osfhandle(File fd);
+extern void my_osmaperr(unsigned long last_error);
+#endif
+
#ifndef TERMINATE
extern void TERMINATE(FILE *file, uint flag);
#endif
@@ -671,6 +682,7 @@ extern void init_glob_errs(void);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern int my_fclose(FILE *fd,myf MyFlags);
+extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_chmod(const char *name, mode_t mode, myf my_flags);
extern int my_sync(File fd, myf my_flags);
=== modified file 'libmysql/CMakeLists.txt'
--- a/libmysql/CMakeLists.txt 2008-08-26 18:57:58 +0000
+++ b/libmysql/CMakeLists.txt 2008-09-09 19:02:38 +0000
@@ -98,7 +98,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ..
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c
- ../mysys/my_getsystime.c ${LIB_SOURCES})
+ ../mysys/my_getsystime.c ../mysys/my_winerr.c ../mysys/my_winfile.c ${LIB_SOURCES})
# Need to set USE_TLS for building the DLL, since __declspec(thread)
# approach to thread local storage does not work properly in DLLs.
=== modified file 'man/Makefile.am'
--- a/man/Makefile.am 2006-12-31 00:02:27 +0000
+++ b/man/Makefile.am 2008-08-27 14:03:39 +0000
@@ -21,5 +21,9 @@ man1_MANS = @man1_files@
man8_MANS = @man8_files@
EXTRA_DIST = $(man1_MANS) $(man8_MANS)
+# "make_win_*" are not needed in Unix binary packages,
+install-data-hook:
+ rm -f $(DESTDIR)$(manlibdir)/man1/make_win_*
+
# Don't update the files from bitkeeper
%::SCCS/s.%
=== modified file 'mysql-test/lib/mtr_report.pl'
--- a/mysql-test/lib/mtr_report.pl 2008-08-25 14:26:49 +0000
+++ b/mysql-test/lib/mtr_report.pl 2008-09-04 13:46:04 +0000
@@ -346,6 +346,12 @@ sub mtr_report_stats ($) {
/Can't execute this command because another BACKUP\/RESTORE operation is in progress/
) or
+ # backup_db_grants test is supposed to trigger lots of restore warnings
+ ($testname eq 'main.backup_db_grants') and
+ (
+ /Restore:/ or /was skipped because the user does not exist/
+ ) or
+
# The tablespace test triggers error below on purpose
($testname eq 'main.backup_tablespace') and
(
=== added file 'mysql-test/r/backup_db_grants.result'
--- a/mysql-test/r/backup_db_grants.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/backup_db_grants.result 2008-08-25 18:14:40 +0000
@@ -0,0 +1,183 @@
+DROP DATABASE IF EXISTS bup_db_grants;
+DROP DATABASE IF EXISTS db2;
+Create two databases and two tables.
+CREATE DATABASE bup_db_grants;
+CREATE DATABASE db2;
+CREATE TABLE bup_db_grants.t1(a INT);
+CREATE TABLE bup_db_grants.s1(b INT);
+INSERT INTO bup_db_grants.t1 VALUES (1), (2), (3), (4);
+INSERT INTO bup_db_grants.s1 VALUES (10), (20), (30), (40);
+Now create users and assign various rights to the databases
+CREATE USER 'bup_user1'@'%';
+CREATE USER bup_user2;
+CREATE USER 'bup_user3'@'%';
+REVOKE ALL ON *.* FROM 'bup_user1'@'%';
+REVOKE ALL ON *.* FROM bup_user2;
+GRANT ALL ON db2.* TO 'bup_user1'@'%';
+GRANT SELECT ON bup_db_grants.* TO 'bup_user1'@'%';
+GRANT INSERT ON bup_db_grants.* TO bup_user2;
+GRANT ALL ON bup_db_grants.* TO 'no_user'@'%';
+GRANT SELECT (a) ON bup_db_grants.t1 TO 'bup_user1'@'%';
+GRANT SELECT (b), INSERT (b) ON bup_db_grants.s1 TO bup_user2;
+FLUSH PRIVILEGES;
+Demonstrate rights of the users.
+SHOW GRANTS FOR 'bup_user1'@'%';
+Grants for bup_user1@%
+GRANT USAGE ON *.* TO 'bup_user1'@'%'
+GRANT ALL PRIVILEGES ON `db2`.* TO 'bup_user1'@'%'
+GRANT SELECT ON `bup_db_grants`.* TO 'bup_user1'@'%'
+GRANT SELECT (a) ON `bup_db_grants`.`t1` TO 'bup_user1'@'%'
+SHOW GRANTS FOR bup_user2;
+Grants for bup_user2@%
+GRANT USAGE ON *.* TO 'bup_user2'@'%'
+GRANT INSERT ON `bup_db_grants`.* TO 'bup_user2'@'%'
+GRANT SELECT (b), INSERT (b) ON `bup_db_grants`.`s1` TO 'bup_user2'@'%'
+SHOW GRANTS FOR 'bup_user3'@'%';
+Grants for bup_user3@%
+GRANT USAGE ON *.* TO 'bup_user3'@'%'
+SHOW GRANTS FOR 'no_user'@'%';
+Grants for no_user@%
+GRANT USAGE ON *.* TO 'no_user'@'%'
+GRANT ALL PRIVILEGES ON `bup_db_grants`.* TO 'no_user'@'%'
+Run backup
+BACKUP DATABASE bup_db_grants TO 'bup_db_grants.bak';
+backup_id
+#
+Drop users and recreate them (removes grants completely).
+DROP USER 'bup_user1'@'%';
+DROP USER bup_user2;
+DROP USER 'bup_user3'@'%';
+DROP USER 'no_user'@'%';
+FLUSH PRIVILEGES;
+CREATE USER 'bup_user1'@'%';
+CREATE USER bup_user2;
+CREATE USER 'bup_user3'@'%';
+FLUSH PRIVILEGES;
+Demonstrate rights of the users.
+SHOW GRANTS FOR 'bup_user1'@'%';
+Grants for bup_user1@%
+GRANT USAGE ON *.* TO 'bup_user1'@'%'
+SHOW GRANTS FOR bup_user2;
+Grants for bup_user2@%
+GRANT USAGE ON *.* TO 'bup_user2'@'%'
+SHOW GRANTS FOR 'bup_user3'@'%';
+Grants for bup_user3@%
+GRANT USAGE ON *.* TO 'bup_user3'@'%'
+Run Restore
+RESTORE FROM 'bup_db_grants.bak';
+backup_id
+#
+SHOW TABLES FROM bup_db_grants;
+Tables_in_bup_db_grants
+s1
+t1
+Demonstrate rights of the users.
+SHOW GRANTS FOR 'bup_user1'@'%';
+Grants for bup_user1@%
+GRANT USAGE ON *.* TO 'bup_user1'@'%'
+GRANT SELECT ON `bup_db_grants`.* TO 'bup_user1'@'%'
+GRANT SELECT (a) ON `bup_db_grants`.`t1` TO 'bup_user1'@'%'
+SHOW GRANTS FOR bup_user2;
+Grants for bup_user2@%
+GRANT USAGE ON *.* TO 'bup_user2'@'%'
+GRANT INSERT ON `bup_db_grants`.* TO 'bup_user2'@'%'
+GRANT SELECT (b), INSERT (b) ON `bup_db_grants`.`s1` TO 'bup_user2'@'%'
+SHOW GRANTS FOR 'bup_user3'@'%';
+Grants for bup_user3@%
+GRANT USAGE ON *.* TO 'bup_user3'@'%'
+SHOW GRANTS FOR 'no_user'@'%';
+ERROR 42000: There is no such grant defined for user 'no_user' on host '%'
+Now test what happens on backup if users are deleted.
+Drop users and recreate one of them (removes grants completely).
+DROP USER 'bup_user1'@'%';
+DROP USER bup_user2;
+DROP USER 'bup_user3'@'%';
+FLUSH PRIVILEGES;
+CREATE USER 'bup_user1'@'%';
+CREATE USER 'bup_user1'@'nosuchhost';
+Run Restore
+RESTORE FROM 'bup_db_grants.bak';
+backup_id
+#
+SHOW TABLES FROM bup_db_grants;
+Tables_in_bup_db_grants
+s1
+t1
+Demonstrate rights of the users.
+SHOW GRANTS FOR 'bup_user1'@'%';
+Grants for bup_user1@%
+GRANT USAGE ON *.* TO 'bup_user1'@'%'
+GRANT SELECT ON `bup_db_grants`.* TO 'bup_user1'@'%'
+GRANT SELECT (a) ON `bup_db_grants`.`t1` TO 'bup_user1'@'%'
+SHOW GRANTS FOR bup_user2;
+ERROR 42000: There is no such grant defined for user 'bup_user2' on host '%'
+SHOW GRANTS FOR 'bup_user3'@'%';
+ERROR 42000: There is no such grant defined for user 'bup_user3' on host '%'
+SHOW GRANTS FOR 'no_user'@'%';
+ERROR 42000: There is no such grant defined for user 'no_user' on host '%'
+Cleanup
+DROP USER 'bup_user1'@'%';
+DROP USER 'bup_user1'@'nosuchhost';
+DROP USER bup_user2;
+ERROR HY000: Operation DROP USER failed for 'bup_user2'@'%'
+DROP USER 'bup_user3'@'%';
+ERROR HY000: Operation DROP USER failed for 'bup_user3'@'%'
+DROP USER 'no_user'@'%';
+ERROR HY000: Operation DROP USER failed for 'no_user'@'%'
+FLUSH PRIVILEGES;
+Now test for encoded user names with an x40 in the middle.
+SET NAMES sjis;
+DROP DATABASE bup_db_grants;
+Create a database and some tables.
+CREATE DATABASE bup_db_grants;
+CREATE TABLE bup_db_grants.t1(a INT);
+CREATE TABLE bup_db_grants.s1(b INT);
+Create a user with multibyte username with @ in the middle.
+SET @name = CONVERT(0x8340 using sjis);
+SELECT @name;
+@name
+�@
+SET @cmd = CONCAT('CREATE USER ', @name);
+PREPARE stmt1 FROM @cmd;
+EXECUTE stmt1;
+Grant privileges to user.
+SET @cmd = CONCAT('GRANT SELECT ON bup_db_grants.* TO ', @name);
+PREPARE stmt2 from @cmd;
+EXECUTE stmt2;
+FLUSH PRIVILEGES;
+Show existing grants.
+SET @cmd = CONCAT('SHOW GRANTS FOR ', @name);
+PREPARE stmt3 FROM @cmd;
+EXECUTE stmt3;
+Grants for bup_db_grants`.* TO '�@'@'%'
+Backup database.
+BACKUP DATABASE bup_db_grants TO 'bup_db_grants.bak';
+backup_id
+#
+Remove privileges from user.
+SET @cmd = CONCAT('REVOKE ALL ON bup_db_grants.* FROM ', @name);
+PREPARE stmt4 FROM @cmd;
+EXECUTE stmt4;
+FLUSH PRIVILEGES;
+Show existing grants -- should only USAGE.
+EXECUTE stmt3;
+Grants for �@@%
+GRANT USAGE ON *.* TO '�@'@'%'
+Run restore.
+RESTORE FROM 'bup_db_grants.bak';
+backup_id
+#
+FLUSH PRIVILEGES;
+Ensure grants have been restored.
+EXECUTE stmt3;
+Grants for �@@%
+GRANT USAGE ON *.* TO '�@'@'%'
+GRANT SELECT ON `bup_db_grants`.* TO '�@'@'%'
+SET @cmd = CONCAT('DROP USER ', @name);
+PREPARE stmt5 FROM @cmd;
+EXECUTE stmt5;
+SET NAMES latin1;
+DROP DATABASE bup_db_grants;
+DROP DATABASE db2;
=== added file 'mysql-test/r/backup_default.result'
--- a/mysql-test/r/backup_default.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/backup_default.result 2008-08-26 13:28:34 +0000
@@ -0,0 +1,73 @@
+
+Server should not crash for backup using default driver - CSV
+Test for bug#35117
+
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE csv_table(
+id int NOT NULL,
+name char(20) NOT NULL,
+city varchar(20) NOT NULL)
+ENGINE=csv;
+INSERT INTO csv_table VALUES(1,'aa1','bb1'),(2,'aa2','bb2'),(3,'aa3','bb3');
+backup on csv only
+BACKUP DATABASE db1 to 'bup_csv.bak';
+backup_id
+#
+DROP DATABASE db1;
+restore on csv only
+RESTORE FROM 'bup_csv.bak';
+backup_id
+#
+testing content in restored tables
+SELECT * FROM csv_table ORDER BY id;
+id name city
+1 aa1 bb1
+2 aa2 bb2
+3 aa3 bb3
+DROP DATABASE db1;
+
+Server should not crash for backup using default driver
+Partitioned Falcon tables
+Test for bug#33566, bug#36792
+
+CREATE DATABASE db1;
+USE db1;
+CREATE TABLE partition_table (
+int_column int(11),
+char_column char(5))
+engine=falcon
+PARTITION BY HASH (int_column);
+INSERT INTO partition_table VALUES (0,'pVtIa');
+INSERT INTO partition_table VALUES (5,'jTfSg');
+INSERT INTO partition_table VALUES (20,'UezFi');
+INSERT INTO partition_table VALUES (25,'cxmeH');
+INSERT INTO partition_table VALUES (65,'lIuNS');
+testing content in restored tables
+SELECT * FROM partition_table ORDER BY int_column;
+int_column char_column
+0 pVtIa
+5 jTfSg
+20 UezFi
+25 cxmeH
+65 lIuNS
+
+Server should not crash for backup using default driver
+Mix of tables
+
+CREATE TABLE csv_table(
+id int NOT NULL,
+name char(20) NOT NULL,
+city varchar(20) NOT NULL)
+ENGINE=csv;
+INSERT INTO csv_table VALUES(1,'aa1','bb1'),(2,'aa2','bb2'),(3,'aa3','bb3');
+CREATE TABLE myisam_table(
+i int,
+v varchar(20))
+ENGINE=myisam;
+INSERT INTO myisam_table VALUES(1,'v1'),(2,'v2'),(3,'v3');
+
+*** CLEANUP ****
+
+DROP DATABASE db1;
=== modified file 'mysql-test/r/backup_errors.result'
--- a/mysql-test/r/backup_errors.result 2008-03-05 17:48:12 +0000
+++ b/mysql-test/r/backup_errors.result 2008-08-21 11:36:09 +0000
@@ -95,3 +95,41 @@ Restoring the table
CREATE TABLE mysql.online_backup_progress LIKE test.obp_copy;
DROP TABLE test.obp_copy;
DROP DATABASE test_ob_error;
+
+Bug#38624
+Test that backup fails with error if database files are removed
+after backup starts
+SET DEBUG_SYNC= 'reset';
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+start backup but stop just before adding metadata to backup image
+SET DEBUG_SYNC= 'backup_before_write_preamble SIGNAL running WAIT_FOR db_will_fail';
+BACKUP DATABASE db1 TO 'bup_db1.bak';
+SET DEBUG_SYNC='now WAIT_FOR running';
+delete database files so that check_db_dir_exists will fail in
+si_objects.cc @ DatabaseObj::do_serialize
+SET DEBUG_SYNC='now SIGNAL db_will_fail';
+Database has been deleted, backup will fail
+ERROR 42000: Unknown database 'db1'
+
+Test that backup fails with error if a table used by
+a trigger cannot be opened
+SET DEBUG_SYNC= 'reset';
+DROP DATABASE IF EXISTS db1;
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (i int);
+CREATE TABLE db1.t2 (v varchar (20));
+CREATE TRIGGER db1.trg AFTER INSERT ON db1.t1 FOR EACH ROW
+BEGIN
+INSERT INTO db1.t2(v) VALUES ('Test trigger fired');
+END;||
+SET DEBUG_SYNC= 'reset';
+Setting debug point that will make backup fail when adding the
+trigger metadata
+SET SESSION DEBUG='+d,backup_fail_add_trigger';
+BACKUP DATABASE db1 TO 'bup_db1.bak';
+ERROR HY000: Failed to obtain meta-data for trigger `db1`.`trg`
+SET DEBUG_SYNC= 'reset';
+DROP DATABASE db1;
+
+Done testing for Bug#38624
=== added file 'mysql-test/r/backup_timeout.result'
--- a/mysql-test/r/backup_timeout.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/backup_timeout.result 2008-08-19 15:35:29 +0000
@@ -0,0 +1,73 @@
+SET DEBUG_SYNC= 'reset';
+DROP DATABASE IF EXISTS bup_ddl_blocker;
+CREATE DATABASE bup_ddl_blocker;
+con1: Creating tables
+CREATE TABLE bup_ddl_blocker.t1 (col_a CHAR(40)) ENGINE=INNODB;
+con1: Loading data
+INSERT INTO bup_ddl_blocker.t1 VALUES ("01 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("02 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("03 Some data to test");
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 50
+Part A
+con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+con1: Get a backup going and stop after the DDL blocker is fired.
+BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+Set ddl timeout to 1 second
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 1
+con2: Try a ddl operation and watch it expire
+CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY;
+ERROR HY000: The backup wait timeout has expired for query 'CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY'.
+release the lock.
+con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+backup_id
+#
+Part B
+con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+con1: Get a backup going and stop after the DDL blocker is fired.
+BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+Set ddl timeout to 0 seconds
+SET backup_wait_timeout = 0;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 0
+con2: Try a ddl operation and it should expire
+CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+ERROR HY000: The backup wait timeout has expired for query 'CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY'.
+SET backup_wait_timeout = 100;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 100
+con3: Try a ddl operation and it should not expire
+CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+release the lock.
+con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+backup_id
+#
+USE bup_ddl_blocker;
+SHOW FULL TABLES;
+Tables_in_bup_ddl_blocker Table_type
+t1 BASE TABLE
+t3 BASE TABLE
+Part C
+Show that the variable can be reset to its timeout value using
+SET backup_wait_timeout = DEFAULT;
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 1
+SET backup_wait_timeout = DEFAULT;
+SHOW VARIABLES LIKE 'backup_wait%';
+Variable_name Value
+backup_wait_timeout 50
+DROP DATABASE bup_ddl_blocker;
=== modified file 'mysql-test/r/backup_views.result'
--- a/mysql-test/r/backup_views.result 2008-08-11 10:41:41 +0000
+++ b/mysql-test/r/backup_views.result 2008-08-20 13:23:10 +0000
@@ -277,10 +277,10 @@ DROP DATABASE bup_db2;
Restore database.
restore database with view dependency to other, non-existing db
RESTORE FROM 'bup_objectview1.bak';
-ERROR 42S02: Table 'bup_db2.t2' doesn't exist
+ERROR HY000: Could not restore view `bup_db1`.`v5`. Please check the view definition for possible missing dependencies.
DROP DATABASE bup_db1;
RESTORE FROM 'bup_objectview2.bak';
-ERROR 42S02: Table 'bup_db1.t3' doesn't exist
+ERROR HY000: Could not restore view `bup_db2`.`student_details`. Please check the view definition for possible missing dependencies.
DROP DATABASE bup_db2;
RESTORE FROM 'bup_objectview.bak';
backup_id
=== modified file 'mysql-test/r/ctype_utf8.result'
--- a/mysql-test/r/ctype_utf8.result 2008-09-04 08:47:10 +0000
+++ b/mysql-test/r/ctype_utf8.result 2008-09-05 11:51:40 +0000
@@ -2402,6 +2402,23 @@ b
c
drop table t1;
set max_sort_length=default;
+CREATE TABLE t1 (
+clipid INT NOT NULL,
+Tape TINYTEXT,
+PRIMARY KEY (clipid),
+KEY tape(Tape(255))
+) CHARACTER SET=utf8;
+ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `clipid` int(11) NOT NULL,
+ `mos` tinyint(4) DEFAULT '0',
+ `Tape` tinytext,
+ PRIMARY KEY (`clipid`),
+ KEY `tape` (`Tape`(255))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
predicted_order int NOT NULL,
=== renamed file 'mysql-test/r/innodb_bug34053.result.moved' => 'mysql-test/r/innodb_bug34053.result'
=== removed file 'mysql-test/r/innodb_bug34053.result'
--- a/mysql-test/r/innodb_bug34053.result 2008-02-19 16:44:09 +0000
+++ b/mysql-test/r/innodb_bug34053.result 1970-01-01 00:00:00 +0000
@@ -1 +0,0 @@
-SET storage_engine=InnoDB;
=== removed file 'mysql-test/r/merge-big.result'
--- a/mysql-test/r/merge-big.result 2008-02-07 11:04:19 +0000
+++ b/mysql-test/r/merge-big.result 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
-drop table if exists t1,t2,t3,t4,t5,t6;
-#
-# Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
-# corrupts a MERGE table
-# Problem #3
-#
-CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
-LOCK TABLE t1 WRITE;
-# connection con1
-SET SESSION debug="+d,sleep_open_and_lock_after_open";
-INSERT INTO t1 VALUES (1);
-# connection default
-# Let INSERT go into thr_multi_lock().
-# Kick INSERT out of thr_multi_lock().
-FLUSH TABLES;
-# Let INSERT go through open_tables() where it sleeps.
-# Unlock and close table and wait for con1 to close too.
-FLUSH TABLES;
-# This should give no result.
-SELECT * FROM t1;
-c1
-UNLOCK TABLES;
-# connection con1
-SET SESSION debug="-d,sleep_open_and_lock_after_open";
-# connection default
-DROP TABLE t1;
=== renamed file 'mysql-test/r/slave_allow_batching_basic.result' => 'mysql-test/r/rpl_slave_allow_batching_basic.result'
=== renamed file 'mysql-test/r/slave_compressed_protocol_basic.result' => 'mysql-test/r/rpl_slave_compressed_protocol_basic.result'
=== renamed file 'mysql-test/r/slave_exec_mode_basic.result' => 'mysql-test/r/rpl_slave_exec_mode_basic.result'
=== renamed file 'mysql-test/r/slave_net_timeout_basic.result' => 'mysql-test/r/rpl_slave_net_timeout_basic.result'
=== added file 'mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data'
Binary files a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data 2008-09-01 21:04:48 +0000 differ
=== removed file 'mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data'
Binary files a/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data 2008-09-05 13:39:08 +0000 and b/mysql-test/std_data/ndb_backup51_data_be/BACKUP-1-0.1.Data 1970-01-01 00:00:00 +0000 differ
=== added file 'mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data'
Binary files a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data 2008-09-01 21:04:48 +0000 differ
=== removed file 'mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data'
Binary files a/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data 2008-09-05 13:39:08 +0000 and b/mysql-test/std_data/ndb_backup51_data_le/BACKUP-1-0.2.Data 1970-01-01 00:00:00 +0000 differ
=== removed file 'mysql-test/suite/funcs_1/t/ndb_storedproc_06.tes'
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_06.tes 2007-02-06 12:35:54 +0000
+++ b/mysql-test/suite/funcs_1/t/ndb_storedproc_06.tes 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/innodb_storedproc_06.test
-#
-# 1. Check if InnoDB is available
---source include/have_innodb.inc
-
-# 2. Set $engine_type
-let $engine_type= innodb;
-
---source suite/funcs_1/storedproc/storedproc_06.inc
=== removed file 'mysql-test/suite/funcs_1/t/ndb_storedproc_08.tes'
--- a/mysql-test/suite/funcs_1/t/ndb_storedproc_08.tes 2007-02-06 12:35:54 +0000
+++ b/mysql-test/suite/funcs_1/t/ndb_storedproc_08.tes 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-#### suite/funcs_1/t/innodb_storedproc_08.test
-#
-# 1. Check if InnoDB is available
---source include/have_innodb.inc
-
-# 2. Set $engine_type
-let $engine_type= innodb;
-
---source suite/funcs_1/storedproc/storedproc_08.inc
=== added file 'mysql-test/suite/large_tests/r/lock_tables_big.result'
--- a/mysql-test/suite/large_tests/r/lock_tables_big.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/large_tests/r/lock_tables_big.result 2008-06-17 23:37:23 +0000
@@ -0,0 +1 @@
+all done
=== added file 'mysql-test/suite/large_tests/t/lock_tables_big.test'
--- a/mysql-test/suite/large_tests/t/lock_tables_big.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/large_tests/t/lock_tables_big.test 2008-06-17 23:37:23 +0000
@@ -0,0 +1,32 @@
+#
+# Bug#24509 cannot use more than 2048 file descriptors on windows
+#
+--disable_query_log
+create database many_tables;
+use many_tables;
+let $max_tables=3000;
+let $i=$max_tables;
+
+--disable_warnings
+create table t (i int);
+let $table_list=t READ;
+
+while ($i)
+{
+ eval create table t$i (i int);
+ let $table_list= $table_list ,t$i READ;
+ dec $i;
+}
+
+#lock all tables we just created (resembles mysqldump startup is doing with --all-databases operation)
+#There will be 3 descriptors for each table (table.FRM, table.MYI and table.MYD files) means 9000 files
+#descriptors altogether. For Microsoft C runtime, this is way too many.
+
+eval LOCK TABLES $table_list;
+unlock tables;
+
+drop database many_tables;
+--disable_query_log
+--echo all done
+
+
=== renamed file 'mysql-test/suite/ndb/r/ndb_binlog_format.result' => 'mysql-test/suite/ndb_team/r/ndb_binlog_format.result'
=== renamed file 'mysql-test/suite/ndb/t/ndb_binlog_format.test' => 'mysql-test/suite/ndb_team/t/ndb_binlog_format.test'
=== added file 'mysql-test/suite/rpl/r/rpl_colSize.result'
--- a/mysql-test/suite/rpl/r/rpl_colSize.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_colSize.result 2008-09-12 10:53:32 +0000
@@ -0,0 +1,179 @@
+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 TABLE IF EXISTS t1;
+**** Testing WL#3228 changes. ****
+*** Create "wider" table on slave ***
+STOP SLAVE;
+RESET SLAVE;
+CREATE TABLE t1 (
+a float (47),
+b double (143,9),
+c decimal (65,30),
+d numeric (4,0),
+e bit (32),
+f char (21),
+g varchar (1300),
+h binary (33),
+j varbinary (200),
+k enum ('5','6','7', '8','9','0'),
+l set ('1','2','3','4','5','6','7','8','9','0','11','12','13','14','15','16','17','18','19','21','22','23','24','25','26','27','28','29'),
+m TINYBLOB,
+n BLOB,
+o MEDIUMBLOB,
+p LONGBLOB,
+q TINYTEXT,
+r TEXT,
+s MEDIUMTEXT,
+t LONGTEXT
+);
+*** Create same table on master but with narrow columns ***
+CREATE TABLE t1 (
+a float (44),
+b double (10,3),
+c decimal (10,2),
+d numeric (3,0),
+e bit (16),
+f char (10),
+g varchar (100),
+h binary (20),
+j varbinary (20),
+k enum ('5','6','7'),
+l set ('1','2','3','4','5','6','7','8','9','0'),
+m TINYBLOB,
+n BLOB,
+o MEDIUMBLOB,
+p LONGBLOB,
+q TINYTEXT,
+r TEXT,
+s MEDIUMTEXT,
+t LONGTEXT
+);
+RESET MASTER;
+*** Start replication ***
+START SLAVE;
+*** Insert data on master and display it. ***
+INSERT INTO t1 () VALUES (
+17.567,
+2.123,
+10.20,
+125,
+hex(64),
+'TEST',
+'This is a test',
+'binary data',
+'more binary data',
+'6',
+'7',
+"blob 1",
+"blob 2",
+"blob 3",
+"blob 4",
+"text 1",
+"text 2",
+"text 3",
+"text 4");
+SELECT * FROM t1 ORDER BY a;
+a b c d e f g h j k l m n o p q r s t
+17.567 2.123 10.20 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
+*** Select data from slave to compare ***
+SELECT * FROM t1 ORDER BY a;
+a b c d e f g h j k l m n o p q r s t
+17.567 2.123000000 10.200000000000000000000000000000 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
+DROP TABLE t1;
+Create varchar table on master
+CREATE TABLE t1 (
+a VARCHAR(50),
+b VARCHAR(100),
+c VARCHAR(300),
+d CHAR(5)
+);
+Alter varchar table on slave
+ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
+ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
+ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
+Insert some values and select them on master
+INSERT INTO t1 VALUES ("This is a test of col a.",
+"This is another test of col b.",
+"This is a test of the large col c.",
+"Col d");
+SELECT * FROM t1;
+a b c d
+This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(50) DEFAULT NULL,
+ `b` varchar(100) DEFAULT NULL,
+ `c` varchar(300) DEFAULT NULL,
+ `d` char(5) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Insert some values and select them on slave
+SELECT * FROM t1;
+a b c d
+This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(100) DEFAULT NULL,
+ `b` varchar(400) DEFAULT NULL,
+ `c` varchar(500) DEFAULT NULL,
+ `d` char(100) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+Create bit table on master
+CREATE TABLE t1 (
+a BIT(7),
+b BIT(8),
+c BIT(21),
+d BIT(11),
+e BIT(11)
+);
+Create bit table on slave
+DROP TABLE t1;
+CREATE TABLE t1 (
+a BIT(16),
+b BIT(22),
+c BIT(54),
+d BIT(25),
+e BIT(13)
+);
+Insert some values and select them on master
+INSERT INTO t1 VALUES (
+b'1010101',
+b'10101011',
+b'101010110101010101111',
+b'10101010101',
+b'10101011111'
+ );
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
+1010101 10101011 101010110101010101111 10101010101 10101011111
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(7) DEFAULT NULL,
+ `b` bit(8) DEFAULT NULL,
+ `c` bit(21) DEFAULT NULL,
+ `d` bit(11) DEFAULT NULL,
+ `e` bit(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Insert some values and select them on master
+SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
+BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
+1010101 10101011 101010110101010101111 10101010101 10101011111
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bit(16) DEFAULT NULL,
+ `b` bit(22) DEFAULT NULL,
+ `c` bit(54) DEFAULT NULL,
+ `d` bit(25) DEFAULT NULL,
+ `e` bit(13) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+*** Cleanup ***
+DROP TABLE t1;
=== removed file 'mysql-test/suite/rpl/r/rpl_colSize.result'
--- a/mysql-test/suite/rpl/r/rpl_colSize.result 2007-07-29 22:10:42 +0000
+++ b/mysql-test/suite/rpl/r/rpl_colSize.result 1970-01-01 00:00:00 +0000
@@ -1,179 +0,0 @@
-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 TABLE IF EXISTS t1;
-**** Testing WL#3228 changes. ****
-*** Create "wider" table on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t1 (
-a float (47),
-b double (143,9),
-c decimal (65,30),
-d numeric (4,0),
-e bit (32),
-f char (21),
-g varchar (1300),
-h binary (33),
-j varbinary (200),
-k enum ('5','6','7', '8','9','0'),
-l set ('1','2','3','4','5','6','7','8','9','0','11','12','13','14','15','16','17','18','19','21','22','23','24','25','26','27','28','29'),
-m TINYBLOB,
-n BLOB,
-o MEDIUMBLOB,
-p LONGBLOB,
-q TINYTEXT,
-r TEXT,
-s MEDIUMTEXT,
-t LONGTEXT
-);
-*** Create same table on master but with narrow columns ***
-CREATE TABLE t1 (
-a float (44),
-b double (10,3),
-c decimal (10,2),
-d numeric (3,0),
-e bit (16),
-f char (10),
-g varchar (100),
-h binary (20),
-j varbinary (20),
-k enum ('5','6','7'),
-l set ('1','2','3','4','5','6','7','8','9','0'),
-m TINYBLOB,
-n BLOB,
-o MEDIUMBLOB,
-p LONGBLOB,
-q TINYTEXT,
-r TEXT,
-s MEDIUMTEXT,
-t LONGTEXT
-);
-RESET MASTER;
-*** Start replication ***
-START SLAVE;
-*** Insert data on master and display it. ***
-INSERT INTO t1 () VALUES (
-17.567,
-2.123,
-10.20,
-125,
-hex(64),
-'TEST',
-'This is a test',
-'binary data',
-'more binary data',
-'6',
-'7',
-"blob 1",
-"blob 2",
-"blob 3",
-"blob 4",
-"text 1",
-"text 2",
-"text 3",
-"text 4");
-SELECT * FROM t1 ORDER BY a;
-a b c d e f g h j k l m n o p q r s t
-17.567 2.123 10.20 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
-*** Select data from slave to compare ***
-SELECT * FROM t1 ORDER BY a;
-a b c d e f g h j k l m n o p q r s t
-17.567 2.123000000 10.200000000000000000000000000000 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
-DROP TABLE t1;
-Create varchar table on master
-CREATE TABLE t1 (
-a VARCHAR(50),
-b VARCHAR(100),
-c VARCHAR(300),
-d CHAR(5)
-);
-Alter varchar table on slave
-ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
-ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
-ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
-ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
-Insert some values and select them on master
-INSERT INTO t1 VALUES ("This is a test of col a.",
-"This is another test of col b.",
-"This is a test of the large col c.",
-"Col d");
-SELECT * FROM t1;
-a b c d
-This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(50) DEFAULT NULL,
- `b` varchar(100) DEFAULT NULL,
- `c` varchar(300) DEFAULT NULL,
- `d` char(5) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-Insert some values and select them on slave
-SELECT * FROM t1;
-a b c d
-This is a test of col a. This is another test of col b. This is a test of the large col c. Col d
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` varchar(100) DEFAULT NULL,
- `b` varchar(400) DEFAULT NULL,
- `c` varchar(500) DEFAULT NULL,
- `d` char(100) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE t1;
-Create bit table on master
-CREATE TABLE t1 (
-a BIT(7),
-b BIT(8),
-c BIT(21),
-d BIT(11),
-e BIT(11)
-);
-Create bit table on slave
-DROP TABLE t1;
-CREATE TABLE t1 (
-a BIT(16),
-b BIT(22),
-c BIT(54),
-d BIT(25),
-e BIT(13)
-);
-Insert some values and select them on master
-INSERT INTO t1 VALUES (
-b'1010101',
-b'10101011',
-b'101010110101010101111',
-b'10101010101',
-b'10101011111'
- );
-SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
-BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
-1010101 10101011 101010110101010101111 10101010101 10101011111
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(7) DEFAULT NULL,
- `b` bit(8) DEFAULT NULL,
- `c` bit(21) DEFAULT NULL,
- `d` bit(11) DEFAULT NULL,
- `e` bit(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-Insert some values and select them on master
-SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
-BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
-1010101 10101011 101010110101010101111 10101010101 10101011111
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` bit(16) DEFAULT NULL,
- `b` bit(22) DEFAULT NULL,
- `c` bit(54) DEFAULT NULL,
- `d` bit(25) DEFAULT NULL,
- `e` bit(13) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-*** Cleanup ***
-DROP TABLE t1;
=== removed file 'mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result 2008-01-11 17:39:45 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result 1970-01-01 00:00:00 +0000
@@ -1,3423 +0,0 @@
-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;
-set binlog_format=row;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format ROW and engine == 'InnoDB'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 FLOAT DEFAULT '2.00',
-f6 CHAR(4) DEFAULT 'TEST',
-f7 INT DEFAULT '0',
-f8 TEXT,
-f9 LONGBLOB,
-f10 BIT(63),
-f11 VARBINARY(64))ENGINE='InnoDB';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-
-* Show Slave Status *
-
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-
-***** Testing Altering table def scenario *****
-
-CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f7 DECIMAL(17,9) default '1000.00',
-f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f8 MEDIUMBLOB,
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='InnoDB';
-
-CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 DECIMAL(17,9) default '1000.00',
-f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
-f9 VARCHAR(1024),
-f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f11 CHAR(255))
-ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 BIGINT,
-f6 BLOB,
-f7 DATE,
-f8 DATETIME,
-f9 FLOAT,
-f10 INT,
-f11 LONGBLOB,
-f12 LONGTEXT,
-f13 MEDIUMBLOB,
-f14 MEDIUMINT,
-f15 MEDIUMTEXT,
-f16 REAL,
-f17 SMALLINT,
-f18 TEXT,
-f19 TIME,
-f20 TIMESTAMP,
-f21 TINYBLOB,
-f22 TINYINT,
-f23 TINYTEXT,
-f24 YEAR,
-f25 BINARY(255),
-f26 BIT(64),
-f27 CHAR(255),
-f28 DECIMAL(30,7),
-f29 DOUBLE,
-f30 ENUM ('a','b', 'c') default 'a',
-f31 FLOAT,
-f32 NUMERIC(17,9),
-f33 SET ('a', 'b', 'c') default 'b',
-f34 VARBINARY(1025),
-f35 VARCHAR(257)
-) ENGINE='InnoDB';
-
-** Alter tables on slave and drop columns **
-
-alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
-f12;
-alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
-alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-alter table t31
-drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
-drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
-drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
-drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
-drop f33, drop f34, drop f35;
-
-** Insert Data into Master **
-INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
-some var char';
-INSERT into t2 values (2, 2, 2, 'second',
-2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
-'01234567', 'c'),
-(3, 3, 3, 'third',
-3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
-'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
-INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
-binary data';
-INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
-INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
-f9=2.2, f10='seven samurai', f28=222.222, f35='222';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-INSERT into t31 values (1, 1, 3, 'third',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-INSERT into t31 values (1, 1, 4, 'fourth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 5, 'fifth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 6, 'sixth',
-/* f5 BIGINT, */ NULL,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ NULL
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates master **
-
-update t31 set f5=555555555555555 where f3=6;
-update t31 set f2=2 where f3=2;
-update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-
-** Check slave status **
-
-select * from t31;
-f1 f2 f3 f4
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='InnoDB';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='InnoDB';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1091
-Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1091
-Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1054
-Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1054
-Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1072
-Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1072
-Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
-set binlog_format=statement;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format STATEMENT and engine == 'InnoDB'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 FLOAT DEFAULT '2.00',
-f6 CHAR(4) DEFAULT 'TEST',
-f7 INT DEFAULT '0',
-f8 TEXT,
-f9 LONGBLOB,
-f10 BIT(63),
-f11 VARBINARY(64))ENGINE='InnoDB';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-
-* Show Slave Status *
-
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-
-***** Testing Altering table def scenario *****
-
-CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f7 DECIMAL(17,9) default '1000.00',
-f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f8 MEDIUMBLOB,
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='InnoDB';
-
-CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 DECIMAL(17,9) default '1000.00',
-f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
-f9 VARCHAR(1024),
-f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f11 CHAR(255))
-ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 BIGINT,
-f6 BLOB,
-f7 DATE,
-f8 DATETIME,
-f9 FLOAT,
-f10 INT,
-f11 LONGBLOB,
-f12 LONGTEXT,
-f13 MEDIUMBLOB,
-f14 MEDIUMINT,
-f15 MEDIUMTEXT,
-f16 REAL,
-f17 SMALLINT,
-f18 TEXT,
-f19 TIME,
-f20 TIMESTAMP,
-f21 TINYBLOB,
-f22 TINYINT,
-f23 TINYTEXT,
-f24 YEAR,
-f25 BINARY(255),
-f26 BIT(64),
-f27 CHAR(255),
-f28 DECIMAL(30,7),
-f29 DOUBLE,
-f30 ENUM ('a','b', 'c') default 'a',
-f31 FLOAT,
-f32 NUMERIC(17,9),
-f33 SET ('a', 'b', 'c') default 'b',
-f34 VARBINARY(1025),
-f35 VARCHAR(257)
-) ENGINE='InnoDB';
-
-** Alter tables on slave and drop columns **
-
-alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
-f12;
-alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
-alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-alter table t31
-drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
-drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
-drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
-drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
-drop f33, drop f34, drop f35;
-
-** Insert Data into Master **
-INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
-some var char';
-INSERT into t2 values (2, 2, 2, 'second',
-2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
-'01234567', 'c'),
-(3, 3, 3, 'third',
-3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
-'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
-INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
-binary data';
-INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
-INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
-f9=2.2, f10='seven samurai', f28=222.222, f35='222';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-INSERT into t31 values (1, 1, 3, 'third',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-INSERT into t31 values (1, 1, 4, 'fourth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 5, 'fifth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 6, 'sixth',
-/* f5 BIGINT, */ NULL,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ NULL
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates master **
-
-update t31 set f5=555555555555555 where f3=6;
-update t31 set f2=2 where f3=2;
-update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-
-** Check slave status **
-
-select * from t31;
-f1 f2 f3 f4
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='InnoDB';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='InnoDB';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1091
-Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1091
-Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1054
-Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1054
-Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1072
-Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1072
-Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
-set binlog_format=mixed;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format MIXED and engine == 'InnoDB'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 FLOAT DEFAULT '2.00',
-f6 CHAR(4) DEFAULT 'TEST',
-f7 INT DEFAULT '0',
-f8 TEXT,
-f9 LONGBLOB,
-f10 BIT(63),
-f11 VARBINARY(64))ENGINE='InnoDB';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-
-* Show Slave Status *
-
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-
-***** Testing Altering table def scenario *****
-
-CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f7 DECIMAL(17,9) default '1000.00',
-f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f8 MEDIUMBLOB,
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='InnoDB';
-
-CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 DECIMAL(17,9) default '1000.00',
-f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
-f9 VARCHAR(1024),
-f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f11 CHAR(255))
-ENGINE='InnoDB';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 BIGINT,
-f6 BLOB,
-f7 DATE,
-f8 DATETIME,
-f9 FLOAT,
-f10 INT,
-f11 LONGBLOB,
-f12 LONGTEXT,
-f13 MEDIUMBLOB,
-f14 MEDIUMINT,
-f15 MEDIUMTEXT,
-f16 REAL,
-f17 SMALLINT,
-f18 TEXT,
-f19 TIME,
-f20 TIMESTAMP,
-f21 TINYBLOB,
-f22 TINYINT,
-f23 TINYTEXT,
-f24 YEAR,
-f25 BINARY(255),
-f26 BIT(64),
-f27 CHAR(255),
-f28 DECIMAL(30,7),
-f29 DOUBLE,
-f30 ENUM ('a','b', 'c') default 'a',
-f31 FLOAT,
-f32 NUMERIC(17,9),
-f33 SET ('a', 'b', 'c') default 'b',
-f34 VARBINARY(1025),
-f35 VARCHAR(257)
-) ENGINE='InnoDB';
-
-** Alter tables on slave and drop columns **
-
-alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
-f12;
-alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
-alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-alter table t31
-drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
-drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
-drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
-drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
-drop f33, drop f34, drop f35;
-
-** Insert Data into Master **
-INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
-some var char';
-INSERT into t2 values (2, 2, 2, 'second',
-2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
-'01234567', 'c'),
-(3, 3, 3, 'third',
-3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
-'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
-INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
-binary data';
-INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
-INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
-f9=2.2, f10='seven samurai', f28=222.222, f35='222';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-INSERT into t31 values (1, 1, 3, 'third',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-INSERT into t31 values (1, 1, 4, 'fourth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 5, 'fifth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 6, 'sixth',
-/* f5 BIGINT, */ NULL,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ NULL
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates master **
-
-update t31 set f5=555555555555555 where f3=6;
-update t31 set f2=2 where f3=2;
-update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-
-** Check slave status **
-
-select * from t31;
-f1 f2 f3 f4
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='InnoDB';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='InnoDB';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='InnoDB';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1091
-Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1091
-Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1054
-Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1054
-Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1072
-Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1072
-Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='InnoDB';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='InnoDB';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
=== removed file 'mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result 2008-01-11 17:39:45 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result 1970-01-01 00:00:00 +0000
@@ -1,3423 +0,0 @@
-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;
-set binlog_format=row;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format ROW and engine == 'MyISAM'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 FLOAT DEFAULT '2.00',
-f6 CHAR(4) DEFAULT 'TEST',
-f7 INT DEFAULT '0',
-f8 TEXT,
-f9 LONGBLOB,
-f10 BIT(63),
-f11 VARBINARY(64))ENGINE='MyISAM';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-
-* Show Slave Status *
-
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-
-***** Testing Altering table def scenario *****
-
-CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f7 DECIMAL(17,9) default '1000.00',
-f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f8 MEDIUMBLOB,
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='MyISAM';
-
-CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 DECIMAL(17,9) default '1000.00',
-f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
-f9 VARCHAR(1024),
-f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f11 CHAR(255))
-ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 BIGINT,
-f6 BLOB,
-f7 DATE,
-f8 DATETIME,
-f9 FLOAT,
-f10 INT,
-f11 LONGBLOB,
-f12 LONGTEXT,
-f13 MEDIUMBLOB,
-f14 MEDIUMINT,
-f15 MEDIUMTEXT,
-f16 REAL,
-f17 SMALLINT,
-f18 TEXT,
-f19 TIME,
-f20 TIMESTAMP,
-f21 TINYBLOB,
-f22 TINYINT,
-f23 TINYTEXT,
-f24 YEAR,
-f25 BINARY(255),
-f26 BIT(64),
-f27 CHAR(255),
-f28 DECIMAL(30,7),
-f29 DOUBLE,
-f30 ENUM ('a','b', 'c') default 'a',
-f31 FLOAT,
-f32 NUMERIC(17,9),
-f33 SET ('a', 'b', 'c') default 'b',
-f34 VARBINARY(1025),
-f35 VARCHAR(257)
-) ENGINE='MyISAM';
-
-** Alter tables on slave and drop columns **
-
-alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
-f12;
-alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
-alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-alter table t31
-drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
-drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
-drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
-drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
-drop f33, drop f34, drop f35;
-
-** Insert Data into Master **
-INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
-some var char';
-INSERT into t2 values (2, 2, 2, 'second',
-2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
-'01234567', 'c'),
-(3, 3, 3, 'third',
-3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
-'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
-INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
-binary data';
-INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
-INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
-f9=2.2, f10='seven samurai', f28=222.222, f35='222';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-INSERT into t31 values (1, 1, 3, 'third',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-INSERT into t31 values (1, 1, 4, 'fourth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 5, 'fifth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 6, 'sixth',
-/* f5 BIGINT, */ NULL,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ NULL
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates master **
-
-update t31 set f5=555555555555555 where f3=6;
-update t31 set f2=2 where f3=2;
-update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-
-** Check slave status **
-
-select * from t31;
-f1 f2 f3 f4
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='MyISAM';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='MyISAM';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1091
-Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1091
-Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1054
-Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1054
-Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1072
-Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1072
-Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
-set binlog_format=statement;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format STATEMENT and engine == 'MyISAM'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 FLOAT DEFAULT '2.00',
-f6 CHAR(4) DEFAULT 'TEST',
-f7 INT DEFAULT '0',
-f8 TEXT,
-f9 LONGBLOB,
-f10 BIT(63),
-f11 VARBINARY(64))ENGINE='MyISAM';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-
-* Show Slave Status *
-
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-
-***** Testing Altering table def scenario *****
-
-CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f7 DECIMAL(17,9) default '1000.00',
-f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f8 MEDIUMBLOB,
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='MyISAM';
-
-CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 DECIMAL(17,9) default '1000.00',
-f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
-f9 VARCHAR(1024),
-f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f11 CHAR(255))
-ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 BIGINT,
-f6 BLOB,
-f7 DATE,
-f8 DATETIME,
-f9 FLOAT,
-f10 INT,
-f11 LONGBLOB,
-f12 LONGTEXT,
-f13 MEDIUMBLOB,
-f14 MEDIUMINT,
-f15 MEDIUMTEXT,
-f16 REAL,
-f17 SMALLINT,
-f18 TEXT,
-f19 TIME,
-f20 TIMESTAMP,
-f21 TINYBLOB,
-f22 TINYINT,
-f23 TINYTEXT,
-f24 YEAR,
-f25 BINARY(255),
-f26 BIT(64),
-f27 CHAR(255),
-f28 DECIMAL(30,7),
-f29 DOUBLE,
-f30 ENUM ('a','b', 'c') default 'a',
-f31 FLOAT,
-f32 NUMERIC(17,9),
-f33 SET ('a', 'b', 'c') default 'b',
-f34 VARBINARY(1025),
-f35 VARCHAR(257)
-) ENGINE='MyISAM';
-
-** Alter tables on slave and drop columns **
-
-alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
-f12;
-alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
-alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-alter table t31
-drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
-drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
-drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
-drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
-drop f33, drop f34, drop f35;
-
-** Insert Data into Master **
-INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
-some var char';
-INSERT into t2 values (2, 2, 2, 'second',
-2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
-'01234567', 'c'),
-(3, 3, 3, 'third',
-3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
-'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
-INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
-binary data';
-INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
-INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
-f9=2.2, f10='seven samurai', f28=222.222, f35='222';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-INSERT into t31 values (1, 1, 3, 'third',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-INSERT into t31 values (1, 1, 4, 'fourth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 5, 'fifth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 6, 'sixth',
-/* f5 BIGINT, */ NULL,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ NULL
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates master **
-
-update t31 set f5=555555555555555 where f3=6;
-update t31 set f2=2 where f3=2;
-update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-
-** Check slave status **
-
-select * from t31;
-f1 f2 f3 f4
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='MyISAM';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='MyISAM';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1091
-Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1091
-Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1054
-Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1054
-Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1072
-Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1072
-Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
-set binlog_format=mixed;
-
-***********************************************************
-***********************************************************
-***************** Start of Testing ************************
-***********************************************************
-***********************************************************
-* This test format == binlog_format MIXED and engine == 'MyISAM'
-***********************************************************
-***********************************************************
-
-***** Testing more columns on the Master *****
-
-CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 FLOAT DEFAULT '2.00',
-f6 CHAR(4) DEFAULT 'TEST',
-f7 INT DEFAULT '0',
-f8 TEXT,
-f9 LONGBLOB,
-f10 BIT(63),
-f11 VARBINARY(64))ENGINE='MyISAM';
-
-* Alter Table on Slave and drop columns f5 through f11 *
-
-alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-
-* Insert data in Master then update and delete some rows*
-
-* Select count and 20 rows from Master *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
-hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
-2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
-
-* Select count and 20 rows from Slave *
-
-SELECT COUNT(*) FROM t1;
-COUNT(*)
-40
-
-SELECT * FROM t1 ORDER BY f3 LIMIT 20;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-
-* Show Slave Status *
-
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-
-***** Testing Altering table def scenario *****
-
-CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f7 DECIMAL(17,9) default '1000.00',
-f8 MEDIUMBLOB,
-f9 NUMERIC(6,4) default '2000.00',
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-
-CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 ENUM('a', 'b', 'c') default 'a',
-f8 MEDIUMBLOB,
-f10 VARCHAR(1024),
-f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f12 SET('a', 'b', 'c') default 'b')
-ENGINE='MyISAM';
-
-CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 DOUBLE DEFAULT '2.00',
-f6 DECIMAL(17,9) default '1000.00',
-f7 MEDIUMBLOB,
-f8 NUMERIC(6,4) default '2000.00',
-f9 VARCHAR(1024),
-f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
-f11 CHAR(255))
-ENGINE='MyISAM';
-Warnings:
-Warning 1264 Out of range value for column 'f8' at row 1
-
-CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
-/* extra */
-f5 BIGINT,
-f6 BLOB,
-f7 DATE,
-f8 DATETIME,
-f9 FLOAT,
-f10 INT,
-f11 LONGBLOB,
-f12 LONGTEXT,
-f13 MEDIUMBLOB,
-f14 MEDIUMINT,
-f15 MEDIUMTEXT,
-f16 REAL,
-f17 SMALLINT,
-f18 TEXT,
-f19 TIME,
-f20 TIMESTAMP,
-f21 TINYBLOB,
-f22 TINYINT,
-f23 TINYTEXT,
-f24 YEAR,
-f25 BINARY(255),
-f26 BIT(64),
-f27 CHAR(255),
-f28 DECIMAL(30,7),
-f29 DOUBLE,
-f30 ENUM ('a','b', 'c') default 'a',
-f31 FLOAT,
-f32 NUMERIC(17,9),
-f33 SET ('a', 'b', 'c') default 'b',
-f34 VARBINARY(1025),
-f35 VARCHAR(257)
-) ENGINE='MyISAM';
-
-** Alter tables on slave and drop columns **
-
-alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
-f12;
-alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
-alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
-alter table t31
-drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11,
-drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18,
-drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25,
-drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
-drop f33, drop f34, drop f35;
-
-** Insert Data into Master **
-INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
-some var char';
-INSERT into t2 values (2, 2, 2, 'second',
-2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char',
-'01234567', 'c'),
-(3, 3, 3, 'third',
-3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char',
-'01234567', 'c');
-Warnings:
-Warning 1264 Out of range value for column 'f9' at row 1
-Warning 1264 Out of range value for column 'f9' at row 2
-INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char';
-INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
-binary data';
-INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
-INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
-f9=2.2, f10='seven samurai', f28=222.222, f35='222';
-Warnings:
-Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1
-INSERT into t31 values (1, 1, 3, 'third',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- );
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-INSERT into t31 values (1, 1, 4, 'fourth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 5, 'fifth',
-/* f5 BIGINT, */ 333333333333333333333333,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ 'three times three'
- ),
-(1, 1, 6, 'sixth',
-/* f5 BIGINT, */ NULL,
-/* f6 BLOB, */ '3333333333333333333333',
-/* f7 DATE, */ '2007-07-18',
-/* f8 DATETIME, */ "2007-07-18",
-/* f9 FLOAT, */ 3.33333333,
-/* f10 INT, */ 333333333,
-/* f11 LONGBLOB, */ '3333333333333333333',
-/* f12 LONGTEXT, */ '3333333333333333333',
-/* f13 MEDIUMBLOB, */ '3333333333333333333',
-/* f14 MEDIUMINT, */ 33,
-/* f15 MEDIUMTEXT, */ 3.3,
-/* f16 REAL, */ 3.3,
-/* f17 SMALLINT, */ 3,
-/* f18 TEXT, */ '33',
-/* f19 TIME, */ '2:59:58.999',
-/* f20 TIMESTAMP, */ 20000303000000,
-/* f21 TINYBLOB, */ '3333',
-/* f22 TINYINT, */ 3,
-/* f23 TINYTEXT, */ '3',
-/* f24 YEAR, */ 3000,
-/* f25 BINARY(255), */ 'three_33333',
-/* f26 BIT(64), */ b'011',
-/* f27 CHAR(255), */ 'three',
-/* f28 DECIMAL(30,7), */ 3.333,
-/* f29 DOUBLE, */ 3.333333333333333333333333333,
-/* f30 ENUM ('a','b','c')*/ 'c',
-/* f31 FLOAT, */ 3.0,
-/* f32 NUMERIC(17,9), */ 3.3333,
-/* f33 SET ('a','b','c'),*/ 'c',
-/*f34 VARBINARY(1025),*/ '3333 minus 3',
-/*f35 VARCHAR(257),*/ NULL
-);
-Warnings:
-Warning 1264 Out of range value for column 'f5' at row 1
-Warning 1264 Out of range value for column 'f24' at row 1
-Warning 1264 Out of range value for column 'f5' at row 2
-Warning 1264 Out of range value for column 'f24' at row 2
-Warning 1264 Out of range value for column 'f24' at row 3
-
-** Sync slave with master **
-** Do selects from tables **
-
-select * from t1 order by f3;
-f1 f2 f3 f4
-2 2 2 second
-3 3 3 next
-5 5 5 second
-6 6 6 next
-8 8 8 second
-9 9 9 next
-11 11 11 second
-12 12 12 next
-14 14 14 second
-15 15 15 next
-17 17 17 second
-18 18 18 next
-20 20 20 second
-21 21 21 next
-23 23 23 second
-24 24 24 next
-26 26 26 second
-27 27 27 next
-29 29 29 second
-30 30 30 next
-31 31 31 second
-32 32 32 second
-33 33 33 second
-34 34 34 second
-35 35 35 second
-36 36 36 second
-37 37 37 second
-38 38 38 second
-39 39 39 second
-40 40 40 second
-41 41 41 second
-42 42 42 second
-43 43 43 second
-44 44 44 second
-45 45 45 second
-46 46 46 second
-47 47 47 second
-48 48 48 second
-49 49 49 second
-50 50 50 second
-select * from t2 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-2 2 2 second
-3 3 3 third
-select * from t3 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t4 order by f1;
-f1 f2 f3 f4
-1 1 1 first
-select * from t31 order by f3;
-f1 f2 f3 f4
-1 1 1 first
-1 1 2 second
-1 1 3 third
-1 1 4 fourth
-1 1 5 fifth
-1 1 6 sixth
-
-** Do updates master **
-
-update t31 set f5=555555555555555 where f3=6;
-update t31 set f2=2 where f3=2;
-update t31 set f1=NULL where f3=1;
-update t31 set f3=0, f27=NULL, f35='f35 new value' where f3=3;
-
-** Delete from Master **
-
-delete from t1;
-delete from t2;
-delete from t3;
-delete from t4;
-delete from t31;
-
-** Check slave status **
-
-select * from t31;
-f1 f2 f3 f4
-show slave status;;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running Yes
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 0
-Last_Error
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 0
-Last_SQL_Error
-
-****************************************
-* columns in master at middle of table *
-* Expect: Proper error message *
-****************************************
-
-** Stop and Reset Slave **
-
-STOP SLAVE;
-RESET SLAVE;
-
-** create table slave side **
-CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
-) ENGINE='MyISAM';
-
-** Connect to master and create table **
-
-CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
-c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
-(2,@b1,DEFAULT,'JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t10 ***
-DROP TABLE t10;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: Proper error message *
-*********************************************
-
-*** Create t11 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
-) ENGINE='MyISAM';
-
-*** Create t11 on Master ***
-CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
-(2,@b1,'Testing is cool','JOE',DEFAULT),
-(3,@b1,DEFAULT,'QA',DEFAULT);
-
-********************************************
-*** Expect slave to fail with Error 1523 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1535
-Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1535
-Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
-SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
-START SLAVE;
-
-*** Drop t11 ***
-DROP TABLE t11;
-
-*********************************************
-* More columns in master at middle of table *
-* Expect: This one should pass blob-text *
-*********************************************
-
-*** Create t12 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
-) ENGINE='MyISAM';
-
-*** Create t12 on Master ***
-CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
-c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',DEFAULT,DEFAULT),
-(3,@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT a,hex(b),f,c,e FROM t12 ORDER BY a;
-a hex(b) f c e
-1 62316231623162316231623162316231 Kyle test 1
-2 62316231623162316231623162316231 JOE test 1
-3 62316231623162316231623162316231 QA test 1
-
-*** Select on Slave ***
-SELECT a,hex(b),c FROM t12 ORDER BY a;
-a hex(b) c
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-*** Drop t12 ***
-DROP TABLE t12;
-
-****************************************************
-* - Alter Master adding columns at middle of table *
-* Expect: columns added *
-****************************************************
-
-
-*** Create t14 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t14 on Master ***
-CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
-ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
-
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT),
-(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT),
-(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT);
-
-SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5 c6 c7
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
-
-*** Select on Slave ****
-SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
-c1 c2 c3 hex(c4) c5
-1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
-2 2.00 This Test Should work 62316231623162316231623162316231 JOE
-3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA
-
-****************************************************
-* - Alter Master Dropping columns from the middle. *
-* Expect: columns dropped *
-****************************************************
-
-*** connect to master and drop columns ***
-ALTER TABLE t14 DROP COLUMN c2;
-ALTER TABLE t14 DROP COLUMN c7;
-
-*** Select from Master ***
-SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
-c1 c3 hex(c4) c5 c6
-1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1
-2 This Test Should work 62316231623162316231623162316231 JOE 1
-3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1
-
-************
-* Bug30415 *
-************
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1091
-Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1091
-Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t14 ***
-DROP TABLE t14;
-DROP TABLE t14;
-RESET MASTER;
-START SLAVE;
-
-*************************************************
-* - Alter Master adding columns at end of table *
-* Expect: Error 1054 *
-*************************************************
-
-*** Create t15 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t15 on Master ***
-CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00),
-(2,@b1,'JOE',DEFAULT,DEFAULT,3.00),
-(3,@b1,'QA',DEFAULT,DEFAULT,3.00);
-SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
-c1 hex(c4) c5 c6 c7 c2
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00
-2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00
-3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00
-
-********************************************
-*** Expect slave to fail with Error 1054 ***
-********************************************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1054
-Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1054
-Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t15 ***
-DROP TABLE t15;
-DROP TABLE t15;
-RESET MASTER;
-START SLAVE;
-
-************************************************
-* - Create index on Master column not on slave *
-* Expect:Warning *
-************************************************
-
-*** Create t16 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t16 on Master ***
-CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Create Index and Data Insert ***
-CREATE INDEX part_of_c6 ON t16 (c6);
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-*****************
-*** BUG 30434 ***
-*****************
-
-SHOW SLAVE STATUS;
-Slave_IO_State #
-Master_Host 127.0.0.1
-Master_User root
-Master_Port #
-Connect_Retry 1
-Master_Log_File master-bin.000001
-Read_Master_Log_Pos #
-Relay_Log_File #
-Relay_Log_Pos #
-Relay_Master_Log_File master-bin.000001
-Slave_IO_Running Yes
-Slave_SQL_Running No
-Replicate_Do_DB
-Replicate_Ignore_DB
-Replicate_Do_Table
-Replicate_Ignore_Table
-Replicate_Wild_Do_Table
-Replicate_Wild_Ignore_Table
-Last_Errno 1072
-Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-Skip_Counter 0
-Exec_Master_Log_Pos #
-Relay_Log_Space #
-Until_Condition None
-Until_Log_File
-Until_Log_Pos 0
-Master_SSL_Allowed No
-Master_SSL_CA_File
-Master_SSL_CA_Path
-Master_SSL_Cert
-Master_SSL_Cipher
-Master_SSL_Key
-Seconds_Behind_Master #
-Master_SSL_Verify_Server_Cert No
-Last_IO_Errno #
-Last_IO_Error #
-Last_SQL_Errno 1072
-Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
-STOP SLAVE;
-RESET SLAVE;
-
-*** Drop t16 ***
-DROP TABLE t16;
-DROP TABLE t16;
-RESET MASTER;
-START SLAVE;
-
-*****************************************************
-* - Delete rows using column on Master not on slave *
-* Expect: Rows Deleted *
-*****************************************************
-
-*** Create t17 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t17 on Master ***
-CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** Delete from master **
-DELETE FROM t17 WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-DROP TABLE t17;
-
-
-*****************************************************
-* - Update row using column on Master not on slave *
-* Expect: Rows updated *
-*****************************************************
-
-** Bug30674 **
-
-*** Create t18 on slave ***
-
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t18 on Master ***
-CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 INT DEFAULT '1',
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-set @b1 = concat(@b1,@b1);
-INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
-(2,@b1,'JOE',2,DEFAULT),
-(3,@b1,'QA',3,DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 QA
-
-** update from master **
-UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
-SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP
-2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
-3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
-
-** Check slave **
-SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
-c1 hex(c4) c5
-1 62316231623162316231623162316231 Kyle
-2 62316231623162316231623162316231 JOE
-3 62316231623162316231623162316231 TEST
-DROP TABLE t18;
-
-
-*****************************************************
-* - Insert UUID column on Master not on slave *
-* Expect: Rows inserted *
-*****************************************************
-
-*** Create t5 on slave ***
-STOP SLAVE;
-RESET SLAVE;
-CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
-) ENGINE='MyISAM';
-
-*** Create t5 on Master ***
-CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
-c6 LONG,
-c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
-)ENGINE='MyISAM';
-RESET MASTER;
-
-*** Start Slave ***
-START SLAVE;
-
-*** Master Data Insert ***
-set @b1 = 'b1b1b1b1';
-INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
-(2,@b1,'JOE',UUID(),DEFAULT),
-(3,@b1,'QA',UUID(),DEFAULT);
-SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1;
-c1 hex(c4) c5 c6 c7
-1 6231623162316231 Kyle UUID TIME
-2 6231623162316231 JOE UUID TIME
-3 6231623162316231 QA UUID TIME
-
-** Select * from Slave **
-SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
-c1 hex(c4) c5
-1 6231623162316231 Kyle
-2 6231623162316231 JOE
-3 6231623162316231 QA
-DROP TABLE t5;
-
=== added file 'mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result 2008-06-26 05:18:28 +0000
@@ -0,0 +1,91 @@
+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;
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+TRUNCATE TABLE t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Master ****
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 223 Query 1 287 BEGIN
+master-bin.000001 287 Table_map 1 330 table_id: # (test.t1)
+master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 392 Write_rows 1 451 table_id: #
+master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F
+master-bin.000001 498 Query 1 563 COMMIT
+master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1
+master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1
+**** On Master ****
+CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
+INSERT INTO t1 VALUES (1,1), (2,2);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+**** On Slave ****
+INSERT INTO t1 VALUE (3,3);
+SELECT * FROM t1 ORDER BY a,b;
+a b
+1 1
+2 2
+3 3
+**** On Master ****
+DELETE FROM t1;
+SELECT * FROM t1 ORDER BY a,b;
+a b
+**** On Slave ****
+SELECT * FROM t1 ORDER BY a,b;
+a b
+3 3
+**** On Master ****
+DROP TABLE t1;
+SHOW BINLOG EVENTS;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4
+master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 223 Query 1 287 BEGIN
+master-bin.000001 287 Table_map 1 330 table_id: # (test.t1)
+master-bin.000001 330 Table_map 1 392 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 392 Write_rows 1 451 table_id: #
+master-bin.000001 451 Write_rows 1 498 table_id: # flags: STMT_END_F
+master-bin.000001 498 Query 1 563 COMMIT
+master-bin.000001 563 Query 1 643 use `test`; TRUNCATE TABLE t1
+master-bin.000001 643 Query 1 719 use `test`; DROP TABLE t1
+master-bin.000001 719 Query 1 836 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
+master-bin.000001 836 Query 1 900 BEGIN
+master-bin.000001 900 Table_map 1 943 table_id: # (test.t1)
+master-bin.000001 943 Table_map 1 1005 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1005 Write_rows 1 1064 table_id: #
+master-bin.000001 1064 Write_rows 1 1111 table_id: # flags: STMT_END_F
+master-bin.000001 1111 Query 1 1176 COMMIT
+master-bin.000001 1176 Query 1 1240 BEGIN
+master-bin.000001 1240 Table_map 1 1283 table_id: # (test.t1)
+master-bin.000001 1283 Table_map 1 1345 table_id: # (mysql.ndb_apply_status)
+master-bin.000001 1345 Write_rows 1 1404 table_id: #
+master-bin.000001 1404 Delete_rows 1 1443 table_id: # flags: STMT_END_F
+master-bin.000001 1443 Query 1 1508 COMMIT
+master-bin.000001 1508 Query 1 1584 use `test`; DROP TABLE t1
=== added file 'mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test 2008-08-20 10:29:58 +0000
@@ -0,0 +1,6 @@
+# Same test as rpl_truncate_7ndb.test, but with mixed mode
+# This is marked with 'big_test' just because the rpl_truncate_7ndb test is
+# so slow...
+--source include/have_binlog_format_mixed.inc
+--source include/big_test.inc
+--source suite/rpl_ndb/t/rpl_truncate_7ndb.test
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2innodb.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2myisam.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2ndb.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2other.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_2other.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_UUID.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_apply_status.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_auto_inc.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_bank.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_blob.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_blob2.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_circular_simplex.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_commit_afterflush.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_ctype_ucs2_def.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_dd_partitions.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_ddl.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_delete_nowhere.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_do_db.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_do_table.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_func003.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_innodb_trans.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_insert_ignore.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_load.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_log.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_multi.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_multi_update2.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_multi_update3.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_myisam2ndb.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_relayrotate.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_rep_ignore.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_row_001.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_sp003.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_sp006.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_stm_innodb.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_sync.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_transaction.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndb_trig004.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_ndbapi_multi.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result'
=== renamed file 'mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result' => 'mysql-test/suite/rpl_ndb_big/r/rpl_truncate_7ndb.result'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2innodb-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2innodb-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2innodb.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2myisam-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2myisam-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2myisam.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2ndb-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2ndb.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2other-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2other-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2other.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_2other.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_UUID.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_apply_status-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_apply_status.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_auto_inc.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_bank.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_blob.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_blob2.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_circular_simplex.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_commit_afterflush.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_ctype_ucs2_def-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_ctype_ucs2_def.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_dd_partitions-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_dd_partitions-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_dd_partitions.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_ddl.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_delete_nowhere.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_db-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_db.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_table-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_do_table.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_func003.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_innodb_trans-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_innodb_trans.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_insert_ignore.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_load.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_log-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_log.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi_update2-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi_update2.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_multi_update3.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_myisam2ndb-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_myisam2ndb.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_relayrotate-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_relayrotate.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_rep_ignore-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_rep_ignore.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_row_001.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_sp003.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_sp006.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_stm_innodb-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_stm_innodb.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_sync.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-master.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction-master.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction-slave.opt' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction-slave.opt'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_transaction.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndb_trig004.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_ndbapi_multi.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_row_basic_7ndb.test'
=== renamed file 'mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test' => 'mysql-test/suite/rpl_ndb_big/t/rpl_truncate_7ndb.test'
=== added file 'mysql-test/t/backup_db_grants.test'
--- a/mysql-test/t/backup_db_grants.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/backup_db_grants.test 2008-08-25 18:14:40 +0000
@@ -0,0 +1,198 @@
+#
+# Test the backup of database grants
+#
+
+--source include/not_embedded.inc
+--source include/have_sjis.inc
+
+--disable_warnings
+DROP DATABASE IF EXISTS bup_db_grants;
+DROP DATABASE IF EXISTS db2;
+--enable_warnings
+
+--echo Create two databases and two tables.
+CREATE DATABASE bup_db_grants;
+CREATE DATABASE db2;
+CREATE TABLE bup_db_grants.t1(a INT);
+CREATE TABLE bup_db_grants.s1(b INT);
+INSERT INTO bup_db_grants.t1 VALUES (1), (2), (3), (4);
+INSERT INTO bup_db_grants.s1 VALUES (10), (20), (30), (40);
+
+--echo Now create users and assign various rights to the databases
+CREATE USER 'bup_user1'@'%';
+CREATE USER bup_user2;
+CREATE USER 'bup_user3'@'%';
+REVOKE ALL ON *.* FROM 'bup_user1'@'%';
+REVOKE ALL ON *.* FROM bup_user2;
+GRANT ALL ON db2.* TO 'bup_user1'@'%';
+GRANT SELECT ON bup_db_grants.* TO 'bup_user1'@'%';
+GRANT INSERT ON bup_db_grants.* TO bup_user2;
+GRANT ALL ON bup_db_grants.* TO 'no_user'@'%';
+GRANT SELECT (a) ON bup_db_grants.t1 TO 'bup_user1'@'%';
+GRANT SELECT (b), INSERT (b) ON bup_db_grants.s1 TO bup_user2;
+FLUSH PRIVILEGES;
+
+--echo Demonstrate rights of the users.
+SHOW GRANTS FOR 'bup_user1'@'%';
+SHOW GRANTS FOR bup_user2;
+SHOW GRANTS FOR 'bup_user3'@'%';
+SHOW GRANTS FOR 'no_user'@'%';
+
+--echo Run backup
+--replace_column 1 #
+BACKUP DATABASE bup_db_grants TO 'bup_db_grants.bak';
+
+--echo Drop users and recreate them (removes grants completely).
+DROP USER 'bup_user1'@'%';
+DROP USER bup_user2;
+DROP USER 'bup_user3'@'%';
+DROP USER 'no_user'@'%';
+
+FLUSH PRIVILEGES;
+
+CREATE USER 'bup_user1'@'%';
+CREATE USER bup_user2;
+CREATE USER 'bup_user3'@'%';
+
+FLUSH PRIVILEGES;
+
+--echo Demonstrate rights of the users.
+SHOW GRANTS FOR 'bup_user1'@'%';
+SHOW GRANTS FOR bup_user2;
+SHOW GRANTS FOR 'bup_user3'@'%';
+
+--echo Run Restore
+--replace_column 1 #
+RESTORE FROM 'bup_db_grants.bak';
+
+SHOW TABLES FROM bup_db_grants;
+
+--echo Demonstrate rights of the users.
+# Note: Since db2 was not in the backup and the user was deleted prior to
+# the restore, that privilege will not appear here.
+SHOW GRANTS FOR 'bup_user1'@'%';
+SHOW GRANTS FOR bup_user2;
+SHOW GRANTS FOR 'bup_user3'@'%';
+--error ER_NONEXISTING_GRANT
+SHOW GRANTS FOR 'no_user'@'%';
+
+--echo Now test what happens on backup if users are deleted.
+
+--echo Drop users and recreate one of them (removes grants completely).
+DROP USER 'bup_user1'@'%';
+DROP USER bup_user2;
+DROP USER 'bup_user3'@'%';
+
+FLUSH PRIVILEGES;
+
+CREATE USER 'bup_user1'@'%';
+CREATE USER 'bup_user1'@'nosuchhost';
+
+--echo Run Restore
+--replace_column 1 #
+RESTORE FROM 'bup_db_grants.bak';
+
+SHOW TABLES FROM bup_db_grants;
+
+--echo Demonstrate rights of the users.
+SHOW GRANTS FOR 'bup_user1'@'%';
+--error ER_NONEXISTING_GRANT
+SHOW GRANTS FOR bup_user2;
+--error ER_NONEXISTING_GRANT
+SHOW GRANTS FOR 'bup_user3'@'%';
+--error ER_NONEXISTING_GRANT
+SHOW GRANTS FOR 'no_user'@'%';
+
+#
+# Section of test disabled due to errors in PB. See BUG#39016
+#
+#--echo Now demonstrate what happens when grants are altered in backup image.
+#
+#--exec perl -pi.bak -e "s/ON bup/ON boo/" $MYSQLTEST_VARDIR/master-data/bup_db_grants.bak
+#--echo Run Restore
+#--error ER_BACKUP_GRANT_WRONG_DB
+#RESTORE FROM 'bup_db_grants.bak';
+#
+#FLUSH PRIVILEGES;
+
+--echo Cleanup
+
+DROP USER 'bup_user1'@'%';
+DROP USER 'bup_user1'@'nosuchhost';
+--error ER_CANNOT_USER
+DROP USER bup_user2;
+--error ER_CANNOT_USER
+DROP USER 'bup_user3'@'%';
+--error ER_CANNOT_USER
+DROP USER 'no_user'@'%';
+
+FLUSH PRIVILEGES;
+
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_db_grants.bak
+
+#--remove_file $MYSQLTEST_VARDIR/master-data/bup_db_grants.bak.bak
+
+--echo Now test for encoded user names with an x40 in the middle.
+
+SET NAMES sjis;
+
+DROP DATABASE bup_db_grants;
+
+--echo Create a database and some tables.
+CREATE DATABASE bup_db_grants;
+CREATE TABLE bup_db_grants.t1(a INT);
+CREATE TABLE bup_db_grants.s1(b INT);
+
+--echo Create a user with multibyte username with @ in the middle.
+SET @name = CONVERT(0x8340 using sjis);
+SELECT @name;
+SET @cmd = CONCAT('CREATE USER ', @name);
+PREPARE stmt1 FROM @cmd;
+EXECUTE stmt1;
+
+--echo Grant privileges to user.
+SET @cmd = CONCAT('GRANT SELECT ON bup_db_grants.* TO ', @name);
+PREPARE stmt2 from @cmd;
+EXECUTE stmt2;
+
+FLUSH PRIVILEGES;
+
+--echo Show existing grants.
+SET @cmd = CONCAT('SHOW GRANTS FOR ', @name);
+PREPARE stmt3 FROM @cmd;
+EXECUTE stmt3;
+
+--echo Backup database.
+--replace_column 1 #
+BACKUP DATABASE bup_db_grants TO 'bup_db_grants.bak';
+
+--echo Remove privileges from user.
+SET @cmd = CONCAT('REVOKE ALL ON bup_db_grants.* FROM ', @name);
+PREPARE stmt4 FROM @cmd;
+EXECUTE stmt4;
+
+FLUSH PRIVILEGES;
+
+--echo Show existing grants -- should only USAGE.
+EXECUTE stmt3;
+
+--echo Run restore.
+--replace_column 1 #
+RESTORE FROM 'bup_db_grants.bak';
+
+FLUSH PRIVILEGES;
+
+--echo Ensure grants have been restored.
+EXECUTE stmt3;
+
+SET @cmd = CONCAT('DROP USER ', @name);
+PREPARE stmt5 FROM @cmd;
+EXECUTE stmt5;
+
+SET NAMES latin1;
+
+DROP DATABASE bup_db_grants;
+DROP DATABASE db2;
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_db_grants.bak
=== added file 'mysql-test/t/backup_default.test'
--- a/mysql-test/t/backup_default.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/backup_default.test 2008-08-26 13:28:34 +0000
@@ -0,0 +1,136 @@
+###########################################################################
+# Purpose: To test backup using default driver
+###############################################################################
+--source include/have_falcon.inc
+--source include/have_partition.inc
+--source include/not_embedded.inc
+
+--echo
+--echo Server should not crash for backup using default driver - CSV
+--echo Test for bug#35117
+--echo
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+--enable_warnings
+
+CREATE DATABASE db1;
+USE db1;
+
+# csv uses default driver
+CREATE TABLE csv_table(
+ id int NOT NULL,
+ name char(20) NOT NULL,
+ city varchar(20) NOT NULL)
+ENGINE=csv;
+
+INSERT INTO csv_table VALUES(1,'aa1','bb1'),(2,'aa2','bb2'),(3,'aa3','bb3');
+
+--echo backup on csv only
+--replace_column 1 #
+BACKUP DATABASE db1 to 'bup_csv.bak';
+
+DROP DATABASE db1;
+
+--echo restore on csv only
+--replace_column 1 #
+RESTORE FROM 'bup_csv.bak';
+
+--echo testing content in restored tables
+SELECT * FROM csv_table ORDER BY id;
+
+DROP DATABASE db1;
+
+--echo
+--echo Server should not crash for backup using default driver
+--echo Partitioned Falcon tables
+--echo Test for bug#33566, bug#36792
+--echo
+
+CREATE DATABASE db1;
+USE db1;
+
+CREATE TABLE partition_table (
+ int_column int(11),
+ char_column char(5))
+engine=falcon
+PARTITION BY HASH (int_column);
+
+INSERT INTO partition_table VALUES (0,'pVtIa');
+INSERT INTO partition_table VALUES (5,'jTfSg');
+INSERT INTO partition_table VALUES (20,'UezFi');
+INSERT INTO partition_table VALUES (25,'cxmeH');
+INSERT INTO partition_table VALUES (65,'lIuNS');
+
+#
+# This portion of the test has been disabled. See BUG#39017
+#
+#--echo backup on partitioned falcon
+#--replace_column 1 #
+#BACKUP DATABASE db1 to 'bup_falcon.bak';
+#
+#DROP DATABASE db1;
+#
+#--echo restore on partitioned falcon
+#--replace_column 1 #
+#RESTORE FROM 'bup_falcon.bak';
+
+--echo testing content in restored tables
+SELECT * FROM partition_table ORDER BY int_column;
+
+
+--echo
+--echo Server should not crash for backup using default driver
+--echo Mix of tables
+--echo
+
+# partition_table already exists in the database
+# re-create the csv_table
+CREATE TABLE csv_table(
+ id int NOT NULL,
+ name char(20) NOT NULL,
+ city varchar(20) NOT NULL)
+ENGINE=csv;
+
+INSERT INTO csv_table VALUES(1,'aa1','bb1'),(2,'aa2','bb2'),(3,'aa3','bb3');
+
+# create a myisam table (not default driver)
+CREATE TABLE myisam_table(
+ i int,
+ v varchar(20))
+ENGINE=myisam;
+
+INSERT INTO myisam_table VALUES(1,'v1'),(2,'v2'),(3,'v3');
+
+#
+# This portion of the test has been disabled. See BUG#39017
+#
+#--echo backup on mixed table database
+#--replace_column 1 #
+#BACKUP DATABASE db1 to 'bup_mixed.bak';
+#
+#DROP DATABASE db1;
+#
+#--echo restore on mixed table database
+#--replace_column 1 #
+#RESTORE FROM 'bup_mixed.bak';
+#
+#--echo testing content in restored tables
+#SELECT * FROM partition_table ORDER BY int_column;
+#SELECT * FROM csv_table ORDER BY id;
+#SELECT * FROM myisam_table ORDER BY i;
+
+
+# Test cleanup section
+
+--echo
+--echo *** CLEANUP ****
+--echo
+
+
+DROP DATABASE db1;
+
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_csv.bak
+#--remove_file $MYSQLTEST_VARDIR/master-data/bup_falcon.bak
+#--remove_file $MYSQLTEST_VARDIR/master-data/bup_mixed.bak
+
=== modified file 'mysql-test/t/backup_errors.test'
--- a/mysql-test/t/backup_errors.test 2008-03-04 17:09:56 +0000
+++ b/mysql-test/t/backup_errors.test 2008-08-21 11:36:09 +0000
@@ -1,4 +1,6 @@
--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_debug_sync.inc
# Check that BACKUP/RESTORE commands correctly report errors
#
@@ -209,3 +211,82 @@ CREATE TABLE mysql.online_backup_progres
DROP TABLE test.obp_copy;
DROP DATABASE test_ob_error;
+
+
+--echo
+--echo Bug#38624
+--echo Test that backup fails with error if database files are removed
+--echo after backup starts
+
+SET DEBUG_SYNC= 'reset';
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+connection con1;
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+
+CREATE DATABASE db1;
+
+connection con2;
+
+--echo start backup but stop just before adding metadata to backup image
+SET DEBUG_SYNC= 'backup_before_write_preamble SIGNAL running WAIT_FOR db_will_fail';
+
+send BACKUP DATABASE db1 TO 'bup_db1.bak';
+
+connection con1;
+
+SET DEBUG_SYNC='now WAIT_FOR running';
+
+--echo delete database files so that check_db_dir_exists will fail in
+--echo si_objects.cc @ DatabaseObj::do_serialize
+
+--remove_file $MYSQLTEST_VARDIR/master-data/db1/db.opt
+--rmdir $MYSQLTEST_VARDIR/master-data/db1
+
+SET DEBUG_SYNC='now SIGNAL db_will_fail';
+
+connection con2;
+--echo Database has been deleted, backup will fail
+--error ER_BAD_DB_ERROR
+reap;
+
+--echo
+--echo Test that backup fails with error if a table used by
+--echo a trigger cannot be opened
+
+SET DEBUG_SYNC= 'reset';
+
+connection con1;
+
+--disable_warnings
+DROP DATABASE IF EXISTS db1;
+
+CREATE DATABASE db1;
+CREATE TABLE db1.t1 (i int);
+CREATE TABLE db1.t2 (v varchar (20));
+
+DELIMITER ||;
+CREATE TRIGGER db1.trg AFTER INSERT ON db1.t1 FOR EACH ROW
+BEGIN
+ INSERT INTO db1.t2(v) VALUES ('Test trigger fired');
+END;||
+DELIMITER ;||
+
+SET DEBUG_SYNC= 'reset';
+
+--echo Setting debug point that will make backup fail when adding the
+--echo trigger metadata
+
+SET SESSION DEBUG='+d,backup_fail_add_trigger';
+--error ER_BACKUP_GET_META_TRIGGER
+BACKUP DATABASE db1 TO 'bup_db1.bak';
+
+SET DEBUG_SYNC= 'reset';
+DROP DATABASE db1;
+
+--echo
+--echo Done testing for Bug#38624
=== added file 'mysql-test/t/backup_timeout.test'
--- a/mysql-test/t/backup_timeout.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/backup_timeout.test 2008-08-19 15:35:29 +0000
@@ -0,0 +1,162 @@
+#
+# This test is for the DDL blocker timeout feature.
+#
+
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/not_embedded.inc
+--source include/have_debug_sync.inc
+
+SET DEBUG_SYNC= 'reset';
+
+#
+# Remove backup files (if they exist)
+#
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak;
+
+#
+# Connections used in this test
+#
+# con1 used to create data, load data, and run the backup
+# con2-con4 used for DDL statements: 2 before backup and 2 during backup
+# con5 used for setting and releasing breakpoints
+#
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+connect (con3,localhost,root,,);
+connect (con4,localhost,root,,);
+connect (con5,localhost,root,,);
+
+connection con1;
+
+# Create data for this test and tailor it to the test.
+--disable_warnings
+DROP DATABASE IF EXISTS bup_ddl_blocker;
+--enable_warnings
+
+CREATE DATABASE bup_ddl_blocker;
+
+# Create a table and load it with data.
+--echo con1: Creating tables
+CREATE TABLE bup_ddl_blocker.t1 (col_a CHAR(40)) ENGINE=INNODB;
+
+--echo con1: Loading data
+INSERT INTO bup_ddl_blocker.t1 VALUES ("01 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("02 Some data to test");
+INSERT INTO bup_ddl_blocker.t1 VALUES ("03 Some data to test");
+
+SHOW VARIABLES LIKE 'backup_wait%';
+
+#
+# Part A - test timeout for one session
+#
+--echo Part A
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
+
+connection con1;
+
+--echo con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+
+--echo con1: Get a backup going and stop after the DDL blocker is fired.
+send BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+
+--echo Set ddl timeout to 1 second
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+--echo con2: Try a ddl operation and watch it expire
+--error ER_DDL_TIMEOUT
+CREATE TABLE bup_ddl_blocker.t2 (col_a CHAR(40)) ENGINE=MEMORY;
+
+connection con5;
+--echo release the lock.
+--echo con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+
+# Reconnect to con1 and let backup finish.
+
+connection con1;
+--replace_column 1 #
+reap;
+
+#
+# Part B - test timeout for a session with a timeout,
+# and a session with no timeout (backup_wait_timeout = 0)
+#
+--echo Part B
+
+--error 0,1
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
+
+connection con1;
+
+--echo con1: Activate synchronization points for backup.
+SET DEBUG_SYNC= 'after_block_ddl SIGNAL bup_blocked WAIT_FOR timeout_done';
+
+--echo con1: Get a backup going and stop after the DDL blocker is fired.
+send BACKUP DATABASE bup_ddl_blocker TO "bup_ddl_blocker.bak";
+
+connection con2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR bup_blocked';
+
+--echo Set ddl timeout to 0 seconds
+SET backup_wait_timeout = 0;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+--echo con2: Try a ddl operation and it should expire
+--error ER_DDL_TIMEOUT
+CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+
+connection con3;
+
+SET backup_wait_timeout = 100;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+--echo con3: Try a ddl operation and it should not expire
+send CREATE TABLE bup_ddl_blocker.t3 (col_a CHAR(40)) ENGINE=MEMORY;
+
+connection con5;
+--echo release the lock.
+--echo con5: Resume all.
+SET DEBUG_SYNC= 'now SIGNAL timeout_done';
+
+# Reconnect to con1 and let backup finish.
+
+connection con1;
+--replace_column 1 #
+reap;
+
+connection con3;
+reap;
+
+USE bup_ddl_blocker;
+SHOW FULL TABLES;
+
+#
+# Part C - test default behavior: set backup timeout = default
+#
+--echo Part C
+
+connection con1;
+
+--echo Show that the variable can be reset to its timeout value using
+--echo SET backup_wait_timeout = DEFAULT;
+SET backup_wait_timeout = 1;
+SHOW VARIABLES LIKE 'backup_wait%';
+SET backup_wait_timeout = DEFAULT;
+SHOW VARIABLES LIKE 'backup_wait%';
+
+DROP DATABASE bup_ddl_blocker;
+
+--remove_file $MYSQLTEST_VARDIR/master-data/bup_ddl_blocker.bak
=== modified file 'mysql-test/t/backup_views.test'
--- a/mysql-test/t/backup_views.test 2008-08-11 10:41:41 +0000
+++ b/mysql-test/t/backup_views.test 2008-08-20 13:23:10 +0000
@@ -205,14 +205,14 @@ DROP DATABASE bup_db2;
--echo restore database with view dependency to other, non-existing db
---error ER_NO_SUCH_TABLE
+--error ER_BACKUP_CANT_RESTORE_VIEW
RESTORE FROM 'bup_objectview1.bak';
# An incomplete bup_db1 was created by the failing restore operation.
# Remove it before trying restore of bup_db2.
DROP DATABASE bup_db1;
---error ER_NO_SUCH_TABLE
+--error ER_BACKUP_CANT_RESTORE_VIEW
RESTORE FROM 'bup_objectview2.bak';
# An incomplete bup_db2 was created by the failing restore operation.
=== modified file 'mysql-test/t/ctype_utf8.test'
--- a/mysql-test/t/ctype_utf8.test 2008-09-04 08:47:10 +0000
+++ b/mysql-test/t/ctype_utf8.test 2008-09-05 11:51:40 +0000
@@ -1524,6 +1524,19 @@ drop table t1;
set max_sort_length=default;
#
+# Bug#26180: Can't add columns to tables created with utf8 text indexes
+#
+CREATE TABLE t1 (
+ clipid INT NOT NULL,
+ Tape TINYTEXT,
+ PRIMARY KEY (clipid),
+ KEY tape(Tape(255))
+) CHARACTER SET=utf8;
+ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+#
# Bug#26474: Add Sinhala script (Sri Lanka) collation to MySQL
#
--disable_warnings
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2008-09-01 09:28:27 +0000
+++ b/mysql-test/t/disabled.def 2008-09-04 13:46:04 +0000
@@ -17,7 +17,6 @@ lowercase_table3 : Bug#32667 low
rpl_log_pos : Bug#8693 Test 'rpl_log_pos' fails sometimes
ctype_create : Bug#32965 main.ctype_create fails
backup_no_engine : Bug#36021 2008-04-13 rsomla server crashes when openning table with unknown storage engine
-backup_tablespace : Bug #36973 backup_tablespace.test fails in pushbuild
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
query_cache_wlock_invalidate_func: Bug#35390 causes not deterministic results.
thread_cache_size_func: BUG#35988, BUG#36733 Due to not deterministic results
@@ -39,6 +38,5 @@ key_buffer_size_basic_32 : Bug#36876
max_heap_table_size_basic_32 : Bug#36877 main.max_heap_table_size_basic_32 fails on some systems
tmp_table_size_basic_32 : Bug#36878 main.tmp_table_size_basic_32 fails on some systems
backup_triggers_and_events : Bug#37762 2008-07-01 rafal Test fails on remove_file for unknown reasons
-backup_tablespace : Bug#36973 2008-07-01 rafal
backup_no_be : Bug#38023 2008-07-16 rafal Test triggers valgrind warnings described in the bug
user_limits : Bug#23921 2008-07-25 joro random failure of user_limits.test
=== renamed file 'mysql-test/t/innodb_bug34053.test.moved' => 'mysql-test/t/innodb_bug34053.test'
=== removed file 'mysql-test/t/innodb_bug34053.test'
--- a/mysql-test/t/innodb_bug34053.test 2008-02-22 23:56:34 +0000
+++ b/mysql-test/t/innodb_bug34053.test 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
-#
-# Make sure http://bugs.mysql.com/34053 remains fixed.
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
-SET storage_engine=InnoDB;
-
-# we do not really care about what gets printed, we are only
-# interested in getting success or failure according to our
-# expectations
--- disable_query_log
--- disable_result_log
-
-GRANT USAGE ON *.* TO 'shane'@'localhost' IDENTIFIED BY '12345';
-FLUSH PRIVILEGES;
-
--- connect (con1,localhost,shane,12345,)
-
--- connection con1
--- error ER_SPECIFIC_ACCESS_DENIED_ERROR
-CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;
--- error ER_SPECIFIC_ACCESS_DENIED_ERROR
-CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB;
-CREATE TABLE innodb_monitorx (a INT) ENGINE=INNODB;
-DROP TABLE innodb_monitorx;
-CREATE TABLE innodb_monito (a INT) ENGINE=INNODB;
-DROP TABLE innodb_monito;
-CREATE TABLE xinnodb_monitor (a INT) ENGINE=INNODB;
-DROP TABLE xinnodb_monitor;
-CREATE TABLE nnodb_monitor (a INT) ENGINE=INNODB;
-DROP TABLE nnodb_monitor;
-
--- connection default
-CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;
-CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB;
-
--- connection con1
--- error ER_SPECIFIC_ACCESS_DENIED_ERROR
-DROP TABLE innodb_monitor;
--- error ER_SPECIFIC_ACCESS_DENIED_ERROR
-DROP TABLE innodb_mem_validate;
-
--- connection default
-DROP TABLE innodb_monitor;
-DROP TABLE innodb_mem_validate;
-DROP USER 'shane'@'localhost';
-
--- disconnect con1
=== removed file 'mysql-test/t/merge-big.test'
--- a/mysql-test/t/merge-big.test 2008-02-07 11:04:19 +0000
+++ b/mysql-test/t/merge-big.test 1970-01-01 00:00:00 +0000
@@ -1,82 +0,0 @@
-#
-# Test of MERGE tables with multisession and many waits.
-#
-# This test takes rather long time so let us run it only in --big-test mode
---source include/big_test.inc
-# We use some debug-only features in this test
---source include/have_debug.inc
-# We use INFORMATION_SCHEMA.PROCESSLIST in this test
---source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1,t2,t3,t4,t5,t6;
---enable_warnings
-
---echo #
---echo # Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
---echo # corrupts a MERGE table
---echo # Problem #3
---echo #
-# Two FLUSH TABLES within a LOCK TABLES segment could invalidate the lock.
-# This did *not* require a MERGE table.
-#
-# To increase reproducibility it was necessary to enter a sleep of 2
-# seconds at the end of wait_for_tables() after unlock of LOCK_open. In
-# 5.0 and 5.1 the sleep must be inserted in open_and_lock_tables() after
-# open_tables() instead. wait_for_tables() is not used in this case. The
-# problem was that FLUSH TABLES releases LOCK_open while having unlocked
-# and closed all tables. When this happened while a thread was in the
-# loop in mysql_lock_tables() right after wait_for_tables()
-# (open_tables()) and before retrying to lock, the thread got the lock.
-# And it did not notice that the table needed a refresh after the
-# [re-]open. So it executed its statement on the table.
-#
-# The first FLUSH TABLES kicked the INSERT out of thr_multi_lock() and
-# let it wait in wait_for_tables() (open_table()). The second FLUSH
-# TABLES must happen while the INSERT was on its way from
-# wait_for_tables() (open_table()) to the next call of thr_multi_lock().
-# This needed to be supported by a sleep to make it repeatable.
-#
-CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
-LOCK TABLE t1 WRITE;
-#SELECT NOW();
- --echo # connection con1
- connect (con1,localhost,root,,);
- let $con1_id= `SELECT CONNECTION_ID()`;
- SET SESSION debug="+d,sleep_open_and_lock_after_open";
- send INSERT INTO t1 VALUES (1);
---echo # connection default
-connection default;
---echo # Let INSERT go into thr_multi_lock().
-#--sleep 8
-#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
-let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE ID = $con1_id AND STATE = 'Locked';
---source include/wait_condition.inc
-#SELECT NOW();
---echo # Kick INSERT out of thr_multi_lock().
-FLUSH TABLES;
-#SELECT NOW();
---echo # Let INSERT go through open_tables() where it sleeps.
-#--sleep 8
-#SELECT ID,STATE,INFO FROM INFORMATION_SCHEMA.PROCESSLIST;
-let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
- WHERE ID = $con1_id AND STATE = 'Waiting for table';
---source include/wait_condition.inc
-#SELECT NOW();
---echo # Unlock and close table and wait for con1 to close too.
-FLUSH TABLES;
-#SELECT NOW();
---echo # This should give no result.
-SELECT * FROM t1;
-#SELECT NOW();
-UNLOCK TABLES;
- --echo # connection con1
- connection con1;
- reap;
- SET SESSION debug="-d,sleep_open_and_lock_after_open";
- disconnect con1;
---echo # connection default
-connection default;
-DROP TABLE t1;
-
=== renamed file 'mysql-test/t/slave_allow_batching_basic.test' => 'mysql-test/t/rpl_slave_allow_batching_basic.test'
=== renamed file 'mysql-test/t/slave_compressed_protocol_basic.test' => 'mysql-test/t/rpl_slave_compressed_protocol_basic.test'
=== renamed file 'mysql-test/t/slave_exec_mode_basic.test' => 'mysql-test/t/rpl_slave_exec_mode_basic.test'
=== renamed file 'mysql-test/t/slave_net_timeout_basic.test' => 'mysql-test/t/rpl_slave_net_timeout_basic.test'
=== modified file 'mysql-test/t/union.test'
--- a/mysql-test/t/union.test 2008-05-13 15:15:40 +0000
+++ b/mysql-test/t/union.test 2008-09-10 12:50:02 +0000
@@ -91,6 +91,7 @@ SELECT @a:=1 UNION SELECT @a:=@a+1;
(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);
(SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2);
+
#
# Test bug reported by joc@stripped
#
=== modified file 'mysys/CMakeLists.txt'
--- a/mysys/CMakeLists.txt 2008-07-09 07:12:43 +0000
+++ b/mysys/CMakeLists.txt 2008-07-23 08:52:08 +0000
@@ -39,7 +39,7 @@ SET(MYSYS_SOURCES array.c charset-def.c
my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c
my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c
my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_wincond.c
- my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c stacktrace.c
+ my_winerr.c my_winfile.c my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c stacktrace.c
rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c
lf_alloc-pin.c lf_dynarray.c lf_hash.c
=== modified file 'mysys/Makefile.am'
--- a/mysys/Makefile.am 2008-06-26 18:21:15 +0000
+++ b/mysys/Makefile.am 2008-07-23 08:52:08 +0000
@@ -60,7 +60,7 @@ libmysys_a_SOURCES = my_init.c my_get
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c \
CMakeLists.txt mf_soundex.c \
- my_conio.c my_wincond.c my_winthread.c
+ my_conio.c my_wincond.c my_winthread.c my_winerr.c my_winfile.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
# test_dir_DEPENDENCIES= $(LIBRARIES)
# testhash_DEPENDENCIES= $(LIBRARIES)
=== modified file 'mysys/default_modify.c'
--- a/mysys/default_modify.c 2007-07-30 08:33:50 +0000
+++ b/mysys/default_modify.c 2008-07-14 14:24:32 +0000
@@ -21,7 +21,7 @@
#define BUFF_SIZE 1024
#define RESERVE 1024 /* Extend buffer with this extent */
-#ifdef __WIN__
+#ifdef _WIN32
#define NEWLINE "\r\n"
#define NEWLINE_LEN 2
#else
@@ -80,7 +80,7 @@ int modify_defaults_file(const char *fil
DBUG_RETURN(2);
/* my_fstat doesn't use the flag parameter */
- if (my_fstat(fileno(cnf_file), &file_stat, MYF(0)))
+ if (my_fstat(my_fileno(cnf_file), &file_stat, MYF(0)))
goto malloc_err;
if (option && option_value)
@@ -98,7 +98,7 @@ int modify_defaults_file(const char *fil
NEWLINE_LEN + /* Space for newline */
RESERVE); /* Some additional space */
- buffer_size= (file_stat.st_size +
+ buffer_size= (uint)(file_stat.st_size +
1); /* The ending zero */
/*
@@ -215,7 +215,7 @@ int modify_defaults_file(const char *fil
if (opt_applied)
{
/* Don't write the file if there are no changes to be made */
- if (my_chsize(fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0,
+ if (my_chsize(my_fileno(cnf_file), (my_off_t) (dst_ptr - file_buffer), 0,
MYF(MY_WME)) ||
my_fseek(cnf_file, 0, MY_SEEK_SET, MYF(0)) ||
my_fwrite(cnf_file, (uchar*) file_buffer, (size_t) (dst_ptr - file_buffer),
=== modified file 'mysys/my_chsize.c'
--- a/mysys/my_chsize.c 2007-05-10 09:59:39 +0000
+++ b/mysys/my_chsize.c 2008-06-17 23:37:23 +0000
@@ -52,20 +52,13 @@ int my_chsize(File fd, my_off_t newlengt
if (oldsize > newlength)
{
-#if defined(HAVE_SETFILEPOINTER)
- /* This is for the moment only true on windows */
- long is_success;
- HANDLE win_file= (HANDLE) _get_osfhandle(fd);
- long length_low, length_high;
- length_low= (long) (ulong) newlength;
- length_high= (long) ((ulonglong) newlength >> 32);
- is_success= SetFilePointer(win_file, length_low, &length_high, FILE_BEGIN);
- if (is_success == -1 && (my_errno= GetLastError()) != NO_ERROR)
+#ifdef _WIN32
+ if (my_win_chsize(fd, newlength))
+ {
+ my_errno= errno;
goto err;
- if (SetEndOfFile(win_file))
- DBUG_RETURN(0);
- my_errno= GetLastError();
- goto err;
+ }
+ DBUG_RETURN(0);
#elif defined(HAVE_FTRUNCATE)
if (ftruncate(fd, (off_t) newlength))
{
=== modified file 'mysys/my_create.c'
--- a/mysys/my_create.c 2008-04-28 16:24:05 +0000
+++ b/mysys/my_create.c 2008-07-23 08:52:08 +0000
@@ -18,7 +18,7 @@
#include "mysys_err.h"
#include <errno.h>
#include <my_sys.h>
-#if defined(__WIN__)
+#if defined(_WIN32)
#include <share.h>
#endif
@@ -41,16 +41,12 @@ File my_create(const char *FileName, int
FileName, CreateFlags, access_flags, MyFlags));
#if !defined(NO_OPEN_3)
- fd = open((char *) FileName, access_flags | O_CREAT,
+ fd= open((char *) FileName, access_flags | O_CREAT,
CreateFlags ? CreateFlags : my_umask);
-#elif defined(VMS)
- fd = open((char *) FileName, access_flags | O_CREAT, 0,
- "ctx=stm","ctx=bin");
-#elif defined(__WIN__)
- fd= my_sopen((char *) FileName, access_flags | O_CREAT | O_BINARY,
- SH_DENYNO, MY_S_IREAD | MY_S_IWRITE);
+#elif defined(_WIN32)
+ fd= my_win_open(FileName, access_flags | O_CREAT);
#else
- fd = open(FileName, access_flags);
+ fd= open(FileName, access_flags);
#endif
if ((MyFlags & MY_SYNC_DIR) && (fd >=0) &&
@@ -71,6 +67,7 @@ File my_create(const char *FileName, int
if (unlikely(fd >= 0 && rc < 0))
{
int tmp= my_errno;
+ my_close(fd, MyFlags);
my_delete(FileName, MyFlags);
my_errno= tmp;
}
=== modified file 'mysys/my_delete.c'
--- a/mysys/my_delete.c 2008-04-28 16:24:05 +0000
+++ b/mysys/my_delete.c 2008-07-23 08:52:08 +0000
@@ -36,7 +36,7 @@ int my_delete(const char *name, myf MyFl
DBUG_RETURN(err);
} /* my_delete */
-#if defined(__WIN__) && defined(__NT__)
+#if defined(__WIN__)
/*
Delete file which is possibly not closed.
=== modified file 'mysys/my_dup.c'
--- a/mysys/my_dup.c 2007-03-29 14:27:42 +0000
+++ b/mysys/my_dup.c 2008-07-23 08:52:08 +0000
@@ -29,7 +29,11 @@ File my_dup(File file, myf MyFlags)
const char *filename;
DBUG_ENTER("my_dup");
DBUG_PRINT("my",("file: %d MyFlags: %d", file, MyFlags));
- fd = dup(file);
+#ifdef _WIN32
+ fd= my_win_dup(file);
+#else
+ fd= dup(file);
+#endif
filename= (((uint) file < my_file_limit) ?
my_file_info[(int) file].name : "Unknown");
DBUG_RETURN(my_register_filename(fd, filename, FILE_BY_DUP,
=== modified file 'mysys/my_file.c'
--- a/mysys/my_file.c 2006-12-23 19:20:40 +0000
+++ b/mysys/my_file.c 2008-06-17 23:37:23 +0000
@@ -97,6 +97,7 @@ uint my_set_max_open_files(uint files)
DBUG_ENTER("my_set_max_open_files");
DBUG_PRINT("enter",("files: %u my_file_limit: %u", files, my_file_limit));
+ files+= MY_FILE_MIN;
files= set_max_open_files(min(files, OS_FILE_LIMIT));
if (files <= MY_NFILE)
DBUG_RETURN(files);
=== modified file 'mysys/my_fopen.c'
--- a/mysys/my_fopen.c 2008-05-29 15:44:11 +0000
+++ b/mysys/my_fopen.c 2008-07-23 08:52:08 +0000
@@ -41,24 +41,14 @@ FILE *my_fopen(const char *filename, int
DBUG_ENTER("my_fopen");
DBUG_PRINT("my",("Name: '%s' flags: %d MyFlags: %d",
filename, flags, MyFlags));
- /*
- if we are not creating, then we need to use my_access to make sure
- the file exists since Windows doesn't handle files like "com1.sym"
- very well
- */
-#ifdef __WIN__
- if (check_if_legal_filename(filename))
- {
- errno= EACCES;
- fd= 0;
- }
- else
+
+ make_ftype(type,flags);
+
+#ifdef _WIN32
+ fd= my_win_fopen(filename, type);
+#else
+ fd= fopen(filename, type);
#endif
- {
- make_ftype(type,flags);
- fd = fopen(filename, type);
- }
-
if (fd != 0)
{
/*
@@ -66,18 +56,20 @@ FILE *my_fopen(const char *filename, int
on some OS (SUNOS). Actually the filename save isn't that important
so we can ignore if this doesn't work.
*/
- if ((uint) fileno(fd) >= my_file_limit)
+
+ int filedesc= my_fileno(fd);
+ if ((uint)filedesc >= my_file_limit)
{
thread_safe_increment(my_stream_opened,&THR_LOCK_open);
DBUG_RETURN(fd); /* safeguard */
}
pthread_mutex_lock(&THR_LOCK_open);
- if ((my_file_info[fileno(fd)].name = (char*)
+ if ((my_file_info[filedesc].name= (char*)
my_strdup(filename,MyFlags)))
{
my_stream_opened++;
my_file_total_opened++;
- my_file_info[fileno(fd)].type = STREAM_BY_FOPEN;
+ my_file_info[filedesc].type= STREAM_BY_FOPEN;
pthread_mutex_unlock(&THR_LOCK_open);
DBUG_PRINT("exit",("stream: %p", fd));
DBUG_RETURN(fd);
@@ -99,6 +91,7 @@ FILE *my_fopen(const char *filename, int
/* Close a stream */
+/* Close a stream */
int my_fclose(FILE *fd, myf MyFlags)
{
int err,file;
@@ -106,8 +99,13 @@ int my_fclose(FILE *fd, myf MyFlags)
DBUG_PRINT("my",("stream: %p MyFlags: %d", fd, MyFlags));
pthread_mutex_lock(&THR_LOCK_open);
- file=fileno(fd);
- if ((err = fclose(fd)) < 0)
+ file= my_fileno(fd);
+#ifndef _WIN32
+ err= fclose(fd);
+#else
+ err= my_win_fclose(fd);
+#endif
+ if(err < 0)
{
my_errno=errno;
if (MyFlags & (MY_FAE | MY_WME))
@@ -138,7 +136,12 @@ FILE *my_fdopen(File Filedes, const char
Filedes, Flags, MyFlags));
make_ftype(type,Flags);
- if ((fd = fdopen(Filedes, type)) == 0)
+#ifdef _WIN32
+ fd= my_win_fdopen(Filedes, type);
+#else
+ fd= fdopen(Filedes, type);
+#endif
+ if (!fd)
{
my_errno=errno;
if (MyFlags & (MY_FAE | MY_WME))
=== modified file 'mysys/my_fstream.c'
--- a/mysys/my_fstream.c 2008-04-09 01:07:00 +0000
+++ b/mysys/my_fstream.c 2008-06-17 23:37:23 +0000
@@ -56,11 +56,11 @@ size_t my_fread(FILE *stream, uchar *Buf
{
if (ferror(stream))
my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG),
- my_filename(fileno(stream)),errno);
+ my_filename(my_fileno(stream)),errno);
else
if (MyFlags & (MY_NABP | MY_FNABP))
my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG),
- my_filename(fileno(stream)),errno);
+ my_filename(my_fileno(stream)),errno);
}
my_errno=errno ? errno : -1;
if (ferror(stream) || MyFlags & (MY_NABP | MY_FNABP))
@@ -144,7 +144,7 @@ size_t my_fwrite(FILE *stream, const uch
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG),
- my_filename(fileno(stream)),errno);
+ my_filename(my_fileno(stream)),errno);
}
writtenbytes= (size_t) -1; /* Return that we got error */
break;
@@ -184,3 +184,14 @@ my_off_t my_ftell(FILE *stream, myf MyFl
DBUG_PRINT("exit",("ftell: %lu",(ulong) pos));
DBUG_RETURN((my_off_t) pos);
} /* my_ftell */
+
+
+/* Get a File corresponding to the stream*/
+int my_fileno(FILE *f)
+{
+#ifdef _WIN32
+ return my_win_fileno(f);
+#else
+ return fileno(f);
+#endif
+}
=== modified file 'mysys/my_getncpus.c'
--- a/mysys/my_getncpus.c 2008-05-29 15:44:11 +0000
+++ b/mysys/my_getncpus.c 2008-07-23 08:52:08 +0000
@@ -29,14 +29,18 @@ int my_getncpus()
#ifdef _SC_NPROCESSORS_ONLN
ncpus= sysconf(_SC_NPROCESSORS_ONLN);
#elif defined(__WIN__)
-#ifdef REGGIE_WILL_FIX_IN_A_PORTABLE_WAY
SYSTEM_INFO sysinfo;
- GetSystemInfo(&sysinfo);
+
+ /*
+ * We are not calling GetNativeSystemInfo here because (1) we
+ * don't believe that they return different values for number
+ * of processors and (2) if WOW64 limits processors for Win32
+ * then we don't want to try to override that.
+ */
+ GetSystemInfo(&sysinfo);
+
ncpus= sysinfo.dwNumberOfProcessors;
#else
- ncpus=2;
-#endif
-#else
/* unknown so play safe: assume SMP and forbid uniprocessor build */
ncpus= 2;
#endif
=== modified file 'mysys/my_lib.c'
--- a/mysys/my_lib.c 2008-04-09 01:07:00 +0000
+++ b/mysys/my_lib.c 2008-06-17 23:37:23 +0000
@@ -35,8 +35,7 @@
# if defined(HAVE_NDIR_H)
# include <ndir.h>
# endif
-# if defined(__WIN__)
-# include <dos.h>
+# if defined(_WIN32)
# ifdef __BORLANDC__
# include <dir.h>
# endif
@@ -92,7 +91,7 @@ static int comp_names(struct fileinfo *a
} /* comp_names */
-#if !defined(__WIN__)
+#if !defined(_WIN32)
MY_DIR *my_dir(const char *path, myf MyFlags)
{
@@ -507,19 +506,24 @@ error:
DBUG_RETURN((MY_DIR *) NULL);
} /* my_dir */
-#endif /* __WIN__ */
+#endif /* _WIN32 */
/****************************************************************************
** File status
** Note that MY_STAT is assumed to be same as struct stat
****************************************************************************/
-int my_fstat(int Filedes, MY_STAT *stat_area,
+
+int my_fstat(File Filedes, MY_STAT *stat_area,
myf MyFlags __attribute__((unused)))
{
DBUG_ENTER("my_fstat");
DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags));
+#ifdef _WIN32
+ DBUG_RETURN(my_win_fstat(Filedes, stat_area));
+#else
DBUG_RETURN(fstat(Filedes, (struct stat *) stat_area));
+#endif
}
@@ -531,11 +535,15 @@ MY_STAT *my_stat(const char *path, MY_ST
stat_area, my_flags));
if ((m_used= (stat_area == NULL)))
- if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))
+ if (!(stat_area= (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))
goto error;
- if (! stat((char *) path, (struct stat *) stat_area) )
- DBUG_RETURN(stat_area);
-
+#ifndef _WIN32
+ if (! stat((char *) path, (struct stat *) stat_area) )
+ DBUG_RETURN(stat_area);
+#else
+ if (! my_win_stat(path, stat_area) )
+ DBUG_RETURN(stat_area);
+#endif
DBUG_PRINT("error",("Got errno: %d from stat", errno));
my_errno= errno;
if (m_used) /* Free if new area */
=== modified file 'mysys/my_lock.c'
--- a/mysys/my_lock.c 2008-06-26 17:48:42 +0000
+++ b/mysys/my_lock.c 2008-09-12 12:57:19 +0000
@@ -22,13 +22,90 @@
#undef NO_ALARM_LOOP
#endif
#include <my_alarm.h>
-#ifdef __WIN__
-#include <sys/locking.h>
-#endif
#ifdef __NETWARE__
#include <nks/fsio.h>
#endif
+#ifdef _WIN32
+#define WIN_LOCK_INFINITE -1
+#define WIN_LOCK_SLEEP_MILLIS 100
+
+static int win_lock(File fd, int locktype, my_off_t start, my_off_t length,
+ int timeout_sec)
+{
+ LARGE_INTEGER liOffset,liLength;
+ DWORD dwFlags;
+ OVERLAPPED ov= {0};
+ HANDLE hFile= (HANDLE)my_get_osfhandle(fd);
+ DWORD lastError= 0;
+ int i;
+ int timeout_millis= timeout_sec * 1000;
+
+ DBUG_ENTER("win_lock");
+
+ liOffset.QuadPart= start;
+ liLength.QuadPart= length;
+
+ ov.Offset= liOffset.LowPart;
+ ov.OffsetHigh= liOffset.HighPart;
+
+ if (locktype == F_UNLCK)
+ {
+ if (UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov))
+ DBUG_RETURN(0);
+ /*
+ For compatibility with fcntl implementation, ignore error,
+ if region was not locked
+ */
+ if (GetLastError() == ERROR_NOT_LOCKED)
+ {
+ SetLastError(0);
+ DBUG_RETURN(0);
+ }
+ goto error;
+ }
+ else if (locktype == F_RDLCK)
+ /* read lock is mapped to a shared lock. */
+ dwFlags= 0;
+ else
+ /* write lock is mapped to an exclusive lock. */
+ dwFlags= LOCKFILE_EXCLUSIVE_LOCK;
+
+ if (timeout_sec == WIN_LOCK_INFINITE)
+ {
+ if (LockFileEx(hFile, dwFlags, 0, liLength.LowPart, liLength.HighPart, &ov))
+ DBUG_RETURN(0);
+ goto error;
+ }
+
+ dwFlags|= LOCKFILE_FAIL_IMMEDIATELY;
+ timeout_millis= timeout_sec * 1000;
+ /* Try lock in a loop, until the lock is acquired or timeout happens */
+ for(i= 0; ;i+= WIN_LOCK_SLEEP_MILLIS)
+ {
+ if (LockFileEx(hFile, dwFlags, 0, liLength.LowPart, liLength.HighPart, &ov))
+ DBUG_RETURN(0);
+
+ if (GetLastError() != ERROR_LOCK_VIOLATION)
+ goto error;
+
+ if (i >= timeout_millis)
+ break;
+ Sleep(WIN_LOCK_SLEEP_MILLIS);
+ }
+
+ /* timeout */
+ errno= EAGAIN;
+ DBUG_RETURN(-1);
+
+error:
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+#endif
+
+
+
/*
Lock a part of a file
@@ -48,9 +125,6 @@ int my_lock(File fd, int locktype, my_of
#ifdef __NETWARE__
int nxErrno;
#endif
-#ifdef __WIN__
- DWORD lastError;
-#endif
DBUG_ENTER("my_lock");
DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %d",
@@ -107,48 +181,18 @@ int my_lock(File fd, int locktype, my_of
DBUG_RETURN(0);
}
}
-#elif defined(__WIN__)
+#elif defined(_WIN32)
{
-
- LARGE_INTEGER liOffset,liLength;
- DWORD dwFlags;
- OVERLAPPED ov= {0};
- HANDLE hFile= (HANDLE)_get_osfhandle(fd);
-
- if ((MyFlags & MY_SHORT_WAIT))
- {
- /* not yet implemented */
- MyFlags|= MY_NO_WAIT;
- }
-
- lastError= 0;
-
- liOffset.QuadPart= start;
- liLength.QuadPart= length;
-
- ov.Offset= liOffset.LowPart;
- ov.OffsetHigh= liOffset.HighPart;
-
- if (locktype == F_UNLCK)
- {
- /* The lock flags are currently ignored by Windows */
- if(UnlockFileEx(hFile, 0, liLength.LowPart, liLength.HighPart, &ov))
- DBUG_RETURN(0);
- else
- lastError= GetLastError();
- }
- else if (locktype == F_RDLCK)
- /* read lock is mapped to a shared lock. */
- dwFlags= 0;
- else
- /* write lock is mapped to an exclusive lock. */
- dwFlags= LOCKFILE_EXCLUSIVE_LOCK;
-
+ int timeout_sec;
if (MyFlags & MY_NO_WAIT)
- dwFlags|= LOCKFILE_FAIL_IMMEDIATELY;
+ timeout_sec= 0;
+ else if(MyFlags & MY_SHORT_WAIT)
+ timeout_sec= my_time_to_wait_for_lock;
+ else
+ timeout_sec= WIN_LOCK_INFINITE;
- if (LockFileEx(hFile, dwFlags, 0, liLength.LowPart, liLength.HighPart, &ov))
- DBUG_RETURN(0);
+ if(win_lock(fd, locktype, start, length, timeout_sec) == 0)
+ DBUG_RETURN(0);
}
#else
#if defined(HAVE_FCNTL)
@@ -206,8 +250,6 @@ int my_lock(File fd, int locktype, my_of
#ifdef __NETWARE__
my_errno = nxErrno;
-#elif defined(__WIN__)
- my_errno = (lastError == ERROR_IO_PENDING)? EAGAIN:lastError?lastError : -1;
#else
/* We got an error. We don't want EACCES errors */
my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1;
=== modified file 'mysys/my_mmap.c'
--- a/mysys/my_mmap.c 2006-12-23 19:20:40 +0000
+++ b/mysys/my_mmap.c 2008-06-17 23:37:23 +0000
@@ -27,17 +27,17 @@ int my_msync(int fd, void *addr, size_t
return my_sync(fd, MYF(0));
}
-#elif defined(__WIN__)
+#elif defined(_WIN32)
static SECURITY_ATTRIBUTES mmap_security_attributes=
{sizeof(SECURITY_ATTRIBUTES), 0, TRUE};
void *my_mmap(void *addr, size_t len, int prot,
- int flags, int fd, my_off_t offset)
+ int flags, File fd, my_off_t offset)
{
HANDLE hFileMap;
LPVOID ptr;
- HANDLE hFile= (HANDLE)_get_osfhandle(fd);
+ HANDLE hFile= (HANDLE)my_get_osfhandle(fd);
if (hFile == INVALID_HANDLE_VALUE)
return MAP_FAILED;
=== modified file 'mysys/my_open.c'
--- a/mysys/my_open.c 2008-05-29 15:44:11 +0000
+++ b/mysys/my_open.c 2008-07-23 08:52:08 +0000
@@ -17,9 +17,7 @@
#include "mysys_err.h"
#include <my_dir.h>
#include <errno.h>
-#if defined(__WIN__)
-#include <share.h>
-#endif
+
/*
Open a file
@@ -43,29 +41,8 @@ File my_open(const char *FileName, int F
DBUG_ENTER("my_open");
DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %d",
FileName, Flags, MyFlags));
-#if defined(__WIN__)
- /*
- Check that we don't try to open or create a file name that may
- cause problems for us in the future (like PRN)
- */
- if (check_if_legal_filename(FileName))
- {
- errno= EACCES;
- DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN,
- EE_FILENOTFOUND, MyFlags));
- }
-#ifndef __WIN__
- if (Flags & O_SHARE)
- fd = sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
- MY_S_IREAD | MY_S_IWRITE);
- else
- fd = open((char *) FileName, Flags | O_BINARY,
- MY_S_IREAD | MY_S_IWRITE);
-#else
- fd= my_sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
- MY_S_IREAD | MY_S_IWRITE);
-#endif
-
+#if defined(_WIN32)
+ fd= my_win_open(FileName, Flags);
#elif !defined(NO_OPEN_3)
fd = open(FileName, Flags, my_umask); /* Normal unix */
#else
@@ -94,11 +71,14 @@ int my_close(File fd, myf MyFlags)
DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
pthread_mutex_lock(&THR_LOCK_open);
+#ifndef _WIN32
do
{
err= close(fd);
} while (err == -1 && errno == EINTR);
-
+#else
+ err= my_win_close(fd);
+#endif
if (err)
{
DBUG_PRINT("error",("Got error %d on close",err));
@@ -109,7 +89,7 @@ int my_close(File fd, myf MyFlags)
if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN)
{
my_free(my_file_info[fd].name, MYF(0));
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined (__WIN__)
+#if defined(THREAD) && !defined(HAVE_PREAD) && !defined (_WIN32)
pthread_mutex_destroy(&my_file_info[fd].mutex);
#endif
my_file_info[fd].type = UNOPEN;
@@ -141,7 +121,7 @@ File my_register_filename(File fd, const
type_of_file, uint error_message_number, myf MyFlags)
{
DBUG_ENTER("my_register_filename");
- if ((int) fd >= 0)
+ if ((int) fd >= MY_FILE_MIN)
{
if ((uint) fd >= my_file_limit)
{
@@ -160,7 +140,7 @@ File my_register_filename(File fd, const
my_file_opened++;
my_file_total_opened++;
my_file_info[fd].type = type_of_file;
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(__WIN__)
+#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
pthread_mutex_init(&my_file_info[fd].mutex,MY_MUTEX_INIT_FAST);
#endif
pthread_mutex_unlock(&THR_LOCK_open);
@@ -187,188 +167,7 @@ File my_register_filename(File fd, const
DBUG_RETURN(-1);
}
-#ifdef __WIN__
-
-extern void __cdecl _dosmaperr(unsigned long);
-
-/*
- Open a file with sharing. Similar to _sopen() from libc, but allows managing
- share delete on win32
-
- SYNOPSIS
- my_sopen()
- path fully qualified file name
- oflag operation flags
- shflag share flag
- pmode permission flags
- RETURN VALUE
- File descriptor of opened file if success
- -1 and sets errno if fails.
-*/
-
-File my_sopen(const char *path, int oflag, int shflag, int pmode)
-{
- int fh; /* handle of opened file */
- int mask;
- HANDLE osfh; /* OS handle of opened file */
- DWORD fileaccess; /* OS file access (requested) */
- DWORD fileshare; /* OS file sharing mode */
- DWORD filecreate; /* OS method of opening/creating */
- DWORD fileattrib; /* OS file attribute flags */
- SECURITY_ATTRIBUTES SecurityAttributes;
-
- SecurityAttributes.nLength= sizeof(SecurityAttributes);
- SecurityAttributes.lpSecurityDescriptor= NULL;
- SecurityAttributes.bInheritHandle= !(oflag & _O_NOINHERIT);
-
- /*
- * decode the access flags
- */
- switch (oflag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
- case _O_RDONLY: /* read access */
- fileaccess= GENERIC_READ;
- break;
- case _O_WRONLY: /* write access */
- fileaccess= GENERIC_WRITE;
- break;
- case _O_RDWR: /* read and write access */
- fileaccess= GENERIC_READ | GENERIC_WRITE;
- break;
- default: /* error, bad oflag */
- errno= EINVAL;
- _doserrno= 0L; /* not an OS error */
- return -1;
- }
-
- /*
- * decode sharing flags
- */
- switch (shflag) {
- case _SH_DENYRW: /* exclusive access except delete */
- fileshare= FILE_SHARE_DELETE;
- break;
- case _SH_DENYWR: /* share read and delete access */
- fileshare= FILE_SHARE_READ | FILE_SHARE_DELETE;
- break;
- case _SH_DENYRD: /* share write and delete access */
- fileshare= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
- break;
- case _SH_DENYNO: /* share read, write and delete access */
- fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
- break;
- case _SH_DENYRWD: /* exclusive access */
- fileshare= 0L;
- break;
- case _SH_DENYWRD: /* share read access */
- fileshare= FILE_SHARE_READ;
- break;
- case _SH_DENYRDD: /* share write access */
- fileshare= FILE_SHARE_WRITE;
- break;
- case _SH_DENYDEL: /* share read and write access */
- fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE;
- break;
- default: /* error, bad shflag */
- errno= EINVAL;
- _doserrno= 0L; /* not an OS error */
- return -1;
- }
-
- /*
- * decode open/create method flags
- */
- switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) {
- case 0:
- case _O_EXCL: /* ignore EXCL w/o CREAT */
- filecreate= OPEN_EXISTING;
- break;
-
- case _O_CREAT:
- filecreate= OPEN_ALWAYS;
- break;
-
- case _O_CREAT | _O_EXCL:
- case _O_CREAT | _O_TRUNC | _O_EXCL:
- filecreate= CREATE_NEW;
- break;
-
- case _O_TRUNC:
- case _O_TRUNC | _O_EXCL: /* ignore EXCL w/o CREAT */
- filecreate= TRUNCATE_EXISTING;
- break;
-
- case _O_CREAT | _O_TRUNC:
- filecreate= CREATE_ALWAYS;
- break;
-
- default:
- /* this can't happen ... all cases are covered */
- errno= EINVAL;
- _doserrno= 0L;
- return -1;
- }
-
- /*
- * decode file attribute flags if _O_CREAT was specified
- */
- fileattrib= FILE_ATTRIBUTE_NORMAL; /* default */
- if (oflag & _O_CREAT)
- {
- _umask((mask= _umask(0)));
-
- if (!((pmode & ~mask) & _S_IWRITE))
- fileattrib= FILE_ATTRIBUTE_READONLY;
- }
-
- /*
- * Set temporary file (delete-on-close) attribute if requested.
- */
- if (oflag & _O_TEMPORARY)
- {
- fileattrib|= FILE_FLAG_DELETE_ON_CLOSE;
- fileaccess|= DELETE;
- }
-
- /*
- * Set temporary file (delay-flush-to-disk) attribute if requested.
- */
- if (oflag & _O_SHORT_LIVED)
- fileattrib|= FILE_ATTRIBUTE_TEMPORARY;
-
- /*
- * Set sequential or random access attribute if requested.
- */
- if (oflag & _O_SEQUENTIAL)
- fileattrib|= FILE_FLAG_SEQUENTIAL_SCAN;
- else if (oflag & _O_RANDOM)
- fileattrib|= FILE_FLAG_RANDOM_ACCESS;
-
- /*
- * try to open/create the file
- */
- if ((osfh= CreateFile(path, fileaccess, fileshare, &SecurityAttributes,
- filecreate, fileattrib, NULL)) == INVALID_HANDLE_VALUE)
- {
- /*
- * OS call to open/create file failed! map the error, release
- * the lock, and return -1. note that it's not necessary to
- * call _free_osfhnd (it hasn't been used yet).
- */
- _dosmaperr(GetLastError()); /* map error */
- return -1; /* return error to caller */
- }
-
- if ((fh= _open_osfhandle((intptr_t)osfh,
- oflag & (_O_APPEND | _O_RDONLY | _O_TEXT))) == -1)
- {
- _dosmaperr(GetLastError()); /* map error */
- CloseHandle(osfh);
- }
-
- return fh; /* return handle */
-}
-#endif /* __WIN__ */
#ifdef EXTRA_DEBUG
=== modified file 'mysys/my_pread.c'
--- a/mysys/my_pread.c 2008-08-25 18:23:18 +0000
+++ b/mysys/my_pread.c 2008-09-09 19:02:38 +0000
@@ -18,81 +18,11 @@
#include "my_base.h"
#include <m_string.h>
#include <errno.h>
-#if defined (HAVE_PREAD) && !defined(__WIN__)
+#if defined (HAVE_PREAD) && !defined(_WIN32)
#include <unistd.h>
#endif
-#ifdef __WIN__
-extern void _dosmaperr(DWORD);
-/*
- Positional read and write on Windows.
-
- NOTE:
- - this functions require NT-based kernel.
- - they can read/write at most 4GB at once.
- - unlike Posix pread/pwrite, they change file pointer position.
-*/
-static size_t pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset)
-{
- DWORD nBytesRead;
- HANDLE hFile;
- OVERLAPPED ov={0};
- LARGE_INTEGER li;
-
- if(!Count)
- return 0;
-#ifdef _WIN64
- if(Count > UINT_MAX)
- Count = UINT_MAX;
-#endif
-
- hFile= (HANDLE)_get_osfhandle(Filedes);
- li.QuadPart= offset;
- ov.Offset= li.LowPart;
- ov.OffsetHigh= li.HighPart;
-
- if(!ReadFile(hFile, Buffer, (DWORD)Count, &nBytesRead, &ov))
- {
- DWORD lastError = GetLastError();
- if(lastError == ERROR_HANDLE_EOF)
- return 0; /*return 0 at EOF*/
- _dosmaperr(lastError);
- return -1;
- }
- else
- return nBytesRead;
-}
-
-static size_t pwrite(File Filedes, const uchar *Buffer, size_t Count, my_off_t offset)
-{
- DWORD nBytesWritten;
- HANDLE hFile;
- OVERLAPPED ov={0};
- LARGE_INTEGER li;
-
- if(!Count)
- return 0;
-
-#ifdef _WIN64
- if(Count > UINT_MAX)
- Count = UINT_MAX;
-#endif
-
- hFile= (HANDLE)_get_osfhandle(Filedes);
- li.QuadPart= offset;
- ov.Offset= li.LowPart;
- ov.OffsetHigh= li.HighPart;
-
- if(!WriteFile(hFile, Buffer, (DWORD)Count, &nBytesWritten, &ov))
- {
- _dosmaperr(GetLastError());
- return -1;
- }
- else
- return nBytesWritten;
-}
-#endif
/*
Read a chunk of bytes from a file from a given position
@@ -120,37 +50,39 @@ size_t my_pread(File Filedes, uchar *Buf
{
size_t readbytes;
int error= 0;
-#if !defined (HAVE_PREAD) && !defined (__WIN__)
+#if !defined (HAVE_PREAD) && !defined (_WIN32)
int save_errno;
#endif
-#ifndef DBUG_OFF
- char llbuf[22];
DBUG_ENTER("my_pread");
- DBUG_PRINT("my",("fd: %d Seek: %s Buffer: %p Count: %lu MyFlags: %d",
- Filedes, ullstr(offset, llbuf), Buffer,
- (ulong)Count, MyFlags));
-#endif
+ DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d",
+ Filedes, (ulonglong)offset, Buffer, (ulong)Count, MyFlags));
for (;;)
{
errno= 0; /* Linux, Windows don't reset this on EOF/success */
-#if !defined (HAVE_PREAD) && !defined (__WIN__)
+#if !defined (HAVE_PREAD) && !defined (_WIN32)
pthread_mutex_lock(&my_file_info[Filedes].mutex);
readbytes= (uint) -1;
error= (lseek(Filedes, offset, MY_SEEK_SET) == (my_off_t) -1 ||
- (readbytes= read(Filedes, Buffer, Count)) != Count);
+ (readbytes= read(Filedes, Buffer, Count)) != Count);
save_errno= errno;
pthread_mutex_unlock(&my_file_info[Filedes].mutex);
if (error)
- {
errno= save_errno;
#else
- if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count)))
- {
+#if defined(_WIN32)
+ readbytes= my_win_pread(Filedes, Buffer, Count, offset);
+#else
+ readbytes= pread(Filedes, Buffer, Count, offset);
+#endif
+ error= (readbytes != Count);
#endif
+ if(error)
+ {
my_errno= errno ? errno : -1;
if (errno == 0 || (readbytes != (size_t) -1 &&
- (MyFlags & (MY_NABP | MY_FNABP))))
- my_errno= HA_ERR_FILE_TOO_SHORT;
+ (MyFlags & (MY_NABP | MY_FNABP))))
+ my_errno= HA_ERR_FILE_TOO_SHORT;
+
DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
(int) readbytes, (uint) Count,Filedes,my_errno));
#ifdef THREAD
@@ -163,19 +95,19 @@ size_t my_pread(File Filedes, uchar *Buf
#endif
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
- if (readbytes == (size_t) -1)
- my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG),
- my_filename(Filedes),my_errno);
- else if (MyFlags & (MY_NABP | MY_FNABP))
- my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG),
- my_filename(Filedes),my_errno);
+ if (readbytes == (size_t) -1)
+ my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG),
+ my_filename(Filedes),my_errno);
+ else if (MyFlags & (MY_NABP | MY_FNABP))
+ my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG),
+ my_filename(Filedes),my_errno);
}
if (readbytes == (size_t) -1 || (MyFlags & (MY_FNABP | MY_NABP)))
- DBUG_RETURN(MY_FILE_ERROR); /* Return with error */
+ DBUG_RETURN(MY_FILE_ERROR); /* Return with error */
}
if (MyFlags & (MY_NABP | MY_FNABP))
- DBUG_RETURN(0); /* Read went ok; Return 0 */
- DBUG_RETURN(readbytes); /* purecov: inspected */
+ DBUG_RETURN(0); /* Read went ok; Return 0 */
+ DBUG_RETURN(readbytes); /* purecov: inspected */
}
} /* my_pread */
@@ -201,45 +133,45 @@ size_t my_pread(File Filedes, uchar *Buf
# Number of bytes read
*/
-size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count,
+size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count,
my_off_t offset, myf MyFlags)
{
- size_t writenbytes, written;
+ size_t writtenbytes, written;
uint errors;
-#ifndef DBUG_OFF
- char llbuf[22];
+
DBUG_ENTER("my_pwrite");
- DBUG_PRINT("my",("fd: %d Seek: %s Buffer: %p Count: %lu MyFlags: %d",
- Filedes, ullstr(offset, llbuf), Buffer,
- (ulong)Count, MyFlags));
-#endif
+ DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d",
+ Filedes, offset, Buffer, (ulong)Count, MyFlags));
errors= 0;
written= 0;
for (;;)
{
-#if !defined (HAVE_PREAD) && !defined (__WIN__)
+#if !defined (HAVE_PREAD) && !defined (_WIN32)
int error;
- writenbytes= (size_t) -1;
+ writtenbytes= (size_t) -1;
pthread_mutex_lock(&my_file_info[Filedes].mutex);
error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 &&
- (writenbytes = write(Filedes, Buffer, Count)) == Count);
+ (writtenbytes= write(Filedes, Buffer, Count)) == Count);
pthread_mutex_unlock(&my_file_info[Filedes].mutex);
if (error)
break;
+#elif defined (_WIN32)
+ writtenbytes= my_win_pwrite(Filedes, Buffer, Count, offset);
#else
- if ((writenbytes= pwrite(Filedes, Buffer, Count,offset)) == Count)
+ writtenbytes= pwrite(Filedes, Buffer, Count, offset);
+#endif
+ if(writtenbytes == Count)
break;
my_errno= errno;
-#endif
- if (writenbytes != (size_t) -1)
- { /* Safegueard */
- written+=writenbytes;
- Buffer+=writenbytes;
- Count-=writenbytes;
- offset+=writenbytes;
+ if (writtenbytes != (size_t) -1)
+ {
+ written+= writtenbytes;
+ Buffer+= writtenbytes;
+ Count-= writtenbytes;
+ offset+= writtenbytes;
}
- DBUG_PRINT("error",("Write only %u bytes", (uint) writenbytes));
+ DBUG_PRINT("error",("Write only %u bytes", (uint) writtenbytes));
#ifndef NO_BACKGROUND
#ifdef THREAD
if (my_thread_var->abort)
@@ -249,20 +181,20 @@ size_t my_pwrite(int Filedes, const ucha
(MyFlags & MY_WAIT_IF_FULL))
{
if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
- my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
- my_filename(Filedes),my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
- (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
+ my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
+ my_filename(Filedes),my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
+ sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
continue;
}
- if ((writenbytes && writenbytes != (size_t) -1) || my_errno == EINTR)
+ if ((writtenbytes && writtenbytes != (size_t) -1) || my_errno == EINTR)
continue; /* Retry */
#endif
if (MyFlags & (MY_NABP | MY_FNABP))
{
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
- my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG),
- my_filename(Filedes),my_errno);
+ my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG),
+ my_filename(Filedes),my_errno);
}
DBUG_RETURN(MY_FILE_ERROR); /* Error on read */
}
@@ -272,5 +204,5 @@ size_t my_pwrite(int Filedes, const ucha
DBUG_EXECUTE_IF("check", my_seek(Filedes, -1, SEEK_SET, MYF(0)););
if (MyFlags & (MY_NABP | MY_FNABP))
DBUG_RETURN(0); /* Want only errors */
- DBUG_RETURN(writenbytes+written); /* purecov: inspected */
+ DBUG_RETURN(writtenbytes+written); /* purecov: inspected */
} /* my_pwrite */
=== modified file 'mysys/my_quick.c'
--- a/mysys/my_quick.c 2007-06-21 08:13:10 +0000
+++ b/mysys/my_quick.c 2008-06-17 23:37:23 +0000
@@ -19,11 +19,19 @@
#include "my_nosys.h"
+#ifdef _WIN32
+extern size_t my_win_read(File Filedes,uchar *Buffer,size_t Count);
+#endif
+
size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,myf MyFlags)
{
size_t readbytes;
-
- if ((readbytes = read(Filedes, Buffer, Count)) != Count)
+#ifdef _WIN32
+ readbytes= my_win_read(Filedes, Buffer, Count);
+#else
+ readbytes= read(Filedes, Buffer, Count);
+#endif
+ if(readbytes != Count)
{
#ifndef DBUG_OFF
if ((readbytes == 0 || readbytes == (size_t) -1) && errno == EINTR)
@@ -40,8 +48,13 @@ size_t my_quick_read(File Filedes,uchar
}
-size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count)
+
+size_t my_quick_write(File Filedes, const uchar *Buffer, size_t Count)
{
+#ifdef _WIN32
+ return my_win_write(Filedes, Buffer, Count);
+#else
+
#ifndef DBUG_OFF
size_t writtenbytes;
#endif
@@ -64,4 +77,5 @@ size_t my_quick_write(File Filedes,const
return (size_t) -1;
}
return 0;
+#endif
}
=== modified file 'mysys/my_read.c'
--- a/mysys/my_read.c 2008-05-29 15:44:11 +0000
+++ b/mysys/my_read.c 2008-07-23 08:52:08 +0000
@@ -44,7 +44,13 @@ size_t my_read(File Filedes, uchar *Buff
for (;;)
{
errno= 0; /* Linux, Windows don't reset this on EOF/success */
- if ((readbytes= read(Filedes, Buffer, Count)) != Count)
+#ifdef _WIN32
+ readbytes= my_win_read(Filedes, Buffer, Count);
+#else
+ readbytes= read(Filedes, Buffer, Count);
+#endif
+
+ if (readbytes != Count)
{
my_errno= errno;
if (errno == 0 || (readbytes != (size_t) -1 &&
=== modified file 'mysys/my_seek.c'
--- a/mysys/my_seek.c 2008-05-29 15:44:11 +0000
+++ b/mysys/my_seek.c 2008-07-23 08:52:08 +0000
@@ -45,36 +45,30 @@
my_off_t my_seek(File fd, my_off_t pos, int whence,
myf MyFlags __attribute__((unused)))
{
- reg1 os_off_t newpos= -1;
+ os_off_t newpos= -1;
DBUG_ENTER("my_seek");
- DBUG_PRINT("my",("fd: %d Hpos: %lu Pos: %lu Whence: %d MyFlags: %d",
- fd, (ulong) (((ulonglong) pos) >> 32), (ulong) pos,
- whence, MyFlags));
+ DBUG_PRINT("my",("fd: %d Pos: %llu Whence: %d MyFlags: %d",
+ fd, (ulonglong) pos, whence, MyFlags));
DBUG_ASSERT(pos != MY_FILEPOS_ERROR); /* safety check */
/*
Make sure we are using a valid file descriptor!
*/
DBUG_ASSERT(fd != -1);
-#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(__WIN__)
- if (MyFlags & MY_THREADSAFE)
- {
- pthread_mutex_lock(&my_file_info[fd].mutex);
- newpos= lseek(fd, pos, whence);
- pthread_mutex_unlock(&my_file_info[fd].mutex);
- }
- else
+#if defined (_WIN32)
+ newpos= my_win_lseek(fd, pos, whence);
+#else
+ newpos= lseek(fd, pos, whence);
#endif
- newpos= lseek(fd, pos, whence);
if (newpos == (os_off_t) -1)
{
- my_errno=errno;
- DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno));
+ my_errno= errno;
+ DBUG_PRINT("error",("lseek: %llu errno: %d", (ulonglong) newpos,errno));
DBUG_RETURN(MY_FILEPOS_ERROR);
}
if ((my_off_t) newpos != pos)
{
- DBUG_PRINT("exit",("pos: %lu", (ulong) newpos));
+ DBUG_PRINT("exit",("pos: %llu", (ulonglong) newpos));
}
DBUG_RETURN((my_off_t) newpos);
} /* my_seek */
@@ -89,13 +83,13 @@ my_off_t my_tell(File fd, myf MyFlags __
DBUG_ENTER("my_tell");
DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
DBUG_ASSERT(fd >= 0);
-#ifdef HAVE_TELL
- pos=tell(fd);
+#if defined (HAVE_TELL) && !defined (_WIN32)
+ pos= tell(fd);
#else
- pos=lseek(fd, 0L, MY_SEEK_CUR);
+ pos= my_seek(fd, 0L, MY_SEEK_CUR,0);
#endif
if (pos == (os_off_t) -1)
- my_errno=errno;
- DBUG_PRINT("exit",("pos: %lu", (ulong) pos));
+ my_errno= errno;
+ DBUG_PRINT("exit",("pos: %llu", (ulonglong) pos));
DBUG_RETURN((my_off_t) pos);
} /* my_tell */
=== modified file 'mysys/my_static.c'
--- a/mysys/my_static.c 2008-08-19 14:10:19 +0000
+++ b/mysys/my_static.c 2008-08-23 00:18:35 +0000
@@ -35,7 +35,7 @@ int NEAR my_umask=0664, NEAR my_umask_d
#ifndef THREAD
int NEAR my_errno=0;
#endif
-struct st_my_file_info my_file_info_default[MY_NFILE]= {{0,UNOPEN}};
+struct st_my_file_info my_file_info_default[MY_NFILE];
uint my_file_limit= MY_NFILE;
struct st_my_file_info *my_file_info= my_file_info_default;
=== modified file 'mysys/my_sync.c'
--- a/mysys/my_sync.c 2008-04-28 16:24:05 +0000
+++ b/mysys/my_sync.c 2008-07-23 08:52:08 +0000
@@ -62,8 +62,8 @@ int my_sync(File fd, myf my_flags)
res= fdatasync(fd);
#elif defined(HAVE_FSYNC)
res= fsync(fd);
-#elif defined(__WIN__)
- res= _commit(fd);
+#elif defined(_WIN32)
+ res= my_win_fsync(fd);
#else
#error Cannot find a way to sync a file, durability in danger
res= 0; /* No sync (strange OS) */
=== added file 'mysys/my_winerr.c'
--- a/mysys/my_winerr.c 1970-01-01 00:00:00 +0000
+++ b/mysys/my_winerr.c 2008-06-17 23:37:23 +0000
@@ -0,0 +1,123 @@
+/* Copyright (C) 2008 MySQL AB
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ Convert Windows API error (GetLastError() to Posix equivalent (errno)
+ The exported function my_osmaperr() is modelled after and borrows
+ heavily from undocumented _dosmaperr()(found of the static Microsoft C runtime).
+*/
+
+#include <my_global.h>
+#include <my_sys.h>
+
+
+struct errentry
+{
+ unsigned long oscode; /* OS return value */
+ int sysv_errno; /* System V error code */
+};
+
+static struct errentry errtable[]= {
+ { ERROR_INVALID_FUNCTION, EINVAL }, /* 1 */
+ { ERROR_FILE_NOT_FOUND, ENOENT }, /* 2 */
+ { ERROR_PATH_NOT_FOUND, ENOENT }, /* 3 */
+ { ERROR_TOO_MANY_OPEN_FILES, EMFILE }, /* 4 */
+ { ERROR_ACCESS_DENIED, EACCES }, /* 5 */
+ { ERROR_INVALID_HANDLE, EBADF }, /* 6 */
+ { ERROR_ARENA_TRASHED, ENOMEM }, /* 7 */
+ { ERROR_NOT_ENOUGH_MEMORY, ENOMEM }, /* 8 */
+ { ERROR_INVALID_BLOCK, ENOMEM }, /* 9 */
+ { ERROR_BAD_ENVIRONMENT, E2BIG }, /* 10 */
+ { ERROR_BAD_FORMAT, ENOEXEC }, /* 11 */
+ { ERROR_INVALID_ACCESS, EINVAL }, /* 12 */
+ { ERROR_INVALID_DATA, EINVAL }, /* 13 */
+ { ERROR_INVALID_DRIVE, ENOENT }, /* 15 */
+ { ERROR_CURRENT_DIRECTORY, EACCES }, /* 16 */
+ { ERROR_NOT_SAME_DEVICE, EXDEV }, /* 17 */
+ { ERROR_NO_MORE_FILES, ENOENT }, /* 18 */
+ { ERROR_LOCK_VIOLATION, EACCES }, /* 33 */
+ { ERROR_BAD_NETPATH, ENOENT }, /* 53 */
+ { ERROR_NETWORK_ACCESS_DENIED, EACCES }, /* 65 */
+ { ERROR_BAD_NET_NAME, ENOENT }, /* 67 */
+ { ERROR_FILE_EXISTS, EEXIST }, /* 80 */
+ { ERROR_CANNOT_MAKE, EACCES }, /* 82 */
+ { ERROR_FAIL_I24, EACCES }, /* 83 */
+ { ERROR_INVALID_PARAMETER, EINVAL }, /* 87 */
+ { ERROR_NO_PROC_SLOTS, EAGAIN }, /* 89 */
+ { ERROR_DRIVE_LOCKED, EACCES }, /* 108 */
+ { ERROR_BROKEN_PIPE, EPIPE }, /* 109 */
+ { ERROR_DISK_FULL, ENOSPC }, /* 112 */
+ { ERROR_INVALID_TARGET_HANDLE, EBADF }, /* 114 */
+ { ERROR_INVALID_HANDLE, EINVAL }, /* 124 */
+ { ERROR_WAIT_NO_CHILDREN, ECHILD }, /* 128 */
+ { ERROR_CHILD_NOT_COMPLETE, ECHILD }, /* 129 */
+ { ERROR_DIRECT_ACCESS_HANDLE, EBADF }, /* 130 */
+ { ERROR_NEGATIVE_SEEK, EINVAL }, /* 131 */
+ { ERROR_SEEK_ON_DEVICE, EACCES }, /* 132 */
+ { ERROR_DIR_NOT_EMPTY, ENOTEMPTY }, /* 145 */
+ { ERROR_NOT_LOCKED, EACCES }, /* 158 */
+ { ERROR_BAD_PATHNAME, ENOENT }, /* 161 */
+ { ERROR_MAX_THRDS_REACHED, EAGAIN }, /* 164 */
+ { ERROR_LOCK_FAILED, EACCES }, /* 167 */
+ { ERROR_ALREADY_EXISTS, EEXIST }, /* 183 */
+ { ERROR_FILENAME_EXCED_RANGE, ENOENT }, /* 206 */
+ { ERROR_NESTING_NOT_ALLOWED, EAGAIN }, /* 215 */
+ { ERROR_NOT_ENOUGH_QUOTA, ENOMEM } /* 1816 */
+};
+
+/* size of the table */
+#define ERRTABLESIZE (sizeof(errtable)/sizeof(errtable[0]))
+
+/* The following two constants must be the minimum and maximum
+values in the (contiguous) range of Exec Failure errors. */
+#define MIN_EXEC_ERROR ERROR_INVALID_STARTING_CODESEG
+#define MAX_EXEC_ERROR ERROR_INFLOOP_IN_RELOC_CHAIN
+
+/* These are the low and high value in the range of errors that are
+access violations */
+#define MIN_EACCES_RANGE ERROR_WRITE_PROTECT
+#define MAX_EACCES_RANGE ERROR_SHARING_BUFFER_EXCEEDED
+
+
+static int get_errno_from_oserr(unsigned long oserrno)
+{
+ int i;
+
+ /* check the table for the OS error code */
+ for (i= 0; i < ERRTABLESIZE; ++i)
+ {
+ if (oserrno == errtable[i].oscode)
+ {
+ return errtable[i].sysv_errno;
+ }
+ }
+
+ /* The error code wasn't in the table. We check for a range of */
+ /* EACCES errors or exec failure errors (ENOEXEC). Otherwise */
+ /* EINVAL is returned. */
+
+ if (oserrno >= MIN_EACCES_RANGE && oserrno <= MAX_EACCES_RANGE)
+ return EACCES;
+ else if (oserrno >= MIN_EXEC_ERROR && oserrno <= MAX_EXEC_ERROR)
+ return ENOEXEC;
+ else
+ return EINVAL;
+}
+
+/* Set errno corresponsing to GetLastError() value */
+void my_osmaperr ( unsigned long oserrno)
+{
+ errno= get_errno_from_oserr(oserrno);
+}
=== added file 'mysys/my_winfile.c'
--- a/mysys/my_winfile.c 1970-01-01 00:00:00 +0000
+++ b/mysys/my_winfile.c 2008-07-23 08:52:08 +0000
@@ -0,0 +1,663 @@
+/* Copyright (C) 2008 MySQL AB
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/*
+ The purpose of this file is to provide implementation of file IO routines on
+ Windows that can be thought as drop-in replacement for corresponding C runtime
+ functionality.
+
+ Compared to Windows CRT, this one
+ - does not have the same file descriptor
+ limitation (default is 16384 and can be increased further, whereas CRT poses
+ a hard limit of 2048 file descriptors)
+ - the file operations are not serialized
+ - positional IO pread/pwrite is ported here.
+ - no text mode for files, all IO is "binary"
+
+ Naming convention:
+ All routines are prefixed with my_win_, e.g Posix open() is implemented with
+ my_win_open()
+
+ Implemented are
+ - POSIX routines(e.g open, read, lseek ...)
+ - Some ANSI C stream routines (fopen, fdopen, fileno, fclose)
+ - Windows CRT equvalients (my_get_osfhandle, open_osfhandle)
+
+ Worth to note:
+ - File descriptors used here are located in a range that is not compatible
+ with CRT on purpose. Attempt to use a file descriptor from Windows CRT library
+ range in my_win_* function will be punished with DBUG_ASSERT()
+
+ - File streams (FILE *) are actually from the C runtime. The routines provided
+ here are useful only in scernarios that use low-level IO with my_win_fileno()
+*/
+
+#ifdef _WIN32
+
+#include "mysys_priv.h"
+#include <share.h>
+#include <sys/stat.h>
+
+/* Associates a file descriptor with an existing operating-system file handle.*/
+File my_open_osfhandle(HANDLE handle, int oflag)
+{
+ int offset= -1;
+ uint i;
+ DBUG_ENTER("my_open_osfhandle");
+
+ pthread_mutex_lock(&THR_LOCK_open);
+ for(i= MY_FILE_MIN; i < my_file_limit;i++)
+ {
+ if(my_file_info[i].fhandle == 0)
+ {
+ struct st_my_file_info *finfo= &(my_file_info[i]);
+ finfo->type= FILE_BY_OPEN;
+ finfo->fhandle= handle;
+ finfo->oflag= oflag;
+ offset= i;
+ break;
+ }
+ }
+ pthread_mutex_unlock(&THR_LOCK_open);
+ if(offset == -1)
+ errno= EMFILE; /* to many file handles open */
+ DBUG_RETURN(offset);
+}
+
+
+static void invalidate_fd(File fd)
+{
+ DBUG_ENTER("invalidate_fd");
+ DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit);
+ my_file_info[fd].fhandle= 0;
+ DBUG_VOID_RETURN;
+}
+
+
+/* Get Windows handle for a file descriptor */
+HANDLE my_get_osfhandle(File fd)
+{
+ DBUG_ENTER("my_get_osfhandle");
+ DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit);
+ DBUG_RETURN(my_file_info[fd].fhandle);
+}
+
+
+static int my_get_open_flags(File fd)
+{
+ DBUG_ENTER("my_get_osfhandle");
+ DBUG_ASSERT(fd >= MY_FILE_MIN && fd < (int)my_file_limit);
+ DBUG_RETURN(my_file_info[fd].oflag);
+}
+
+
+/*
+ Open a file with sharing. Similar to _sopen() from libc, but allows managing
+ share delete on win32
+
+ SYNOPSIS
+ my_win_sopen()
+ path file name
+ oflag operation flags
+ shflag share flag
+ pmode permission flags
+
+ RETURN VALUE
+ File descriptor of opened file if success
+ -1 and sets errno if fails.
+*/
+
+File my_win_sopen(const char *path, int oflag, int shflag, int pmode)
+{
+ int fh; /* handle of opened file */
+ int mask;
+ HANDLE osfh; /* OS handle of opened file */
+ DWORD fileaccess; /* OS file access (requested) */
+ DWORD fileshare; /* OS file sharing mode */
+ DWORD filecreate; /* OS method of opening/creating */
+ DWORD fileattrib; /* OS file attribute flags */
+ SECURITY_ATTRIBUTES SecurityAttributes;
+
+ DBUG_ENTER("my_win_sopen");
+
+ if (check_if_legal_filename(path))
+ {
+ errno= EACCES;
+ DBUG_RETURN(-1);
+ }
+ SecurityAttributes.nLength= sizeof(SecurityAttributes);
+ SecurityAttributes.lpSecurityDescriptor= NULL;
+ SecurityAttributes.bInheritHandle= !(oflag & _O_NOINHERIT);
+
+ /* decode the access flags */
+ switch (oflag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
+ case _O_RDONLY: /* read access */
+ fileaccess= GENERIC_READ;
+ break;
+ case _O_WRONLY: /* write access */
+ fileaccess= GENERIC_WRITE;
+ break;
+ case _O_RDWR: /* read and write access */
+ fileaccess= GENERIC_READ | GENERIC_WRITE;
+ break;
+ default: /* error, bad oflag */
+ errno= EINVAL;
+ DBUG_RETURN(-1);
+ }
+
+ /* decode sharing flags */
+ switch (shflag) {
+ case _SH_DENYRW: /* exclusive access except delete */
+ fileshare= FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYWR: /* share read and delete access */
+ fileshare= FILE_SHARE_READ | FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYRD: /* share write and delete access */
+ fileshare= FILE_SHARE_WRITE | FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYNO: /* share read, write and delete access */
+ fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
+ break;
+ case _SH_DENYRWD: /* exclusive access */
+ fileshare= 0L;
+ break;
+ case _SH_DENYWRD: /* share read access */
+ fileshare= FILE_SHARE_READ;
+ break;
+ case _SH_DENYRDD: /* share write access */
+ fileshare= FILE_SHARE_WRITE;
+ break;
+ case _SH_DENYDEL: /* share read and write access */
+ fileshare= FILE_SHARE_READ | FILE_SHARE_WRITE;
+ break;
+ default: /* error, bad shflag */
+ errno= EINVAL;
+ DBUG_RETURN(-1);
+ }
+
+ /* decode open/create method flags */
+ switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) {
+ case 0:
+ case _O_EXCL: /* ignore EXCL w/o CREAT */
+ filecreate= OPEN_EXISTING;
+ break;
+
+ case _O_CREAT:
+ filecreate= OPEN_ALWAYS;
+ break;
+
+ case _O_CREAT | _O_EXCL:
+ case _O_CREAT | _O_TRUNC | _O_EXCL:
+ filecreate= CREATE_NEW;
+ break;
+
+ case _O_TRUNC:
+ case _O_TRUNC | _O_EXCL: /* ignore EXCL w/o CREAT */
+ filecreate= TRUNCATE_EXISTING;
+ break;
+
+ case _O_CREAT | _O_TRUNC:
+ filecreate= CREATE_ALWAYS;
+ break;
+
+ default:
+ /* this can't happen ... all cases are covered */
+ errno= EINVAL;
+ DBUG_RETURN(-1);
+ }
+
+ /* decode file attribute flags if _O_CREAT was specified */
+ fileattrib= FILE_ATTRIBUTE_NORMAL; /* default */
+ if (oflag & _O_CREAT)
+ {
+ _umask((mask= _umask(0)));
+
+ if (!((pmode & ~mask) & _S_IWRITE))
+ fileattrib= FILE_ATTRIBUTE_READONLY;
+ }
+
+ /* Set temporary file (delete-on-close) attribute if requested. */
+ if (oflag & _O_TEMPORARY)
+ {
+ fileattrib|= FILE_FLAG_DELETE_ON_CLOSE;
+ fileaccess|= DELETE;
+ }
+
+ /* Set temporary file (delay-flush-to-disk) attribute if requested.*/
+ if (oflag & _O_SHORT_LIVED)
+ fileattrib|= FILE_ATTRIBUTE_TEMPORARY;
+
+ /* Set sequential or random access attribute if requested. */
+ if (oflag & _O_SEQUENTIAL)
+ fileattrib|= FILE_FLAG_SEQUENTIAL_SCAN;
+ else if (oflag & _O_RANDOM)
+ fileattrib|= FILE_FLAG_RANDOM_ACCESS;
+
+ /* try to open/create the file */
+ if ((osfh= CreateFile(path, fileaccess, fileshare, &SecurityAttributes,
+ filecreate, fileattrib, NULL)) == INVALID_HANDLE_VALUE)
+ {
+ /*
+ OS call to open/create file failed! map the error, release
+ the lock, and return -1. note that it's not necessary to
+ call _free_osfhnd (it hasn't been used yet).
+ */
+ my_osmaperr(GetLastError()); /* map error */
+ DBUG_RETURN(-1); /* return error to caller */
+ }
+
+ if ((fh= my_open_osfhandle(osfh,
+ oflag & (_O_APPEND | _O_RDONLY | _O_TEXT))) == -1)
+ {
+ CloseHandle(osfh);
+ }
+
+ DBUG_RETURN(fh); /* return handle */
+}
+
+
+File my_win_open(const char *path, int flags)
+{
+ DBUG_ENTER("my_win_open");
+ DBUG_RETURN(my_win_sopen((char *) path, flags | _O_BINARY, _SH_DENYNO,
+ _S_IREAD | S_IWRITE));
+}
+
+
+int my_win_close(File fd)
+{
+ DBUG_ENTER("my_win_close");
+ if(CloseHandle(my_get_osfhandle(fd)))
+ {
+ invalidate_fd(fd);
+ DBUG_RETURN(0);
+ }
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+
+
+size_t my_win_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset)
+{
+ DWORD nBytesRead;
+ HANDLE hFile;
+ OVERLAPPED ov= {0};
+ LARGE_INTEGER li;
+
+ DBUG_ENTER("my_win_pread");
+
+ if(!Count)
+ DBUG_RETURN(0);
+#ifdef _WIN64
+ if(Count > UINT_MAX)
+ Count= UINT_MAX;
+#endif
+
+ hFile= (HANDLE)my_get_osfhandle(Filedes);
+ li.QuadPart= offset;
+ ov.Offset= li.LowPart;
+ ov.OffsetHigh= li.HighPart;
+
+ if(!ReadFile(hFile, Buffer, (DWORD)Count, &nBytesRead, &ov))
+ {
+ DWORD lastError= GetLastError();
+ if(lastError == ERROR_HANDLE_EOF)
+ DBUG_RETURN(0); /*return 0 at EOF*/
+ my_osmaperr(lastError);
+ DBUG_RETURN(-1);
+ }
+ DBUG_RETURN(nBytesRead);
+}
+
+
+size_t my_win_read(File Filedes, uchar *Buffer, size_t Count)
+{
+ DWORD nBytesRead;
+ HANDLE hFile;
+
+ DBUG_ENTER("my_win_read");
+ if(!Count)
+ return 0;
+#ifdef _WIN64
+ if(Count > UINT_MAX)
+ Count= UINT_MAX;
+#endif
+
+ hFile= (HANDLE)my_get_osfhandle(Filedes);
+
+ if(!ReadFile(hFile, Buffer, (DWORD)Count, &nBytesRead, NULL))
+ {
+ DWORD lastError= GetLastError();
+ if(lastError == ERROR_HANDLE_EOF)
+ DBUG_RETURN(0); /*return 0 at EOF*/
+ my_osmaperr(lastError);
+ DBUG_RETURN(-1);
+ }
+ DBUG_RETURN(nBytesRead);
+}
+
+
+size_t my_win_pwrite(File Filedes, const uchar *Buffer, size_t Count,
+ my_off_t offset)
+{
+ DWORD nBytesWritten;
+ HANDLE hFile;
+ OVERLAPPED ov= {0};
+ LARGE_INTEGER li;
+
+ DBUG_ENTER("my_win_pwrite");
+ DBUG_PRINT("my",("Filedes: %d, Buffer: %p, Count: %zd, offset: %llu",
+ Filedes, Buffer, Count, (ulonglong)offset));
+
+ if(!Count)
+ DBUG_RETURN(0);
+
+#ifdef _WIN64
+ if(Count > UINT_MAX)
+ Count= UINT_MAX;
+#endif
+
+ hFile= (HANDLE)my_get_osfhandle(Filedes);
+ li.QuadPart= offset;
+ ov.Offset= li.LowPart;
+ ov.OffsetHigh= li.HighPart;
+
+ if(!WriteFile(hFile, Buffer, (DWORD)Count, &nBytesWritten, &ov))
+ {
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+ }
+ else
+ DBUG_RETURN(nBytesWritten);
+}
+
+
+my_off_t my_win_lseek(File fd, my_off_t pos, int whence)
+{
+ LARGE_INTEGER offset;
+ LARGE_INTEGER newpos;
+
+ DBUG_ENTER("my_win_lseek");
+
+ /* Check compatibility of Windows and Posix seek constants */
+ compile_time_assert(FILE_BEGIN == SEEK_SET && FILE_CURRENT == SEEK_CUR
+ && FILE_END == SEEK_END);
+
+ offset.QuadPart= pos;
+ if(!SetFilePointerEx(my_get_osfhandle(fd), offset, &newpos, whence))
+ {
+ my_osmaperr(GetLastError());
+ newpos.QuadPart= -1;
+ }
+ DBUG_RETURN(newpos.QuadPart);
+}
+
+
+#ifndef FILE_WRITE_TO_END_OF_FILE
+#define FILE_WRITE_TO_END_OF_FILE 0xffffffff
+#endif
+size_t my_win_write(File fd, const uchar *Buffer, size_t Count)
+{
+ DWORD nWritten;
+ OVERLAPPED ov;
+ OVERLAPPED *pov= NULL;
+ HANDLE hFile;
+
+ DBUG_ENTER("my_win_write");
+ DBUG_PRINT("my",("Filedes: %d, Buffer: %p, Count %zd", fd, Buffer, Count));
+ if(my_get_open_flags(fd) & _O_APPEND)
+ {
+ /*
+ Atomic append to the end of file is is done by special initialization of
+ the OVERLAPPED structure. See MSDN WriteFile documentation for more info.
+ */
+ memset(&ov, 0, sizeof(ov));
+ ov.Offset= FILE_WRITE_TO_END_OF_FILE;
+ ov.OffsetHigh= -1;
+ pov= &ov;
+ }
+
+ hFile= my_get_osfhandle(fd);
+ if(!WriteFile(hFile, Buffer, (DWORD)Count, &nWritten, pov))
+ {
+ nWritten= (size_t)-1;
+ my_osmaperr(GetLastError());
+ }
+ DBUG_RETURN((size_t)nWritten);
+}
+
+
+int my_win_chsize(File fd, my_off_t newlength)
+{
+ HANDLE hFile;
+ LARGE_INTEGER length;
+ DBUG_ENTER("my_win_chsize");
+
+ hFile= (HANDLE) my_get_osfhandle(fd);
+ length.QuadPart= newlength;
+ if (!SetFilePointerEx(hFile, length , NULL , FILE_BEGIN))
+ goto err;
+ if (!SetEndOfFile(hFile))
+ goto err;
+ DBUG_RETURN(0);
+err:
+ my_osmaperr(GetLastError());
+ my_errno= errno;
+ DBUG_RETURN(-1);
+}
+
+
+/* Get the file descriptor for stdin,stdout or stderr */
+static File my_get_stdfile_descriptor(FILE *stream)
+{
+ HANDLE hFile;
+ DWORD nStdHandle;
+ DBUG_ENTER("my_get_stdfile_descriptor");
+
+ if(stream == stdin)
+ nStdHandle= STD_INPUT_HANDLE;
+ else if(stream == stdout)
+ nStdHandle= STD_OUTPUT_HANDLE;
+ else if(stream == stderr)
+ nStdHandle= STD_ERROR_HANDLE;
+ else
+ DBUG_RETURN(-1);
+
+ hFile= GetStdHandle(nStdHandle);
+ if(hFile != INVALID_HANDLE_VALUE)
+ DBUG_RETURN(my_open_osfhandle(hFile, 0));
+ DBUG_RETURN(-1);
+}
+
+
+File my_win_fileno(FILE *file)
+{
+ HANDLE hFile= (HANDLE)_get_osfhandle(fileno(file));
+ int retval= -1;
+ uint i;
+
+ DBUG_ENTER("my_win_fileno");
+
+ for(i= MY_FILE_MIN; i < my_file_limit; i++)
+ {
+ if(my_file_info[i].fhandle == hFile)
+ {
+ retval= i;
+ break;
+ }
+ }
+ if(retval == -1)
+ /* try std stream */
+ DBUG_RETURN(my_get_stdfile_descriptor(file));
+ DBUG_RETURN(retval);
+}
+
+
+FILE *my_win_fopen(const char *filename, const char *type)
+{
+ FILE *file;
+ int flags= 0;
+ DBUG_ENTER("my_win_open");
+
+ /*
+ If we are not creating, then we need to use my_access to make sure
+ the file exists since Windows doesn't handle files like "com1.sym"
+ very well
+ */
+ if (check_if_legal_filename(filename))
+ {
+ errno= EACCES;
+ DBUG_RETURN(NULL);
+ }
+
+ file= fopen(filename, type);
+ if(!file)
+ DBUG_RETURN(NULL);
+
+ if(strchr(type,'a') != NULL)
+ flags= O_APPEND;
+
+ /*
+ Register file handle in my_table_info.
+ Necessary for my_fileno()
+ */
+ if(my_open_osfhandle((HANDLE)_get_osfhandle(fileno(file)), flags) < 0)
+ {
+ fclose(file);
+ DBUG_RETURN(NULL);
+ }
+ DBUG_RETURN(file);
+}
+
+
+FILE * my_win_fdopen(File fd, const char *type)
+{
+ FILE *file;
+ int crt_fd;
+ int flags= 0;
+
+ DBUG_ENTER("my_win_fdopen");
+
+ if(strchr(type,'a') != NULL)
+ flags= O_APPEND;
+ /* Convert OS file handle to CRT file descriptor and then call fdopen*/
+ crt_fd= _open_osfhandle((intptr_t)my_get_osfhandle(fd), flags);
+ if(crt_fd < 0)
+ file= NULL;
+ else
+ file= fdopen(crt_fd, type);
+ DBUG_RETURN(file);
+}
+
+
+int my_win_fclose(FILE *file)
+{
+ File fd;
+
+ DBUG_ENTER("my_win_close");
+ fd= my_fileno(file);
+ if(fd < 0)
+ DBUG_RETURN(-1);
+ if(fclose(file) < 0)
+ DBUG_RETURN(-1);
+ invalidate_fd(fd);
+ DBUG_RETURN(0);
+}
+
+
+
+/*
+ Quick and dirty my_fstat() implementation for Windows.
+ Use CRT fstat on temporarily allocated file descriptor.
+ Patch file size, because size that fstat returns is not
+ reliable (may be outdated)
+*/
+int my_win_fstat(File fd, struct _stati64 *buf)
+{
+ int crt_fd;
+ int retval;
+ HANDLE hFile, hDup;
+
+ DBUG_ENTER("my_win_fstat");
+
+ hFile= my_get_osfhandle(fd);
+ if(!DuplicateHandle( GetCurrentProcess(), hFile, GetCurrentProcess(),
+ &hDup ,0,FALSE,DUPLICATE_SAME_ACCESS))
+ {
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+ }
+ if ((crt_fd= _open_osfhandle((intptr_t)hDup,0)) < 0)
+ DBUG_RETURN(-1);
+
+ retval= _fstati64(crt_fd, buf);
+ if(retval == 0)
+ {
+ /* File size returned by stat is not accurate (may be outdated), fix it*/
+ GetFileSizeEx(hDup, (PLARGE_INTEGER) (&(buf->st_size)));
+ }
+ _close(crt_fd);
+ DBUG_RETURN(retval);
+}
+
+
+
+int my_win_stat( const char *path, struct _stati64 *buf)
+{
+ DBUG_ENTER("my_win_stat");
+ if(_stati64( path, buf) == 0)
+ {
+ /* File size returned by stat is not accurate (may be outdated), fix it*/
+ WIN32_FILE_ATTRIBUTE_DATA data;
+ if (GetFileAttributesEx(path, GetFileExInfoStandard, &data))
+ {
+ LARGE_INTEGER li;
+ li.LowPart= data.nFileSizeLow;
+ li.HighPart= data.nFileSizeHigh;
+ buf->st_size= li.QuadPart;
+ }
+ DBUG_RETURN(0);
+ }
+ DBUG_RETURN(-1);
+}
+
+
+
+int my_win_fsync(File fd)
+{
+ DBUG_ENTER("my_win_fsync");
+ if(FlushFileBuffers(my_get_osfhandle(fd)))
+ DBUG_RETURN(0);
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+
+
+
+int my_win_dup(File fd)
+{
+ HANDLE hDup;
+ DBUG_ENTER("my_win_dup");
+ if (DuplicateHandle(GetCurrentProcess(), my_get_osfhandle(fd),
+ GetCurrentProcess(), &hDup, 0, FALSE, DUPLICATE_SAME_ACCESS))
+ {
+ DBUG_RETURN(my_open_osfhandle(hDup, my_get_open_flags(fd)));
+ }
+ my_osmaperr(GetLastError());
+ DBUG_RETURN(-1);
+}
+
+#endif /*_WIN32*/
=== modified file 'mysys/my_write.c'
--- a/mysys/my_write.c 2008-05-29 15:44:11 +0000
+++ b/mysys/my_write.c 2008-07-23 08:52:08 +0000
@@ -20,14 +20,14 @@
/* Write a chunk of bytes to a file */
-size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
+size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags)
{
- size_t writenbytes, written;
+ size_t writtenbytes, written;
uint errors;
DBUG_ENTER("my_write");
DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d",
Filedes, Buffer, (ulong) Count, MyFlags));
- errors=0; written=0;
+ errors= 0; written= 0;
/* The behavior of write(fd, buf, 0) is not portable */
if (unlikely(!Count))
@@ -35,17 +35,22 @@ size_t my_write(int Filedes, const uchar
for (;;)
{
- if ((writenbytes= write(Filedes, Buffer, Count)) == Count)
+#ifdef _WIN32
+ writtenbytes= my_win_write(Filedes, Buffer, Count);
+#else
+ writtenbytes= write(Filedes, Buffer, Count);
+#endif
+ if (writtenbytes == Count)
break;
- if (writenbytes != (size_t) -1)
+ if (writtenbytes != (size_t) -1)
{ /* Safeguard */
- written+=writenbytes;
- Buffer+=writenbytes;
- Count-=writenbytes;
+ written+= writtenbytes;
+ Buffer+= writtenbytes;
+ Count-= writtenbytes;
}
- my_errno=errno;
+ my_errno= errno;
DBUG_PRINT("error",("Write only %ld bytes, error: %d",
- (long) writenbytes, my_errno));
+ (long) writtenbytes, my_errno));
#ifndef NO_BACKGROUND
#ifdef THREAD
if (my_thread_var->abort)
@@ -61,19 +66,19 @@ size_t my_write(int Filedes, const uchar
continue;
}
- if ((writenbytes == 0 || writenbytes == (size_t) -1))
+ if ((writtenbytes == 0 || writtenbytes == (size_t) -1))
{
if (my_errno == EINTR)
{
DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld",
- (long) writenbytes));
+ (long) writtenbytes));
continue; /* Interrupted */
}
- if (!writenbytes && !errors++) /* Retry once */
+ if (!writtenbytes && !errors++) /* Retry once */
{
/* We may come here if the file quota is exeeded */
- errno=EFBIG; /* Assume this is the error */
+ errno= EFBIG; /* Assume this is the error */
continue;
}
}
@@ -94,5 +99,5 @@ size_t my_write(int Filedes, const uchar
}
if (MyFlags & (MY_NABP | MY_FNABP))
DBUG_RETURN(0); /* Want only errors */
- DBUG_RETURN(writenbytes+written);
+ DBUG_RETURN(writtenbytes+written);
} /* my_write */
=== modified file 'mysys/mysys_priv.h'
--- a/mysys/mysys_priv.h 2007-07-30 08:33:50 +0000
+++ b/mysys/mysys_priv.h 2008-07-23 10:40:12 +0000
@@ -42,3 +42,27 @@ extern pthread_mutex_t THR_LOCK_charset,
#endif
void my_error_unregister_all(void);
+
+#ifdef _WIN32
+/* my_winfile.c exports, should not be used outside mysys */
+extern File my_win_open(const char *path, int oflag);
+extern int my_win_close(File fd);
+extern size_t my_win_read(File fd, uchar *buffer, size_t count);
+extern size_t my_win_write(File fd, const uchar *buffer, size_t count);
+extern size_t my_win_pread(File fd, uchar *buffer, size_t count,
+ my_off_t offset);
+extern size_t my_win_pwrite(File fd, const uchar *buffer, size_t count,
+ my_off_t offset);
+extern my_off_t my_win_lseek(File fd, my_off_t pos, int whence);
+extern int my_win_chsize(File fd, my_off_t newlength);
+extern FILE* my_win_fopen(const char *filename, const char *type);
+extern File my_win_fclose(FILE *file);
+extern File my_win_fileno(FILE *file);
+extern FILE* my_win_fdopen(File Filedes, const char *type);
+extern int my_win_stat(const char *path, struct _stati64 *buf);
+extern int my_win_fstat(File fd, struct _stati64 *buf);
+extern int my_win_fsync(File fd);
+extern File my_win_dup(File fd);
+extern File my_win_sopen(const char *path, int oflag, int shflag, int perm);
+extern File my_open_osfhandle(HANDLE handle, int oflag);
+#endif
=== modified file 'scripts/make_binary_distribution.sh'
--- a/scripts/make_binary_distribution.sh 2008-07-21 03:55:09 +0000
+++ b/scripts/make_binary_distribution.sh 2008-09-11 08:01:28 +0000
@@ -385,6 +385,9 @@ copyfileto $BASE/include config.h includ
rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h
+# In a NetWare binary package, these tools and their manuals are not useful
+rm -f $BASE/man/man1/make_win_*
+
copyfileto $BASE/support-files support-files/*
copyfileto $BASE/share scripts/*.sql
@@ -427,6 +430,7 @@ fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \
$BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \
+ $BASE/bin/make_win_* \
$BASE/bin/setsomevars $BASE/support-files/Makefile* \
$BASE/support-files/*.sh
=== modified file 'scripts/make_win_bin_dist'
--- a/scripts/make_win_bin_dist 2008-03-14 14:28:18 +0000
+++ b/scripts/make_win_bin_dist 2008-08-25 17:29:53 +0000
@@ -146,6 +146,10 @@ mkdir $DESTDIR/bin
cp client/$TARGET/*.exe $DESTDIR/bin/
cp extra/$TARGET/*.exe $DESTDIR/bin/
cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/
+# Maria engine is optional, so clients might not exist
+if ls storage/maria/$TARGET/*.exe > /dev/null 2>&1; then
+ cp storage/maria/$TARGET/*.exe $DESTDIR/bin/
+fi
if [ x"$TARGET" != x"release" ] ; then
cp client/$TARGET/mysql.pdb $DESTDIR/bin/
cp client/$TARGET/mysqladmin.pdb $DESTDIR/bin/
=== modified file 'sql/backup/backup_aux.h'
--- a/sql/backup/backup_aux.h 2008-07-31 10:45:02 +0000
+++ b/sql/backup/backup_aux.h 2008-08-21 19:28:49 +0000
@@ -47,6 +47,12 @@ storage_engine_ref get_se_by_name(const
namespace backup {
/**
+ Constants for appending uniqueness to privileges in backup catalog.
+*/
+#define UNIQUE_PRIV_KEY_LEN 9
+#define UNIQUE_PRIV_KEY_FORMAT "%08lu"
+
+/**
Local version of LEX_STRING structure.
Defines various constructors for convenience.
=== modified file 'sql/backup/backup_info.cc'
--- a/sql/backup/backup_info.cc 2008-08-05 08:04:30 +0000
+++ b/sql/backup/backup_info.cc 2008-08-20 13:23:10 +0000
@@ -309,7 +309,7 @@ Backup_info::Dep_node::get_key(const uch
Backup_info::Backup_info(Backup_restore_ctx &ctx)
:m_ctx(ctx), m_state(Backup_info::ERROR), native_snapshots(8),
m_dep_list(NULL), m_dep_end(NULL),
- m_srout_end(NULL), m_view_end(NULL), m_trigger_end(NULL)
+ m_srout_end(NULL), m_view_end(NULL), m_trigger_end(NULL), m_event_end(NULL)
{
using namespace backup;
@@ -786,6 +786,18 @@ int Backup_info::add_db_items(Db &db)
if (add_objects(db, BSTREAM_IT_TRIGGER, *it))
goto error;
+ delete it;
+ it= get_all_db_grants(m_ctx.m_thd, &db.name());
+
+ if (!it)
+ {
+ m_ctx.fatal_error(ER_BACKUP_LIST_DB_PRIV, db.name().ptr());
+ goto error;
+ }
+
+ if (add_objects(db, BSTREAM_IT_PRIVILEGE, *it))
+ goto error;
+
goto finish;
error:
@@ -1002,7 +1014,7 @@ Backup_info::add_db_object(Db &db, const
ulong pos= db.obj_count();
DBUG_ASSERT(obj);
- const ::String *name= obj->get_name();
+ String *name= (String *)obj->get_name();
DBUG_ASSERT(name);
switch (type) {
@@ -1016,12 +1028,29 @@ Backup_info::add_db_object(Db &db, const
case BSTREAM_IT_SFUNC: error= ER_BACKUP_CATALOG_ADD_SROUT; break;
case BSTREAM_IT_EVENT: error= ER_BACKUP_CATALOG_ADD_EVENT; break;
case BSTREAM_IT_TRIGGER: error= ER_BACKUP_CATALOG_ADD_TRIGGER; break;
+ case BSTREAM_IT_PRIVILEGE: error= ER_BACKUP_CATALOG_ADD_PRIV; break;
// Only known types of objects should be added to the catalogue.
default: DBUG_ASSERT(FALSE);
}
+ /*
+ Generate a unique name for the privilege (grant) objects.
+ Note: this name does not alter the mechanics of the
+ grant objects in si_objects.cc
+ */
+ if (type == BSTREAM_IT_PRIVILEGE)
+ {
+ String new_name;
+ char buff[10];
+ sprintf(buff, UNIQUE_PRIV_KEY_FORMAT, pos);
+ new_name.append(*name);
+ new_name.append(" ");
+ new_name.append(buff);
+ name->copy(new_name);
+ }
+
/*
Add new object to the dependency list. If it is a view, add its
dependencies first.
@@ -1068,9 +1097,8 @@ Backup_info::add_db_object(Db &db, const
objects.
*/
- // Add object to catalogue
Dbobj *o= Image_info::add_db_object(db, type, *name, pos);
-
+
if (!o)
{
m_ctx.fatal_error(error, db.name().ptr(), name->ptr());
@@ -1199,6 +1227,12 @@ int Backup_info::add_to_dep_list(const o
break;
case BSTREAM_IT_EVENT:
+ end= &m_event_end;
+ if (!m_event_end)
+ m_event_end= m_trigger_end ? m_trigger_end : m_view_end ? m_view_end : m_srout_end;
+ break;
+
+ case BSTREAM_IT_PRIVILEGE:
end= &m_dep_end;
break;
=== modified file 'sql/backup/backup_info.h'
--- a/sql/backup/backup_info.h 2008-05-17 15:54:19 +0000
+++ b/sql/backup/backup_info.h 2008-08-20 13:23:10 +0000
@@ -141,6 +141,12 @@ class Backup_info: public backup::Image_
*/
Dep_node *m_trigger_end;
+ /**
+ Points at the last event on the dependency list. NULL if events section
+ is empty.
+ */
+ Dep_node *m_event_end;
+
/**
Hash keeping all elements stored in the dependency list.
=== modified file 'sql/backup/backup_test.cc'
--- a/sql/backup/backup_test.cc 2008-07-19 03:03:39 +0000
+++ b/sql/backup/backup_test.cc 2008-08-20 13:23:10 +0000
@@ -44,14 +44,20 @@ int execute_backup_test_command(THD *thd
field_list.push_back(new Item_empty_string("serialization", 13));
protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
- obs::ObjIterator *it= obs::get_databases(thd);
-
- if (it)
+ //obs::ObjIterator *it= obs::get_databases(thd);
+ List_iterator<LEX_STRING> it(*db_list);
+
+ //if (it)
{
obs::Obj *db;
- while ((db= it->next()))
+ //while ((db= it->next()))
+ LEX_STRING *dbname;
+ while ((dbname= it++))
{
+ String dir;
+ dir.copy(dbname->str, dbname->length, system_charset_info);
+ db= get_database(&dir);
if (is_internal_db_name(db->get_db_name()))
continue;
@@ -223,18 +229,42 @@ int execute_backup_test_command(THD *thd
delete event;
}
-
- delete tit;
}
- // That's it.
+ //
+ // List db grants.
+ //
+ tit= obs::get_all_db_grants(thd, db->get_name());
- delete db;
- }
- }
+ if (tit)
+ {
+ obs::Obj *grant;
+
+ while ((grant= tit->next()))
+ {
+ String serial;
+ serial.length(0);
+ protocol->prepare_for_resend();
+ protocol->store(const_cast<String*>(db->get_name()));
+ protocol->store(const_cast<String*>(grant->get_name()));
+ String user;
+ String host;
+ String *user_host= (String *)grant->get_name();
+ user_exists(thd, user_host);
+ protocol->store(C_STRING_WITH_LEN("GRANT"),
+ system_charset_info);
+ grant->serialize(thd, &serial);
+ protocol->store(&serial);
+ protocol->write();
- delete it;
+ delete grant;
+ }
+ delete tit;
+ }
+ }
+ }
+ thd->main_da.reset_diagnostics_area();
my_eof(thd);
DBUG_RETURN(res);
}
=== modified file 'sql/backup/be_default.cc'
--- a/sql/backup/be_default.cc 2008-07-09 08:19:03 +0000
+++ b/sql/backup/be_default.cc 2008-08-18 08:25:56 +0000
@@ -381,6 +381,14 @@ result_t Backup::get_data(Buffer &buf)
read_set= cur_table->read_set;
start_tbl_read(cur_table);
+ // The first time the table is accessed after opening it,
+ // cur_table->in_use points to the locking thread. It has to point
+ // to the backup thread before the table can be read
+ if (cur_table->in_use != locking_thd->m_thd) {
+ DBUG_ASSERT(cur_table->in_use == locking_thd->lock_thd);
+ cur_table->in_use= locking_thd->m_thd;
+ }
+
buf.table_num= tbl_num;
mode= READ_RCD;
}
=== modified file 'sql/backup/image_info.cc'
--- a/sql/backup/image_info.cc 2008-07-31 10:45:02 +0000
+++ b/sql/backup/image_info.cc 2008-08-20 13:23:10 +0000
@@ -384,6 +384,7 @@ Image_info::Obj *find_obj(const Image_in
case BSTREAM_IT_SFUNC:
case BSTREAM_IT_EVENT:
case BSTREAM_IT_TRIGGER:
+ case BSTREAM_IT_PRIVILEGE:
{
const st_bstream_dbitem_info &it=
reinterpret_cast<const st_bstream_dbitem_info&>(item);
=== modified file 'sql/backup/image_info.h'
--- a/sql/backup/image_info.h 2008-08-11 16:06:30 +0000
+++ b/sql/backup/image_info.h 2008-08-20 13:23:10 +0000
@@ -1012,6 +1012,17 @@ obs::Obj* Image_info::Dbobj::materialize
case BSTREAM_IT_TRIGGER:
m_obj_ptr= obs::materialize_trigger(db_name, name, ver, &sdata);
break;
+ case BSTREAM_IT_PRIVILEGE:
+ {
+ /*
+ Here we undo the uniqueness suffix for grants.
+ */
+ String new_name;
+ new_name.copy(*name);
+ new_name.length(new_name.length() - UNIQUE_PRIV_KEY_LEN);
+ m_obj_ptr= obs::materialize_db_grant(db_name, &new_name, ver, &sdata);
+ break;
+ }
default: m_obj_ptr= NULL;
}
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc 2008-08-11 16:06:30 +0000
+++ b/sql/backup/kernel.cc 2008-08-21 11:36:09 +0000
@@ -905,6 +905,7 @@ int Backup_restore_ctx::do_backup()
report_stats_pre(info);
DBUG_PRINT("backup",("Writing preamble"));
+ DEBUG_SYNC(m_thd, "backup_before_write_preamble");
if (write_preamble(info, s))
{
@@ -1053,6 +1054,10 @@ int Backup_restore_ctx::do_restore()
if (read_meta_data(info, s))
{
+ // FIXME: detect errors.
+ // FIXME: error logging.
+ m_thd->main_da.reset_diagnostics_area();
+
fatal_error(ER_BACKUP_READ_META);
DBUG_RETURN(m_error);
}
@@ -1427,6 +1432,7 @@ int bcat_add_item(st_bstream_image_heade
case BSTREAM_IT_SFUNC:
case BSTREAM_IT_EVENT:
case BSTREAM_IT_TRIGGER:
+ case BSTREAM_IT_PRIVILEGE:
{
st_bstream_dbitem_info *it= (st_bstream_dbitem_info*)item;
@@ -1438,7 +1444,6 @@ int bcat_add_item(st_bstream_image_heade
Image_info::Dbobj *it1= info->add_db_object(*db, item->type, name_str,
item->pos);
-
if (!it1)
return BSTREAM_ERROR;
@@ -1689,6 +1694,7 @@ int bcat_create_item(st_bstream_image_he
case BSTREAM_IT_EVENT: create_err= ER_BACKUP_CANT_RESTORE_EVENT; break;
case BSTREAM_IT_TRIGGER: create_err= ER_BACKUP_CANT_RESTORE_TRIGGER; break;
case BSTREAM_IT_TABLESPACE: create_err= ER_BACKUP_CANT_RESTORE_TS; break;
+ case BSTREAM_IT_PRIVILEGE: create_err= ER_BACKUP_CANT_RESTORE_PRIV; break;
/*
TODO: Decide what to do when we come across unknown item:
@@ -1775,6 +1781,48 @@ int bcat_create_item(st_bstream_image_he
// Create the object.
+ /*
+ We need to check to see if the user exists (grantee) and if not,
+ do not execute the grant.
+ */
+ if (item->type == BSTREAM_IT_PRIVILEGE)
+ {
+ /*
+ Issue warning to the user that grant was skipped.
+
+ @todo Replace write_message() call with the result of the revised
+ error handling work in WL#4384 with possible implementation
+ via a related bug report.
+ */
+ if (!obs::user_exists(thd, sobj->get_name()))
+ {
+ info->m_ctx.write_message(log_level::WARNING,
+ ER(ER_BACKUP_GRANT_SKIPPED),
+ create_stmt);
+ return BSTREAM_OK;
+ }
+ /*
+ We need to check the grant against the database list to ensure the
+ grants have not been altered to apply to another database.
+ */
+ ::String db_name; // db name extracted from grant statement
+ char *start;
+ char *end;
+ int size= 0;
+
+ start= strstr((char *)create_stmt.begin, "ON ") + 3;
+ end= strstr(start, ".");
+ size= end - start;
+ db_name.alloc(size);
+ db_name.length(0);
+ db_name.append(start, size);
+ if (!info->has_db(db_name))
+ {
+ info->m_ctx.fatal_error(ER_BACKUP_GRANT_WRONG_DB, create_stmt);
+ return BSTREAM_ERROR;
+ }
+ }
+
if (sobj->execute(thd))
{
info->m_ctx.fatal_error(create_err, desc);
@@ -1820,6 +1868,7 @@ int bcat_get_item_create_query(st_bstrea
case BSTREAM_IT_EVENT: meta_err= ER_BACKUP_GET_META_EVENT; break;
case BSTREAM_IT_TRIGGER: meta_err= ER_BACKUP_GET_META_TRIGGER; break;
case BSTREAM_IT_TABLESPACE: meta_err= ER_BACKUP_GET_META_TS; break;
+ case BSTREAM_IT_PRIVILEGE: meta_err= ER_BACKUP_GET_META_PRIV; break;
/*
This can't happen - the item was obtained from the backup kernel.
=== modified file 'sql/ddl_blocker.cc'
--- a/sql/ddl_blocker.cc 2008-06-25 13:39:04 +0000
+++ b/sql/ddl_blocker.cc 2008-08-19 15:35:29 +0000
@@ -101,29 +101,49 @@ void DDL_blocker_class::end_DDL()
/**
check_DDL_blocker
- Check to see if we are blocked from continuing. If so,
- wait until the blocked process signals the condition.
+ Check to see if we are blocked from continuing. If so, wait until block is
+ removed or the timeout specified by backup_wait_timeout variable occurs.
+
+ @param[in] thd The THD object from the caller.
- @param thd The THD object from the caller.
- @returns TRUE
+ @note: This operation blocks DDL operations until end_ddl() is called.
+
+ @returns TRUE if not blocked
+ @returns FALSE if ddl is blocked and timeout occurs
*/
my_bool DDL_blocker_class::check_DDL_blocker(THD *thd)
{
+ int ret = 0;
+ struct timespec ddl_timeout;
DBUG_ENTER("check_DDL_blocker()");
DEBUG_SYNC(thd, "before_check_ddl_blocked");
+ set_timespec(ddl_timeout, thd->backup_wait_timeout);
+
/*
Check the ddl blocker condition. Rest until ddl blocker is released.
*/
pthread_mutex_lock(&THR_LOCK_DDL_is_blocked);
thd->enter_cond(&COND_DDL_blocker, &THR_LOCK_DDL_is_blocked,
"DDL blocker: DDL is blocked");
- while (DDL_blocked && !thd->DDL_exception)
- pthread_cond_wait(&COND_DDL_blocker, &THR_LOCK_DDL_is_blocked);
- start_DDL();
- thd->exit_cond("DDL blocker: Ok to run DDL");
- DEBUG_SYNC(thd, "after_start_ddl");
- DBUG_RETURN(TRUE);
+ while (DDL_blocked && !thd->DDL_exception && (ret == 0))
+ {
+ if (thd->backup_wait_timeout == 0)
+ ret = -1;
+ else
+ ret= pthread_cond_timedwait(&COND_DDL_blocker, &THR_LOCK_DDL_is_blocked,
+ &ddl_timeout);
+ }
+ thd->exit_cond("DDL blocker: DDL is not blocked");
+ if (ret == 0)
+ {
+ start_DDL();
+ DEBUG_SYNC(thd, "after_start_ddl");
+ }
+ else
+ my_error(ER_DDL_TIMEOUT, MYF(0), thd->query);
+
+ DBUG_RETURN(ret == 0);
}
/**
=== modified file 'sql/discover.cc'
--- a/sql/discover.cc 2008-04-09 00:56:49 +0000
+++ b/sql/discover.cc 2008-07-14 14:24:32 +0000
@@ -67,7 +67,7 @@ int readfrm(const char *name, uchar **fr
error= 2;
if (my_fstat(file, &state, MYF(0)))
goto err;
- read_len= state.st_size;
+ read_len= (size_t)state.st_size;
// Read whole frm file
error= 3;
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2008-07-14 12:49:19 +0000
+++ b/sql/ha_ndbcluster.cc 2008-07-31 18:41:00 +0000
@@ -83,6 +83,11 @@ static bool ndbcluster_show_status(handl
static int ndbcluster_alter_tablespace(handlerton *hton,
THD* thd,
st_alter_tablespace *info);
+static int ndbcluster_fill_is_table(handlerton *hton,
+ THD *thd,
+ TABLE_LIST *tables,
+ COND *cond,
+ enum enum_schema_tables);
static int ndbcluster_fill_files_table(handlerton *hton,
THD *thd,
TABLE_LIST *tables,
@@ -7924,7 +7929,7 @@ static int ndbcluster_init(void *p)
h->partition_flags= ndbcluster_partition_flags; /* Partition flags */
h->alter_partition_flags=
ndbcluster_alter_partition_flags; /* Alter table flags */
- h->fill_files_table= ndbcluster_fill_files_table;
+ h->fill_is_table= ndbcluster_fill_is_table;
#ifdef HAVE_NDB_BINLOG
ndbcluster_binlog_init_handlerton();
#endif
@@ -11497,6 +11502,33 @@ bool ha_ndbcluster::get_no_parts(const c
DBUG_RETURN(TRUE);
}
+/**
+ Used to fill in INFORMATION_SCHEMA* tables.
+
+ @param hton handle to the handlerton structure
+ @param thd the thread/connection descriptor
+ @param[in,out] tables the information schema table that is filled up
+ @param cond used for conditional pushdown to storage engine
+ @param schema_table_idx the table id that distinguishes the type of table
+
+ @return Operation status
+ */
+static int ndbcluster_fill_is_table(handlerton *hton,
+ THD *thd,
+ TABLE_LIST *tables,
+ COND *cond,
+ enum enum_schema_tables schema_table_idx)
+{
+ int ret= 0;
+
+ if (schema_table_idx == SCH_FILES)
+ {
+ ret= ndbcluster_fill_files_table(hton, thd, tables, cond);
+ }
+
+ return ret;
+}
+
static int ndbcluster_fill_files_table(handlerton *hton,
THD *thd,
TABLE_LIST *tables,
=== modified file 'sql/handler.h'
--- a/sql/handler.h 2008-08-26 19:16:28 +0000
+++ b/sql/handler.h 2008-09-08 11:31:03 +0000
@@ -188,6 +188,30 @@ typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_AL
#define HA_HAS_NEW_CHECKSUM (LL(1) << 39)
/*
+ When a multiple key conflict happens in a REPLACE command mysql
+ expects the conflicts to be reported in the ascending order of
+ key names.
+
+ For e.g.
+
+ CREATE TABLE t1 (a INT, UNIQUE (a), b INT NOT NULL, UNIQUE (b), c INT NOT
+ NULL, INDEX(c));
+
+ REPLACE INTO t1 VALUES (1,1,1),(2,2,2),(2,1,3);
+
+ MySQL expects the conflict with 'a' to be reported before the conflict with
+ 'b'.
+
+ If the underlying storage engine does not report the conflicting keys in
+ ascending order, it causes unexpected errors when the REPLACE command is
+ executed.
+
+ This flag helps the underlying SE to inform the server that the keys are not
+ ordered.
+ */
+#define HA_DUPLICATE_KEY_NOT_IN_ORDER (LL(1) << 40)
+
+/*
Set of all binlog flags. Currently only contain the capabilities
flags.
*/
@@ -549,6 +573,49 @@ class st_alter_tablespace : public Sql_a
/* The handler for a table type. Will be included in the TABLE structure */
struct st_table;
+
+/*
+ Make sure that the order of schema_tables and enum_schema_tables are the same.
+*/
+enum enum_schema_tables
+{
+ SCH_CHARSETS= 0,
+ SCH_COLLATIONS,
+ SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
+ SCH_COLUMNS,
+ SCH_COLUMN_PRIVILEGES,
+ SCH_ENGINES,
+ SCH_EVENTS,
+ SCH_FILES,
+ SCH_GLOBAL_STATUS,
+ SCH_GLOBAL_VARIABLES,
+ SCH_KEY_COLUMN_USAGE,
+ SCH_OPEN_TABLES,
+ SCH_PARAMETERS,
+ SCH_PARTITIONS,
+ SCH_PLUGINS,
+ SCH_PROCESSLIST,
+ SCH_PROFILES,
+ SCH_REFERENTIAL_CONSTRAINTS,
+ SCH_PROCEDURES,
+ SCH_SCHEMATA,
+ SCH_SCHEMA_PRIVILEGES,
+ SCH_SESSION_STATUS,
+ SCH_SESSION_VARIABLES,
+ SCH_STATISTICS,
+ SCH_STATUS,
+ SCH_TABLES,
+ SCH_TABLE_CONSTRAINTS,
+ SCH_TABLE_NAMES,
+ SCH_TABLE_PRIVILEGES,
+ SCH_TRIGGERS,
+ SCH_USER_PRIVILEGES,
+ SCH_VARIABLES,
+ SCH_VIEWS,
+ SCH_FALCON_TABLESPACES,
+ SCH_FALCON_TABLESPACE_FILES
+};
+
typedef struct st_table TABLE;
typedef struct st_table_share TABLE_SHARE;
struct st_foreign_key_info;
@@ -713,9 +780,9 @@ struct handlerton
uint (*partition_flags)();
uint (*alter_partition_flags)();
int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
- int (*fill_files_table)(handlerton *hton, THD *thd,
- TABLE_LIST *tables,
- class Item *cond);
+ int (*fill_is_table)(handlerton *hton, THD *thd, TABLE_LIST *tables,
+ class Item *cond,
+ enum enum_schema_tables);
uint32 flags; /* global handler flags */
/*
Those handlerton functions below are properly initialized at handler
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2008-09-05 13:39:08 +0000
+++ b/sql/log.cc 2008-09-11 08:01:28 +0000
@@ -34,7 +34,7 @@
#include <stdarg.h>
#include <m_ctype.h> // For test_if_number
-#ifdef __NT__
+#ifdef _WIN32
#include "message.h"
#endif
@@ -1753,7 +1753,7 @@ err:
DBUG_RETURN(-1);
}
-#ifdef __NT__
+#ifdef _WIN32
static int eventSource = 0;
static void setup_windows_event_source()
@@ -1788,8 +1788,7 @@ static void setup_windows_event_source()
RegCloseKey(hRegKey);
}
-#endif /* __NT__ */
-
+#endif /* _WIN32 */
/**
Find a unique filename for 'filename.#'.
@@ -1919,7 +1918,7 @@ bool MYSQL_LOG::open(const char *log_nam
#ifdef EMBEDDED_LIBRARY
"embedded library\n",
my_progname, server_version, MYSQL_COMPILATION_COMMENT
-#elif __NT__
+#elif _WIN32
"started with:\nTCP Port: %d, Named Pipe: %s\n",
my_progname, server_version, MYSQL_COMPILATION_COMMENT,
mysqld_port, mysqld_unix_port
@@ -4732,7 +4731,7 @@ void MYSQL_BIN_LOG::signal_update()
DBUG_VOID_RETURN;
}
-#ifdef __NT__
+#ifdef _WIN32
static void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
size_t length, size_t buffLen)
{
@@ -4765,7 +4764,7 @@ static void print_buffer_to_nt_eventlog(
DBUG_VOID_RETURN;
}
-#endif /* __NT__ */
+#endif /* _WIN32 */
/**
@@ -4823,13 +4822,13 @@ int vprint_msg_to_log(enum loglevel leve
char buff[1024];
DBUG_ENTER("vprint_msg_to_log");
-#ifdef __NT__
+#ifdef _WIN32
size_t length=
#endif
my_vsnprintf(buff, sizeof(buff), format, args);
print_buffer_to_file(level, buff);
-#ifdef __NT__
+#ifdef _WIN32
print_buffer_to_nt_eventlog(level, buff, length, sizeof(buff));
#endif
=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h 2008-08-27 16:48:24 +0000
+++ b/sql/mysql_priv.h 2008-09-04 13:46:04 +0000
@@ -638,6 +638,8 @@ extern void debug_sync(THD *thd, const c
#define DEBUG_SYNC(_thd_, _sync_point_name_) /* disabled DEBUG_SYNC */
#endif /* defined(ENABLED_DEBUG_SYNC) */
+#define BACKUP_WAIT_TIMEOUT_DEFAULT 50;
+
/* BINLOG_DUMP options */
#define BINLOG_DUMP_NON_BLOCK 1
=== modified file 'sql/mysql_priv.h.pp'
--- a/sql/mysql_priv.h.pp 2008-06-17 12:27:04 +0000
+++ b/sql/mysql_priv.h.pp 2008-07-11 13:08:06 +0000
@@ -25,6 +25,7 @@ extern int _db_keyword_(struct _db_code_
extern int _db_strict_keyword_(const char *keyword);
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
extern int _db_explain_init_(char *buf, size_t len);
+extern int _db_is_pushed_(void);
extern void _db_setjmp_(void);
extern void _db_longjmp_(void);
extern void _db_process_(const char *name);
@@ -194,7 +195,8 @@ typedef struct my_collation_handler_st
const uchar *, size_t, const uchar *, size_t,
my_bool diff_if_only_endspace_difference);
size_t (*strnxfrm)(struct charset_info_st *,
- uchar *, size_t, const uchar *, size_t);
+ uchar *dst, size_t dstlen, uint nweights,
+ const uchar *src, size_t srclen, uint flags);
size_t (*strnxfrmlen)(struct charset_info_st *, size_t);
my_bool (*like_range)(struct charset_info_st *,
const char *s, size_t s_length,
@@ -305,6 +307,8 @@ typedef struct charset_info_st
uint16 max_sort_char;
uchar pad_char;
my_bool escape_with_backslash_is_dangerous;
+ uchar levels_for_compare;
+ uchar levels_for_order;
MY_CHARSET_HANDLER *cset;
MY_COLLATION_HANDLER *coll;
} CHARSET_INFO;
@@ -313,10 +317,12 @@ extern CHARSET_INFO my_charset_big5_chin
extern CHARSET_INFO my_charset_big5_bin;
extern CHARSET_INFO my_charset_cp932_japanese_ci;
extern CHARSET_INFO my_charset_cp932_bin;
+extern CHARSET_INFO my_charset_cp1250_czech_ci;
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
extern CHARSET_INFO my_charset_eucjpms_bin;
extern CHARSET_INFO my_charset_euckr_korean_ci;
extern CHARSET_INFO my_charset_euckr_bin;
+extern CHARSET_INFO my_charset_filename;
extern CHARSET_INFO my_charset_gb2312_chinese_ci;
extern CHARSET_INFO my_charset_gb2312_bin;
extern CHARSET_INFO my_charset_gbk_chinese_ci;
@@ -334,13 +340,21 @@ extern CHARSET_INFO my_charset_ucs2_bin;
extern CHARSET_INFO my_charset_ucs2_unicode_ci;
extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin;
-extern CHARSET_INFO my_charset_utf8_general_ci;
-extern CHARSET_INFO my_charset_utf8_unicode_ci;
-extern CHARSET_INFO my_charset_utf8_bin;
-extern CHARSET_INFO my_charset_cp1250_czech_ci;
-extern CHARSET_INFO my_charset_filename;
-extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
- const uchar *, size_t);
+extern CHARSET_INFO my_charset_utf16_bin;
+extern CHARSET_INFO my_charset_utf16_general_ci;
+extern CHARSET_INFO my_charset_utf16_unicode_ci;
+extern CHARSET_INFO my_charset_utf32_bin;
+extern CHARSET_INFO my_charset_utf32_general_ci;
+extern CHARSET_INFO my_charset_utf32_unicode_ci;
+extern CHARSET_INFO my_charset_utf8mb3_bin;
+extern CHARSET_INFO my_charset_utf8mb3_general_ci;
+extern CHARSET_INFO my_charset_utf8mb3_unicode_ci;
+extern CHARSET_INFO my_charset_utf8mb4_bin;
+extern CHARSET_INFO my_charset_utf8mb4_general_ci;
+extern CHARSET_INFO my_charset_utf8mb4_unicode_ci;
+extern size_t my_strnxfrm_simple(CHARSET_INFO *,
+ uchar *dst, size_t dstlen, uint nweights,
+ const uchar *src, size_t srclen, uint flags);
size_t my_strnxfrmlen_simple(CHARSET_INFO *, size_t);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, size_t,
const uchar *, size_t, my_bool);
@@ -413,6 +427,18 @@ my_bool my_like_range_ucs2(CHARSET_INFO
size_t res_length,
char *min_str, char *max_str,
size_t *min_length, size_t *max_length);
+my_bool my_like_range_utf16(CHARSET_INFO *cs,
+ const char *ptr, size_t ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ size_t res_length,
+ char *min_str, char *max_str,
+ size_t *min_length, size_t *max_length);
+my_bool my_like_range_utf32(CHARSET_INFO *cs,
+ const char *ptr, size_t ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ size_t res_length,
+ char *min_str, char *max_str,
+ size_t *min_length, size_t *max_length);
int my_wildcmp_8bit(CHARSET_INFO *,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
@@ -447,6 +473,25 @@ uint my_instr_mb(struct charset_info_st
const char *b, size_t b_length,
const char *s, size_t s_length,
my_match_t *match, uint nmatch);
+int my_strnncoll_mb_bin(CHARSET_INFO * cs,
+ const uchar *s, size_t slen,
+ const uchar *t, size_t tlen,
+ my_bool t_is_prefix);
+int my_strnncollsp_mb_bin(CHARSET_INFO *cs,
+ const uchar *a, size_t a_length,
+ const uchar *b, size_t b_length,
+ my_bool diff_if_only_endspace_difference);
+int my_wildcmp_mb_bin(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many);
+int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
+ const char *s, const char *t);
+void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *key, size_t len,ulong *nr1, ulong *nr2);
+size_t my_strnxfrm_mb(CHARSET_INFO *,
+ uchar *dst, size_t dstlen, uint nweights,
+ const uchar *src, size_t srclen, uint flags);
int my_wildcmp_unicode(CHARSET_INFO *cs,
const char *str, const char *str_end,
const char *wildstr, const char *wildend,
@@ -461,6 +506,13 @@ my_bool my_propagate_complex(CHARSET_INF
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
+uint my_strxfrm_flag_normalize(uint flags, uint nlevels);
+void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
+ uint flags, uint level);
+size_t my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs,
+ uchar *str, uchar *frmend, uchar *strend,
+ uint nweights, uint flags, uint level);
+my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs);
#include <stdarg.h>
#include <typelib.h>
#include "my_alloc.h"
@@ -510,9 +562,9 @@ extern char errbuff[(2)][(256)];
extern char *home_dir;
extern const char *my_progname;
extern char curr_dir[];
-extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
-extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
- myf MyFlags);
+extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
+extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
+ myf MyFlags);
extern uint my_file_limit;
extern ulong my_thread_stack_size;
extern my_bool my_use_large_pages;
@@ -728,14 +780,13 @@ extern int my_chsize(File fd,my_off_t ne
extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
-extern int my_error (int nr,myf MyFlags, ...);
-extern int my_printf_error (uint my_err, const char *format, myf MyFlags, ...)
- __attribute__((format(printf, 2, 4)));
+extern void my_error (int nr,myf MyFlags, ...);
+extern void my_printf_error (uint my_err, const char *format, myf MyFlags, ...)
+ __attribute__((format(printf, 2, 4)));
extern int my_error_register(const char **errmsgs, int first, int last);
extern const char **my_error_unregister(int first, int last);
-extern int my_message(uint my_err, const char *str,myf MyFlags);
-extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
-extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
+extern void my_message(uint my_err, const char *str,myf MyFlags);
+extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern my_bool my_init(void);
extern void my_end(int infoflag);
extern int my_redel(const char *from, const char *to, int MyFlags);
@@ -1010,7 +1061,6 @@ extern void (*my_str_free)(void *);
extern char *stpcpy(char *, const char *);
extern char _dig_vec_upper[];
extern char _dig_vec_lower[];
-extern const double log_10[309];
extern void bmove512(uchar *dst,const uchar *src,size_t len);
extern void bmove_upp(uchar *dst,const uchar *src,size_t len);
extern void bchange(uchar *dst,size_t old_len,const uchar *src,
@@ -1035,8 +1085,15 @@ extern char *strxncat (char *dst,size_t
extern char *strxnmov (char *dst,size_t len, const char *src, ...);
extern char *strxncpy (char *dst,size_t len, const char *src, ...);
extern int is_prefix(const char *, const char *);
+typedef enum {
+ MY_GCVT_ARG_FLOAT,
+ MY_GCVT_ARG_DOUBLE
+} my_gcvt_arg_type;
double my_strtod(const char *str, char **end, int *error);
double my_atof(const char *nptr);
+size_t my_fcvt(double x, int precision, char *to, my_bool *error);
+size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
+ my_bool *error);
extern char *llstr(longlong value,char *buff);
extern char *ullstr(longlong value,char *buff);
extern char *int2str(long val, char *dst, int radix, int upcase);
@@ -1044,7 +1101,7 @@ extern char *int10_to_str(long val,char
extern char *str2int(const char *src,int radix,long lower,long upper,
long *val);
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
-extern char *longlong2str(longlong val,char *dst,int radix);
+extern char *ll2str(longlong val,char *dst,int radix, int upcase);
extern char *longlong10_to_str(longlong val,char *dst,int radix);
extern size_t my_vsnprintf(char *str, size_t n,
const char *format, va_list ap);
@@ -1056,6 +1113,29 @@ struct st_mysql_lex_string
size_t length;
};
typedef struct st_mysql_lex_string LEX_STRING;
+static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
+{
+ const uchar *end= ptr + len;
+ if (len > 20)
+ {
+ const uchar *end_words= (const uchar *)(intptr)
+ (((ulonglong)(intptr)end) / 4 * 4);
+ const uchar *start_words= (const uchar *)(intptr)
+ ((((ulonglong)(intptr)ptr) + 4 - 1) / 4 * 4);
+ assert(((ulonglong)(intptr)ptr) >= 4);
+ if (end_words > ptr)
+ {
+ while (end > end_words && end[-1] == 0x20)
+ end--;
+ if (end[-1] == 0x20 && start_words < end_words)
+ while (end > start_words && ((unsigned *)end)[-1] == 0x20202020)
+ end -= 4;
+ }
+ }
+ while (end > ptr && end[-1] == 0x20)
+ end--;
+ return (end);
+}
#include <hash.h>
typedef uchar *(*hash_get_key)(const uchar *,size_t*,my_bool);
typedef void (*hash_free_key)(void *);
@@ -1228,6 +1308,11 @@ enum ha_key_alg {
HA_KEY_ALG_HASH= 3,
HA_KEY_ALG_FULLTEXT= 4
};
+enum ha_build_method {
+ HA_BUILD_DEFAULT,
+ HA_BUILD_ONLINE,
+ HA_BUILD_OFFLINE
+};
enum ha_storage_media {
HA_SM_DEFAULT= 0,
HA_SM_DISK= 1,
@@ -1469,12 +1554,69 @@ public:
void subtract(Bitmap& map2) { bitmap_subtract(&map, &map2.map); }
void merge(Bitmap& map2) { bitmap_union(&map, &map2.map); }
my_bool is_set(uint n) const { return bitmap_is_set(&map, n); }
+ my_bool is_set() const { return !bitmap_is_clear_all(&map); }
my_bool is_prefix(uint n) const { return bitmap_is_prefix(&map, n); }
my_bool is_clear_all() const { return bitmap_is_clear_all(&map); }
my_bool is_set_all() const { return bitmap_is_set_all(&map); }
my_bool is_subset(const Bitmap& map2) const { return bitmap_is_subset(&map, &map2.map); }
my_bool is_overlapping(const Bitmap& map2) const { return bitmap_is_overlapping(&map, &map2.map); }
my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); }
+ my_bool operator!=(const Bitmap& map2) const { return !bitmap_cmp(&map, &map2.map); }
+ Bitmap operator&=(uint n)
+ {
+ if (bitmap_is_set(&map, n))
+ {
+ { memset((&map)->bitmap, 0, 4*((((&map))->n_bits + 31)/32)); };
+ bitmap_set_bit(&map, n);
+ }
+ else
+ { memset((&map)->bitmap, 0, 4*((((&map))->n_bits + 31)/32)); };
+ return *this;
+ }
+ Bitmap operator&=(const Bitmap& map2)
+ {
+ bitmap_intersect(&map, &map2.map);
+ return *this;
+ }
+ Bitmap operator&(uint n)
+ {
+ Bitmap bm(*this);
+ bm&= n;
+ return bm;
+ }
+ Bitmap operator&(const Bitmap& map2)
+ {
+ Bitmap bm(*this);
+ bm&= map2;
+ return bm;
+ }
+ Bitmap operator|=(uint n)
+ {
+ bitmap_set_bit(&map, n);
+ return *this;
+ }
+ Bitmap operator|=(const Bitmap& map2)
+ {
+ bitmap_union(&map, &map2.map);
+ }
+ Bitmap operator|(uint n)
+ {
+ Bitmap bm(*this);
+ bm|= n;
+ return bm;
+ }
+ Bitmap operator|(const Bitmap& map2)
+ {
+ Bitmap bm(*this);
+ bm|= map2;
+ return bm;
+ }
+ Bitmap operator~()
+ {
+ Bitmap bm(*this);
+ bitmap_invert(&bm.map);
+ return bm;
+ }
char *print(char *buf) const
{
char *s=buf;
@@ -1504,7 +1646,7 @@ template <> class Bitmap<64>
{
ulonglong map;
public:
- Bitmap<64>() { }
+ Bitmap<64>() { map= 0; }
explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); }
void init() { }
void init(uint prefix_to_set) { set_prefix(prefix_to_set); }
@@ -1532,9 +1674,34 @@ public:
my_bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); }
my_bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; }
my_bool operator==(const Bitmap<64>& map2) const { return map == map2.map; }
- char *print(char *buf) const { longlong2str(map,buf,16); return buf; }
+ char *print(char *buf) const { ll2str((map),(buf),(16),1); return buf; }
ulonglong to_ulonglong() const { return map; }
};
+class Table_map_iterator
+{
+ ulonglong bmp;
+ uint no;
+public:
+ Table_map_iterator(ulonglong t) : bmp(t), no(0) {}
+ int next_bit()
+ {
+ static const char last_bit[16]= {32, 0, 1, 0,
+ 2, 0, 1, 0,
+ 3, 0, 1, 0,
+ 2, 0, 1, 0};
+ uint bit;
+ while ((bit= last_bit[bmp & 0xF]) == 32)
+ {
+ no += 4;
+ bmp= bmp >> 4;
+ if (!bmp)
+ return BITMAP_END;
+ }
+ bmp &= ~(1LL << bit);
+ return no + bit;
+ }
+ enum { BITMAP_END= 64 };
+};
#include "sql_array.h"
#include <my_sys.h>
template <class Elem> class Dynamic_array
@@ -1543,6 +1710,10 @@ template <class Elem> class Dynamic_arra
public:
Dynamic_array(uint prealloc=16, uint increment=16)
{
+ init(prealloc, increment);
+ }
+ void init(uint prealloc=16, uint increment=16)
+ {
init_dynamic_array2(&array,sizeof(Elem),NULL,prealloc,increment );
}
Elem& at(int idx)
@@ -1565,6 +1736,10 @@ public:
{
return array.elements;
}
+ void clear()
+ {
+ array.elements= 0;
+ }
~Dynamic_array()
{
delete_dynamic(&array);
@@ -1575,6 +1750,60 @@ public:
my_qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func);
}
};
+template <class Elem> class Array
+{
+ enum {alloc_increment = 16};
+ Elem **buffer;
+ uint n_elements, max_element;
+public:
+ Array(MEM_ROOT *mem_root, uint prealloc=16)
+ {
+ buffer= (Elem**)alloc_root(mem_root, prealloc * sizeof(Elem**));
+ max_element = buffer? prealloc : 0;
+ n_elements= 0;
+ }
+ Elem& at(int idx)
+ {
+ return *(((Elem*)buffer) + idx);
+ }
+ Elem **front()
+ {
+ return buffer;
+ }
+ Elem **back()
+ {
+ return buffer + n_elements;
+ }
+ In_C_you_should_use_my_bool_instead() append(MEM_ROOT *mem_root, Elem *el)
+ {
+ if (n_elements == max_element)
+ {
+ Elem **newbuf;
+ if (!(newbuf= (Elem**)alloc_root(mem_root, (n_elements + alloc_increment)*
+ sizeof(Elem**))))
+ {
+ return (0);
+ }
+ memcpy(newbuf, buffer, n_elements*sizeof(Elem*));
+ buffer= newbuf;
+ }
+ buffer[n_elements++]= el;
+ return (0);
+ }
+ int elements()
+ {
+ return n_elements;
+ }
+ void clear()
+ {
+ n_elements= 0;
+ }
+ typedef int (*CMP_FUNC)(Elem * const *el1, Elem *const *el2);
+ void sort(CMP_FUNC cmp_func)
+ {
+ my_qsort(buffer, n_elements, sizeof(Elem*), (qsort_cmp)cmp_func);
+ }
+};
#include "sql_plugin.h"
class sys_var;
#include <mysql/plugin.h>
@@ -1621,6 +1850,7 @@ struct st_mysql_plugin
struct st_mysql_sys_var **system_vars;
void * __reserved1;
};
+#include "plugin_ftparser.h"
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,
@@ -1667,19 +1897,19 @@ struct st_mysql_ftparser
int (*init)(MYSQL_FTPARSER_PARAM *param);
int (*deinit)(MYSQL_FTPARSER_PARAM *param);
};
-struct st_mysql_storage_engine
+struct st_mysql_daemon
{
int interface_version;
};
-struct handlerton;
-struct st_mysql_daemon
+struct st_mysql_information_schema
{
int interface_version;
};
-struct st_mysql_information_schema
+struct st_mysql_storage_engine
{
int interface_version;
};
+struct handlerton;
struct st_mysql_value
{
int (*value_type)(struct st_mysql_value *);
@@ -1781,12 +2011,10 @@ enum scheduler_types
};
void one_thread_per_connection_scheduler(scheduler_functions* func);
void one_thread_scheduler(scheduler_functions* func);
-enum pool_command_op
-{
- NOT_IN_USE_OP= 0, NORMAL_OP= 1, CONNECT_OP, KILL_OP, DIE_OP
-};
class thd_scheduler
{};
+#include "probes.h"
+#include <netdb.h>
enum enum_query_type
{
QT_ORDINARY,
@@ -1828,15 +2056,15 @@ typedef struct st_net {
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
- my_bool unused0;
- my_bool unused;
- my_bool compress;
my_bool unused1;
- unsigned char *query_cache_query;
+ my_bool unused2;
+ my_bool compress;
+ my_bool unused3;
+ unsigned char *unused;
unsigned int last_errno;
unsigned char error;
- my_bool unused2;
- my_bool return_errno;
+ my_bool unused4;
+ my_bool unused5;
char last_error[512];
char sqlstate[5 +1];
void *extension;
@@ -1964,7 +2192,6 @@ uchar *net_store_length(uchar *pkg, ulon
#include <netinet/ip.h>
#include <netinet/tcp.h>
void my_inet_ntoa(struct in_addr in, char *buf);
-struct hostent;
struct hostent *my_gethostbyname_r(const char *name,
struct hostent *result, char *buffer,
int buflen, int *h_errnop);
@@ -1991,9 +2218,10 @@ const char* vio_description(Vio *vio);
enum enum_vio_type vio_type(Vio* vio);
int vio_errno(Vio*vio);
my_socket vio_fd(Vio*vio);
-my_bool vio_peer_addr(Vio* vio, char *buf, uint16 *port);
-void vio_in_addr(Vio *vio, struct in_addr *in);
+my_bool vio_peer_addr(Vio *vio, char *buf, uint16 *port, size_t buflen);
my_bool vio_poll_read(Vio *vio,uint timeout);
+my_bool vio_peek_read(Vio *vio, uint *bytes);
+ssize_t vio_pending(Vio *vio);
void vio_end(void);
enum SSL_type
{
@@ -2009,8 +2237,9 @@ struct st_vio
void * hPipe;
my_bool localhost;
int fcntl_mode;
- struct sockaddr_in local;
- struct sockaddr_in remote;
+ struct sockaddr_storage local;
+ struct sockaddr_storage remote;
+ int addrLen;
enum enum_vio_type type;
char desc[30];
char *read_buffer;
@@ -2024,8 +2253,8 @@ struct st_vio
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
int (*fastsend)(Vio*);
- my_bool (*peer_addr)(Vio*, char *, uint16*);
- void (*in_addr)(Vio*, struct in_addr*);
+ my_bool (*peer_addr)(Vio*, char *, uint16*, size_t);
+ void (*in_addr)(Vio*, struct sockaddr_storage*);
my_bool (*should_retry)(Vio*);
my_bool (*was_interrupted)(Vio*);
int (*vioclose)(Vio*);
@@ -2094,6 +2323,7 @@ typedef struct st_key {
int bdb_return_if_eq;
} handler;
struct st_table *table;
+ LEX_STRING comment;
} KEY;
struct st_join_table;
typedef struct st_reginfo {
@@ -2106,6 +2336,7 @@ struct st_read_record;
class SQL_SELECT;
class THD;
class handler;
+struct st_join_table;
typedef struct st_read_record {
struct st_table *table;
handler *file;
@@ -2122,6 +2353,7 @@ typedef struct st_read_record {
uchar *cache,*cache_pos,*cache_end,*read_positions;
IO_CACHE *io_cache;
In_C_you_should_use_my_bool_instead() print_error, ignore_not_found_rows;
+ struct st_join_table *do_insideout_scan;
} READ_RECORD;
typedef enum enum_mysql_timestamp_type timestamp_type;
typedef struct {
@@ -2327,6 +2559,12 @@ protected:
CHARSET_INFO *m_client_cs;
CHARSET_INFO *m_connection_cl;
};
+enum open_table_mode
+{
+ OTM_OPEN= 0,
+ OTM_CREATE= 1,
+ OTM_ALTER= 2
+};
struct TABLE_LIST;
class String;
void view_store_options(THD *thd, TABLE_LIST *table, String *buff);
@@ -2709,6 +2947,16 @@ static inline In_C_you_should_use_my_boo
{
return str+ cs->cset->scan(cs, str, end, 2) == end;
}
+inline
+In_C_you_should_use_my_bool_instead() operator==(const String &s1, const String &s2)
+{
+ return stringcmp(&s1,&s2) == 0;
+}
+inline
+In_C_you_should_use_my_bool_instead() operator!=(const String &s1, const String &s2)
+{
+ return !(s1 == s2);
+}
#include "sql_list.h"
class Sql_alloc
{
@@ -3025,7 +3273,7 @@ struct ilink
struct ilink **prev,*next;
static void *operator new(size_t size)
{
- return (void*)my_malloc((uint)size, (myf) (16 | 8));
+ return (void*)my_malloc((uint)size, (myf) (16 | 8 | 1024));
}
static void operator delete(void* ptr_arg, size_t size)
{
@@ -3590,6 +3838,97 @@ extern void multi_key_cache_change(KEY_C
KEY_CACHE *new_data);
extern int reset_key_cache_counters(const char *name,
KEY_CACHE *key_cache);
+#include <backup/api_types.h>
+extern const String my_null_string;
+namespace backup {
+typedef unsigned char byte;
+enum result_t { OK=0, READY, PROCESSING, BUSY, DONE, ERROR };
+typedef uint version_t;
+class Db_ref
+{
+ const String *m_name;
+ public:
+ Db_ref(): m_name(NULL)
+ {}
+ const In_C_you_should_use_my_bool_instead() is_valid() const
+ { return m_name != NULL; }
+ const String& name() const
+ { return *m_name; }
+ const String& catalog() const
+ { return my_null_string; }
+ In_C_you_should_use_my_bool_instead() operator==(const Db_ref &db) const
+ { return stringcmp(m_name,&db.name())==0; }
+ In_C_you_should_use_my_bool_instead() operator!=(const Db_ref &db) const
+ { return ! this->operator==(db); }
+ protected:
+ Db_ref(const String &name): m_name(&name)
+ {}
+ friend class Table_ref;
+};
+class Table_ref
+{
+ const Db_ref m_db;
+ const String *m_name;
+ public:
+ Table_ref(): m_name(NULL)
+ {}
+ const In_C_you_should_use_my_bool_instead() is_valid() const
+ { return m_name != NULL; }
+ const Db_ref& db() const
+ { return m_db; }
+ const String& name() const
+ { return *m_name; }
+ In_C_you_should_use_my_bool_instead() operator==(const Table_ref &t) const
+ {
+ return m_db == t.db() &&
+ stringcmp(m_name,&t.name()) == 0;
+ }
+ In_C_you_should_use_my_bool_instead() operator!=(const Table_ref &db) const
+ { return ! this->operator==(db); }
+ typedef char describe_buf[512];
+ const char* describe(char *buf, size_t len) const
+ {
+ my_snprintf(buf,len,"%s.%s",db().name().ptr(),name().ptr());
+ return buf;
+ }
+ const char* describe(describe_buf &buf) const
+ { return describe(buf,sizeof(buf)); }
+ protected:
+ Table_ref(const String &db, const String &name):
+ m_db(db), m_name(&name)
+ {}
+};
+class Table_list
+{
+ public:
+ virtual ~Table_list() {}
+ virtual Table_ref operator[](uint pos) const =0;
+ virtual uint count() const =0;
+};
+struct Buffer
+{
+ size_t size;
+ uint table_no;
+ In_C_you_should_use_my_bool_instead() last;
+ byte *data;
+ Buffer(): size(0),table_no(0),last((0)), data(NULL)
+ {}
+ void reset(size_t len)
+ {
+ size= len;
+ table_no= 0;
+ last= (0);
+ }
+};
+class Engine;
+class Backup_driver;
+class Restore_driver;
+}
+typedef backup::result_t Backup_result_t;
+typedef backup::Engine Backup_engine;
+typedef Backup_result_t backup_factory(::handlerton *,Backup_engine*&);
+#include <sql_bitmap.h>
+typedef Bitmap<39> HA_ALTER_FLAGS;
enum legacy_db_type
{
DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
@@ -3615,6 +3954,10 @@ enum legacy_db_type
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
+enum column_format_type { COLUMN_FORMAT_TYPE_NOT_USED= -1,
+ COLUMN_FORMAT_TYPE_DEFAULT= 0,
+ COLUMN_FORMAT_TYPE_FIXED= 1,
+ COLUMN_FORMAT_TYPE_DYNAMIC= 2 };
enum enum_binlog_func {
BFN_RESET_LOGS= 1,
BFN_RESET_SLAVE= 2,
@@ -3766,6 +4109,44 @@ class st_alter_tablespace : public Sql_a
}
};
struct st_table;
+enum enum_schema_tables
+{
+ SCH_CHARSETS= 0,
+ SCH_COLLATIONS,
+ SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
+ SCH_COLUMNS,
+ SCH_COLUMN_PRIVILEGES,
+ SCH_ENGINES,
+ SCH_EVENTS,
+ SCH_FILES,
+ SCH_GLOBAL_STATUS,
+ SCH_GLOBAL_VARIABLES,
+ SCH_KEY_COLUMN_USAGE,
+ SCH_OPEN_TABLES,
+ SCH_PARAMETERS,
+ SCH_PARTITIONS,
+ SCH_PLUGINS,
+ SCH_PROCESSLIST,
+ SCH_PROFILES,
+ SCH_REFERENTIAL_CONSTRAINTS,
+ SCH_PROCEDURES,
+ SCH_SCHEMATA,
+ SCH_SCHEMA_PRIVILEGES,
+ SCH_SESSION_STATUS,
+ SCH_SESSION_VARIABLES,
+ SCH_STATISTICS,
+ SCH_STATUS,
+ SCH_TABLES,
+ SCH_TABLE_CONSTRAINTS,
+ SCH_TABLE_NAMES,
+ SCH_TABLE_PRIVILEGES,
+ SCH_TRIGGERS,
+ SCH_USER_PRIVILEGES,
+ SCH_VARIABLES,
+ SCH_VIEWS,
+ SCH_FALCON_TABLESPACES,
+ SCH_FALCON_TABLESPACE_FILES
+};
typedef struct st_table TABLE;
typedef struct st_table_share TABLE_SHARE;
struct st_foreign_key_info;
@@ -3827,11 +4208,14 @@ struct handlerton
In_C_you_should_use_my_bool_instead() (*flush_logs)(handlerton *hton);
In_C_you_should_use_my_bool_instead() (*show_status)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat);
uint (*partition_flags)();
- uint (*alter_table_flags)(uint flags);
+ uint (*alter_partition_flags)();
int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info);
int (*fill_files_table)(handlerton *hton, THD *thd,
TABLE_LIST *tables,
class Item *cond);
+ int (*fill_is_table)(handlerton *hton, THD *thd, TABLE_LIST *tables,
+ class Item *cond,
+ enum enum_schema_tables);
uint32 flags;
int (*binlog_func)(handlerton *hton, THD *thd, enum_binlog_func fn, void *arg);
void (*binlog_log_query)(handlerton *hton, THD *thd,
@@ -3855,6 +4239,7 @@ struct handlerton
const char *name);
uint32 license;
void *data;
+ backup_factory *get_backup_engine;
};
class Ha_trx_info;
struct THD_TRANS
@@ -3918,7 +4303,7 @@ private:
uchar m_flags;
};
enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
- ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
+ ISO_REPEATABLE_READ, ISO_SERIALIZABLE};
enum ndb_distribution { ND_KEYHASH= 0, ND_LINHASH= 1 };
typedef struct {
ulonglong data_file_length;
@@ -3962,14 +4347,25 @@ typedef struct st_ha_create_information
In_C_you_should_use_my_bool_instead() table_existed;
In_C_you_should_use_my_bool_instead() frm_only;
In_C_you_should_use_my_bool_instead() varchar;
- enum ha_storage_media storage_media;
+ enum ha_storage_media default_storage_media;
enum ha_choice page_checksum;
} HA_CREATE_INFO;
+typedef struct st_ha_alter_information
+{
+ KEY *key_info_buffer;
+ uint key_count;
+ uint index_drop_count;
+ uint *index_drop_buffer;
+ uint index_add_count;
+ uint *index_add_buffer;
+ void *data;
+} HA_ALTER_INFO;
typedef struct st_key_create_information
{
enum ha_key_alg algorithm;
ulong block_size;
LEX_STRING parser_name;
+ LEX_STRING comment;
} KEY_CREATE_INFO;
class TABLEOP_HOOKS
{
@@ -4008,11 +4404,65 @@ typedef struct st_ha_check_opt
} HA_CHECK_OPT;
typedef struct st_handler_buffer
{
- const uchar *buffer;
- const uchar *buffer_end;
+ uchar *buffer;
+ uchar *buffer_end;
uchar *end_of_used_area;
} HANDLER_BUFFER;
typedef struct system_status_var SSV;
+typedef void *range_seq_t;
+typedef struct st_range_seq_if
+{
+ range_seq_t (*init)(void *init_params, uint n_ranges, uint flags);
+ uint (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
+} RANGE_SEQ_IF;
+uint16 &mrr_persistent_flag_storage(range_seq_t seq, uint idx);
+char* &mrr_get_ptr_by_idx(range_seq_t seq, uint idx);
+class COST_VECT
+{
+public:
+ double io_count;
+ double avg_io_cost;
+ double cpu_cost;
+ double mem_cost;
+ double import_cost;
+ enum { IO_COEFF=1 };
+ enum { CPU_COEFF=1 };
+ enum { MEM_COEFF=1 };
+ enum { IMPORT_COEFF=1 };
+ COST_VECT() {}
+ double total_cost()
+ {
+ return IO_COEFF*io_count*avg_io_cost + CPU_COEFF * cpu_cost +
+ MEM_COEFF*mem_cost + IMPORT_COEFF*import_cost;
+ }
+ void zero()
+ {
+ avg_io_cost= 1.0;
+ io_count= cpu_cost= mem_cost= import_cost= 0.0;
+ }
+ void multiply(double m)
+ {
+ io_count *= m;
+ cpu_cost *= m;
+ import_cost *= m;
+ }
+ void add(const COST_VECT* cost)
+ {
+ double io_count_sum= io_count + cost->io_count;
+ add_io(cost->io_count, cost->avg_io_cost);
+ io_count= io_count_sum;
+ cpu_cost += cost->cpu_cost;
+ }
+ void add_io(double add_io_cnt, double add_avg_cost)
+ {
+ double io_count_sum= io_count + add_io_cnt;
+ avg_io_cost= (io_count * avg_io_cost +
+ add_io_cnt * add_avg_cost) / io_count_sum;
+ io_count= io_count_sum;
+ }
+};
+void get_sweep_read_cost(TABLE *table, ha_rows nrows, In_C_you_should_use_my_bool_instead() interrupted,
+ COST_VECT *cost);
class ha_statistics
{
public:
@@ -4051,14 +4501,18 @@ public:
uchar *ref;
uchar *dup_ref;
ha_statistics stats;
- In_C_you_should_use_my_bool_instead() multi_range_sorted;
- KEY_MULTI_RANGE *multi_range_curr;
- KEY_MULTI_RANGE *multi_range_end;
+ range_seq_t mrr_iter;
+ RANGE_SEQ_IF mrr_funcs;
HANDLER_BUFFER *multi_range_buffer;
+ uint ranges_in_seq;
+ In_C_you_should_use_my_bool_instead() mrr_is_output_sorted;
+ In_C_you_should_use_my_bool_instead() mrr_have_range;
+ KEY_MULTI_RANGE mrr_cur_range;
key_range save_end_range, *end_range;
KEY_PART_INFO *range_key_part;
int key_compare_result_on_equal;
In_C_you_should_use_my_bool_instead() eq_range;
+ In_C_you_should_use_my_bool_instead() in_range_check_pushed_down;
uint errkey;
uint key_used_on_scan;
uint active_index;
@@ -4067,18 +4521,22 @@ public:
enum {NONE=0, INDEX, RND} inited;
In_C_you_should_use_my_bool_instead() locked;
In_C_you_should_use_my_bool_instead() implicit_emptied;
- const COND *pushed_cond;
+ const Item *pushed_cond;
+ Item *pushed_idx_cond;
+ uint pushed_idx_cond_keyno;
ulonglong next_insert_id;
ulonglong insert_id_for_cur_row;
Discrete_interval auto_inc_interval_for_cur_row;
handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
:table_share(share_arg), table(0),
estimation_rows_to_insert(0), ht(ht_arg),
- ref(0), key_used_on_scan(64), active_index(64),
+ ref(0), in_range_check_pushed_down((0)),
+ key_used_on_scan(64), active_index(64),
ref_length(sizeof(my_off_t)),
ft_handler(0), inited(NONE),
locked((0)), implicit_emptied(0),
- pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0)
+ pushed_cond(0), pushed_idx_cond(NULL), pushed_idx_cond_keyno(64),
+ next_insert_id(0), insert_id_for_cur_row(0)
{}
virtual ~handler(void)
{
@@ -4093,33 +4551,35 @@ public:
int ha_index_init(uint idx, In_C_you_should_use_my_bool_instead() sorted)
{
int result;
- const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_init","./sql/handler.h",1159,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_init","./sql/handler.h",1463,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
assert(inited==NONE);
if (!(result= index_init(idx, sorted)))
inited=INDEX;
- do {_db_return_ (1163, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
+ end_range= NULL;
+ do {_db_return_ (1468, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
}
int ha_index_end()
{
- const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_end","./sql/handler.h",1167,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_index_end","./sql/handler.h",1472,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
assert(inited==INDEX);
inited=NONE;
- do {_db_return_ (1170, &_db_func_, &_db_file_, &_db_level_); return(index_end());} while(0);
+ end_range= NULL;
+ do {_db_return_ (1476, &_db_func_, &_db_file_, &_db_level_); return(index_end());} while(0);
}
int ha_rnd_init(In_C_you_should_use_my_bool_instead() scan)
{
int result;
- const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_init","./sql/handler.h",1175,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_init","./sql/handler.h",1481,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
assert(inited==NONE || (inited==RND && scan));
inited= (result= rnd_init(scan)) ? NONE: RND;
- do {_db_return_ (1178, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
+ do {_db_return_ (1484, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
}
int ha_rnd_end()
{
- const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_end","./sql/handler.h",1182,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("ha_rnd_end","./sql/handler.h",1488,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
assert(inited==RND);
inited=NONE;
- do {_db_return_ (1185, &_db_func_, &_db_file_, &_db_level_); return(rnd_end());} while(0);
+ do {_db_return_ (1491, &_db_func_, &_db_file_, &_db_level_); return(rnd_end());} while(0);
}
int ha_reset();
int ha_index_or_rnd_end()
@@ -4149,8 +4609,6 @@ public:
uint *dup_key_found);
int ha_delete_all_rows();
int ha_reset_auto_increment(ulonglong value);
- int ha_backup(THD* thd, HA_CHECK_OPT* check_opt);
- int ha_restore(THD* thd, HA_CHECK_OPT* check_opt);
int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt);
int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt);
In_C_you_should_use_my_bool_instead() ha_check_and_repair(THD *thd);
@@ -4166,12 +4624,12 @@ public:
int action_flag, HA_CREATE_INFO *info);
int ha_change_partitions(HA_CREATE_INFO *create_info,
const char *path,
- ulonglong *copied,
- ulonglong *deleted,
+ ulonglong * const copied,
+ ulonglong * const deleted,
const uchar *pack_frm_data,
size_t pack_frm_len);
- int ha_drop_partitions(const char *path);
- int ha_rename_partitions(const char *path);
+ int ha_drop_partitions(THD *thd, const char *path);
+ int ha_rename_partitions(THD *thd, const char *path);
int ha_optimize_partitions(THD *thd);
int ha_analyze_partitions(THD *thd);
int ha_check_partitions(THD *thd);
@@ -4191,6 +4649,17 @@ public:
{ return ((double) (ulonglong) (stats.data_file_length)) / 4096 + 2; }
virtual double read_time(uint index, uint ranges, ha_rows rows)
{ return ((double) (ulonglong) (ranges+rows)); }
+ virtual double index_only_read_time(uint keynr, double records);
+ virtual ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
+ void *seq_init_param,
+ uint n_ranges, uint *bufsz,
+ uint *flags, COST_VECT *cost);
+ virtual int multi_range_read_info(uint keyno, uint n_ranges, uint keys,
+ uint *bufsz, uint *flags, COST_VECT *cost);
+ virtual int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
+ uint n_ranges, uint mode,
+ HANDLER_BUFFER *buf);
+ virtual int multi_range_read_next(char **range_info);
virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; }
In_C_you_should_use_my_bool_instead() has_transactions()
{ return (ha_table_flags() & (1 << 0)) == 0; }
@@ -4250,15 +4719,12 @@ public:
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
return index_read_last(buf, key, key_len);
}
- virtual int read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
- KEY_MULTI_RANGE *ranges, uint range_count,
- In_C_you_should_use_my_bool_instead() sorted, HANDLER_BUFFER *buffer);
- virtual int read_multi_range_next(KEY_MULTI_RANGE **found_range_p);
virtual int read_range_first(const key_range *start_key,
const key_range *end_key,
In_C_you_should_use_my_bool_instead() eq_range, In_C_you_should_use_my_bool_instead() sorted);
virtual int read_range_next();
int compare_key(key_range *range);
+ int compare_key2(key_range *range);
virtual int ft_init() { return 131; }
void ft_end() { ft_handler=NULL; }
virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
@@ -4266,11 +4732,7 @@ public:
virtual int ft_read(uchar *buf) { return 131; }
virtual int rnd_next(uchar *buf)=0;
virtual int rnd_pos(uchar * buf, uchar *pos)=0;
- virtual int rnd_pos_by_record(uchar *record)
- {
- position(record);
- return rnd_pos(record, ref);
- }
+ virtual int rnd_pos_by_record(uchar *record);
virtual int read_first_row(uchar *buf, uint primary_key);
virtual int restart_rnd_next(uchar *buf, uchar *pos)
{ return 131; }
@@ -4282,6 +4744,8 @@ public:
virtual int info(uint)=0;
virtual void get_dynamic_partition_info(PARTITION_INFO *stat_info,
uint part_id);
+ virtual uint32 calculate_key_hash_value(Field **field_array)
+ { assert(0); return 0; }
virtual int extra(enum ha_extra_function operation)
{ return 0; }
virtual int extra_opt(enum ha_extra_function operation, ulong cache_size)
@@ -4296,7 +4760,7 @@ public:
ulonglong *nb_reserved_values);
void set_next_insert_id(ulonglong id)
{
- do {_db_pargs_(1488,"info"); _db_doprnt_ ("auto_increment: next value %lu", (ulong)id);} while(0);
+ do {_db_pargs_(1803,"info"); _db_doprnt_ ("auto_increment: next value %lu", (ulong)id);} while(0);
next_insert_id= id;
}
void restore_auto_increment(ulonglong prev_insert_id)
@@ -4310,9 +4774,7 @@ public:
{ return -1; }
virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt)
{ return -1; }
- virtual int dump(THD* thd, int fd = -1) { return 131; }
virtual int indexes_are_disabled(void) {return 0;}
- virtual int net_read_dump(NET* net) { return 131; }
virtual char *update_table_comment(const char * comment)
{ return (char*) comment;}
virtual void append_create_info(String *packet) {}
@@ -4320,8 +4782,7 @@ public:
{ return (0); }
virtual char* get_foreign_key_create_info()
{ return(NULL);}
- virtual char* get_tablespace_name(THD *thd, char *name, uint name_len)
- { return(NULL);}
+ const char* get_tablespace_name();
virtual In_C_you_should_use_my_bool_instead() can_switch_engines() { return 1; }
virtual int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
{ return 0; }
@@ -4339,7 +4800,9 @@ public:
*no_parts= 0;
return 0;
}
- virtual void set_part_info(partition_info *part_info) {return;}
+ virtual void set_part_info(partition_info *part_info,
+ In_C_you_should_use_my_bool_instead() early)
+ {return;}
virtual ulong index_flags(uint idx, uint part, In_C_you_should_use_my_bool_instead() all_parts) const =0;
virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
{ return (131); }
@@ -4355,13 +4818,13 @@ public:
uint max_key_parts() const
{ return ((16) < (max_supported_key_parts()) ? (16) : (max_supported_key_parts())); }
uint max_key_length() const
- { return ((3072) < (max_supported_key_length()) ? (3072) : (max_supported_key_length())); }
+ { return ((4096) < (max_supported_key_length()) ? (4096) : (max_supported_key_length())); }
uint max_key_part_length() const
- { return ((3072) < (max_supported_key_part_length()) ? (3072) : (max_supported_key_part_length())); }
+ { return ((4096) < (max_supported_key_part_length()) ? (4096) : (max_supported_key_part_length())); }
virtual uint max_supported_record_length() const { return 65535; }
virtual uint max_supported_keys() const { return 0; }
virtual uint max_supported_key_parts() const { return 16; }
- virtual uint max_supported_key_length() const { return 3072; }
+ virtual uint max_supported_key_length() const { return 4096; }
virtual uint max_supported_key_part_length() const { return 255; }
virtual uint min_record_length(uint options) const { return 1; }
virtual In_C_you_should_use_my_bool_instead() low_byte_first() const { return 1; }
@@ -4370,8 +4833,8 @@ public:
virtual In_C_you_should_use_my_bool_instead() auto_repair() const { return 0; }
virtual uint lock_count(void) const { return 1; }
virtual THR_LOCK_DATA **store_lock(THD *thd,
- THR_LOCK_DATA **to,
- enum thr_lock_type lock_type)=0;
+ THR_LOCK_DATA **to,
+ enum thr_lock_type lock_type)=0;
virtual uint8 table_cache_type() { return 0; }
virtual my_bool register_query_cache_table(THD *thd, char *table_key,
uint key_length,
@@ -4387,12 +4850,51 @@ public:
{
return memcmp(ref1, ref2, ref_length);
}
- virtual const COND *cond_push(const COND *cond) { return cond; };
- virtual void cond_pop() { return; };
+ virtual const COND *cond_push(const COND *cond) { return cond; }
+ virtual void cond_pop() { return; }
+ virtual Item *idx_cond_push(uint keyno, Item* idx_cond) { return idx_cond; }
virtual In_C_you_should_use_my_bool_instead() check_if_incompatible_data(HA_CREATE_INFO *create_info,
- uint table_changes)
+ uint table_changes)
{ return 1; }
+ virtual int check_if_supported_alter(TABLE *altered_table,
+ HA_CREATE_INFO *create_info,
+ HA_ALTER_FLAGS *alter_flags,
+ uint table_changes)
+ {
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("check_if_supported_alter","./sql/handler.h",2076,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ if (this->check_if_incompatible_data(create_info, table_changes)
+ == 1)
+ do {_db_return_ (2079, &_db_func_, &_db_file_, &_db_level_); return(2);} while(0);
+ else
+ do {_db_return_ (2081, &_db_func_, &_db_file_, &_db_level_); return(0);} while(0);
+ }
+ virtual int alter_table_phase1(THD *thd,
+ TABLE *altered_table,
+ HA_CREATE_INFO *create_info,
+ HA_ALTER_INFO *alter_info,
+ HA_ALTER_FLAGS *alter_flags)
+ {
+ return 138;
+ }
+ virtual int alter_table_phase2(THD *thd,
+ TABLE *altered_table,
+ HA_CREATE_INFO *create_info,
+ HA_ALTER_INFO *alter_info,
+ HA_ALTER_FLAGS *alter_flags)
+ {
+ return 138;
+ }
+ virtual int alter_table_phase3(THD *thd, TABLE *table)
+ {
+ return 138;
+ }
virtual void use_hidden_primary_key();
+ virtual int lock_table(THD *thd __attribute__((unused)),
+ int lock_type __attribute__((unused)),
+ int lock_timeout __attribute__((unused)))
+ {
+ return 131;
+ }
protected:
void ha_statistic_increment(ulong SSV::*offset) const;
void **ha_data(THD *) const;
@@ -4451,10 +4953,6 @@ private:
{ return ((_my_thread_var())->thr_errno=131); }
virtual int reset_auto_increment(ulonglong value)
{ return 131; }
- virtual int backup(THD* thd, HA_CHECK_OPT* check_opt)
- { return -1; }
- virtual int restore(THD* thd, HA_CHECK_OPT* check_opt)
- { return -1; }
virtual int optimize(THD* thd, HA_CHECK_OPT* check_opt)
{ return -1; }
virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt)
@@ -4472,14 +4970,14 @@ private:
{ return (0); }
virtual int change_partitions(HA_CREATE_INFO *create_info,
const char *path,
- ulonglong *copied,
- ulonglong *deleted,
+ ulonglong * const copied,
+ ulonglong * const deleted,
const uchar *pack_frm_data,
size_t pack_frm_len)
{ return 131; }
- virtual int drop_partitions(const char *path)
+ virtual int drop_partitions(THD *thd, const char *path)
{ return 131; }
- virtual int rename_partitions(const char *path)
+ virtual int rename_partitions(THD *thd, const char *path)
{ return 131; }
virtual int optimize_partitions(THD *thd)
{ return 131; }
@@ -4490,6 +4988,47 @@ private:
virtual int repair_partitions(THD *thd)
{ return 131; }
};
+class DsMrr_impl
+{
+public:
+ typedef void (handler::*range_check_toggle_func_t)(In_C_you_should_use_my_bool_instead() on);
+ DsMrr_impl()
+ : h2(NULL) {};
+ handler *h;
+ TABLE *table;
+private:
+ handler *h2;
+ uchar *rowids_buf;
+ uchar *rowids_buf_cur;
+ uchar *rowids_buf_last;
+ uchar *rowids_buf_end;
+ In_C_you_should_use_my_bool_instead() dsmrr_eof;
+ In_C_you_should_use_my_bool_instead() is_mrr_assoc;
+ In_C_you_should_use_my_bool_instead() use_default_impl;
+public:
+ void init(handler *h_arg, TABLE *table_arg)
+ {
+ h= h_arg;
+ table= table_arg;
+ }
+ int dsmrr_init(handler *h, KEY *key, RANGE_SEQ_IF *seq_funcs,
+ void *seq_init_param, uint n_ranges, uint mode,
+ HANDLER_BUFFER *buf);
+ void dsmrr_close();
+ int dsmrr_fill_buffer(handler *h);
+ int dsmrr_next(handler *h, char **range_info);
+ int dsmrr_info(uint keyno, uint n_ranges, uint keys, uint *bufsz,
+ uint *flags, COST_VECT *cost);
+ ha_rows dsmrr_info_const(uint keyno, RANGE_SEQ_IF *seq,
+ void *seq_init_param, uint n_ranges, uint *bufsz,
+ uint *flags, COST_VECT *cost);
+private:
+ In_C_you_should_use_my_bool_instead() key_uses_partial_cols(uint keyno);
+ In_C_you_should_use_my_bool_instead() choose_mrr_impl(uint keyno, ha_rows rows, uint *flags, uint *bufsz,
+ COST_VECT *cost);
+ In_C_you_should_use_my_bool_instead() get_disk_sweep_mrr_cost(uint keynr, ha_rows rows, uint flags,
+ uint *buffer_size, COST_VECT *cost);
+};
extern const char *ha_row_type[];
extern const char *tx_isolation_names[];
extern const char *binlog_format_names[];
@@ -4534,7 +5073,7 @@ void ha_drop_database(char* path);
int ha_create_table(THD *thd, const char *path,
const char *db, const char *table_name,
HA_CREATE_INFO *create_info,
- In_C_you_should_use_my_bool_instead() update_create_info);
+ In_C_you_should_use_my_bool_instead() update_create_info);
int ha_delete_table(THD *thd, handlerton *db_type, const char *path,
const char *db, const char *alias, In_C_you_should_use_my_bool_instead() generate_warning);
In_C_you_should_use_my_bool_instead() ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat);
@@ -4673,7 +5212,7 @@ typedef struct st_grant_info
enum tmp_table_type
{
NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE,
- INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
+ INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE, TMP_TABLE_FRM_FILE_ONLY
};
enum trg_event_type
{
@@ -4764,6 +5303,8 @@ typedef struct st_table_share
return db_plugin ? ((handlerton*)((db_plugin)[0]->data)) : NULL;
}
enum row_type row_type;
+ enum ha_storage_media default_storage_media;
+ char *tablespace;
enum tmp_table_type tmp_table;
enum ha_choice transactional;
enum ha_choice page_checksum;
@@ -4804,6 +5345,7 @@ typedef struct st_table_share
ulong table_map_id;
ulonglong table_map_version;
int cached_row_logging_check;
+ void *ha_data;
void set_table_cache_key(char *key_buff, uint key_length)
{
table_cache_key.str= key_buff;
@@ -4981,41 +5523,6 @@ typedef struct st_foreign_key_info
List<LEX_STRING> foreign_fields;
List<LEX_STRING> referenced_fields;
} FOREIGN_KEY_INFO;
-enum enum_schema_tables
-{
- SCH_CHARSETS= 0,
- SCH_COLLATIONS,
- SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
- SCH_COLUMNS,
- SCH_COLUMN_PRIVILEGES,
- SCH_ENGINES,
- SCH_EVENTS,
- SCH_FILES,
- SCH_GLOBAL_STATUS,
- SCH_GLOBAL_VARIABLES,
- SCH_KEY_COLUMN_USAGE,
- SCH_OPEN_TABLES,
- SCH_PARTITIONS,
- SCH_PLUGINS,
- SCH_PROCESSLIST,
- SCH_PROFILES,
- SCH_REFERENTIAL_CONSTRAINTS,
- SCH_PROCEDURES,
- SCH_SCHEMATA,
- SCH_SCHEMA_PRIVILEGES,
- SCH_SESSION_STATUS,
- SCH_SESSION_VARIABLES,
- SCH_STATISTICS,
- SCH_STATUS,
- SCH_TABLES,
- SCH_TABLE_CONSTRAINTS,
- SCH_TABLE_NAMES,
- SCH_TABLE_PRIVILEGES,
- SCH_TRIGGERS,
- SCH_USER_PRIVILEGES,
- SCH_VARIABLES,
- SCH_VIEWS
-};
typedef struct st_field_info
{
const char* field_name;
@@ -5086,6 +5593,9 @@ struct TABLE_LIST
char *db, *alias, *table_name, *schema_table_name;
char *option;
Item *on_expr;
+ Item *sj_on_expr;
+ table_map sj_inner_tables;
+ uint sj_in_exprs;
Item *prep_on_expr;
COND_EQUAL *cond_equal;
TABLE_LIST *natural_join;
@@ -5165,7 +5675,11 @@ struct TABLE_LIST
char timestamp_buffer[20];
In_C_you_should_use_my_bool_instead() prelocking_placeholder;
In_C_you_should_use_my_bool_instead() create;
+ int lock_timeout;
+ In_C_you_should_use_my_bool_instead() lock_transactional;
In_C_you_should_use_my_bool_instead() internal_tmp_table;
+ In_C_you_should_use_my_bool_instead() is_alias;
+ In_C_you_should_use_my_bool_instead() is_fqtn;
View_creation_ctx *view_creation_ctx;
LEX_STRING view_client_cs_name;
LEX_STRING view_connection_cl_name;
@@ -5335,8 +5849,11 @@ typedef struct st_nested_join
table_map used_tables;
table_map not_null_tables;
struct st_join_table *first_nested;
- uint counter;
+ uint counter_;
nested_join_map nj_map;
+ table_map sj_depends_on;
+ table_map sj_corr_tables;
+ List<Item> sj_outer_expr_list;
} NESTED_JOIN;
typedef struct st_changed_table_list
{
@@ -5493,6 +6010,7 @@ public:
virtual int save_field_metadata(uchar *first_byte)
{ return do_save_field_metadata(first_byte); }
virtual uint32 data_length() { return pack_length(); }
+ virtual uint32 used_length() { return pack_length(); }
virtual uint32 sort_length() const { return pack_length(); }
virtual uint32 max_data_length() const {
return pack_length();
@@ -5558,7 +6076,7 @@ public:
};
size_t last_null_byte() const {
size_t bytes= do_last_null_byte();
- do {_db_pargs_(284,"debug"); _db_doprnt_ ("last_null_byte() ==> %ld", (long) bytes);} while(0);
+ do {_db_pargs_(290,"debug"); _db_doprnt_ ("last_null_byte() ==> %ld", (long) bytes);} while(0);
assert(bytes <= table->s->null_bytes);
return bytes;
}
@@ -5624,17 +6142,17 @@ public:
uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first);
uchar *pack(uchar *to, const uchar *from)
{
- const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::pack","./sql/field.h",390,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::pack","./sql/field.h",396,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
uchar *result= this->pack(to, from, UINT_MAX, table->s->db_low_byte_first);
- do {_db_return_ (392, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
+ do {_db_return_ (398, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
}
virtual const uchar *unpack(uchar* to, const uchar *from,
uint param_data, In_C_you_should_use_my_bool_instead() low_byte_first);
const uchar *unpack(uchar* to, const uchar *from)
{
- const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::unpack","./sql/field.h",402,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Field::unpack","./sql/field.h",408,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
const uchar *result= unpack(to, from, 0U, table->s->db_low_byte_first);
- do {_db_return_ (404, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
+ do {_db_return_ (410, &_db_func_, &_db_file_, &_db_level_); return(result);} while(0);
}
virtual uchar *pack_key(uchar* to, const uchar *from,
uint max_length, In_C_you_should_use_my_bool_instead() low_byte_first)
@@ -5709,6 +6227,30 @@ public:
assert(0);
return GEOM_GEOMETRY;
}
+ inline enum ha_storage_media field_storage_type() const
+ {
+ return (enum ha_storage_media)
+ ((flags >> 22) & 7);
+ }
+ inline enum column_format_type column_format() const
+ {
+ return (enum column_format_type)
+ ((flags >> 25) & 7);
+ }
+ void dbug_print()
+ {
+ if (is_real_null())
+ fprintf(_db_fp_(), "NULL");
+ else
+ {
+ char buf[256];
+ String str(buf, sizeof(buf), &my_charset_bin);
+ str.length(0);
+ String *pstr;
+ pstr= val_str(&str);
+ fprintf(_db_fp_(), "'%s'", pstr->c_ptr_safe());
+ }
+ }
virtual void hash(ulong *nr, ulong *nr2);
friend In_C_you_should_use_my_bool_instead() reopen_table(THD *,struct st_table *,In_C_you_should_use_my_bool_instead());
friend int cre_myisam(char * name, register TABLE *form, uint options,
@@ -6565,6 +7107,7 @@ public:
uint packed_col_length(const uchar *to, uint length);
uint max_packed_col_length(uint max_length);
uint32 data_length();
+ uint32 used_length();
uint size_of() const { return sizeof(*this); }
enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; }
In_C_you_should_use_my_bool_instead() has_charset(void) const
@@ -6946,6 +7489,16 @@ public:
Create_field *clone(MEM_ROOT *mem_root) const
{ return new (mem_root) Create_field(*this); }
void create_length_to_internal_length(void);
+ inline enum ha_storage_media field_storage_type() const
+ {
+ return (enum ha_storage_media)
+ ((flags >> 22) & 7);
+ }
+ inline enum column_format_type column_format() const
+ {
+ return (enum column_format_type)
+ ((flags >> 25) & 7);
+ }
void init_for_tmp_table(enum_field_types sql_type_arg,
uint32 max_length, uint32 decimals,
In_C_you_should_use_my_bool_instead() maybe_null, In_C_you_should_use_my_bool_instead() is_unsigned);
@@ -6953,7 +7506,9 @@ public:
char *decimals, uint type_modifier, Item *default_value,
Item *on_update_value, LEX_STRING *comment, char *change,
List<String> *interval_list, CHARSET_INFO *cs,
- uint uint_geom_type);
+ uint uint_geom_type,
+ enum ha_storage_media storage_type,
+ enum column_format_type column_format);
};
class Send_field {
public:
@@ -7010,6 +7565,8 @@ protected:
enum enum_field_types *field_types;
uint field_count;
In_C_you_should_use_my_bool_instead() net_store_data(const uchar *from, size_t length);
+ In_C_you_should_use_my_bool_instead() net_store_data(const uchar *from, size_t length,
+ CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
In_C_you_should_use_my_bool_instead() store_string_aux(const char *from, size_t length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
public:
@@ -7236,6 +7793,161 @@ int mysql_drop_function(THD *thd,const L
extern ST_FIELD_INFO query_profile_statistics_info[];
int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);
+#include "mysql_priv.h"
+#include <sys/resource.h>
+class PROF_MEASUREMENT;
+class QUERY_PROFILE;
+class PROFILING;
+template <class T> class Queue
+{
+private:
+ struct queue_item
+ {
+ T *payload;
+ struct queue_item *next, *previous;
+ };
+ struct queue_item *first, *last;
+public:
+ Queue()
+ {
+ elements= 0;
+ first= last= NULL;
+ }
+ void empty()
+ {
+ struct queue_item *i, *after_i;
+ for (i= first; i != NULL; i= after_i)
+ {
+ after_i= i->next;
+ ((void)(myf) (0),my_no_flags_free((char *) i));
+ }
+ elements= 0;
+ }
+ ulong elements;
+ void push_back(T *payload)
+ {
+ struct queue_item *new_item;
+ new_item= (struct queue_item *) my_malloc(sizeof(struct queue_item), (myf) (0));
+ new_item->payload= payload;
+ if (first == NULL)
+ first= new_item;
+ if (last != NULL)
+ {
+ assert(last->next == NULL);
+ last->next= new_item;
+ }
+ new_item->previous= last;
+ new_item->next= NULL;
+ last= new_item;
+ elements++;
+ }
+ T *pop()
+ {
+ struct queue_item *old_item= first;
+ T *ret= NULL;
+ if (first == NULL)
+ {
+ do {_db_pargs_(135,"warning"); _db_doprnt_ ("tried to pop nonexistent item from Queue");} while(0);
+ return NULL;
+ }
+ ret= old_item->payload;
+ if (first->next != NULL)
+ first->next->previous= NULL;
+ else
+ last= NULL;
+ first= first->next;
+ ((void)(myf) (0),my_no_flags_free((char *)old_item));
+ elements--;
+ return ret;
+ }
+ In_C_you_should_use_my_bool_instead() is_empty()
+ {
+ assert(((elements > 0) && (first != NULL)) || ((elements == 0) || (first == NULL)));
+ return (elements == 0);
+ }
+ void *new_iterator()
+ {
+ return first;
+ }
+ void *iterator_next(void *current)
+ {
+ return ((struct queue_item *) current)->next;
+ }
+ T *iterator_value(void *current)
+ {
+ return ((struct queue_item *) current)->payload;
+ }
+};
+class PROF_MEASUREMENT
+{
+private:
+ friend class QUERY_PROFILE;
+ friend class PROFILING;
+ QUERY_PROFILE *profile;
+ char *status;
+ struct rusage rusage;
+ char *function;
+ char *file;
+ unsigned int line;
+ double time_usecs;
+ char *allocated_status_memory;
+ void set_label(const char *status_arg, const char *function_arg,
+ const char *file_arg, unsigned int line_arg);
+ void clean_up();
+ PROF_MEASUREMENT();
+ PROF_MEASUREMENT(QUERY_PROFILE *profile_arg, const char *status_arg);
+ PROF_MEASUREMENT(QUERY_PROFILE *profile_arg, const char *status_arg,
+ const char *function_arg,
+ const char *file_arg, unsigned int line_arg);
+ ~PROF_MEASUREMENT();
+ void collect();
+};
+class QUERY_PROFILE
+{
+private:
+ friend class PROFILING;
+ PROFILING *profiling;
+ query_id_t profiling_query_id;
+ char *query_source;
+ PROF_MEASUREMENT *profile_start;
+ PROF_MEASUREMENT *profile_end;
+ Queue<PROF_MEASUREMENT> entries;
+ QUERY_PROFILE(PROFILING *profiling_arg, const char *status_arg);
+ ~QUERY_PROFILE();
+ void set_query_source(char *query_source_arg, uint query_length_arg);
+ void new_status(const char *status_arg,
+ const char *function_arg,
+ const char *file_arg, unsigned int line_arg);
+ void reset();
+ In_C_you_should_use_my_bool_instead() show(uint options);
+};
+class PROFILING
+{
+private:
+ friend class PROF_MEASUREMENT;
+ friend class QUERY_PROFILE;
+ query_id_t profile_id_counter;
+ THD *thd;
+ In_C_you_should_use_my_bool_instead() keeping;
+ In_C_you_should_use_my_bool_instead() enabled;
+ QUERY_PROFILE *current;
+ QUERY_PROFILE *last;
+ Queue<QUERY_PROFILE> history;
+ query_id_t next_profile_id() { return(profile_id_counter++); }
+public:
+ PROFILING();
+ ~PROFILING();
+ void set_query_source(char *query_source_arg, uint query_length_arg);
+ void start_new_query(const char *initial_state= "starting");
+ void discard_current_query();
+ void finish_current_query();
+ void status_change(const char *status_arg,
+ const char *function_arg,
+ const char *file_arg, unsigned int line_arg);
+ inline void set_thd(THD *thd_arg) { thd= thd_arg; };
+ In_C_you_should_use_my_bool_instead() show_profiles();
+ int fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
+};
#include "sql_partition.h"
#pragma interface
typedef struct {
@@ -7445,6 +8157,7 @@ public:
const char *part_state;
partition_element *curr_part_elem;
partition_element *current_partition;
+ TABLE *table;
key_map all_fields_in_PF, all_fields_in_PPF, all_fields_in_SPF;
key_map some_fields_in_PF;
handlerton *default_engine_type;
@@ -7807,9 +8520,12 @@ typedef In_C_you_should_use_my_bool_inst
typedef In_C_you_should_use_my_bool_instead() (Item::*Item_analyzer) (uchar **argp);
typedef Item* (Item::*Item_transformer) (uchar *arg);
typedef void (*Cond_traverser) (const Item *item, void *arg);
-class Item {
+class Item
+{
Item(const Item &);
void operator=(Item &);
+ int8 is_expensive_cache;
+ virtual In_C_you_should_use_my_bool_instead() is_expensive_processor(uchar *arg) { return 0; }
public:
static void *operator new(size_t size)
{ return sql_alloc(size); }
@@ -7858,6 +8574,7 @@ public:
virtual void make_field(Send_field *field);
Field *make_string_field(TABLE *table);
virtual In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
+ virtual void fix_after_pullout(st_select_lex *new_parent, Item **ref) {};
inline void quick_fix_field() { fixed= 1; }
int save_in_field_no_warnings(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
virtual int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
@@ -7970,7 +8687,6 @@ public:
virtual In_C_you_should_use_my_bool_instead() find_item_in_field_list_processor(uchar *arg) { return 0; }
virtual In_C_you_should_use_my_bool_instead() change_context_processor(uchar *context) { return 0; }
virtual In_C_you_should_use_my_bool_instead() reset_query_id_processor(uchar *query_id_arg) { return 0; }
- virtual In_C_you_should_use_my_bool_instead() is_expensive_processor(uchar *arg) { return 0; }
virtual In_C_you_should_use_my_bool_instead() register_field_in_read_map(uchar *arg) { return 0; }
virtual In_C_you_should_use_my_bool_instead() check_partition_func_processor(uchar *bool_arg) { return (1);}
virtual In_C_you_should_use_my_bool_instead() subst_argument_checker(uchar **arg)
@@ -8008,6 +8724,12 @@ public:
}
virtual In_C_you_should_use_my_bool_instead() result_as_longlong() { return (0); }
In_C_you_should_use_my_bool_instead() is_datetime();
+ virtual In_C_you_should_use_my_bool_instead() is_expensive()
+ {
+ if (is_expensive_cache < 0)
+ is_expensive_cache= walk(&Item::is_expensive_processor, 0, (uchar*)0);
+ return ((is_expensive_cache) ? 1 : 0);
+ }
virtual Field::geometry_type get_geometry_type() const
{ return Field::GEOM_GEOMETRY; };
String *check_well_formed_result(String *str, In_C_you_should_use_my_bool_instead() send_error= 0);
@@ -8264,6 +8986,7 @@ public:
In_C_you_should_use_my_bool_instead() send(Protocol *protocol, String *str_arg);
void reset_field(Field *f);
In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref);
void make_field(Send_field *tmp_field);
int save_in_field(Field *field,In_C_you_should_use_my_bool_instead() no_conversions);
void save_org_in_field(Field *field);
@@ -8318,6 +9041,27 @@ public:
assert(field_type() == MYSQL_TYPE_GEOMETRY);
return field->get_geometry_type();
}
+ void dbug_print()
+ {
+ fprintf(_db_fp_(), "<field ");
+ if (field)
+ {
+ fprintf(_db_fp_(), "'%s.%s': ", field->table->alias, field->field_name);
+ field->dbug_print();
+ }
+ else
+ fprintf(_db_fp_(), "NULL");
+ fprintf(_db_fp_(), ", result_field: ");
+ if (result_field)
+ {
+ fprintf(_db_fp_(), "'%s.%s': ",
+ result_field->table->alias, result_field->field_name);
+ result_field->dbug_print();
+ }
+ else
+ fprintf(_db_fp_(), "NULL");
+ fprintf(_db_fp_(), ">\n");
+ }
friend class Item_default_value;
friend class Item_insert_value;
friend class st_select_lex_unit;
@@ -8368,7 +9112,7 @@ public:
};
class Item_param :public Item
{
- char cnvbuf[(255*3 +1)];
+ char cnvbuf[(255*4 +1)];
String cnvstr;
Item *cnvitem;
public:
@@ -8708,7 +9452,7 @@ class Item_empty_string :public Item_par
{
public:
Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) :
- Item_partition_func_safe_string("",0, cs ? cs : &my_charset_utf8_general_ci)
+ Item_partition_func_safe_string("",0, cs ? cs : &my_charset_utf8mb4_general_ci)
{ name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; }
void make_field(Send_field *field);
};
@@ -8813,6 +9557,7 @@ public:
In_C_you_should_use_my_bool_instead() send(Protocol *prot, String *tmp);
void make_field(Send_field *field);
In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref);
int save_in_field(Field *field, In_C_you_should_use_my_bool_instead() no_conversions);
void save_org_in_field(Field *field);
enum Item_result result_type () const { return (*ref)->result_type(); }
@@ -8947,6 +9692,7 @@ public:
outer_ref->save_org_in_field(result_field);
}
In_C_you_should_use_my_bool_instead() fix_fields(THD *, Item **);
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref);
table_map used_tables() const
{
return (*ref)->const_item() ? 0 : (((table_map) 1) << (sizeof(table_map)*8-2));
@@ -9081,9 +9827,21 @@ class Cached_item_field :public Cached_i
Field *field;
uint length;
public:
- Cached_item_field(Item_field *item)
+ void dbug_print()
{
- field= item->field;
+ uchar *org_ptr;
+ org_ptr= field->ptr;
+ fprintf(_db_fp_(), "new: ");
+ field->dbug_print();
+ field->ptr= buff;
+ fprintf(_db_fp_(), ", old: ");
+ field->dbug_print();
+ field->ptr= org_ptr;
+ fprintf(_db_fp_(), "\n");
+ }
+ Cached_item_field(Field *arg_field) : field(arg_field)
+ {
+ field= arg_field;
buff= (uchar*) sql_calloc(length=field->pack_length());
}
In_C_you_should_use_my_bool_instead() cmp(void);
@@ -9345,13 +10103,13 @@ public:
void keep_array() { save_array= 1; }
void cleanup()
{
- const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Item_cache_row::cleanup","./sql/item.h",2898,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
+ const char *_db_func_, *_db_file_; uint _db_level_; char **_db_framep_; _db_enter_ ("Item_cache_row::cleanup","./sql/item.h",2970,&_db_func_,&_db_file_,&_db_level_, &_db_framep_);
Item_cache::cleanup();
if (save_array)
bzero(values, item_count*sizeof(Item**));
else
values= 0;
- do {_db_return_ (2904, &_db_func_, &_db_file_, &_db_level_); return;} while(0);
+ do {_db_return_ (2976, &_db_func_, &_db_file_, &_db_level_); return;} while(0);
}
};
class Item_type_holder: public Item
@@ -9383,7 +10141,8 @@ void mark_select_range_as_dependent(THD
st_select_lex *current_sel,
Field *found_field, Item *found_item,
Item_ident *resolved_item);
-extern Cached_item *new_Cached_item(THD *thd, Item *item);
+extern Cached_item *new_Cached_item(THD *thd, Item *item,
+ In_C_you_should_use_my_bool_instead() use_result_field);
extern Item_result item_cmp_type(Item_result a,Item_result b);
extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item);
extern In_C_you_should_use_my_bool_instead() field_is_equal_to_item(Field *field,Item *item);
@@ -9420,6 +10179,16 @@ In_C_you_should_use_my_bool_instead() ch
In_C_you_should_use_my_bool_instead() check_string_char_length(LEX_STRING *str, const char *err_msg,
uint max_char_length, CHARSET_INFO *cs,
In_C_you_should_use_my_bool_instead() no_error);
+In_C_you_should_use_my_bool_instead() check_identifier_name(LEX_STRING *str, uint max_char_length,
+ uint err_code, const char *param_for_err_msg);
+inline In_C_you_should_use_my_bool_instead() check_identifier_name(LEX_STRING *str, uint err_code)
+{
+ return check_identifier_name(str, 64, err_code, "");
+}
+inline In_C_you_should_use_my_bool_instead() check_identifier_name(LEX_STRING *str)
+{
+ return check_identifier_name(str, 64, 0, "");
+}
In_C_you_should_use_my_bool_instead() test_if_data_home_dir(const char *dir);
In_C_you_should_use_my_bool_instead() parse_sql(THD *thd,
class Lex_input_stream *lip,
@@ -9449,6 +10218,34 @@ In_C_you_should_use_my_bool_instead() ge
In_C_you_should_use_my_bool_instead() general_log_write(THD *thd, enum enum_server_command command,
const char *query, uint query_length);
#include "sql_class.h"
+#include <mysql/plugin_audit.h>
+#include "plugin.h"
+struct mysql_event
+{
+ int event_class;
+};
+struct mysql_event_general
+{
+ int event_class;
+ int general_error_code;
+ unsigned long general_thread_id;
+ const char *general_user;
+ unsigned int general_user_length;
+ const char *general_command;
+ unsigned int general_command_length;
+ const char *general_query;
+ unsigned int general_query_length;
+ struct charset_info_st *general_charset;
+ unsigned long long general_time;
+ unsigned long long general_rows;
+};
+struct st_mysql_audit
+{
+ int interface_version;
+ void (*release_thd)(void*);
+ void (*event_notify)(void*, const struct mysql_event *);
+ unsigned long class_mask[1];
+};
#include "log.h"
class Relay_log_info;
class Format_description_log_event;
@@ -9556,7 +10353,7 @@ public:
pthread_mutex_t LOCK_log;
char *name;
char log_file_name[512];
- char time_buff[20], db[(64*3) + 1];
+ char time_buff[20], db[(64*4) + 1];
In_C_you_should_use_my_bool_instead() write_error, inited;
IO_CACHE log_file;
enum_log_type log_type;
@@ -9646,7 +10443,8 @@ public:
}
void set_max_size(ulong max_size_arg);
void signal_update();
- void wait_for_update(THD* thd, In_C_you_should_use_my_bool_instead() master_or_slave);
+ void wait_for_update_relay_log(THD* thd);
+ int wait_for_update_bin_log(THD* thd, const struct timespec * timeout);
void set_need_start_event() { need_start_event = 1; }
void init(In_C_you_should_use_my_bool_instead() no_auto_events_arg, ulong max_size);
void init_pthread_objects();
@@ -9891,6 +10689,7 @@ enum enum_slave_exec_mode { SLAVE_EXEC_M
SLAVE_EXEC_MODE_LAST_BIT};
enum enum_mark_columns
{ MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE};
+enum enum_filetype { FILETYPE_CSV, FILETYPE_XML };
extern char internal_table_name[2];
extern char empty_c_string[1];
extern const char **errmesg;
@@ -9919,9 +10718,14 @@ typedef struct st_copy_info {
} COPY_INFO;
class Key_part_spec :public Sql_alloc {
public:
- const char *field_name;
+ LEX_STRING field_name;
uint length;
- Key_part_spec(const char *name,uint len=0) :field_name(name), length(len) {}
+ Key_part_spec(const LEX_STRING &name, uint len)
+ : field_name(name), length(len)
+ {}
+ Key_part_spec(const char *name, const size_t name_len, uint len)
+ : length(len)
+ { field_name.str= (char *)name; field_name.length= name_len; }
In_C_you_should_use_my_bool_instead() operator==(const Key_part_spec& other) const;
Key_part_spec *clone(MEM_ROOT *mem_root) const
{ return new (mem_root) Key_part_spec(*this); }
@@ -9951,14 +10755,23 @@ public:
enum Keytype type;
KEY_CREATE_INFO key_create_info;
List<Key_part_spec> columns;
- const char *name;
+ LEX_STRING name;
In_C_you_should_use_my_bool_instead() generated;
- Key(enum Keytype type_par, const char *name_arg,
+ Key(enum Keytype type_par, const LEX_STRING &name_arg,
KEY_CREATE_INFO *key_info_arg,
In_C_you_should_use_my_bool_instead() generated_arg, List<Key_part_spec> &cols)
:type(type_par), key_create_info(*key_info_arg), columns(cols),
name(name_arg), generated(generated_arg)
{}
+ Key(enum Keytype type_par, const char *name_arg, size_t name_len_arg,
+ KEY_CREATE_INFO *key_info_arg, In_C_you_should_use_my_bool_instead() generated_arg,
+ List<Key_part_spec> &cols)
+ :type(type_par), key_create_info(*key_info_arg), columns(cols),
+ generated(generated_arg)
+ {
+ name.str= (char *)name_arg;
+ name.length= name_len_arg;
+ }
Key(const Key &rhs, MEM_ROOT *mem_root);
virtual ~Key() {}
friend In_C_you_should_use_my_bool_instead() foreign_key_prefix(Key *a, Key *b);
@@ -9975,7 +10788,7 @@ public:
Table_ident *ref_table;
List<Key_part_spec> ref_columns;
uint delete_opt, update_opt, match_opt;
- Foreign_key(const char *name_arg, List<Key_part_spec> &cols,
+ Foreign_key(const LEX_STRING &name_arg, List<Key_part_spec> &cols,
Table_ident *table, List<Key_part_spec> &ref_cols,
uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg)
:Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols),
@@ -10000,6 +10813,16 @@ public:
uint rights;
LEX_COLUMN (const String& x,const uint& y ): column (x),rights (y) {}
};
+struct Query_cache_block;
+struct Query_cache_tls
+{
+ Query_cache_block *first_query_block;
+ void set_first_query_block(Query_cache_block *first_query_block_arg)
+ {
+ first_query_block= first_query_block_arg;
+ }
+ Query_cache_tls() :first_query_block(NULL) {}
+};
#include "sql_lex.h"
class Table_ident;
class sql_exchange;
@@ -10033,10 +10856,10 @@ enum enum_sql_command {
SQLCOM_ROLLBACK, SQLCOM_ROLLBACK_TO_SAVEPOINT,
SQLCOM_COMMIT, SQLCOM_SAVEPOINT, SQLCOM_RELEASE_SAVEPOINT,
SQLCOM_SLAVE_START, SQLCOM_SLAVE_STOP,
- SQLCOM_BEGIN, SQLCOM_LOAD_MASTER_TABLE, SQLCOM_CHANGE_MASTER,
- SQLCOM_RENAME_TABLE, SQLCOM_BACKUP_TABLE, SQLCOM_RESTORE_TABLE,
+ SQLCOM_BEGIN, SQLCOM_CHANGE_MASTER,
+ SQLCOM_RENAME_TABLE,
SQLCOM_RESET, SQLCOM_PURGE, SQLCOM_PURGE_BEFORE, SQLCOM_SHOW_BINLOGS,
- SQLCOM_SHOW_OPEN_TABLES, SQLCOM_LOAD_MASTER_DATA,
+ SQLCOM_SHOW_OPEN_TABLES,
SQLCOM_HA_OPEN, SQLCOM_HA_CLOSE, SQLCOM_HA_READ,
SQLCOM_SHOW_SLAVE_HOSTS, SQLCOM_DELETE_MULTI, SQLCOM_UPDATE_MULTI,
SQLCOM_SHOW_BINLOG_EVENTS, SQLCOM_SHOW_NEW_MASTER, SQLCOM_DO,
@@ -10064,6 +10887,8 @@ enum enum_sql_command {
SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
SQLCOM_SHOW_CREATE_TRIGGER,
SQLCOM_ALTER_DB_UPGRADE,
+ SQLCOM_SHOW_ARCHIVE,
+ SQLCOM_BACKUP, SQLCOM_RESTORE,
SQLCOM_SHOW_PROFILE, SQLCOM_SHOW_PROFILES,
SQLCOM_END
};
@@ -10093,7 +10918,6 @@ struct system_variables
ulong max_tmp_tables;
ulong max_insert_delayed_threads;
ulong min_examined_row_limit;
- ulong multi_range_count;
ulong myisam_repair_threads;
ulong myisam_sort_buff_size;
ulong myisam_stats_method;
@@ -10105,6 +10929,8 @@ struct system_variables
ulong net_write_timeout;
ulong optimizer_prune_level;
ulong optimizer_search_depth;
+ ulong optimizer_use_mrr;
+ ulong optimizer_switch;
ulong preload_buff_size;
ulong profiling_history_size;
ulong query_cache_type;
@@ -10209,6 +11035,7 @@ typedef struct system_status_var
ulong com_stmt_fetch;
ulong com_stmt_reset;
ulong com_stmt_close;
+ ulong questions;
double last_query_cost;
} STATUS_VAR;
void mark_transaction_to_rollback(THD *thd, In_C_you_should_use_my_bool_instead() all);
@@ -10294,10 +11121,10 @@ struct st_mysql_options {
unsigned long max_allowed_packet;
my_bool use_ssl;
my_bool compress,named_pipe;
- my_bool rpl_probe;
- my_bool rpl_parse;
- my_bool no_master_reads;
- my_bool separate_thread;
+ my_bool unused1;
+ my_bool unused2;
+ my_bool unused3;
+ my_bool unused4;
enum mysql_option methods_to_use;
char *client_ip;
my_bool secure_auth;
@@ -10318,10 +11145,6 @@ enum mysql_protocol_type
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
-enum mysql_rpl_type
-{
- MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
-};
typedef struct character_set
{
unsigned int number;
@@ -10361,10 +11184,8 @@ typedef struct st_mysql
my_bool free_me;
my_bool reconnect;
char scramble[20 +1];
- my_bool rpl_pivot;
- struct st_mysql* master, *next_slave;
- struct st_mysql* last_used_slave;
- struct st_mysql* last_used_con;
+ my_bool unused1;
+ void *unused2, *unused3, *unused4, *unused5;
LIST *stmts;
const struct st_mysql_methods *methods;
void *thd;
@@ -10388,20 +11209,6 @@ typedef struct st_mysql_res {
my_bool unbuffered_fetch_cancelled;
void *extension;
} MYSQL_RES;
-typedef struct st_mysql_manager
-{
- NET net;
- char *host, *user, *passwd;
- char *net_buf, *net_buf_pos, *net_data_end;
- unsigned int port;
- int cmd_status;
- int last_errno;
- int net_buf_size;
- my_bool free_me;
- my_bool eof;
- char last_error[256];
- void *extension;
-} MYSQL_MANAGER;
typedef struct st_mysql_parameters
{
unsigned long *p_max_allowed_packet;
@@ -10454,14 +11261,6 @@ int mysql_real_query(MYSQL *mysql, const
unsigned long length);
MYSQL_RES * mysql_store_result(MYSQL *mysql);
MYSQL_RES * mysql_use_result(MYSQL *mysql);
-my_bool mysql_master_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool mysql_master_send_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool mysql_slave_query(MYSQL *mysql, const char *q,
- unsigned long length);
-my_bool mysql_slave_send_query(MYSQL *mysql, const char *q,
- unsigned long length);
void mysql_get_character_set_info(MYSQL *mysql,
MY_CHARSET_INFO *charset);
void
@@ -10476,22 +11275,6 @@ mysql_set_local_infile_handler(MYSQL *my
void *);
void
mysql_set_local_infile_default(MYSQL *mysql);
-void mysql_enable_rpl_parse(MYSQL* mysql);
-void mysql_disable_rpl_parse(MYSQL* mysql);
-int mysql_rpl_parse_enabled(MYSQL* mysql);
-void mysql_enable_reads_from_master(MYSQL* mysql);
-void mysql_disable_reads_from_master(MYSQL* mysql);
-my_bool mysql_reads_from_master_enabled(MYSQL* mysql);
-enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len);
-my_bool mysql_rpl_probe(MYSQL* mysql);
-int mysql_set_master(MYSQL* mysql, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd);
-int mysql_add_slave(MYSQL* mysql, const char* host,
- unsigned int port,
- const char* user,
- const char* passwd);
int mysql_shutdown(MYSQL *mysql,
enum mysql_enum_shutdown_level
shutdown_level);
@@ -10538,18 +11321,6 @@ void mysql_debug(const char *debug);
void myodbc_remove_escape(MYSQL *mysql,char *name);
unsigned int mysql_thread_safe(void);
my_bool mysql_embedded(void);
-MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con);
-MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con,
- const char* host,
- const char* user,
- const char* passwd,
- unsigned int port);
-void mysql_manager_close(MYSQL_MANAGER* con);
-int mysql_manager_command(MYSQL_MANAGER* con,
- const char* cmd, int cmd_len);
-int mysql_manager_fetch_line(MYSQL_MANAGER* con,
- char* res_buf,
- int res_buf_size);
my_bool mysql_read_query_result(MYSQL *mysql);
enum enum_mysql_stmt_state
{
@@ -10905,7 +11676,7 @@ my_bool grant_init();
void grant_free(void);
my_bool grant_reload(THD *thd);
In_C_you_should_use_my_bool_instead() check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
- uint show_command, uint number, In_C_you_should_use_my_bool_instead() dont_print_error);
+ In_C_you_should_use_my_bool_instead() show_command, uint number, In_C_you_should_use_my_bool_instead() dont_print_error);
In_C_you_should_use_my_bool_instead() check_grant_column (THD *thd, GRANT_INFO *grant,
const char *db_name, const char *table_name,
const char *name, uint length, Security_context *sctx);
@@ -10936,6 +11707,8 @@ int sp_grant_privileges(THD *thd, const
In_C_you_should_use_my_bool_instead() check_routine_level_acl(THD *thd, const char *db, const char *name,
In_C_you_should_use_my_bool_instead() is_proc);
In_C_you_should_use_my_bool_instead() is_acl_user(const char *host, const char *user);
+In_C_you_should_use_my_bool_instead() has_any_table_level_privileges(THD *thd, ulong required_access,
+ TABLE_LIST *tables);
#include "tztime.h"
class Time_zone: public Sql_alloc
{
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2008-08-26 15:01:13 +0000
+++ b/sql/mysqld.cc 2008-09-09 19:02:38 +0000
@@ -761,14 +761,12 @@ static char shutdown_event_name[40];
#include "nt_servc.h"
static NTService Service; ///< Service object for WinNT
#endif /* EMBEDDED_LIBRARY */
-#endif /* __WIN__ */
-#ifdef __NT__
static char pipe_name[512];
static SECURITY_ATTRIBUTES saPipeSecurity;
static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE;
-#endif
+#endif /* __WIN__ */
#ifndef EMBEDDED_LIBRARY
bool mysqld_embedded=0;
@@ -840,7 +838,7 @@ pthread_handler_t handle_connections_soc
pthread_handler_t kill_server_thread(void *arg);
static void bootstrap(FILE *file);
static bool read_init_file(char *file_name);
-#ifdef __NT__
+#ifdef _WIN32
pthread_handler_t handle_connections_namedpipes(void *arg);
#endif
#ifdef HAVE_SMEM
@@ -937,7 +935,7 @@ static void close_connections(void)
ip_sock= INVALID_SOCKET;
}
}
-#ifdef __NT__
+#ifdef _WIN32
if (hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe)
{
HANDLE temp;
@@ -1779,7 +1777,7 @@ static void network_init(void)
}
}
-#ifdef __NT__
+#ifdef _WIN32
/* create named pipe */
if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
opt_enable_named_pipe)
@@ -4281,12 +4279,12 @@ static void create_shutdown_thread()
#endif /* EMBEDDED_LIBRARY */
-#if (defined(__NT__) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY)
+#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY)
static void handle_connections_methods()
{
pthread_t hThread;
DBUG_ENTER("handle_connections_methods");
-#ifdef __NT__
+#ifdef _WIN32
if (hPipe == INVALID_HANDLE_VALUE &&
(!have_tcpip || opt_disable_networking) &&
!opt_enable_shared_memory)
@@ -4299,7 +4297,7 @@ static void handle_connections_methods()
pthread_mutex_lock(&LOCK_thread_count);
(void) pthread_cond_init(&COND_handler_count,NULL);
handler_count=0;
-#ifdef __NT__
+#ifdef _WIN32
if (hPipe != INVALID_HANDLE_VALUE)
{
handler_count++;
@@ -4310,7 +4308,7 @@ static void handle_connections_methods()
handler_count--;
}
}
-#endif /* __NT__ */
+#endif /* _WIN32 */
if (have_tcpip && !opt_disable_networking)
{
handler_count++;
@@ -4350,7 +4348,7 @@ void decrement_handler_count()
}
#else
#define decrement_handler_count()
-#endif /* defined(__NT__) || defined(HAVE_SMEM) */
+#endif /* defined(_WIN32) || defined(HAVE_SMEM) */
#ifndef EMBEDDED_LIBRARY
@@ -4590,7 +4588,7 @@ int main(int argc, char **argv)
pthread_cond_signal(&COND_server_started);
pthread_mutex_unlock(&LOCK_server_started);
-#if defined(__NT__) || defined(HAVE_SMEM)
+#if defined(_WIN32) || defined(HAVE_SMEM)
handle_connections_methods();
#else
#ifdef __WIN__
@@ -4601,7 +4599,7 @@ int main(int argc, char **argv)
}
#endif
handle_connections_sockets(0);
-#endif /* __NT__ */
+#endif /* _WIN32 || HAVE_SMEM */
/* (void) pthread_attr_destroy(&connection_attrib); */
@@ -5262,7 +5260,7 @@ pthread_handler_t handle_connections_soc
}
-#ifdef __NT__
+#ifdef _WIN32
pthread_handler_t handle_connections_namedpipes(void *arg)
{
HANDLE hConnectedPipe;
@@ -5342,7 +5340,7 @@ pthread_handler_t handle_connections_nam
decrement_handler_count();
DBUG_RETURN(0);
}
-#endif /* __NT__ */
+#endif /* _WIN32 */
#ifdef HAVE_SMEM
@@ -5931,7 +5929,7 @@ struct my_option my_long_options[] =
"Deprecated option, use --external-locking instead.",
(uchar**) &opt_external_locking, (uchar**) &opt_external_locking,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef __NT__
+#ifdef _WIN32
{"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).",
(uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
=== modified file 'sql/parse_file.cc'
--- a/sql/parse_file.cc 2008-04-09 01:07:00 +0000
+++ b/sql/parse_file.cc 2008-07-14 14:24:32 +0000
@@ -446,7 +446,7 @@ sql_parse_prepare(const LEX_STRING *file
DBUG_RETURN(0);
}
- if (!(parser->buff= (char*) alloc_root(mem_root, stat_info.st_size+1)))
+ if (!(parser->buff= (char*) alloc_root(mem_root, (size_t)(stat_info.st_size+1))))
{
DBUG_RETURN(0);
}
@@ -457,7 +457,7 @@ sql_parse_prepare(const LEX_STRING *file
}
if ((len= my_read(file, (uchar *)parser->buff,
- stat_info.st_size, MYF(MY_WME))) ==
+ (size_t)stat_info.st_size, MYF(MY_WME))) ==
MY_FILE_ERROR)
{
my_close(file, MYF(MY_WME));
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2008-09-09 12:48:29 +0000
+++ b/sql/set_var.cc 2008-09-11 08:01:28 +0000
@@ -230,6 +230,7 @@ static sys_var_long_ptr sys_concurrent_i
static sys_var_long_ptr sys_connect_timeout(&vars, "connect_timeout",
&connect_timeout);
static sys_var_const_str sys_datadir(&vars, "datadir", mysql_real_data_home);
+static sys_var_backup_wait_timeout sys_backup_wait_timeout(&vars, "backup_wait_timeout");
#ifndef DBUG_OFF
static sys_var_thd_dbug sys_dbug(&vars, "debug");
#endif
@@ -820,7 +821,7 @@ static SHOW_VAR fixed_vars[]= {
{"lower_case_file_system", (char*) &lower_case_file_system, SHOW_MY_BOOL},
{"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT},
{"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR},
-#ifdef __NT__
+#ifdef _WIN32
{"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL},
#endif
{"open_files_limit", (char*) &open_files_limit, SHOW_LONG},
@@ -2851,6 +2852,61 @@ bool sys_var_insert_id::update(THD *thd,
}
+/**
+ Get value.
+
+ Returns the value for the backup_wait_timeout session variable.
+
+ @param[IN] thd Thread object
+ @param[IN] type Type of variable
+ @param[IN] base Not used
+
+ @returns value of variable
+*/
+uchar *sys_var_backup_wait_timeout::value_ptr(THD *thd, enum_var_type type,
+ LEX_STRING *base)
+{
+ thd->sys_var_tmp.ulong_value= thd->backup_wait_timeout;
+ return (uchar*) &thd->sys_var_tmp.ulonglong_value;
+}
+
+
+/**
+ Update value.
+
+ Set the backup_wait_timeout variable.
+
+ @param[IN] thd Thread object
+ @param[IN] var Pointer to value from command.
+
+ @returns 0
+*/
+bool sys_var_backup_wait_timeout::update(THD *thd, set_var *var)
+{
+ if (var->save_result.ulong_value > (LONG_MAX/1000))
+ thd->backup_wait_timeout= LONG_MAX/1000;
+ else
+ thd->backup_wait_timeout= var->save_result.ulong_value;
+ return 0;
+}
+
+
+/**
+ Set default value.
+
+ Set the backup_wait_timeout variable to the default value.
+
+ @param[IN] thd Thread object
+ @param[IN] type Type of variable
+
+ @returns 0
+*/
+void sys_var_backup_wait_timeout::set_default(THD *thd, enum_var_type type)
+{
+ thd->backup_wait_timeout= BACKUP_WAIT_TIMEOUT_DEFAULT;
+}
+
+
uchar *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
=== modified file 'sql/set_var.h'
--- a/sql/set_var.h 2008-09-09 12:48:29 +0000
+++ b/sql/set_var.h 2008-09-10 12:50:02 +0000
@@ -655,6 +655,31 @@ public:
};
+/**
+ Backup_wait_timeout system variable class.
+
+ This class consolidates the mechanism to manage the backup_wait_timeout
+ system variable. It is a session only variable thus we check the type for
+ check_type() and check_default() to ensure it isn't accessed as a global.
+
+ A set_default() method is provided to allow the SET command :
+ SET backup_wait_TIMEOUT = DEFAULT;
+*/
+class sys_var_backup_wait_timeout :public sys_var
+{
+public:
+ sys_var_backup_wait_timeout(sys_var_chain *chain, const char *name_arg)
+ :sys_var(name_arg)
+ { chain_sys_var(chain); }
+ bool update(THD *thd, set_var *var);
+ bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
+ bool check_default(enum_var_type type) { return type == OPT_GLOBAL; }
+ SHOW_TYPE show_type() { return SHOW_LONG; }
+ uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
+ void set_default(THD *thd, enum_var_type type);
+};
+
+
class sys_var_insert_id :public sys_var
{
public:
=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt 2008-08-22 13:21:31 +0000
+++ b/sql/share/errmsg.txt 2008-08-27 13:03:26 +0000
@@ -6275,7 +6275,7 @@ ER_BACKUP_CANT_RESTORE_DB
ER_BACKUP_CANT_RESTORE_TABLE
eng "Could not restore table %-.64s"
ER_BACKUP_CANT_RESTORE_VIEW
- eng "Could not restore view %-.64s"
+ eng "Could not restore view %-.64s. Please check the view definition for possible missing dependencies."
ER_BACKUP_CANT_RESTORE_SROUT
eng "Could not restore stored routine %-.64s"
ER_BACKUP_CANT_RESTORE_EVENT
@@ -6374,3 +6374,17 @@ ER_BACKUP_RELEASE_NAME_LOCK_FAILED
eng "Restore failed to release the name locks on the tables."
ER_BACKUP_BACKUPDIR
eng "The path specified for the system variable backupdir cannot be accessed or is invalid. ref: %-.64s"
+ER_DDL_TIMEOUT
+ eng "The backup wait timeout has expired for query '%-64s'."
+ER_BACKUP_LIST_DB_PRIV
+ eng "Can't enumerate grants in database '%-.64s'."
+ER_BACKUP_CATALOG_ADD_PRIV
+ eng "Failed to add grant '%-.64s' to the catalog"
+ER_BACKUP_GET_META_PRIV
+ eng "Failed to obtain meta-data for grant '%-.64s'."
+ER_BACKUP_CANT_RESTORE_PRIV
+ eng "Could not execute grant '%-.64s'."
+ER_BACKUP_GRANT_SKIPPED
+ eng "The grant '%-.64s' was skipped because the user does not exist."
+ER_BACKUP_GRANT_WRONG_DB
+ eng "The grant '%-.64s' failed. Database not included in the backup image."
=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc 2008-08-11 10:41:41 +0000
+++ b/sql/si_objects.cc 2008-08-21 11:36:09 +0000
@@ -759,6 +759,123 @@ private:
String m_create_stmt;
};
+/**
+ @class DbGrantObj
+
+ This class provides an abstraction to database-level grants.
+ This class will permit the recording and replaying of these
+ grants.
+*/
+class DbGrantObj : public Obj
+{
+public:
+ DbGrantObj(const String *grantee,
+ const String *db_name,
+ const String *priv_type);
+
+public:
+ virtual bool materialize(uint serialization_version,
+ const String *serialization);
+
+ const String* get_name()
+ {
+ return &m_name;
+ }
+
+ const String *get_db_name()
+ {
+ return &m_db_name;
+ }
+
+ const String *get_priv_type()
+ {
+ return &m_priv_type;
+ }
+
+protected:
+ // These attributes are to be used only for serialization.
+ String m_db_name; ///< corresponds with TABLE_SCHEMA in IS tables.
+ String m_name; ///< name used to list in catalog.
+ String m_grantee; ///< corresponds with GRANTEE in IS tables.
+ String m_priv_type; ///< corresponds with PRIVILEGE_TYPE in IS tables.
+
+ bool drop(THD *thd) { return 0; }; // Drop not supported.
+ virtual bool do_execute(THD *thd);
+
+private:
+ virtual bool do_serialize(THD *thd, String *serialization);
+ // These attributes are to be used only for materialization.
+ String m_grant_stmt;
+};
+
+/**
+ @class TblGrantObj
+
+ This class provides an abstraction to table-level and routine-level grants.
+ This class will permit the recording and replaying of these
+ grants.
+*/
+class TblGrantObj : public DbGrantObj
+{
+public:
+ TblGrantObj(const String *grantee,
+ const String *db_name,
+ const String *table_name,
+ const String *priv_type);
+
+public:
+
+ const String *get_table_name()
+ {
+ return &m_table_name;
+ }
+
+protected:
+ // These attributes are to be used only for serialization.
+ String m_table_name; ///< corresponds with TABLE_NAME in IS tables.
+
+
+private:
+ virtual bool do_serialize(THD *thd, String *serialization);
+
+ // These attributes are to be used only for materialization.
+ String m_grant_stmt;
+};
+
+/**
+ @class ColGrantObj
+
+ This class provides an abstraction to column-level grants.
+ This class will permit the recording and replaying of these
+ grants.
+*/
+class ColGrantObj : public TblGrantObj
+{
+public:
+ ColGrantObj(const String *grantee,
+ const String *db_name,
+ const String *table_name,
+ const String *col_name,
+ const String *priv_type);
+
+public:
+
+ const String *get_col_name()
+ {
+ return &m_col_name;
+ }
+
+protected:
+ // These attributes are to be used only for serialization.
+ String m_col_name; ///< corresponds with COLUMN_NAME in IS tables.
+
+private:
+ virtual bool do_serialize(THD *thd, String *serialization);
+
+ // These attributes are to be used only for materialization.
+ String m_grant_stmt;
+};
+
///////////////////////////////////////////////////////////////////////////
//
@@ -797,9 +914,9 @@ public:
protected:
virtual Obj *create_obj(TABLE *t) = 0;
+ THD *m_thd;
private:
- THD *m_thd;
TABLE *m_is_table;
handler *m_ha;
my_bitmap_map *m_orig_columns;
@@ -938,6 +1055,67 @@ private:
String m_db_name;
};
+class DbGrantIterator : public InformationSchemaIterator
+{
+public:
+ DbGrantIterator(THD *thd,
+ const String *db_name,
+ TABLE *is_table,
+ handler *ha,
+ my_bitmap_map *orig_columns) :
+ InformationSchemaIterator(thd, is_table, ha, orig_columns)
+ {
+ m_db_name.copy(*db_name);
+ }
+
+protected:
+ virtual DbGrantObj *create_obj(TABLE *t);
+
+private:
+ String m_db_name;
+};
+
+class TblGrantIterator : public InformationSchemaIterator
+{
+public:
+ TblGrantIterator(THD *thd,
+ const String *db_name,
+ TABLE *is_table,
+ handler *ha,
+ my_bitmap_map *orig_columns) :
+ InformationSchemaIterator(thd, is_table, ha, orig_columns)
+ {
+ m_db_name.copy(*db_name);
+ }
+
+protected:
+ virtual TblGrantObj *create_obj(TABLE *t);
+
+private:
+ String m_db_name;
+};
+
+class ColGrantIterator : public InformationSchemaIterator
+{
+public:
+ ColGrantIterator(THD *thd,
+ const String *db_name,
+ TABLE *is_table,
+ handler *ha,
+ my_bitmap_map *orig_columns) :
+ InformationSchemaIterator(thd, is_table, ha, orig_columns)
+ {
+ m_db_name.copy(*db_name);
+ }
+
+protected:
+ virtual ColGrantObj *create_obj(TABLE *t);
+
+private:
+ String m_db_name;
+};
+
+
///////////////////////////////////////////////////////////////////////////
class DbStoredFuncIterator : public DbStoredProcIterator
@@ -1055,6 +1233,24 @@ bool InformationSchemaIterator::prepare_
*is_table= open_schema_table(thd, st, NULL);
break;
}
+ case SCH_SCHEMA_PRIVILEGES:
+ {
+ st= find_schema_table(thd, "SCHEMA_PRIVILEGES");
+ *is_table= open_schema_table(thd, st, NULL);
+ break;
+ }
+ case SCH_TABLE_PRIVILEGES:
+ {
+ st= find_schema_table(thd, "TABLE_PRIVILEGES");
+ *is_table= open_schema_table(thd, st, NULL);
+ break;
+ }
+ case SCH_COLUMN_PRIVILEGES:
+ {
+ st= find_schema_table(thd, "COLUMN_PRIVILEGES");
+ *is_table= open_schema_table(thd, st, NULL);
+ break;
+ }
default:
{
st= get_schema_table(is_table_idx);
@@ -1320,6 +1516,141 @@ EventObj *DbEventIterator::create_obj(TA
return new EventObj(&db_name, &event_name);
}
#endif
+
+///////////////////////////////////////////////////////////////////////////
+
+//
+// Implementation: DbGrantIterator class.
+//
+
+///////////////////////////////////////////////////////////////////////////
+
+DbGrantObj* DbGrantIterator::create_obj(TABLE *t)
+{
+ String grantee; // corresponds with GRANTEE
+ String db_name; // corresponds with TABLE_SCHEMA
+ String priv_type; // corresponds with PRIVILEGE_TYPE
+
+ t->field[0]->val_str(&grantee);
+ t->field[2]->val_str(&db_name);
+ t->field[3]->val_str(&priv_type);
+
+ /*
+ The fill method for SCHEMA_PRIVILEGES does not use the COND portion
+ of the generic fill() method. Thus, we have to do the restriction here.
+
+ Ensure the only rows sent back from iterator are the ones that match the
+ database specified.
+ */
+ if (db_name == m_db_name)
+ {
+ DBUG_PRINT("DbGrantIterator::create", (" Found grant %s %s %s",
+ db_name.ptr(), grantee.ptr(), priv_type.ptr()));
+
+ /*
+ Include grants for only users that exist at time of backup.
+ */
+ if (user_exists(m_thd, &grantee))
+ return new DbGrantObj(&grantee, &db_name, &priv_type);
+ else
+ return NULL;
+ }
+ else
+ return NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+//
+// Implementation: TblGrantIterator class.
+//
+
+///////////////////////////////////////////////////////////////////////////
+
+TblGrantObj* TblGrantIterator::create_obj(TABLE *t)
+{
+ String grantee; // corresponds with GRANTEE
+ String db_name; // corresponds with TABLE_SCHEMA
+ String tbl_name; // corresponds with TABLE_NAME
+ String priv_type; // corresponds with PRIVILEGE_TYPE
+
+ t->field[0]->val_str(&grantee);
+ t->field[2]->val_str(&db_name);
+ t->field[3]->val_str(&tbl_name);
+ t->field[4]->val_str(&priv_type);
+
+ /*
+ The fill method for TABLE_PRIVILEGES does not use the COND portion
+ of the generic fill() method. Thus, we have to do the restriction here.
+
+ Ensure the only rows sent back from iterator are the ones that match the
+ database specified.
+ */
+ if (db_name == m_db_name)
+ {
+ DBUG_PRINT("TblGrantIterator::create", (" Found grant %s %s %s %s",
+ db_name.ptr(), grantee.ptr(), tbl_name.ptr(), priv_type.ptr()));
+
+ /*
+ Include grants for only users that exist at time of backup.
+ */
+ if (user_exists(m_thd, &grantee))
+ return new TblGrantObj(&grantee, &db_name, &tbl_name, &priv_type);
+ else
+ return NULL;
+ }
+ else
+ return NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////
+
+//
+// Implementation: ColGrantIterator class.
+//
+
+///////////////////////////////////////////////////////////////////////////
+
+ColGrantObj* ColGrantIterator::create_obj(TABLE *t)
+{
+ String grantee; // corresponds with GRANTEE
+ String db_name; // corresponds with TABLE_SCHEMA
+ String tbl_name; // corresponds with TABLE_NAME
+ String col_name; // corresponds with COLUMN_NAME
+ String priv_type; // corresponds with PRIVILEGE_TYPE
+
+ t->field[0]->val_str(&grantee);
+ t->field[2]->val_str(&db_name);
+ t->field[3]->val_str(&tbl_name);
+ t->field[4]->val_str(&col_name);
+ t->field[5]->val_str(&priv_type);
+
+ /*
+ The fill method for COLUMN_PRIVILEGES does not use the COND portion
+ of the generic fill() method. Thus, we have to do the restriction here.
+
+ Ensure the only rows sent back from iterator are the ones that match the
+ database specified.
+ */
+ if (db_name == m_db_name)
+ {
+ DBUG_PRINT("ColGrantIterator::create", (" Found grant %s %s %s %s %s",
+ db_name.ptr(), grantee.ptr(), tbl_name.ptr(), col_name.ptr(),
+ priv_type.ptr()));
+
+ /*
+ Include grants for only users that exist at time of backup.
+ */
+ if (user_exists(m_thd, &grantee))
+ return new ColGrantObj(&grantee, &db_name, &tbl_name,
+ &col_name, &priv_type);
+ else
+ return NULL;
+ }
+ else
+ return NULL;
+}
+
///////////////////////////////////////////////////////////////////////////
//
@@ -1502,6 +1833,18 @@ DbEventIterator *
create_is_iterator<DbEventIterator>(THD *, enum_schema_tables, const String *);
#endif
+template
+DbGrantIterator *
+create_is_iterator<DbGrantIterator>(THD *, enum_schema_tables, const String *);
+
+template
+TblGrantIterator *
+create_is_iterator<TblGrantIterator>(THD *, enum_schema_tables, const String *);
+
+template
+ColGrantIterator *
+create_is_iterator<ColGrantIterator>(THD *, enum_schema_tables, const String *);
+
ObjIterator *get_db_tables(THD *thd, const String *db_name)
{
return create_is_iterator<DbTablesIterator>(thd, SCH_TABLES, db_name);
@@ -1536,6 +1879,56 @@ ObjIterator *get_db_events(THD *thd, con
#endif
}
+/**
+ GrantObjIterator constructor
+
+ This constructor initializes iterators for the grants supported.
+ These include database-, table- and routine-, and column-level grants.
+ The iterators return all of the grants for the database specified.
+*/
+GrantObjIterator::GrantObjIterator(THD *thd, const String *db_name)
+: ObjIterator()
+{
+ db_grants= create_is_iterator<DbGrantIterator>(thd,
+ SCH_SCHEMA_PRIVILEGES,
+ db_name);
+ tbl_grants= create_is_iterator<TblGrantIterator>(thd,
+ SCH_TABLE_PRIVILEGES,
+ db_name);
+ col_grants= create_is_iterator<ColGrantIterator>(thd,
+ SCH_COLUMN_PRIVILEGES,
+ db_name);
+}
+
+Obj *GrantObjIterator::next()
+{
+ Obj *obj= 0;
+ obj= db_grants->next();
+ if (!obj)
+ obj= tbl_grants->next();
+ if (!obj)
+ obj= col_grants->next();
+ return obj;
+}
+
+/**
+ Creates a high-level iterator that iterates over database-, table-,
+ routine-, and column-level privileges which shall permit a single
+ iterator from the si_objects to retrieve all of the privileges for
+ a given database.
+
+ @param[IN] thd Current THD object
+ @param[IN] db_name Name of database to get grants
+
+ @Note The client is responsible for destroying the returned iterator.
+
+ @return a pointer to an iterator object.
+ @retval NULL in case of error.
+*/
+ObjIterator *get_all_db_grants(THD *thd, const String *db_name)
+{
+ return new GrantObjIterator(thd, db_name);
+}
///////////////////////////////////////////////////////////////////////////
@@ -1607,7 +2000,7 @@ bool DatabaseObj::do_serialize(THD *thd,
if (check_db_dir_existence(m_db_name.c_ptr()))
{
my_error(ER_BAD_DB_ERROR, MYF(0), m_db_name.c_ptr());
- DBUG_RETURN(FALSE);
+ DBUG_RETURN(TRUE);
}
load_db_opt_by_name(thd, m_db_name.c_ptr(), &create);
@@ -1941,8 +2334,9 @@ bool TriggerObj::do_serialize(THD *thd,
alloc_mdl_locks(lst, thd->mem_root);
+ DBUG_EXECUTE_IF("backup_fail_add_trigger", DBUG_RETURN(TRUE););
if (open_tables(thd, &lst, &num_tables, 0))
- DBUG_RETURN(FALSE);
+ DBUG_RETURN(TRUE);
DBUG_ASSERT(num_tables == 1);
Table_triggers_list *triggers= lst->table->triggers;
@@ -2584,6 +2978,191 @@ bool TablespaceObj::do_execute(THD *thd)
}
///////////////////////////////////////////////////////////////////////////
+//
+// Implementation: DbGrantObj class.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+DbGrantObj::DbGrantObj(const String *grantee,
+ const String *db_name,
+ const String *priv_type)
+{
+ // copy strings to newly allocated memory
+ m_db_name.copy(*db_name);
+ m_grantee.copy(*grantee);
+ m_name.copy(*grantee);
+ m_priv_type.copy(*priv_type);
+}
+
+/**
+ Serialize the object.
+
+ This method produces the data necessary for materializing the object
+ on restore (creates object).
+
+ @param[in] thd Thread context.
+ @param[out] serialization The data needed to recreate this object.
+
+ @note this method will return an error if the db_name is either
+ mysql or information_schema as these are not objects that
+ should be recreated using this interface.
+
+ @returns Error status.
+ @retval FALSE on success
+ @retval TRUE on error
+*/
+bool DbGrantObj::do_serialize(THD *thd, String *serialization)
+{
+ DBUG_ENTER("DbGrantObj::do_serialize()");
+ serialization->length(0);
+ serialization->append("GRANT ");
+ serialization->append(m_priv_type);
+ serialization->append(" ON ");
+ serialization->append(m_db_name);
+ serialization->append(".* TO ");
+ serialization->append(m_grantee);
+ DBUG_RETURN(0);
+}
+
+/**
+ Materialize the serialization string.
+
+ This method saves serialization string into a member variable.
+
+ @param[in] serialization_version version number of this interface
+ @param[in] serialization the string from serialize()
+
+ @todo take serialization_version into account
+
+ @returns Error status.
+ @retval FALSE on success
+ @retval TRUE on error
+*/
+bool DbGrantObj::materialize(uint serialization_version,
+ const String *serialization)
+{
+ DBUG_ENTER("DbGrantObj::materialize()");
+ m_grant_stmt.copy(*serialization);
+ DBUG_RETURN(0);
+}
+
+/**
+ Create the object.
+
+ This method uses serialization string in a query and executes it.
+
+ @param[in] thd Thread context.
+
+ @returns Error status.
+ @retval FALSE on success
+ @retval TRUE on error
+*/
+bool DbGrantObj::do_execute(THD *thd)
+{
+ DBUG_ENTER("DbGrantObj::do_execute()");
+ DBUG_RETURN(execute_with_ctx(thd, &m_grant_stmt, true));
+}
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Implementation: TblGrantObj class.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+TblGrantObj::TblGrantObj(const String *grantee,
+ const String *db_name,
+ const String *table_name,
+ const String *priv_type)
+: DbGrantObj(grantee, db_name, priv_type)
+{
+ // copy strings to newly allocated memory
+ m_table_name.copy(*table_name);
+}
+
+/**
+ Serialize the object.
+
+ This method produces the data necessary for materializing the object
+ on restore (creates object).
+
+ @param[in] thd Thread context.
+ @param[out] serialization The data needed to recreate this object.
+
+ @note this method will return an error if the db_name is either
+ mysql or information_schema as these are not objects that
+ should be recreated using this interface.
+
+ @returns Error status.
+ @retval FALSE on success
+ @retval TRUE on error
+*/
+bool TblGrantObj::do_serialize(THD *thd, String *serialization)
+{
+ DBUG_ENTER("TblGrantObj::do_serialize()");
+ serialization->length(0);
+ serialization->append("GRANT ");
+ serialization->append(m_priv_type);
+ serialization->append(" ON ");
+ serialization->append(m_db_name);
+ serialization->append(".");
+ serialization->append(m_table_name);
+ serialization->append(" TO ");
+ serialization->append(m_grantee);
+ DBUG_RETURN(0);
+}
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Implementation: ColGrantObj class.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+ColGrantObj::ColGrantObj(const String *grantee,
+ const String *db_name,
+ const String *table_name,
+ const String *col_name,
+ const String *priv_type)
+: TblGrantObj(grantee, db_name, table_name, priv_type)
+{
+ // copy strings to newly allocated memory
+ m_col_name.copy(*col_name);
+}
+
+/**
+ Serialize the object.
+
+ This method produces the data necessary for materializing the object
+ on restore (creates object).
+
+ @param[in] thd Thread context.
+ @param[out] serialization The data needed to recreate this object.
+
+ @note this method will return an error if the db_name is either
+ mysql or information_schema as these are not objects that
+ should be recreated using this interface.
+
+ @returns Error status.
+ @retval FALSE on success
+ @retval TRUE on error
+*/
+bool ColGrantObj::do_serialize(THD *thd, String *serialization)
+{
+ DBUG_ENTER("ColGrantObj::do_serialize()");
+ serialization->length(0);
+ serialization->append("GRANT ");
+ serialization->append(m_priv_type);
+ serialization->append("(");
+ serialization->append(m_col_name);
+ serialization->append(") ON ");
+ serialization->append(m_db_name);
+ serialization->append(".");
+ serialization->append(m_table_name);
+ serialization->append(" TO ");
+ serialization->append(m_grantee);
+ DBUG_RETURN(0);
+}
+
+///////////////////////////////////////////////////////////////////////////
Obj *get_database(const String *db_name)
{
@@ -2721,6 +3300,33 @@ Obj *materialize_tablespace(const String
return obj;
}
+Obj *get_db_grant(const String *grantee,
+ const String *db_name)
+{
+ String priv_type;
+ priv_type.length(0);
+
+ return new DbGrantObj(grantee, db_name, &priv_type);
+}
+
+Obj *materialize_db_grant(const String *db_name,
+ const String *grantee,
+ uint serialization_version,
+ const String *serialization)
+{
+ /*
+ Here we create a grant for the purposes of applying the
+ grants. We use DbGrantObj for all types of grants because
+ we only have the GRANT statement in the serialization
+ string and therefore do not that the 'parts' to create
+ the specific types.
+ */
+ Obj *obj= get_db_grant(grantee, db_name);
+ obj->materialize(serialization_version, serialization);
+
+ return obj;
+}
+
///////////////////////////////////////////////////////////////////////////
bool is_internal_db_name(const String *db_name)
@@ -2744,6 +3350,90 @@ bool check_db_existence(const String *db
return check_db_dir_existence(((String *) db_name)->c_ptr_safe());
}
+/*
+ Splits grantee clause into user and host portions. Needed for checking
+ to see if user exists on system.
+*/
+int split_user_host(String *grantee, String *user, String *host)
+{
+ int len= 0;
+ int tics= 0;
+ char *ptr= 0;
+
+ /*
+ Since passwords are single byte characters and usernames can be multibyte
+ characters and the 0x40 = 64 = @ can occur in the username, we must search
+ for the first @ from the right.
+ */
+ len= grantee->length();
+ len--;
+ ptr= grantee->c_ptr() + len;
+ while ((len > 0) && (*ptr != '@'))
+ {
+ len--;
+ ptr= grantee->c_ptr() + len;
+ }
+
+ if (ptr == 0)
+ return -1;
+ len= ptr - grantee->c_ptr();
+ user->length(0);
+ char *cptr= grantee->c_ptr();
+
+ /*
+ String ' from strings.
+ */
+ if (strncmp(cptr, "'", 1) == 0)
+ {
+ cptr++;
+ len--;
+ tics++;
+ }
+ user->append(cptr, len - tics);
+ len= grantee->length() - len - 1 - tics;
+ host->length(0);
+
+ /*
+ String ' from strings.
+ */
+ cptr= ptr + 1;
+ tics= 0;
+ if (strncmp(cptr, "'", 1) == 0)
+ {
+ cptr++;
+ len--;
+ }
+ if (strncmp(cptr+len-1, "'", 1) == 0)
+ tics++;
+ host->append(cptr, len - tics);
+ return 0;
+}
+
+/*
+ Returns TRUE if user is defined on the system.
+*/
+bool user_exists(THD *thd, const String *grantee)
+{
+ String user;
+ String host;
+ bool user_exists= FALSE;
+
+ user.length(0);
+ host.length(0);
+ if (grantee)
+ {
+#ifndef EMBEDDED_LIBRARY
+ split_user_host((String *)grantee, &user, &host);
+ if (!user.ptr())
+ user.append("''");
+ user_exists= is_acl_user(host.ptr(), user.ptr());
+#else
+ user_exists= TRUE;
+#endif
+ }
+ return user_exists;
+}
+
/**
Locate the row in the information_schema view for this tablespace.
=== modified file 'sql/si_objects.h'
--- a/sql/si_objects.h 2008-07-05 08:41:26 +0000
+++ b/sql/si_objects.h 2008-08-20 13:23:10 +0000
@@ -115,6 +115,12 @@ private:
friend Obj *materialize_tablespace(const String *,
uint,
const String *);
+
+ friend Obj *materialize_db_grant(const String *,
+ const String *,
+ uint,
+ const String *);
+
};
@@ -222,6 +228,39 @@ public:
};
+/**
+ GrantObjIternator is an encapsulation of the three iterators for each level
+ of grant supported: database-, table- and routine-, and column-level.
+*/
+class GrantObjIterator : public ObjIterator
+{
+public:
+ GrantObjIterator(THD *thd, const String *db_name);
+
+ ~GrantObjIterator()
+ {
+ delete db_grants;
+ delete tbl_grants;
+ delete col_grants;
+ }
+
+ /**
+ This operation returns a pointer to the next object in an enumeration.
+ It returns NULL if there is no more objects.
+
+ The client is responsible to destroy the returned object.
+
+ @return a pointer to the object
+ @retval NULL if there is no more objects in an enumeration.
+ */
+ Obj *next();
+
+private:
+ ObjIterator *db_grants; ///< database-level grants
+ ObjIterator *tbl_grants; ///< table- and routine-level grants
+ ObjIterator *col_grants; ///< column-level grants
+};
+
///////////////////////////////////////////////////////////////////////////
// The functions in this section are intended to construct an instance of
@@ -429,6 +468,14 @@ ObjIterator *get_db_stored_functions(THD
ObjIterator *get_db_events(THD *thd, const String *db_name);
+/*
+ Creates a high-level iterator that iterates over database-, table-,
+ routine-, and column-level privileges which shall permit a single
+ iterator from the si_objects to retrieve all of the privileges for
+ a given database.
+*/
+ObjIterator *get_all_db_grants(THD *thd, const String *db_name);
+
///////////////////////////////////////////////////////////////////////////
// The functions are intended to enumerate dependent objects.
@@ -506,6 +553,11 @@ Obj *materialize_tablespace(const String
uint serialization_version,
const String *serialialization);
+Obj *materialize_db_grant(const String *grantee,
+ const String *db_name,
+ uint serialization_version,
+ const String *serialization);
+
///////////////////////////////////////////////////////////////////////////
bool is_internal_db_name(const String *db_name);
@@ -522,6 +574,11 @@ bool is_internal_db_name(const String *d
bool check_db_existence(const String *db_name);
/*
+ Returns TRUE if user is defined on the system.
+*/
+bool user_exists(THD *thd, const String *grantee);
+
+/*
This method returns a @c TablespaceObj object if the table has a tablespace.
*/
Obj *get_tablespace_for_table(THD *thd,
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2008-09-05 13:39:08 +0000
+++ b/sql/sql_class.cc 2008-09-10 12:50:02 +0000
@@ -537,6 +537,7 @@ THD::THD()
when the DDL blocker is engaged.
*/
DDL_exception(FALSE),
+ backup_wait_timeout(50),
#if defined(ENABLED_DEBUG_SYNC)
debug_sync_control(0),
#endif /* defined(ENABLED_DEBUG_SYNC) */
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2008-09-05 13:39:08 +0000
+++ b/sql/sql_class.h 2008-09-10 12:50:02 +0000
@@ -1936,6 +1936,7 @@ public:
when the DDL blocker is engaged.
*/
my_bool DDL_exception; // Allow some DDL if there is an exception
+ ulong backup_wait_timeout;
Locked_tables_list locked_tables_list;
=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc 2008-06-27 09:26:03 +0000
+++ b/sql/sql_connect.cc 2008-07-23 08:52:08 +0000
@@ -987,7 +987,7 @@ bool login_connection(THD *thd)
if (error)
{ // Wrong permissions
-#ifdef __NT__
+#ifdef _WIN32
if (vio_type(net->vio) == VIO_TYPE_NAMEDPIPE)
my_sleep(1000); /* must wait after eof() */
#endif
=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc 2008-09-08 10:03:52 +0000
+++ b/sql/sql_insert.cc 2008-09-12 08:58:52 +0000
@@ -1306,6 +1306,23 @@ bool mysql_prepare_insert(THD *thd, TABL
static int last_uniq_key(TABLE *table,uint keynr)
{
+ /*
+ When an underlying storage engine informs that the unique key
+ conflicts are not reported in the ascending order by setting
+ the HA_DUPLICATE_KEY_NOT_IN_ORDER flag, we cannot rely on this
+ information to determine the last key conflict.
+
+ The information about the last key conflict will be used to
+ do a replace of the new row on the conflicting row, rather
+ than doing a delete (of old row) + insert (of new row).
+
+ Hence check for this flag and disable replacing the last row
+ by returning 0 always. Returning 0 will result in doing
+ a delete + insert always.
+ */
+ if (table->file->ha_table_flags() & HA_DUPLICATE_KEY_NOT_IN_ORDER)
+ return 0;
+
while (++keynr < table->s->keys)
if (table->key_info[keynr].flags & HA_NOSAME)
return 0;
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2008-09-10 08:38:07 +0000
+++ b/sql/sql_parse.cc 2008-09-10 12:50:02 +0000
@@ -2484,7 +2484,11 @@ mysql_execute_command(THD *thd)
TABLE in the same way. That way we avoid that a new table is
created during a gobal read lock.
*/
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ {
+ res= 1;
+ goto ddl_blocker_err;
+ }
if (!thd->locked_tables_mode &&
!(need_start_waiting= !wait_if_global_read_lock(thd, 0, 1)))
{
@@ -2610,6 +2614,7 @@ mysql_execute_command(THD *thd)
/* put tables back for PS rexecuting */
end_with_restore_list:
DDL_blocker->end_DDL();
+ddl_blocker_err:
lex->link_first_table_back(create_table, link_to_local);
break;
}
@@ -2625,7 +2630,8 @@ end_with_restore_list:
table without having to do a full rebuild.
*/
{
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
/* Prepare stack copies to be re-execution safe */
HA_CREATE_INFO create_info;
Alter_info alter_info(lex->alter_info, thd->mem_root);
@@ -2693,7 +2699,8 @@ end_with_restore_list:
case SQLCOM_ALTER_TABLE:
{
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
ulong priv=0;
ulong priv_needed= ALTER_ACL;
@@ -2805,7 +2812,8 @@ end_with_restore_list:
goto error;
}
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
if (mysql_rename_tables(thd, first_table, 0))
{
DDL_blocker->end_DDL();
@@ -2905,7 +2913,8 @@ end_with_restore_list:
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, all_tables, FALSE, FALSE, UINT_MAX))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
res= mysql_repair_table(thd, first_table, &lex->check_opt);
DDL_blocker->end_DDL();
/* ! we write after unlocking the table */
@@ -2957,7 +2966,8 @@ end_with_restore_list:
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, all_tables, FALSE, FALSE, UINT_MAX))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ?
mysql_recreate_table(thd, first_table) :
mysql_optimize_table(thd, first_table, &lex->check_opt);
@@ -3198,7 +3208,8 @@ end_with_restore_list:
goto error;
}
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
res= mysql_truncate(thd, first_table, 0);
DDL_blocker->end_DDL();
@@ -3301,7 +3312,8 @@ end_with_restore_list:
/* So that DROP TEMPORARY TABLE gets to binlog at commit/rollback */
thd->options|= OPTION_KEEP_LOG;
}
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
/* DDL and binlog write order protected by LOCK_open */
res= mysql_rm_table(thd, first_table, lex->drop_if_exists,
lex->drop_temporary);
@@ -3547,7 +3559,8 @@ end_with_restore_list:
if (check_access(thd,CREATE_ACL,lex->name.str, 0, 1, 0,
is_schema_db(lex->name.str)))
break;
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
res= mysql_create_db(thd,(lower_case_table_names == 2 ? alias :
lex->name.str), &create_info, 0);
DDL_blocker->end_DDL();
@@ -3585,7 +3598,8 @@ end_with_restore_list:
ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
goto error;
}
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
res= mysql_rm_db(thd, lex->name.str, lex->drop_if_exists, 0);
DDL_blocker->end_DDL();
break;
@@ -3623,7 +3637,8 @@ end_with_restore_list:
goto error;
}
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
res= mysql_upgrade_db(thd, db);
DDL_blocker->end_DDL();
if (!res)
@@ -3663,7 +3678,8 @@ end_with_restore_list:
ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
goto error;
}
- DDL_blocker->check_DDL_blocker(thd);
+ if (!DDL_blocker->check_DDL_blocker(thd))
+ goto error;
res= mysql_alter_db(thd, db->str, &create_info);
DDL_blocker->end_DDL();
break;
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2008-08-21 23:38:19 +0000
+++ b/sql/sql_show.cc 2008-09-08 11:31:03 +0000
@@ -6329,8 +6329,9 @@ static my_bool run_hton_fill_schema_file
struct run_hton_fill_schema_files_args *args=
(run_hton_fill_schema_files_args *) arg;
handlerton *hton= plugin_data(plugin, handlerton *);
- if(hton->fill_files_table && hton->state == SHOW_OPTION_YES)
- hton->fill_files_table(hton, thd, args->tables, args->cond);
+ if(hton->fill_is_table && hton->state == SHOW_OPTION_YES)
+ hton->fill_is_table(hton, thd, args->tables, args->cond,
+ get_schema_table_idx(args->tables->schema_table));
return false;
}
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2008-09-04 08:47:10 +0000
+++ b/sql/sql_table.cc 2008-09-05 11:51:40 +0000
@@ -5905,6 +5905,35 @@ mysql_fast_or_online_alter_table(THD *th
/**
+ maximum possible length for certain blob types.
+
+ @param[in] type Blob type (e.g. MYSQL_TYPE_TINY_BLOB)
+
+ @return
+ length
+*/
+
+static uint
+blob_length_by_type(enum_field_types type)
+{
+ switch (type)
+ {
+ case MYSQL_TYPE_TINY_BLOB:
+ return 255;
+ case MYSQL_TYPE_BLOB:
+ return 65535;
+ case MYSQL_TYPE_MEDIUM_BLOB:
+ return 16777215;
+ case MYSQL_TYPE_LONG_BLOB:
+ return 4294967295U;
+ default:
+ DBUG_ASSERT(0); // we should never go here
+ return 0;
+ }
+}
+
+
+/**
Prepare column and key definitions for CREATE TABLE in ALTER TABLE.
This function transforms parse output of ALTER TABLE - lists of
@@ -6209,6 +6238,14 @@ mysql_prepare_alter_table(THD *thd, TABL
BLOBs may have cfield->length == 0, which is why we test it before
checking whether cfield->length < key_part_length (in chars).
+
+ In case of TEXTs we check the data type maximum length *in bytes*
+ to key part length measured *in characters* (i.e. key_part_length
+ devided to mbmaxlen). This is because it's OK to have:
+ CREATE TABLE t1 (a tinytext, key(a(254)) character set utf8);
+ In case of this example:
+ - data type maximum length is 255.
+ - key_part_length is 1016 (=254*4, where 4 is mbmaxlen)
*/
if (!Field::type_can_have_key_part(cfield->field->type()) ||
!Field::type_can_have_key_part(cfield->sql_type) ||
@@ -6216,8 +6253,11 @@ mysql_prepare_alter_table(THD *thd, TABL
(key_info->flags & HA_SPATIAL) ||
(cfield->field->field_length == key_part_length &&
!f_is_blob(key_part->key_type)) ||
- (cfield->length && (cfield->length < key_part_length /
- key_part->field->charset()->mbmaxlen)))
+ (cfield->length && (((cfield->sql_type >= MYSQL_TYPE_TINY_BLOB &&
+ cfield->sql_type <= MYSQL_TYPE_BLOB) ?
+ blob_length_by_type(cfield->sql_type) :
+ cfield->length) <
+ key_part_length / key_part->field->charset()->mbmaxlen)))
key_part_length= 0; // Use whole field
}
key_part_length /= key_part->field->charset()->mbmaxlen;
=== modified file 'sql/table.h'
--- a/sql/table.h 2008-09-08 08:52:36 +0000
+++ b/sql/table.h 2008-09-12 08:58:52 +0000
@@ -872,50 +872,6 @@ typedef struct st_foreign_key_info
List<LEX_STRING> referenced_fields;
} FOREIGN_KEY_INFO;
-/*
- Make sure that the order of schema_tables and enum_schema_tables are the same.
-*/
-
-enum enum_schema_tables
-{
- SCH_CHARSETS= 0,
- SCH_COLLATIONS,
- SCH_COLLATION_CHARACTER_SET_APPLICABILITY,
- SCH_COLUMNS,
- SCH_COLUMN_PRIVILEGES,
- SCH_ENGINES,
- SCH_EVENTS,
- SCH_FILES,
- SCH_GLOBAL_STATUS,
- SCH_GLOBAL_VARIABLES,
- SCH_KEY_COLUMN_USAGE,
- SCH_OPEN_TABLES,
- SCH_PARAMETERS,
- SCH_PARTITIONS,
- SCH_PLUGINS,
- SCH_PROCESSLIST,
- SCH_PROFILES,
- SCH_REFERENTIAL_CONSTRAINTS,
- SCH_PROCEDURES,
- SCH_SCHEMATA,
- SCH_SCHEMA_PRIVILEGES,
- SCH_SESSION_STATUS,
- SCH_SESSION_VARIABLES,
- SCH_STATISTICS,
- SCH_STATUS,
- SCH_TABLES,
- SCH_TABLE_CONSTRAINTS,
- SCH_TABLE_NAMES,
- SCH_TABLE_PRIVILEGES,
- SCH_TRIGGERS,
- SCH_USER_PRIVILEGES,
- SCH_VARIABLES,
- SCH_VIEWS,
- SCH_FALCON_TABLESPACES,
- SCH_FALCON_TABLESPACE_FILES
-};
-
-
#define MY_I_S_MAYBE_NULL 1
#define MY_I_S_UNSIGNED 2
=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc 2008-06-05 16:11:22 +0000
+++ b/storage/archive/ha_archive.cc 2008-07-23 08:52:08 +0000
@@ -655,10 +655,10 @@ int ha_archive::create(const char *name,
{
if (!my_fstat(frm_file, &file_stat, MYF(MY_WME)))
{
- frm_ptr= (uchar *)my_malloc(sizeof(uchar) * file_stat.st_size, MYF(0));
+ frm_ptr= (uchar *)my_malloc(sizeof(uchar) * (size_t)file_stat.st_size, MYF(0));
if (frm_ptr)
{
- my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0));
+ my_read(frm_file, frm_ptr, (size_t)file_stat.st_size, MYF(0));
azwrite_frm(&create_stream, (char *)frm_ptr, file_stat.st_size);
my_free((uchar*)frm_ptr, MYF(0));
}
=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc 2008-08-15 18:34:18 +0000
+++ b/storage/csv/ha_tina.cc 2008-08-23 00:18:35 +0000
@@ -177,7 +177,7 @@ static TINA_SHARE *get_share(const char
if (my_stat(share->data_file_name, &file_stat, MYF(MY_WME)) == NULL)
goto error;
- share->saved_data_file_length= file_stat.st_size;
+ share->saved_data_file_length= (off_t)file_stat.st_size;
if (my_hash_insert(&tina_open_tables, (uchar*) share))
goto error;
=== modified file 'storage/falcon/Interlock.h'
--- a/storage/falcon/Interlock.h 2008-08-21 11:23:44 +0000
+++ b/storage/falcon/Interlock.h 2008-09-09 19:02:38 +0000
@@ -32,50 +32,50 @@ extern "C" char compareswapptr(volatile
#define INTERLOCKED_ADD(ptr, value) interlockedAdd(ptr, value)
#ifdef _WIN32
+#include <windows.h>
#define COMPARE_EXCHANGE(target,compare,exchange)\
(InterlockedCompareExchange(target,exchange,compare)==compare)
-#ifdef _WIN64
-#include <intrin.h>
#define COMPARE_EXCHANGE_POINTER(target,compare,exchange)\
(InterlockedCompareExchangePointer((void *volatile*) target,(void*)exchange,(void*)compare)==(void*)compare)
-#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
-void* _InterlockedCompareExchangePointer(void *volatile *Destination, void *Exchange, void *Comperand);
-#else /* _WIN64 */
-#define COMPARE_EXCHANGE_POINTER(target,compare,exchange)\
- (InterlockedCompareExchange((volatile long*) target,(long)exchange,(long)compare)==(long)compare)
-#endif /* _WIN64 */
-
-#define InterlockedIncrement _InterlockedIncrement
-#define InterlockedDecrement _InterlockedDecrement
-#define InterlockedExchange _InterlockedExchange
-#define InterlockedExchangeAdd _InterlockedExchangeAdd
-
-#define InterlockedCompareExchange _InterlockedCompareExchange
-
-#ifndef InterlockedCompareExchangePointer
-//#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
-#endif /* InterlockedCompareExchangePointer */
-
-#ifndef __MACHINEX64
-extern "C"
+/*
+ x86 compilers (both VS2003 or VS2005) never use instrinsics, but generate
+ function calls to kernel32 instead, even in the optimized build.
+ We force intrinsics as described in MSDN documentation for
+ _InterlockedCompareExchange.
+ x64 on the other hand, always uses intrinsic version, even in debug build
+*/
+#ifdef _M_IX86
+#if (_MSC_VER >= 1400)
+#include <intrin.h>
+#else
+/* Visual Studio 2003 and earlier do not have prototypes for atomic intrinsics */
+extern "C"
{
- long InterlockedIncrement(long* lpAddend);
- long InterlockedDecrement(long* lpAddend);
- long InterlockedExchange(long* volatile addend, long value);
- long InterlockedExchangeAdd(long* volatile addend, long value);
- long InterlockedCompareExchange(volatile long *Destination, long Exchange, long Comperand);
- //void* InterlockedCompareExchangePointer(void *volatile* *Destination, void *Exchange, void *Comperand);
+ long _InterlockedIncrement(long volatile *Addend);
+ long _InterlockedDecrement(long volatile *Addend);
+ long _InterlockedExchangeAdd(long volatile *Addend, long Value);
+ long _InterlockedExchange(long volatile *Target,long Value);
+ long _InterlockedCompareExchange (long volatile *Target, long Value, long Comp);
}
-#endif /* __MACHINEX64 */
-
#pragma intrinsic(_InterlockedIncrement)
#pragma intrinsic(_InterlockedDecrement)
#pragma intrinsic(_InterlockedExchange)
#pragma intrinsic(_InterlockedExchangeAdd)
#pragma intrinsic(_InterlockedCompareExchange)
-//#pragma intrinsic(_InterlockedCompareExchangePointer)
+#endif /* _MSC_VER */
+
+#define InterlockedIncrement _InterlockedIncrement
+#define InterlockedDecrement _InterlockedDecrement
+#define InterlockedExchangeAdd _InterlockedExchangeAdd
+#define InterlockedExchange _InterlockedExchange
+#define InterlockedCompareExchange _InterlockedCompareExchange
+/*
+ No need to handle InterlockedCompareExchangePointer
+ it is a defined as InterlockedCompareExchange.
+*/
+#endif /*_M_IX86*/
#else /* _WIN32 */
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2008-08-21 23:38:19 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2008-08-23 00:18:35 +0000
@@ -882,7 +882,29 @@ innobase_mysql_tmpfile(void)
will be passed to fdopen(), it will be closed by invoking
fclose(), which in turn will invoke close() instead of
my_close(). */
+
+#ifdef _WIN32
+ /* Note that on Windows, the integer returned by mysql_tmpfile
+ has no relation to C runtime file descriptor. Here, we need
+ to call my_get_osfhandle to get the HANDLE and then convert it
+ to C runtime filedescriptor. */
+ {
+ HANDLE hFile = my_get_osfhandle(fd);
+ HANDLE hDup;
+ BOOL bOK =
+ DuplicateHandle(GetCurrentProcess(), hFile, GetCurrentProcess(),
+ &hDup, 0, FALSE, DUPLICATE_SAME_ACCESS);
+ if(bOK) {
+ fd2 = _open_osfhandle((intptr_t)hDup,0);
+ }
+ else {
+ my_osmaperr(GetLastError());
+ fd2 = -1;
+ }
+ }
+#else
fd2 = dup(fd);
+#endif
if (fd2 < 0) {
DBUG_PRINT("error",("Got error %d on dup",fd2));
my_errno=errno;
=== modified file 'storage/maria/CMakeLists.txt'
--- a/storage/maria/CMakeLists.txt 2008-08-26 18:57:58 +0000
+++ b/storage/maria/CMakeLists.txt 2008-09-09 19:02:38 +0000
@@ -49,7 +49,7 @@ SET(MARIA_SOURCES ma_init.c ma_open.c ma
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(maria ${MARIA_SOURCES})
- ADD_DEPENDENCIES(ha_falcon GenError)
+ ADD_DEPENDENCIES(ha_falcon maria GenError)
ADD_EXECUTABLE(maria_ftdump maria_ftdump.c)
TARGET_LINK_LIBRARIES(maria_ftdump maria myisam mysys dbug strings zlib wsock32)
=== modified file 'storage/myisam/mi_locking.c'
--- a/storage/myisam/mi_locking.c 2008-07-23 12:46:33 +0000
+++ b/storage/myisam/mi_locking.c 2008-09-09 19:02:38 +0000
@@ -227,7 +227,7 @@ int mi_lock_database(MI_INFO *info, int
break; /* Impossible */
}
}
-#ifdef __WIN__
+#ifdef _WIN32
else
{
/*
@@ -461,11 +461,11 @@ int _mi_writeinfo(register MI_INFO *info
share->state.update_count= info->last_loop= ++info->this_loop;
if ((error= mi_state_info_write(share, share->kfile, &share->state, 1)))
olderror=my_errno;
-#ifdef __WIN__
+#ifdef _WIN32
if (myisam_flush)
{
- _commit(share->kfile);
- _commit(info->dfile);
+ my_sync(share->kfile,0);
+ my_sync(info->dfile,0);
}
#endif
}
=== modified file 'storage/myisam/myisam_ftdump.c'
--- a/storage/myisam/myisam_ftdump.c 2008-05-09 10:27:23 +0000
+++ b/storage/myisam/myisam_ftdump.c 2008-07-23 08:52:08 +0000
@@ -50,7 +50,6 @@ static struct my_option my_long_options[
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
-
int main(int argc,char *argv[])
{
int error=0, subkeys;
@@ -63,6 +62,7 @@ int main(int argc,char *argv[])
struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
MY_INIT(argv[0]);
+
if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(error);
if (count || dump)
=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh 2008-05-29 15:44:11 +0000
+++ b/support-files/mysql.spec.sh 2008-09-11 08:01:28 +0000
@@ -37,11 +37,6 @@
%{?_with_cluster:%define CLUSTER_BUILD 1}
%{!?_with_cluster:%define CLUSTER_BUILD 0}
-# use "rpmbuild --with federated" or "rpm --define '_with_federated 1'" (for RPM 3.x)
-# to build with federated support (off by default)
-%{?_with_federated:%define FEDERATED_BUILD 1}
-%{!?_with_federated:%define FEDERATED_BUILD 0}
-
%if %{STATIC_BUILD}
%define release 0
%else
@@ -347,11 +342,7 @@ BuildMySQL "--enable-shared \
--with-archive-storage-engine \
--with-csv-storage-engine \
--with-blackhole-storage-engine \
-%if %{FEDERATED_BUILD}
--with-federated-storage-engine \
-%else
- --without-federated-storage-engine \
-%endif
%ifarch i386 x86_64
--with-falcon \
%else
@@ -392,11 +383,7 @@ BuildMySQL "--enable-shared \
--with-archive-storage-engine \
--with-csv-storage-engine \
--with-blackhole-storage-engine \
-%if %{FEDERATED_BUILD}
--with-federated-storage-engine \
-%else
- --without-federated-storage-engine \
-%endif
%ifarch i386 x86_64
--with-falcon \
%else
@@ -468,6 +455,9 @@ install -m 755 $MBD/support-files/mysql.
# Install embedded server library in the build root
install -m 644 $MBD/libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
+# in RPMs, it is unlikely that anybody should use "sql-bench"
+rm -fr $RBR%{_datadir}/sql-bench
+
# Create a symlink "rcmysql", pointing to the init.script. SuSE users
# will appreciate that, as all services usually offer this.
ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql
@@ -657,6 +647,7 @@ fi
%doc %attr(644, root, root) %{_infodir}/mysql.info*
+%doc %attr(644, root, man) %{_mandir}/man1/innochecksum.1*
%doc %attr(644, root, man) %{_mandir}/man1/my_print_defaults.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisam_ftdump.1*
%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
@@ -674,11 +665,13 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/mysqltest.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_tzinfo_to_sql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqlbug.1*
%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
+%attr(755, root, root) %{_bindir}/innochecksum
%attr(755, root, root) %{_bindir}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisam_ftdump
%attr(755, root, root) %{_bindir}/myisamchk
@@ -718,6 +711,7 @@ fi
%attr(755, root, root) %{_bindir}/msql2mysql
%attr(755, root, root) %{_bindir}/mysql
%attr(755, root, root) %{_bindir}/mysql_find_rows
+%attr(755, root, root) %{_bindir}/mysql_upgrade_shell
%attr(755, root, root) %{_bindir}/mysql_waitpid
%attr(755, root, root) %{_bindir}/mysqlaccess
%attr(755, root, root) %{_bindir}/mysqladmin
@@ -730,6 +724,7 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_find_rows.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1*
@@ -775,6 +770,8 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/ndb_config.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_desc.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_error_reporter.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_mgm.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_restore.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_backup_file.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_schema_file.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_print_sys_file.1*
@@ -786,13 +783,14 @@ fi
%files ndb-extra
%defattr(-,root,root,0755)
-%attr(755, root, root) %{_sbindir}/ndb_cpcd
%attr(755, root, root) %{_bindir}/ndb_delete_all
%attr(755, root, root) %{_bindir}/ndb_drop_index
%attr(755, root, root) %{_bindir}/ndb_drop_table
+%attr(755, root, root) %{_sbindir}/ndb_cpcd
%doc %attr(644, root, man) %{_mandir}/man1/ndb_delete_all.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_index.1*
%doc %attr(644, root, man) %{_mandir}/man1/ndb_drop_table.1*
+%doc %attr(644, root, man) %{_mandir}/man1/ndb_cpcd.1*
%endif
%files devel
@@ -803,6 +801,7 @@ fi
%dir %attr(755, root, root) %{_includedir}/mysql
%dir %attr(755, root, root) %{_libdir}/mysql
%{_includedir}/mysql/*
+%{_datadir}/aclocal/mysql.m4
%{_libdir}/mysql/libdbug.a
%{_libdir}/mysql/libheap.a
%if %{have_libgcc}
@@ -852,6 +851,24 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Fri Aug 29 2008 Kent Boortz <kent@stripped>
+
+- Removed the "Federated" storage engine option, and enabled in all
+
+* Tue Aug 26 2008 Joerg Bruehe <joerg@stripped>
+
+- Get rid of the "warning: Installed (but unpackaged) file(s) found:"
+ Some generated files aren't needed in RPMs:
+ - the "sql-bench/" subdirectory
+ Some files were missing:
+ - /usr/share/aclocal/mysql.m4 ("devel" subpackage)
+ - Manual "mysqlbug" ("server" subpackage)
+ - Program "innochecksum" and its manual ("server" subpackage)
+ - Manual "mysql_find_rows" ("client" subpackage)
+ - Script "mysql_upgrade_shell" ("client" subpackage)
+ - Program "ndb_cpcd" and its manual ("ndb-extra" subpackage)
+ - Manuals "ndb_mgm" + "ndb_restore" ("ndb-tools" subpackage)
+
* Mon Mar 31 2008 Kent Boortz <kent@stripped>
- Made the "Federated" storage engine an option
=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c 2008-05-14 13:33:43 +0000
+++ b/vio/viosocket.c 2008-06-05 20:44:29 +0000
@@ -261,17 +261,17 @@ int vio_close(Vio * vio)
{
int r=0;
DBUG_ENTER("vio_close");
-#ifdef __WIN__
+#ifdef _WIN32
if (vio->type == VIO_TYPE_NAMEDPIPE)
{
-#if defined(__NT__) && defined(MYSQL_SERVER)
+#ifdef MYSQL_SERVER
CancelIo(vio->hPipe);
DisconnectNamedPipe(vio->hPipe);
#endif
r=CloseHandle(vio->hPipe);
}
else
-#endif /* __WIN__ */
+#endif /* _WIN32 */
if (vio->type != VIO_CLOSED)
{
DBUG_ASSERT(vio->sd >= 0);
@@ -493,7 +493,7 @@ int vio_close_pipe(Vio * vio)
{
int r;
DBUG_ENTER("vio_close_pipe");
-#if defined(__NT__) && defined(MYSQL_SERVER)
+#ifdef MYSQL_SERVER
CancelIo(vio->hPipe);
DisconnectNamedPipe(vio->hPipe);
#endif
=== modified file 'win/README'
--- a/win/README 2007-09-20 15:44:25 +0000
+++ b/win/README 2008-04-03 15:39:47 +0000
@@ -60,7 +60,6 @@ The options right now are:
WITH_EXAMPLE_STORAGE_ENGINE
WITH_FALCON_STORAGE_ENGINE
WITH_FEDERATED_STORAGE_ENGINE
- __NT__ Enable named pipe support
MYSQL_SERVER_SUFFIX=<suffix> Server suffix, default none
COMPILATION_COMMENT=<comment> Server comment, default "Source distribution"
MYSQL_TCP_PORT=<port> Server port, default 3306
=== added file 'win/build-vs9.bat.moved'
--- a/win/build-vs9.bat.moved 1970-01-01 00:00:00 +0000
+++ b/win/build-vs9.bat.moved 2008-09-12 08:58:52 +0000
@@ -0,0 +1,18 @@
+@echo off
+
+REM Copyright (C) 2006 MySQL AB
+REM
+REM This program is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU General Public License as published by
+REM the Free Software Foundation; version 2 of the License.
+REM
+REM This program is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+REM GNU General Public License for more details.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with this program; if not, write to the Free Software
+REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+cmake -G "Visual Studio 9 2008"
+
=== added file 'win/build-vs9_x64.bat.moved'
--- a/win/build-vs9_x64.bat.moved 1970-01-01 00:00:00 +0000
+++ b/win/build-vs9_x64.bat.moved 2008-09-12 08:58:52 +0000
@@ -0,0 +1,18 @@
+@echo off
+
+REM Copyright (C) 2006 MySQL AB
+REM
+REM This program is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU General Public License as published by
+REM the Free Software Foundation; version 2 of the License.
+REM
+REM This program is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+REM GNU General Public License for more details.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with this program; if not, write to the Free Software
+REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+cmake -G "Visual Studio 9 2008 Win64"
+
=== modified file 'win/create_manifest.js'
--- a/win/create_manifest.js 2007-07-25 17:18:12 +0000
+++ b/win/create_manifest.js 2008-08-29 15:30:41 +0000
@@ -31,7 +31,17 @@ try
var end= supp_version.indexOf("-");
if (end == -1) end= supp_version.length;
var app_version= supp_version.substring(0, end);
- app_version+= ".0";
+ var fourth_element= 0;
+ if(app_version.match(/[a-z]$/)) {
+ fourth_element+= (1 + app_version.charCodeAt(end-1) - "a".charCodeAt(0));
+ app_version= app_version.substring(0,--end);
+ }
+ if(app_version.match(/sp[1-9]$/)) {
+ fourth_element+= 100*(app_version.charCodeAt(end-1) - "0".charCodeAt(0));
+ app_version= app_version.substring(0, end-3);
+ end-= 3;
+ }
+ app_version+= "." + fourth_element;
break;
case "arch":
var app_arch= parts[1];
=== modified file 'zlib/gzio.c'
--- a/zlib/gzio.c 2006-01-12 14:32:39 +0000
+++ b/zlib/gzio.c 2008-08-25 17:14:21 +0000
@@ -7,10 +7,10 @@
/* @(#) $Id$ */
-#include "zutil.h"
-
#include <stdio.h>
+#include "zutil.h"
+
#ifdef NO_DEFLATE /* for compatibility with old definition */
# define NO_GZCOMPRESS
#endif
Thread |
---|
• bzr push into mysql-6.0 branch (kgeorge:2829 to 2835) Bug#38342 | Georgi Kodinov | 15 Sep |