1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-08 17:02:21 +03:00

Merge mysql.com:/home/pz/mysql/mysql-4.1-root

into mysql.com:/home/pz/mysql/mysql-4.1


BitKeeper/etc/logging_ok:
  auto-union
include/mysql_com.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
This commit is contained in:
unknown
2002-10-27 13:13:31 +03:00
115 changed files with 985 additions and 642 deletions

View File

@ -505,3 +505,11 @@ vio/test-sslserver
vio/viotest-ssl vio/viotest-ssl
sql_error.cc sql_error.cc
sql_prepare.cc sql_prepare.cc
autom4te.cache/*
innobase/autom4te.cache/*
configure.lineno
innobase/configure.lineno
innobase/stamp-h1
myisam/rt_test.MYD
myisam/rt_test.MYI
stamp-h1

View File

@ -199,7 +199,9 @@ BK|sql-bench/Results/ATIS-mysql-3.21-Linux_2.2.1_i686|19700101030959|02022|660fb
BK|sql-bench/Results/ATIS-mysql-Linux_2.2.10_i686|19700101030959|02025|3fa4d167cceff7e8 BK|sql-bench/Results/ATIS-mysql-Linux_2.2.10_i686|19700101030959|02025|3fa4d167cceff7e8
BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02312|84ca3b85ff306133 BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02312|84ca3b85ff306133
BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_i686_xeon|19700101030959|02044|3e820c28bf4af63a BK|sql-bench/Results/ATIS-mysql-Linux_2.2.14_i686_xeon|19700101030959|02044|3e820c28bf4af63a
BK|sql-bench/Results/ATIS-mysql-SunOS_5.5.1_sun4u|19700101030959|02031|dfb4c5f6b6db3b49
BK|sql-bench/Results/ATIS-mysql-SunOS_5.6_sun4m|19700101030959|02032|62028e0375b3b8b BK|sql-bench/Results/ATIS-mysql-SunOS_5.6_sun4m|19700101030959|02032|62028e0375b3b8b
BK|sql-bench/Results/ATIS-mysql-SunOS_5.7_sun4u|19700101030959|02034|be0d9789776c5ed7
BK|sql-bench/Results/ATIS-mysql_3.21-Linux_2.0.35_i686|19700101030959|02036|c25425e045ca8dfc BK|sql-bench/Results/ATIS-mysql_3.21-Linux_2.0.35_i686|19700101030959|02036|c25425e045ca8dfc
BK|sql-bench/Results/ATIS-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02304|cbe120d860296d2f BK|sql-bench/Results/ATIS-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02304|cbe120d860296d2f
BK|sql-bench/Results/ATIS-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02027|a74e7b82d3908fa9 BK|sql-bench/Results/ATIS-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02027|a74e7b82d3908fa9
@ -263,7 +265,9 @@ BK|sql-bench/Results/RUN-mysql-3.21-Linux_2.2.1_i686|19700101030959|02050|f6fdd6
BK|sql-bench/Results/RUN-mysql-Linux_2.2.10_i686|19700101030959|02041|712f52be5d195406 BK|sql-bench/Results/RUN-mysql-Linux_2.2.10_i686|19700101030959|02041|712f52be5d195406
BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02038|8ee87b26b91c86fe BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02038|8ee87b26b91c86fe
BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_i686_xeon|19700101030959|02055|17854e751e1d9d1d BK|sql-bench/Results/RUN-mysql-Linux_2.2.14_i686_xeon|19700101030959|02055|17854e751e1d9d1d
BK|sql-bench/Results/RUN-mysql-SunOS_5.5.1_sun4u|19700101030959|02058|afbba182428e20df
BK|sql-bench/Results/RUN-mysql-SunOS_5.6_sun4m|19700101030959|02059|eafc8188345e262b BK|sql-bench/Results/RUN-mysql-SunOS_5.6_sun4m|19700101030959|02059|eafc8188345e262b
BK|sql-bench/Results/RUN-mysql-SunOS_5.7_sun4u|19700101030959|02061|86e1dc0e25a8b8f
BK|sql-bench/Results/RUN-mysql_3.21-Linux_2.0.35_i686|19700101030959|02064|ea8672d8473435 BK|sql-bench/Results/RUN-mysql_3.21-Linux_2.0.35_i686|19700101030959|02064|ea8672d8473435
BK|sql-bench/Results/RUN-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02310|a902e1a967d79c42 BK|sql-bench/Results/RUN-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02310|a902e1a967d79c42
BK|sql-bench/Results/RUN-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02030|413ab3b8a99e61e9 BK|sql-bench/Results/RUN-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02030|413ab3b8a99e61e9
@ -273,7 +277,9 @@ BK|sql-bench/Results/alter-table-mysql-3.21-Linux_2.2.1_i686|19700101030959|0207
BK|sql-bench/Results/alter-table-mysql-Linux_2.2.10_i686|19700101030959|02081|93b78a85b720a186 BK|sql-bench/Results/alter-table-mysql-Linux_2.2.10_i686|19700101030959|02081|93b78a85b720a186
BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02314|4ae4b989301df98b BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02314|4ae4b989301df98b
BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_i686_xeon|19700101030959|02057|64cc4b874cd6fabf BK|sql-bench/Results/alter-table-mysql-Linux_2.2.14_i686_xeon|19700101030959|02057|64cc4b874cd6fabf
BK|sql-bench/Results/alter-table-mysql-SunOS_5.5.1_sun4u|19700101030959|02087|9d7e75667fcb29ec
BK|sql-bench/Results/alter-table-mysql-SunOS_5.6_sun4m|19700101030959|02088|8a1bd6589a189890 BK|sql-bench/Results/alter-table-mysql-SunOS_5.6_sun4m|19700101030959|02088|8a1bd6589a189890
BK|sql-bench/Results/alter-table-mysql-SunOS_5.7_sun4u|19700101030959|02090|ce74c2f623d3bb3
BK|sql-bench/Results/alter-table-mysql_3.21-Linux_2.0.35_i686|19700101030959|02092|762639f2560976bd BK|sql-bench/Results/alter-table-mysql_3.21-Linux_2.0.35_i686|19700101030959|02092|762639f2560976bd
BK|sql-bench/Results/alter-table-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02316|1390155aad5b6e86 BK|sql-bench/Results/alter-table-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02316|1390155aad5b6e86
BK|sql-bench/Results/alter-table-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02317|9090bebb62ef164b BK|sql-bench/Results/alter-table-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02317|9090bebb62ef164b
@ -283,7 +289,9 @@ BK|sql-bench/Results/big-tables-mysql-3.21-Linux_2.2.1_i686|19700101030959|02106
BK|sql-bench/Results/big-tables-mysql-Linux_2.2.10_i686|19700101030959|02109|99daa1c5370d077d BK|sql-bench/Results/big-tables-mysql-Linux_2.2.10_i686|19700101030959|02109|99daa1c5370d077d
BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02315|2804ec3c95be436a BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02315|2804ec3c95be436a
BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_i686_xeon|19700101030959|02074|290c2c3de9d8e6b BK|sql-bench/Results/big-tables-mysql-Linux_2.2.14_i686_xeon|19700101030959|02074|290c2c3de9d8e6b
BK|sql-bench/Results/big-tables-mysql-SunOS_5.5.1_sun4u|19700101030959|02115|7d7b6c0bf58b9b79
BK|sql-bench/Results/big-tables-mysql-SunOS_5.6_sun4m|19700101030959|02116|f351a7f3e1e2257e BK|sql-bench/Results/big-tables-mysql-SunOS_5.6_sun4m|19700101030959|02116|f351a7f3e1e2257e
BK|sql-bench/Results/big-tables-mysql-SunOS_5.7_sun4u|19700101030959|02118|ebc379b231312bbe
BK|sql-bench/Results/big-tables-mysql_3.21-Linux_2.0.35_i686|19700101030959|02120|190e827e569c99a4 BK|sql-bench/Results/big-tables-mysql_3.21-Linux_2.0.35_i686|19700101030959|02120|190e827e569c99a4
BK|sql-bench/Results/big-tables-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02318|c5eabcb89ceac698 BK|sql-bench/Results/big-tables-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02318|c5eabcb89ceac698
BK|sql-bench/Results/big-tables-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02319|856d503725373684 BK|sql-bench/Results/big-tables-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02319|856d503725373684
@ -293,7 +301,9 @@ BK|sql-bench/Results/connect-mysql-3.21-Linux_2.2.1_i686|19700101030959|02134|c0
BK|sql-bench/Results/connect-mysql-Linux_2.2.10_i686|19700101030959|02137|c92505d77e19d5ec BK|sql-bench/Results/connect-mysql-Linux_2.2.10_i686|19700101030959|02137|c92505d77e19d5ec
BK|sql-bench/Results/connect-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02084|e7e2959b7387251f BK|sql-bench/Results/connect-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02084|e7e2959b7387251f
BK|sql-bench/Results/connect-mysql-Linux_2.2.14_i686_xeon|19700101030959|02071|ea19dc3ec55b3618 BK|sql-bench/Results/connect-mysql-Linux_2.2.14_i686_xeon|19700101030959|02071|ea19dc3ec55b3618
BK|sql-bench/Results/connect-mysql-SunOS_5.5.1_sun4u|19700101030959|02142|a9493110fe62e0b1
BK|sql-bench/Results/connect-mysql-SunOS_5.6_sun4m|19700101030959|02143|a10e3ddfa26a3e7f BK|sql-bench/Results/connect-mysql-SunOS_5.6_sun4m|19700101030959|02143|a10e3ddfa26a3e7f
BK|sql-bench/Results/connect-mysql-SunOS_5.7_sun4u|19700101030959|02145|c67beb9e9d2cf32e
BK|sql-bench/Results/connect-mysql_3.21-Linux_2.0.35_i686|19700101030959|02146|650abd213e6828c6 BK|sql-bench/Results/connect-mysql_3.21-Linux_2.0.35_i686|19700101030959|02146|650abd213e6828c6
BK|sql-bench/Results/connect-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02320|ce69cc65bc827b5c BK|sql-bench/Results/connect-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02320|ce69cc65bc827b5c
BK|sql-bench/Results/connect-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02066|f801e08429a4f7c6 BK|sql-bench/Results/connect-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02066|f801e08429a4f7c6
@ -303,7 +313,9 @@ BK|sql-bench/Results/create-mysql-3.21-Linux_2.2.1_i686|19700101030959|02158|515
BK|sql-bench/Results/create-mysql-Linux_2.2.10_i686|19700101030959|02161|9e7822f66df6aa76 BK|sql-bench/Results/create-mysql-Linux_2.2.10_i686|19700101030959|02161|9e7822f66df6aa76
BK|sql-bench/Results/create-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02102|34ded91c5fc25de9 BK|sql-bench/Results/create-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02102|34ded91c5fc25de9
BK|sql-bench/Results/create-mysql-Linux_2.2.14_i686_xeon|19700101030959|02139|50d15991293030ef BK|sql-bench/Results/create-mysql-Linux_2.2.14_i686_xeon|19700101030959|02139|50d15991293030ef
BK|sql-bench/Results/create-mysql-SunOS_5.5.1_sun4u|19700101030959|02166|bbb5de66fc56de7b
BK|sql-bench/Results/create-mysql-SunOS_5.6_sun4m|19700101030959|02221|9233114ae6f8c5f BK|sql-bench/Results/create-mysql-SunOS_5.6_sun4m|19700101030959|02221|9233114ae6f8c5f
BK|sql-bench/Results/create-mysql-SunOS_5.7_sun4u|19700101030959|02223|7ee13bfcafeab498
BK|sql-bench/Results/create-mysql_3.21-Linux_2.0.35_i686|19700101030959|02225|df1b037d17b33587 BK|sql-bench/Results/create-mysql_3.21-Linux_2.0.35_i686|19700101030959|02225|df1b037d17b33587
BK|sql-bench/Results/create-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02321|e985e71d552ff09e BK|sql-bench/Results/create-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02321|e985e71d552ff09e
BK|sql-bench/Results/create-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02099|483dcf223d5abf81 BK|sql-bench/Results/create-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02099|483dcf223d5abf81
@ -313,7 +325,9 @@ BK|sql-bench/Results/insert-mysql-3.21-Linux_2.2.1_i686|19700101030959|02239|fd0
BK|sql-bench/Results/insert-mysql-Linux_2.2.10_i686|19700101030959|02242|763edf9aec633f51 BK|sql-bench/Results/insert-mysql-Linux_2.2.10_i686|19700101030959|02242|763edf9aec633f51
BK|sql-bench/Results/insert-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02130|5be3d6f299738a31 BK|sql-bench/Results/insert-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02130|5be3d6f299738a31
BK|sql-bench/Results/insert-mysql-Linux_2.2.14_i686_xeon|19700101030959|02141|c683ee4b9d214298 BK|sql-bench/Results/insert-mysql-Linux_2.2.14_i686_xeon|19700101030959|02141|c683ee4b9d214298
BK|sql-bench/Results/insert-mysql-SunOS_5.5.1_sun4u|19700101030959|02247|8a9ae41f9a79f79
BK|sql-bench/Results/insert-mysql-SunOS_5.6_sun4m|19700101030959|02248|3402d060ae20e19 BK|sql-bench/Results/insert-mysql-SunOS_5.6_sun4m|19700101030959|02248|3402d060ae20e19
BK|sql-bench/Results/insert-mysql-SunOS_5.7_sun4u|19700101030959|02250|78efa132c6e252b9
BK|sql-bench/Results/insert-mysql_3.21-Linux_2.0.35_i686|19700101030959|02252|60c0965dff31db07 BK|sql-bench/Results/insert-mysql_3.21-Linux_2.0.35_i686|19700101030959|02252|60c0965dff31db07
BK|sql-bench/Results/insert-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02322|ed252140ff399961 BK|sql-bench/Results/insert-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02322|ed252140ff399961
BK|sql-bench/Results/insert-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02114|29a3b8a1ca8aa9d BK|sql-bench/Results/insert-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02114|29a3b8a1ca8aa9d
@ -323,7 +337,9 @@ BK|sql-bench/Results/select-mysql-3.21-Linux_2.2.1_i686|19700101030959|02265|ed3
BK|sql-bench/Results/select-mysql-Linux_2.2.10_i686|19700101030959|02268|a2e264d777b787d BK|sql-bench/Results/select-mysql-Linux_2.2.10_i686|19700101030959|02268|a2e264d777b787d
BK|sql-bench/Results/select-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02227|308117295c3bc096 BK|sql-bench/Results/select-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02227|308117295c3bc096
BK|sql-bench/Results/select-mysql-Linux_2.2.14_i686_xeon|19700101030959|02152|ead3f11b46ac626f BK|sql-bench/Results/select-mysql-Linux_2.2.14_i686_xeon|19700101030959|02152|ead3f11b46ac626f
BK|sql-bench/Results/select-mysql-SunOS_5.5.1_sun4u|19700101030959|02273|c9a1a498a052e268
BK|sql-bench/Results/select-mysql-SunOS_5.6_sun4m|19700101030959|02274|4da215905bce988d BK|sql-bench/Results/select-mysql-SunOS_5.6_sun4m|19700101030959|02274|4da215905bce988d
BK|sql-bench/Results/select-mysql-SunOS_5.7_sun4u|19700101030959|02276|632c92971c61e34a
BK|sql-bench/Results/select-mysql_3.21-Linux_2.0.35_i686|19700101030959|02278|5fadbac5f98696a BK|sql-bench/Results/select-mysql_3.21-Linux_2.0.35_i686|19700101030959|02278|5fadbac5f98696a
BK|sql-bench/Results/select-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02323|e8c0871a668a610d BK|sql-bench/Results/select-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02323|e8c0871a668a610d
BK|sql-bench/Results/select-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02127|963a98ed526e2be4 BK|sql-bench/Results/select-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02127|963a98ed526e2be4
@ -333,7 +349,9 @@ BK|sql-bench/Results/wisconsin-mysql-3.21-Linux_2.2.1_i686|19700101030959|02290|
BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.10_i686|19700101030959|02288|301a82b12a84922b BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.10_i686|19700101030959|02288|301a82b12a84922b
BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02280|d01900af34fb33b8 BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02280|d01900af34fb33b8
BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_i686_xeon|19700101030959|02154|7525b23938631801 BK|sql-bench/Results/wisconsin-mysql-Linux_2.2.14_i686_xeon|19700101030959|02154|7525b23938631801
BK|sql-bench/Results/wisconsin-mysql-SunOS_5.5.1_sun4u|19700101030959|02297|379705afa2e12378
BK|sql-bench/Results/wisconsin-mysql-SunOS_5.6_sun4m|19700101030959|02298|ec61b14072715dc8 BK|sql-bench/Results/wisconsin-mysql-SunOS_5.6_sun4m|19700101030959|02298|ec61b14072715dc8
BK|sql-bench/Results/wisconsin-mysql-SunOS_5.7_sun4u|19700101030959|02300|f27927f8c64ea8ad
BK|sql-bench/Results/wisconsin-mysql_3.21-Linux_2.0.35_i686|19700101030959|02302|31703d40ea6b4f66 BK|sql-bench/Results/wisconsin-mysql_3.21-Linux_2.0.35_i686|19700101030959|02302|31703d40ea6b4f66
BK|sql-bench/Results/wisconsin-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02324|ec075a89dbdbbe6a BK|sql-bench/Results/wisconsin-mysql_fast-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02324|ec075a89dbdbbe6a
BK|sql-bench/Results/wisconsin-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02325|233d5aa529979990 BK|sql-bench/Results/wisconsin-pg-Linux_2.2.14_5.0_i686-cmp-mysql,pg|19700101030959|02325|233d5aa529979990
@ -652,6 +670,7 @@ mwagner@evoq.home.mwagner.org|Docs/Books/prof.eps|20001231203220|15779|dc69b0395
mwagner@evoq.home.mwagner.org|Docs/Books/pthreads.eps|20001231203220|18899|d60ad51891ef4c49 mwagner@evoq.home.mwagner.org|Docs/Books/pthreads.eps|20001231203220|18899|d60ad51891ef4c49
mwagner@evoq.home.mwagner.org|Docs/Books/realmen.eps|20001231203220|22075|1ceb4839e835dad4 mwagner@evoq.home.mwagner.org|Docs/Books/realmen.eps|20001231203220|22075|1ceb4839e835dad4
mwagner@evoq.home.mwagner.org|Docs/Books/sql-99.eps|20001231203220|25230|cec4ae16fee4c640 mwagner@evoq.home.mwagner.org|Docs/Books/sql-99.eps|20001231203220|25230|cec4ae16fee4c640
mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.res|20001014084759|41327|1295456b9394876
mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.res|20001014084759|41327|1295456b93948768 mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.res|20001014084759|41327|1295456b93948768
mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.tst|20001013104933|54568|2e626fa07144d2c8 mwagner@evoq.home.mwagner.org|mysql-test/chew_on_this/select.tst|20001013104933|54568|2e626fa07144d2c8
mwagner@evoq.home.mwagner.org|mysql-test/mybin/start-mysqld|20001016055648|54840|9c8f21a7ab97793a mwagner@evoq.home.mwagner.org|mysql-test/mybin/start-mysqld|20001016055648|54840|9c8f21a7ab97793a
@ -726,6 +745,8 @@ mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000029.xml|20001017133713|
mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000030.xml|20001017133600|63205|c2b25781eefaee9 mwagner@evoq.home.mwagner.org|mysql-test/xml/tests/sel000030.xml|20001017133600|63205|c2b25781eefaee9
mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/README|20001013051514|26509|cd4bb681e5a0cd10 mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/README|20001013051514|26509|cd4bb681e5a0cd10
mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/mysqltest.xsl|20001013051514|27425|1b8f6ec4f1b5f634 mwagner@evoq.home.mwagner.org|mysql-test/xml/xsl/mysqltest.xsl|20001013051514|27425|1b8f6ec4f1b5f634
mwagner@work.mysql.com|mysql-test/r/3.23/sel000001.result|20001010091454|28284|383913ae4505ec86
mwagner@work.mysql.com|mysql-test/r/3.23/sel000002.result|20001010091454|29230|d1787e6fd5dbc1cc
nick@nick.leippe.com|mysql-test/r/rpl_empty_master_crash.result|20020531235552|47718|615f521be2132141 nick@nick.leippe.com|mysql-test/r/rpl_empty_master_crash.result|20020531235552|47718|615f521be2132141
nick@nick.leippe.com|mysql-test/t/rpl_empty_master_crash.test|20020531235552|52328|99464e737639ccc6 nick@nick.leippe.com|mysql-test/t/rpl_empty_master_crash.test|20020531235552|52328|99464e737639ccc6
sasha@mysql.sashanet.com|BitKeeper/etc/logging_ok|20000801000905|12967|5b7d847a2158554 sasha@mysql.sashanet.com|BitKeeper/etc/logging_ok|20000801000905|12967|5b7d847a2158554
@ -733,19 +754,36 @@ sasha@mysql.sashanet.com|build-tags|20011125054855|05181|7afb7e785b80f97
sasha@mysql.sashanet.com|build-tags|20011201050944|25384|b6f6fff142121618 sasha@mysql.sashanet.com|build-tags|20011201050944|25384|b6f6fff142121618
sasha@mysql.sashanet.com|libmysql_r/acconfig.h|20001128060846|51084|65f1202b3b5c345f sasha@mysql.sashanet.com|libmysql_r/acconfig.h|20001128060846|51084|65f1202b3b5c345f
sasha@mysql.sashanet.com|mysql-test/README.gcov|20001012045950|28177|5a6da067a30780ce sasha@mysql.sashanet.com|mysql-test/README.gcov|20001012045950|28177|5a6da067a30780ce
sasha@mysql.sashanet.com|mysql-test/README.gcov|20001214012355|41825|2de7575ca81155e5
sasha@mysql.sashanet.com|mysql-test/README|20001010001022|12739|108667adaeabe3f5 sasha@mysql.sashanet.com|mysql-test/README|20001010001022|12739|108667adaeabe3f5
sasha@mysql.sashanet.com|mysql-test/r/3.23/alt000001.result|20001122072330|24729|393103dbf15f35c9 sasha@mysql.sashanet.com|mysql-test/r/3.23/alt000001.result|20001122072330|24729|393103dbf15f35c9
sasha@mysql.sashanet.com|mysql-test/r/3.23/ins000001.result|20001018175743|49824|f45c599efdf8352b
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.a.result|20001118063528|39426|2987b17db06808c3 sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.a.result|20001118063528|39426|2987b17db06808c3
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.b.result|20001118063528|44057|62e1fa91167cacc3 sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000001.b.result|20001118063528|44057|62e1fa91167cacc3
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000002.result|20001118063528|46039|109f5ceed1e0d64
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000003.result|20001118063528|48148|68d6ee00beaa011
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.a.result|20001118063528|50132|3415f066cb91c460 sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.a.result|20001118063528|50132|3415f066cb91c460
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.b.result|20001118063528|52094|352b35351551485 sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000004.b.result|20001118063528|52094|352b35351551485
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000005.result|20001118063528|54071|a50962bc2340ab9a
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000006.result|20001118063528|56081|5653051e8ce6b4aa
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000007.result|20001121063807|21606|e0c3b6134e0884da
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000008.result|20001121063807|23636|c5cfee19ca5a7da9
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000009.result|20001121063807|25633|ed8042446ab97926
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000010.result|20001122072330|29430|3228109b8965b0f8
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000011.result|20001125024912|48851|c29dce30aa97f265
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.result|20001126062901|05938|35d6596da7b90fc5
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.status.result|20001126062901|09395|bbbd650b5beea32f sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000012.status.result|20001126062901|09395|bbbd650b5beea32f
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.result|20001202171150|03876|ac5024e6cf6daac6
sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.status.result|20001202171150|06069|6bee190c298cc9fd sasha@mysql.sashanet.com|mysql-test/r/3.23/rpl000013.status.result|20001202171150|06069|6bee190c298cc9fd
sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000003.result|20001011230020|64653|d7b657b1e3a286a7
sasha@mysql.sashanet.com|mysql-test/r/3.23/sel000100.res|20001205131218|23520|84ed46856cb3a69f
sasha@mysql.sashanet.com|mysql-test/r/3.23/shw000001.result|20001121234128|16652|8b20b03d8319b9a5 sasha@mysql.sashanet.com|mysql-test/r/3.23/shw000001.result|20001121234128|16652|8b20b03d8319b9a5
sasha@mysql.sashanet.com|mysql-test/r/binlog-backup-restore.result|20010424233926|16010|605de78abda64d27 sasha@mysql.sashanet.com|mysql-test/r/binlog-backup-restore.result|20010424233926|16010|605de78abda64d27
sasha@mysql.sashanet.com|mysql-test/r/df_crash.result|20010406010433|59989|4a3dbee64843953d sasha@mysql.sashanet.com|mysql-test/r/df_crash.result|20010406010433|59989|4a3dbee64843953d
sasha@mysql.sashanet.com|mysql-test/r/identity.result|20010910233028|16331|e41453a364242503 sasha@mysql.sashanet.com|mysql-test/r/identity.result|20010910233028|16331|e41453a364242503
sasha@mysql.sashanet.com|mysql-test/r/mrg000002.result|20001212152450|11492|745be0854aaaaf5e sasha@mysql.sashanet.com|mysql-test/r/mrg000002.result|20001212152450|11492|745be0854aaaaf5e
sasha@mysql.sashanet.com|mysql-test/r/slave-running.result|20001208141122|24303|f73e49462cf59e1f
sasha@mysql.sashanet.com|mysql-test/r/slave-stopped.result|20001208141122|28916|25c134b1a4f1993a
sasha@mysql.sashanet.com|mysql-test/std_data/m.MRG|20001212152450|17736|3f5632c37af00f18 sasha@mysql.sashanet.com|mysql-test/std_data/m.MRG|20001212152450|17736|3f5632c37af00f18
sasha@mysql.sashanet.com|mysql-test/std_data/m.frm|20001212152450|13897|e351dfe0b6824c0c sasha@mysql.sashanet.com|mysql-test/std_data/m.frm|20001212152450|13897|e351dfe0b6824c0c
sasha@mysql.sashanet.com|mysql-test/std_data/select-key.master|20001009234916|07315|e6b83af25df0ce5 sasha@mysql.sashanet.com|mysql-test/std_data/select-key.master|20001009234916|07315|e6b83af25df0ce5

View File

@ -20,6 +20,7 @@ heikki@donna.mysql.fi
heikki@hundin.mysql.fi heikki@hundin.mysql.fi
heikki@rescue. heikki@rescue.
heikki@work.mysql.com heikki@work.mysql.com
hf@genie.(none)
jani@dsl-jkl1657.dial.inet.fi jani@dsl-jkl1657.dial.inet.fi
jani@hynda.(none) jani@hynda.(none)
jani@hynda.mysql.fi jani@hynda.mysql.fi

View File

@ -215,7 +215,14 @@ if ($opt_stage <= 1)
# Only enable InnoDB when requested (required to be able to # Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB) # build the "Classic" packages that do not include InnoDB)
$opt_config_options.= " --without-innodb" if (!$opt_innodb); if ($opt_innodb)
{
$opt_config_options.= " --with-innodb";
}
else
{
$opt_config_options.= " --without-innodb";
}
if ($opt_with_other_libc) if ($opt_with_other_libc)
{ {
@ -314,7 +321,7 @@ if (!$opt_no_test)
} }
if ($opt_innodb) if ($opt_innodb)
{ {
$extra.=" --innodb_data_file_path=ibdata1:100M"; $extra.=" --innodb_data_file_path=ibdata1:100M:autoextend";
} }
safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-locking $extra >> $log 2>&1 &"); safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-locking $extra >> $log 2>&1 &");
sleep(2); sleep(2);

View File

@ -9934,7 +9934,9 @@ Error in accept: Protocol error
@end example @end example
You might try starting the server with the @code{--set-variable back_log=50} You might try starting the server with the @code{--set-variable back_log=50}
option as a workaround for this. @xref{Command-line options}. option as a workaround for this. Please note that @code{--set-variable} is
deprecated since @strong{MySQL 4.0}, just use @code{--back_log=50} instead.
@xref{Command-line options}.
If you are linking your own MySQL client, you might get the If you are linking your own MySQL client, you might get the
following error when you try to execute it: following error when you try to execute it:
@ -14390,7 +14392,9 @@ Only use one thread (for debugging under Linux). @xref{Debugging server}.
Give a variable a value. @code{--help} lists variables. You can find a full Give a variable a value. @code{--help} lists variables. You can find a full
description for all variables in the @code{SHOW VARIABLES} section in this description for all variables in the @code{SHOW VARIABLES} section in this
manual. @xref{SHOW VARIABLES}. The tuning server parameters section includes manual. @xref{SHOW VARIABLES}. The tuning server parameters section includes
information of how to optimise these. @xref{Server parameters}. information of how to optimize these. Please note that @code{--set-variable}
is deprecated since @strong{MySQL 4.0}, just use @code{--var=option} instead.
@xref{Server parameters}.
In MySQL 4.0.2 one can set a variable directly with In MySQL 4.0.2 one can set a variable directly with
@code{--variable-name=option} and @code{set-variable} is not anymore needed @code{--variable-name=option} and @code{set-variable} is not anymore needed
@ -14611,7 +14615,9 @@ This is equivalent to @code{--option=value} on the command-line.
@item set-variable = variable=value @item set-variable = variable=value
This is equivalent to @code{--set-variable variable=value} on the command-line. This is equivalent to @code{--set-variable variable=value} on the command-line.
This syntax must be used to set a @code{mysqld} variable. This syntax must be used to set a @code{mysqld} variable. Please note that
@code{--set-variable} is deprecated since @strong{MySQL 4.0}, just use
@code{--variable=value} instead.
@end table @end table
The @code{client} group allows you to specify options that apply to all The @code{client} group allows you to specify options that apply to all
@ -18164,8 +18170,10 @@ Output debug log. The @code{debug_options} string often is
@item -? or --help @item -? or --help
Display a help message and exit. Display a help message and exit.
@item -O var=option, --set-variable var=option @item -O var=option, --set-variable var=option
Set the value of a variable. The possible variables and their default values Set the value of a variable. Please note that @code{--set-variable} is
for myisamchk can be examined with @code{myisamchk --help}: deprecated since @strong{MySQL 4.0}, just use @code{--var=option} instead.
The possible variables and their default values for myisamchk can be examined
with @code{myisamchk --help}:
@multitable @columnfractions .20 .10 @multitable @columnfractions .20 .10
@item @strong{Variable} @tab @strong{Value} @item @strong{Variable} @tab @strong{Value}
@item key_buffer_size @tab 523264 @item key_buffer_size @tab 523264
@ -22104,6 +22112,8 @@ Don't write column names in results.
@cindex @code{set-variable}, @code{mysql} option @cindex @code{set-variable}, @code{mysql} option
@item -O, --set-variable var=option @item -O, --set-variable var=option
Give a variable a value. @code{--help} lists variables. Give a variable a value. @code{--help} lists variables.
Please note that @code{--set-variable} is deprecated since
@strong{MySQL 4.0}, just use @code{--var=option} instead.
@cindex @code{one-database}, @code{mysql} option @cindex @code{one-database}, @code{mysql} option
@item -o, --one-database @item -o, --one-database
@ -22181,7 +22191,8 @@ Wait and retry if connection is down instead of aborting.
@end table @end table
You can also set the following variables with @code{-O} or You can also set the following variables with @code{-O} or
@code{--set-variable}: @code{--set-variable}; please note that @code{--set-variable} is
deprecated since @strong{MySQL 4.0}, just use @code{--var=option} instead:
@cindex timeout, @code{connect_timeout} variable @cindex timeout, @code{connect_timeout} variable
@cindex @code{connect_timeout} variable @cindex @code{connect_timeout} variable
@ -22874,6 +22885,8 @@ The MySQL user name to use when connecting to the server. The
default value is your Unix login name. default value is your Unix login name.
@item -O var=option, --set-variable var=option @item -O var=option, --set-variable var=option
Set the value of a variable. The possible variables are listed below. Set the value of a variable. The possible variables are listed below.
Please note that @code{--set-variable} is deprecated since
@strong{MySQL 4.0}, just use @code{--var=option} instead.
@item -v, --verbose @item -v, --verbose
Verbose mode. Print out more information on what the program does. Verbose mode. Print out more information on what the program does.
@item -V, --version @item -V, --version
@ -27396,6 +27409,9 @@ thread_stack current value: 131072
wait_timeout current value: 28800 wait_timeout current value: 28800
@end example @end example
Please note that @code{--set-variable} is deprecated since
@strong{MySQL 4.0}, just use @code{--var=option} instead.
If there is a @code{mysqld} server currently running, you can see what If there is a @code{mysqld} server currently running, you can see what
values it actually is using for the variables by executing this command: values it actually is using for the variables by executing this command:
@ -45679,7 +45695,7 @@ will be active.
static char *server_args[] = @{ static char *server_args[] = @{
"this_program", /* this string is not used */ "this_program", /* this string is not used */
"--datadir=.", "--datadir=.",
"--set-variable=key_buffer_size=32M" "--key_buffer_size=32M"
@}; @};
static char *server_groups[] = @{ static char *server_groups[] = @{
"embedded", "embedded",
@ -47995,6 +48011,8 @@ use big packets so that you run out of memory.
If you are using the @code{mysql} client, you may specify a bigger If you are using the @code{mysql} client, you may specify a bigger
buffer by starting the client with @code{mysql --set-variable=max_allowed_packet=8M}. Other clients have different methods to set this variable. buffer by starting the client with @code{mysql --set-variable=max_allowed_packet=8M}. Other clients have different methods to set this variable.
Please note that @code{--set-variable} is deprecated since
@strong{MySQL 4.0}, just use @code{--max-allowed-packet=8M} instead.
You can use the option file to set @code{max_allowed_packet} to a larger You can use the option file to set @code{max_allowed_packet} to a larger
size in @code{mysqld}. For example, if you are expecting to store the size in @code{mysqld}. For example, if you are expecting to store the
@ -50797,6 +50815,8 @@ each individual 4.0.x release.
@appendixsubsec Changes in release 4.0.5 @appendixsubsec Changes in release 4.0.5
@itemize @itemize
@item @item
Small code improvement in multi-table updates
@item
Fixed a newly introduced bug that caused @code{ORDER BY ... LIMIT #} Fixed a newly introduced bug that caused @code{ORDER BY ... LIMIT #}
to not return all rows. to not return all rows.
@item @item
@ -50826,6 +50846,12 @@ original @code{--ignore-spaces} in @code{mysqlclient}. (Both syntaxes will
work). work).
@item @item
Don't require @code{UPDATE} privilege when using @code{REPLACE}. Don't require @code{UPDATE} privilege when using @code{REPLACE}.
@item
Allow braces in joins in all positions. Formerly, things like
@code{SELECT * FROM (t2 LEFT JOIN t3 USING (a)), t1} worked, but
not @code{SELECT * FROM t1, (t2 LEFT JOIN t3 USING (a))}. Note that
braces are simply removed, they do not change the way the join is
executed.
@end itemize @end itemize
@node News-4.0.4, News-4.0.3, News-4.0.5, News-4.0.x @node News-4.0.4, News-4.0.3, News-4.0.5, News-4.0.x
@ -51654,6 +51680,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.54 @appendixsubsec Changes in release 3.23.54
@itemize @itemize
@item @item
Fixed a problem with BDB and @code{ALTER TABLE}.
@item
Fixed reference to freed memory when doing complicated @code{GROUP BY Fixed reference to freed memory when doing complicated @code{GROUP BY
... ORDER BY} queries. Symptom was that @code{mysqld} died in function ... ORDER BY} queries. Symptom was that @code{mysqld} died in function
@code{send_fields}. @code{send_fields}.
@ -51689,8 +51717,6 @@ Small fix in @code{safe_mysqld} for some shells.
@item @item
Fixed that @code{FLUSH STATUS} doesn't reset @code{Delayed_insert_threads}. Fixed that @code{FLUSH STATUS} doesn't reset @code{Delayed_insert_threads}.
@item @item
Fixed that @code{SHOW STATUS} doesn't reset @code{Delayed_insert_threads}.
@item
Fixed core dump bug when using the @code{BINARY} cast on a @code{NULL} value. Fixed core dump bug when using the @code{BINARY} cast on a @code{NULL} value.
@item @item
Fixed race condition when someone did a @code{GRANT} at the same time a new Fixed race condition when someone did a @code{GRANT} at the same time a new

View File

@ -16,7 +16,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.4.1" #define CHECK_VERSION "2.4.2"
#include "client_priv.h" #include "client_priv.h"
#include <m_ctype.h> #include <m_ctype.h>
@ -463,7 +463,7 @@ static int handle_request_for_tables(char *tables, uint length)
if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME)))) if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
return 1; return 1;
sprintf(query, "%s TABLE `%s` %s", op, tables, options); sprintf(query, "%s TABLE %s %s", op, tables, options);
if (mysql_query(sock, query)) if (mysql_query(sock, query))
{ {
sprintf(message, "when executing '%s TABLE `%s` %s", op, tables,options); sprintf(message, "when executing '%s TABLE `%s` %s", op, tables,options);
@ -493,12 +493,9 @@ static void print_result()
if (status) if (status)
{ {
if (found_error) if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
{ (!opt_fast || strcmp(row[3],"OK")))
if (what_to_do != DO_REPAIR && opt_auto_repair && insert_dynamic(&tables4repair, prev);
(!opt_fast || strcmp(row[3],"OK")))
insert_dynamic(&tables4repair, row[0]);
}
found_error=0; found_error=0;
if (opt_silent) if (opt_silent)
continue; continue;
@ -515,6 +512,9 @@ static void print_result()
strmov(prev, row[0]); strmov(prev, row[0]);
putchar('\n'); putchar('\n');
} }
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
(!opt_fast || strcmp(row[3],"OK")))
insert_dynamic(&tables4repair, prev);
mysql_free_result(res); mysql_free_result(res);
} }

View File

@ -50,13 +50,14 @@
/* The following is parameter to ha_rkey() how to use key */ /* The following is parameter to ha_rkey() how to use key */
enum ha_rkey_function { enum ha_rkey_function {
HA_READ_KEY_EXACT, /* Find first record else error */ HA_READ_KEY_EXACT, /* Find first record else error */
HA_READ_KEY_OR_NEXT, /* Record or next record */ HA_READ_KEY_OR_NEXT, /* Record or next record */
HA_READ_KEY_OR_PREV, /* Record or previous */ HA_READ_KEY_OR_PREV, /* Record or previous */
HA_READ_AFTER_KEY, /* Find next rec. after key-record */ HA_READ_AFTER_KEY, /* Find next rec. after key-record */
HA_READ_BEFORE_KEY, /* Find next rec. before key-record */ HA_READ_BEFORE_KEY, /* Find next rec. before key-record */
HA_READ_PREFIX, /* Key which as same prefix */ HA_READ_PREFIX, /* Key which as same prefix */
HA_READ_PREFIX_LAST, /* Last key with the same prefix */ HA_READ_PREFIX_LAST, /* Last key with the same prefix */
HA_READ_PREFIX_LAST_OR_PREV, /* Last or prev key with the same prefix */
HA_READ_MBR_CONTAIN, HA_READ_MBR_CONTAIN,
HA_READ_MBR_INTERSECT, HA_READ_MBR_INTERSECT,
HA_READ_MBR_WITHIN, HA_READ_MBR_WITHIN,
@ -66,7 +67,7 @@ enum ha_rkey_function {
/* Key algorithm types */ /* Key algorithm types */
enum ha_key_alg { enum ha_key_alg {
HA_KEY_ALG_UNDEF= 0, /* Not specified (old file) */ HA_KEY_ALG_UNDEF= 0, /* Not specified (old file) */
HA_KEY_ALG_BTREE= 1, /* B-tree, default one */ HA_KEY_ALG_BTREE= 1, /* B-tree, default one */
HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */ HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */
@ -202,7 +203,7 @@ enum ha_base_keytype {
/* Bits in flag to _status */ /* Bits in flag to _status */
#define HA_STATUS_POS 1 /* Return position */ #define HA_STATUS_POS 1 /* Return position */
#define HA_STATUS_NO_LOCK 2 /* Don't use external lock */ #define HA_STATUS_NO_LOCK 2 /* Don't use external lock */
#define HA_STATUS_TIME 4 /* Return update time */ #define HA_STATUS_TIME 4 /* Return update time */
#define HA_STATUS_CONST 8 /* Return constants values */ #define HA_STATUS_CONST 8 /* Return constants values */
#define HA_STATUS_VARIABLE 16 #define HA_STATUS_VARIABLE 16
@ -233,7 +234,7 @@ enum ha_base_keytype {
#define HA_ERR_WRONG_TABLE_DEF 143 #define HA_ERR_WRONG_TABLE_DEF 143
#define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */ #define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */
#define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */ #define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */
#define HA_ERR_LOCK_WAIT_TIMEOUT 146 #define HA_ERR_LOCK_WAIT_TIMEOUT 146
#define HA_ERR_LOCK_TABLE_FULL 147 #define HA_ERR_LOCK_TABLE_FULL 147
#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */ #define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */
#define HA_ERR_LOCK_DEADLOCK 149 #define HA_ERR_LOCK_DEADLOCK 149
@ -272,7 +273,7 @@ enum ha_base_keytype {
#define READ_CHECK_USED 4 #define READ_CHECK_USED 4
#define KEY_READ_USED 8 #define KEY_READ_USED 8
#define WRITE_CACHE_USED 16 #define WRITE_CACHE_USED 16
#define OPT_NO_ROWS 32 #define OPT_NO_ROWS 32
/* bits in update */ /* bits in update */
#define HA_STATE_CHANGED 1 /* Database has changed */ #define HA_STATE_CHANGED 1 /* Database has changed */
@ -302,7 +303,7 @@ enum data_file_type {
#ifdef BIG_TABLES #ifdef BIG_TABLES
typedef my_off_t ha_rows; typedef my_off_t ha_rows;
#else #else
typedef ulong ha_rows; typedef ulong ha_rows;
#endif #endif
#define HA_POS_ERROR (~ (ha_rows) 0) #define HA_POS_ERROR (~ (ha_rows) 0)

View File

@ -51,7 +51,7 @@ enum enum_server_command
#define BLOB_FLAG 16 /* Field is a blob */ #define BLOB_FLAG 16 /* Field is a blob */
#define UNSIGNED_FLAG 32 /* Field is unsigned */ #define UNSIGNED_FLAG 32 /* Field is unsigned */
#define ZEROFILL_FLAG 64 /* Field is zerofill */ #define ZEROFILL_FLAG 64 /* Field is zerofill */
#define BINARY_FLAG 128
/* The following are only sent to new clients */ /* The following are only sent to new clients */
#define ENUM_FLAG 256 /* field is an enum */ #define ENUM_FLAG 256 /* field is an enum */
#define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ #define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */

View File

@ -4,6 +4,8 @@
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
*/ */
#include "univ.i"
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
@ -607,13 +609,18 @@ How to make the InnoDB parser and lexer C files:
6. Remove the #include of unistd.h from about line 2500 of lexyy.c 6. Remove the #include of unistd.h from about line 2500 of lexyy.c
7. Move #include <math.h> in pars0grm.c after #include "univ.i" to remove
a large file compilation error on AIX.
8. Move #include "univ.i" in lexyy.c to the file start to remove a large
file compilation error on AIX.
These instructions seem to work at least with bison-1.28 and flex-2.5.4 on These instructions seem to work at least with bison-1.28 and flex-2.5.4 on
Linux. Linux.
*******************************************************/ *******************************************************/
#line 36 "pars0lex.l" #line 36 "pars0lex.l"
#define YYSTYPE que_node_t* #define YYSTYPE que_node_t*
#include "univ.i"
#include "pars0pars.h" #include "pars0pars.h"
#include "pars0grm.h" #include "pars0grm.h"
#include "pars0sym.h" #include "pars0sym.h"

View File

@ -102,6 +102,8 @@ que_node_t */
#include "que0que.h" #include "que0que.h"
#include "row0sel.h" #include "row0sel.h"
#include <math.h>
#define YYSTYPE que_node_t* #define YYSTYPE que_node_t*
/* #define __STDC__ */ /* #define __STDC__ */

View File

@ -118,7 +118,7 @@ int _nisam_search(register N_INFO *info, register N_KEYDEF *keyinfo, uchar *key,
if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0) if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0)
{ {
keypos=_nisam_get_last_key(info,keyinfo,buff,lastkey,keypos); keypos=_nisam_get_last_key(info,keyinfo,buff,lastkey,keypos);
if ((nextflag & SEARCH_LAST) && if (!(nextflag & SEARCH_SMALLER) &&
_nisam_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND)) _nisam_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND))
{ {
my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */ my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */

View File

@ -41,5 +41,5 @@ uint NEAR nisam_read_vec[]=
{ {
SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER, SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER,
SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER, SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER,
SEARCH_FIND, SEARCH_LAST SEARCH_FIND, SEARCH_LAST,SEARCH_LAST | SEARCH_SMALLER
}; };

View File

@ -107,6 +107,7 @@ void start_embedded_conn1(NET * net)
thd->command=COM_SLEEP; thd->command=COM_SLEEP;
thd->version=refresh_version; thd->version=refresh_version;
thd->set_time(); thd->set_time();
bzero(thd->scramble, sizeof(thd->scramble));
init_sql_alloc(&thd->mem_root,8192,8192); init_sql_alloc(&thd->mem_root,8192,8192);
check_connections1(thd); check_connections1(thd);

View File

@ -202,7 +202,8 @@ static void _ftb_init_index_search(FT_INFO *ftb)
MI_KEYDEF *keyinfo; MI_KEYDEF *keyinfo;
my_off_t keyroot; my_off_t keyroot;
if (ftb->state != READY || ftb->keynr == NO_SUCH_KEY) if ((ftb->state != READY && ftb->state !=INDEX_DONE) ||
ftb->keynr == NO_SUCH_KEY)
return; return;
ftb->state=INDEX_SEARCH; ftb->state=INDEX_SEARCH;

View File

@ -79,6 +79,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
#error #error
#endif #endif
DBUG_ENTER("walk_and_match");
word->weight=LWS_FOR_QUERY; word->weight=LWS_FOR_QUERY;
keylen=_ft_make_key(aio->info,aio->keynr,(char*) aio->keybuff,word,0); keylen=_ft_make_key(aio->info,aio->keynr,(char*) aio->keybuff,word,0);
@ -112,7 +114,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
#else #else
#error #error
#endif #endif
if(tmp_weight==0) return doc_cnt; /* stopword, doc_cnt should be 0 */ if(tmp_weight==0) DBUG_RETURN(doc_cnt); /* stopword, doc_cnt should be 0 */
#ifdef EVAL_RUN #ifdef EVAL_RUN
cnt=*(byte *)(aio->info->lastkey+keylen); cnt=*(byte *)(aio->info->lastkey+keylen);
@ -122,7 +124,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
/* saving document matched into dtree */ /* saving document matched into dtree */
if (!(selem=tree_insert(&aio->dtree, &sdoc, 0, aio->dtree.custom_arg))) if (!(selem=tree_insert(&aio->dtree, &sdoc, 0, aio->dtree.custom_arg)))
return 1; DBUG_RETURN(1);
sptr=(FT_SUPERDOC *)ELEMENT_KEY((&aio->dtree), selem); sptr=(FT_SUPERDOC *)ELEMENT_KEY((&aio->dtree), selem);
@ -153,21 +155,22 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
if (doc_cnt) if (doc_cnt)
{ {
word->weight*=GWS_IN_USE; word->weight*=GWS_IN_USE;
if (word->weight < 0) if (word->weight < 0) word->weight=0;
word->weight=0;
} }
return 0; DBUG_RETURN(0);
} }
static int walk_and_copy(FT_SUPERDOC *from, static int walk_and_copy(FT_SUPERDOC *from,
uint32 count __attribute__((unused)), FT_DOC **to) uint32 count __attribute__((unused)), FT_DOC **to)
{ {
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight; from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
(*to)->dpos=from->doc.dpos; (*to)->dpos=from->doc.dpos;
(*to)->weight=from->doc.weight; (*to)->weight=from->doc.weight;
(*to)++; (*to)++;
return 0; DBUG_RETURN(0);
} }
@ -185,12 +188,13 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query,
FT_DOC *dptr; FT_DOC *dptr;
FT_INFO *dlist=NULL; FT_INFO *dlist=NULL;
my_off_t saved_lastpos=info->lastpos; my_off_t saved_lastpos=info->lastpos;
DBUG_ENTER("ft_init_nlq_search");
/* black magic ON */ /* black magic ON */
if ((int) (keynr = _mi_check_index(info,keynr)) < 0) if ((int) (keynr = _mi_check_index(info,keynr)) < 0)
return NULL; DBUG_RETURN(NULL);
if (_mi_readinfo(info,F_RDLCK,1)) if (_mi_readinfo(info,F_RDLCK,1))
return NULL; DBUG_RETURN(NULL);
/* black magic OFF */ /* black magic OFF */
aio.info=info; aio.info=info;
@ -237,7 +241,7 @@ err2:
err: err:
info->lastpos=saved_lastpos; info->lastpos=saved_lastpos;
return dlist; DBUG_RETURN(dlist);
} }

View File

@ -190,6 +190,7 @@ byte ft_simple_get_word(byte **start, byte *end, FT_WORD *word)
{ {
byte *doc=*start; byte *doc=*start;
int mwc; int mwc;
DBUG_ENTER("ft_simple_get_word");
while (doc<end) while (doc<end)
{ {
@ -211,32 +212,35 @@ byte ft_simple_get_word(byte **start, byte *end, FT_WORD *word)
!is_stopword(word->pos, word->len)) !is_stopword(word->pos, word->len))
{ {
*start=doc; *start=doc;
return 1; DBUG_RETURN(1);
} }
} }
return 0; DBUG_RETURN(0);
} }
void ft_parse_init(TREE *wtree, CHARSET_INFO *cs) void ft_parse_init(TREE *wtree, CHARSET_INFO *cs)
{ {
DBUG_ENTER("ft_parse_init");
if (!is_tree_inited(wtree)) if (!is_tree_inited(wtree))
init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL, cs); init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL, cs);
DBUG_VOID_RETURN;
} }
int ft_parse(TREE *wtree, byte *doc, int doclen) int ft_parse(TREE *wtree, byte *doc, int doclen)
{ {
byte *end=doc+doclen; byte *end=doc+doclen;
FT_WORD w; FT_WORD w;
DBUG_ENTER("ft_parse");
while (ft_simple_get_word(&doc,end,&w)) while (ft_simple_get_word(&doc,end,&w))
{ {
if (!tree_insert(wtree, &w, 0, wtree->custom_arg)) if (!tree_insert(wtree, &w, 0, wtree->custom_arg))
goto err; goto err;
} }
return 0; DBUG_RETURN(0);
err: err:
delete_tree(wtree); delete_tree(wtree);
return 1; DBUG_RETURN(1);
} }

View File

@ -78,7 +78,7 @@ extern ulong collstat;
/* Mysterious, but w/o (double) GWS_IDF performs better :-o */ /* Mysterious, but w/o (double) GWS_IDF performs better :-o */
#define GWS_IDF log(aio->info->state->records/doc_cnt) #define GWS_IDF log(aio->info->state->records/doc_cnt)
#define GWS_IDF1 log((double)aio->info->state->records/doc_cnt) #define GWS_IDF1 log((double)aio->info->state->records/doc_cnt)
#define GWS_PROB log(((double)(aio->info->state->records-doc_cnt))/doc_cnt) #define GWS_PROB ((aio->info->state->records > doc_cnt) ? log(((double)(aio->info->state->records-doc_cnt))/doc_cnt) : 0 )
#define GWS_FREQ (1.0/doc_cnt) #define GWS_FREQ (1.0/doc_cnt)
#define GWS_SQUARED pow(log((double)aio->info->state->records/doc_cnt),2) #define GWS_SQUARED pow(log((double)aio->info->state->records/doc_cnt),2)
#define GWS_CUBIC pow(log((double)aio->info->state->records/doc_cnt),3) #define GWS_CUBIC pow(log((double)aio->info->state->records/doc_cnt),3)

View File

@ -404,7 +404,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
length+=key_length; length+=key_length;
keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE); keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE);
if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH || if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
length > MI_MAX_KEY_LENGTH) length >= MI_MAX_KEY_BUFF)
{ {
my_errno=HA_WRONG_CREATE_OPTION; my_errno=HA_WRONG_CREATE_OPTION;
goto err; goto err;

View File

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Remove all rows from a MyISAM table */ /* Remove all rows from a MyISAM table */
/* This only clears the status information and truncates the data file */ /* This clears the status information and truncates files */
#include "myisamdef.h" #include "myisamdef.h"
@ -49,14 +49,15 @@ int mi_delete_all_rows(MI_INFO *info)
state->key_root[i]= HA_OFFSET_ERROR; state->key_root[i]= HA_OFFSET_ERROR;
myisam_log_command(MI_LOG_DELETE_ALL,info,(byte*) 0,0,0); myisam_log_command(MI_LOG_DELETE_ALL,info,(byte*) 0,0,0);
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)))
goto err;
/* /*
If we are using delayed keys or if the user has done changes to the tables If we are using delayed keys or if the user has done changes to the tables
since it was locked then there may be key blocks in the key cache since it was locked then there may be key blocks in the key cache
*/ */
flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED); flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED);
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)) ||
my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) )
goto err;
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
allow_break(); /* Allow SIGHUP & SIGINT */ allow_break(); /* Allow SIGHUP & SIGINT */
DBUG_RETURN(0); DBUG_RETURN(0);

View File

@ -132,7 +132,7 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (_mi_get_prev_key(info,keyinfo, buff, info->lastkey, keypos, if (_mi_get_prev_key(info,keyinfo, buff, info->lastkey, keypos,
&info->lastkey_length)) &info->lastkey_length))
goto err; goto err;
if ((nextflag & SEARCH_LAST) && if (!(nextflag & SEARCH_SMALLER) &&
ha_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND, ha_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND,
&not_used)) &not_used))
{ {

View File

@ -51,12 +51,12 @@ uint NEAR myisam_read_vec[]=
{ {
SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER, SEARCH_FIND, SEARCH_FIND | SEARCH_BIGGER, SEARCH_FIND | SEARCH_SMALLER,
SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER, SEARCH_NO_FIND | SEARCH_BIGGER, SEARCH_NO_FIND | SEARCH_SMALLER,
SEARCH_FIND | SEARCH_PREFIX, SEARCH_LAST, SEARCH_FIND | SEARCH_PREFIX, SEARCH_LAST, SEARCH_LAST | SEARCH_SMALLER,
MBR_CONTAIN, MBR_INTERSECT, MBR_WITHIN, MBR_DISJOINT, MBR_EQUAL MBR_CONTAIN, MBR_INTERSECT, MBR_WITHIN, MBR_DISJOINT, MBR_EQUAL
}; };
uint NEAR myisam_readnext_vec[]= uint NEAR myisam_readnext_vec[]=
{ {
SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER,
SEARCH_BIGGER, SEARCH_SMALLER SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER
}; };

View File

@ -4,7 +4,7 @@ connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,); connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connection slave; connection slave;
--error 0,1199 --error 0,1199
!slave stop; !stop slave;
@r/slave-stopped.result show status like 'Slave_running'; @r/slave-stopped.result show status like 'Slave_running';
connection master; connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@ -13,7 +13,7 @@ connection slave;
reset slave; reset slave;
# Clean up old test tables # Clean up old test tables
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
@r/slave-running.result show status like 'Slave_running'; @r/slave-running.result show status like 'Slave_running';
# Set the default connection to 'master' # Set the default connection to 'master'

View File

@ -192,6 +192,7 @@ CHARACTER_SET=latin1
DBUSER="" DBUSER=""
START_WAIT_TIMEOUT=10 START_WAIT_TIMEOUT=10
STOP_WAIT_TIMEOUT=10 STOP_WAIT_TIMEOUT=10
TEST_REPLICATION=0
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
@ -265,6 +266,9 @@ while test $# -gt 0; do
--user-test=*) --user-test=*)
USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
;; ;;
--rpl)
TEST_REPLICATION=1
;;
--mysqld=*) --mysqld=*)
TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"` TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP"
@ -1289,15 +1293,22 @@ $ECHO $DASH72
if [ -z "$1" ] ; if [ -z "$1" ] ;
then then
if [ x$RECORD = x1 ]; then if [ x$RECORD = x1 ]; then
$ECHO "Will not run in record mode without a specific test case." $ECHO "Will not run in record mode without a specific test case."
else else
for tf in $TESTDIR/*.$TESTSUFFIX if [ x$TEST_REPLICATION = x1 ]; then
do for tf in $TESTDIR/rpl*.$TESTSUFFIX
run_testcase $tf do
done run_testcase $tf
$RM -f $TIMEFILE # Remove for full test done
fi else
for tf in $TESTDIR/*.$TESTSUFFIX
do
run_testcase $tf
done
fi
$RM -f $TIMEFILE # Remove for full test
fi
else else
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
tname=`$BASENAME $1 .test` tname=`$BASENAME $1 .test`

View File

@ -193,7 +193,7 @@ INSERT INTO t1 (art) VALUES ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'
('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'); ('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j');
select count(*) from t1 where upper(art) = 'J'; select count(*) from t1 where upper(art) = 'J';
count(*) count(*)
602 213
select count(*) from t1 where art = 'J' or art = 'j'; select count(*) from t1 where art = 'J' or art = 'j';
count(*) count(*)
602 602

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
create table t1 (word char(20) not null); create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words.dat' into table t1;
@ -30,9 +30,9 @@ abandoned
abandoning abandoning
abandonment abandonment
abandons abandons
slave stop; stop slave;
set password for root@"localhost" = password('foo'); set password for root@"localhost" = password('foo');
slave start; start slave;
set password for root@"localhost" = password(''); set password for root@"localhost" = password('');
create table t3(n int); create table t3(n int);
insert into t3 values(1),(2); insert into t3 values(1),(2);
@ -45,13 +45,13 @@ sum(length(word))
141 141
drop table t1,t3; drop table t1,t3;
reset master; reset master;
slave stop; stop slave;
reset slave; reset slave;
create table t1(n int); create table t1(n int);
select get_lock("hold_slave",10); select get_lock("hold_slave",10);
get_lock("hold_slave",10) get_lock("hold_slave",10)
1 1
slave start; start slave;
select release_lock("hold_slave"); select release_lock("hold_slave");
release_lock("hold_slave") release_lock("hold_slave")
1 1
@ -68,7 +68,7 @@ kill @id;
drop table t2; drop table t2;
Server shutdown in progress Server shutdown in progress
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
slave start; start slave;
select count(*) from t1; select count(*) from t1;
count(*) count(*)
5000 5000

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1; drop table if exists t1;
create table t1 (n int auto_increment primary key); create table t1 (n int auto_increment primary key);
set insert_id = 2000; set insert_id = 2000;
@ -17,7 +17,7 @@ show slave hosts;
Server_id Host Port Rpl_recovery_rank Master_id Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 9999 2 1 2 127.0.0.1 9999 2 1
drop table t1; drop table t1;
slave stop; stop slave;
drop table if exists t2; drop table if exists t2;
create table t2(id int auto_increment primary key, created datetime); create table t2(id int auto_increment primary key, created datetime);
set timestamp=12345; set timestamp=12345;
@ -25,7 +25,7 @@ insert into t2 set created=now();
select * from t2; select * from t2;
id created id created
1 1970-01-01 06:25:45 1 1970-01-01 06:25:45
slave start; start slave;
select * from t2; select * from t2;
id created id created
1 1970-01-01 06:25:45 1 1970-01-01 06:25:45

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1; drop table if exists t1;
create table t1(n int primary key); create table t1(n int primary key);
insert into t1 values (1),(2),(2); insert into t1 values (1),(2),(2);

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
drop table if exists t1; drop table if exists t1;
create table t1 (word char(20) not null, index(word)); create table t1 (word char(20) not null, index(word));

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1; drop table if exists t1;
CREATE TABLE t1 (name varchar(64), age smallint(3)); CREATE TABLE t1 (name varchar(64), age smallint(3));
INSERT INTO t1 SET name='Andy', age=31; INSERT INTO t1 SET name='Andy', age=31;

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
set SQL_LOG_BIN=0,timestamp=200006; set SQL_LOG_BIN=0,timestamp=200006;
drop table if exists t1; drop table if exists t1;
create table t1(t timestamp not null,a char(1)); create table t1(t timestamp not null,a char(1));

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists foo; drop table if exists foo;
create table foo (n int); create table foo (n int);
insert into foo values(4); insert into foo values(4);

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
use test; use test;
drop table if exists foo; drop table if exists foo;
create table foo (n int); create table foo (n int);

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop database if exists foo; drop database if exists foo;
create database foo; create database foo;
drop database if exists bar; drop database if exists bar;

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1; drop table if exists t1;
drop table if exists t1; drop table if exists t1;
create table t1 (n int not null auto_increment primary key); create table t1 (n int not null auto_increment primary key);

View File

@ -1,14 +1,14 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
slave stop; stop slave;
slave start; start slave;
insert into t1 values(2); insert into t1 values(2);
select * from t1; select * from t1;
n n

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
create table t2 (n int); create table t2 (n int);
create temporary table t1 (n int); create temporary table t1 (n int);

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t2; drop table if exists t2;
create table t2(n int); create table t2(n int);
create temporary table t1 (n int); create temporary table t1 (n int);

View File

@ -14,7 +14,7 @@ master_password='',master_port=MASTER_PORT;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.001 4 No No 0 0 0 4 127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.001 4 No No 0 0 0 4
slave start; start slave;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 7 master-bin.001 79 slave-relay-bin.001 120 master-bin.001 Yes Yes 0 0 79 120 127.0.0.1 root MASTER_PORT 7 master-bin.001 79 slave-relay-bin.001 120 master-bin.001 Yes Yes 0 0 79 120

View File

@ -1,7 +1,7 @@
reset master; reset master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
slave start; start slave;
drop table if exists t1; drop table if exists t1;
create table t1(n int); create table t1(n int);
insert into t1 values(24); insert into t1 values(24);

View File

@ -1,6 +1,6 @@
reset slave; reset slave;
slave start; start slave;
show master logs; show binary logs;
Log_name Log_name
master-bin.001 master-bin.001
master-bin.002 master-bin.002

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop database if exists d1; drop database if exists d1;
create database d1; create database d1;
create table d1.t1 ( n int); create table d1.t1 ( n int);

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1; drop table if exists t1;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space

View File

@ -1,8 +1,8 @@
slave stop; stop slave;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
Variable_name Value Variable_name Value
rpl_recovery_rank 1 rpl_recovery_rank 1
@ -17,14 +17,14 @@ rpl_recovery_rank 2
show status like 'Rpl_status'; show status like 'Rpl_status';
Variable_name Value Variable_name Value
Rpl_status ACTIVE_SLAVE Rpl_status ACTIVE_SLAVE
slave start; start slave;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
Variable_name Value Variable_name Value
rpl_recovery_rank 3 rpl_recovery_rank 3
show status like 'Rpl_status'; show status like 'Rpl_status';
Variable_name Value Variable_name Value
Rpl_status ACTIVE_SLAVE Rpl_status ACTIVE_SLAVE
slave start; start slave;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
Variable_name Value Variable_name Value
rpl_recovery_rank 4 rpl_recovery_rank 4

View File

@ -1,16 +1,16 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT; master_password='',master_port=MASTER_PORT;
slave start; start slave;
slave stop; stop slave;
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT; master_password='',master_port=SLAVE_PORT;
slave start; start slave;
flush logs; flush logs;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
create table t1(n int); create table t1(n int);
insert into t1 values(get_lock("lock",2)); insert into t1 values(get_lock("lock",2));
select get_lock("lock",2); select get_lock("lock",2);

View File

@ -1,10 +1,10 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
slave stop; stop slave;
reset master; reset master;
reset slave; reset slave;
reset master; reset master;
@ -36,9 +36,9 @@ show binlog events from 79 limit 2,1;
Log_name Pos Event_type Server_id Orig_log_pos Info Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL) master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL)
flush logs; flush logs;
slave start; start slave;
flush logs; flush logs;
slave stop; stop slave;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1); insert into t1 values (1);
drop table t1; drop table t1;
@ -59,12 +59,12 @@ Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.002 4 Query 1 4 use `test`; create table t1 (n int) master-bin.002 4 Query 1 4 use `test`; create table t1 (n int)
master-bin.002 62 Query 1 62 use `test`; insert into t1 values (1) master-bin.002 62 Query 1 62 use `test`; insert into t1 values (1)
master-bin.002 122 Query 1 122 use `test`; drop table t1 master-bin.002 122 Query 1 122 use `test`; drop table t1
show master logs; show binary logs;
Log_name Log_name
master-bin.001 master-bin.001
master-bin.002 master-bin.002
slave start; start slave;
show master logs; show binary logs;
Log_name Log_name
slave-bin.001 slave-bin.001
slave-bin.002 slave-bin.002

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
show master status; show master status;
File Position Binlog_do_db Binlog_ignore_db File Position Binlog_do_db Binlog_ignore_db
master-bin.001 79 master-bin.001 79
@ -11,17 +11,17 @@ show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 124 127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 124
change master to master_log_pos=73; change master to master_log_pos=73;
slave stop; stop slave;
change master to master_log_pos=73; change master to master_log_pos=73;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No No 0 0 73 4 127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No No 0 0 73 4
slave start; start slave;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 73 4 127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 73 4
change master to master_log_pos=173; change master to master_log_pos=173;
slave start; start slave;
show slave status; show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 173 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 173 4 127.0.0.1 root MASTER_PORT 1 master-bin.001 173 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 173 4
@ -33,7 +33,7 @@ drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
change master to master_log_pos=79; change master to master_log_pos=79;
slave start; start slave;
select * from t1; select * from t1;
n n
1 1

View File

@ -1,20 +1,20 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
create table t1(n int auto_increment primary key); create table t1(n int auto_increment primary key);
insert into t1 values (2); insert into t1 values (2);
insert into t1 values(NULL); insert into t1 values(NULL);
insert into t1 values(NULL); insert into t1 values(NULL);
delete from t1 where n = 2; delete from t1 where n = 2;
slave start; start slave;
slave stop; stop slave;
create table t2(n int); create table t2(n int);
drop table t2; drop table t2;
insert into t1 values(NULL); insert into t1 values(NULL);
slave start; start slave;
select * from t1; select * from t1;
n n
1 1

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
SHOW SLAVE HOSTS; SHOW SLAVE HOSTS;

View File

@ -1,13 +1,13 @@
slave start; start slave;
Could not initialize master info structure, check permisions on master.info Could not initialize master info structure, check permisions on master.info
slave start; start slave;
Could not initialize master info structure, check permisions on master.info Could not initialize master info structure, check permisions on master.info
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
Could not initialize master info Could not initialize master info
reset slave; reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
reset master; reset master;
slave start; start slave;
drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4;
create temporary table temp_table (a char(80) not null); create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables"); insert into temp_table values ("testing temporary tables");
@ -25,7 +25,7 @@ drop table if exists t2;
create table t2(m int not null auto_increment primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
flush logs; flush logs;
show master logs; show binary logs;
Log_name Log_name
master-bin.001 master-bin.001
master-bin.002 master-bin.002
@ -39,9 +39,9 @@ insert into t2 values(1234);
set insert_id=1234; set insert_id=1234;
insert into t2 values(NULL); insert into t2 values(NULL);
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
slave start; start slave;
purge master logs to 'master-bin.003'; purge master logs to 'master-bin.003';
show master logs; show binary logs;
Log_name Log_name
master-bin.003 master-bin.003
insert into t2 values (65); insert into t2 values (65);
@ -60,7 +60,7 @@ insert into temp_table values ("testing temporary tables part 2");
drop table if exists t3; drop table if exists t3;
create table t3 (n int); create table t3 (n int);
create table t4 select * from temp_table; create table t4 select * from temp_table;
show master logs; show binary logs;
Log_name Log_name
master-bin.003 master-bin.003
master-bin.004 master-bin.004

View File

@ -1,9 +1,9 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
drop table if exists t1; drop table if exists t1;
create table t1 (n int not null primary key); create table t1 (n int not null primary key);
insert into t1 values (1); insert into t1 values (1);

View File

@ -1,16 +1,16 @@
slave stop; stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master; reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start; start slave;
create table t2(n int); create table t2(n int);
create table t1(n int not null auto_increment primary key); create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL); insert into t1 values (NULL),(NULL);
truncate table t1; truncate table t1;
insert into t1 values (4),(NULL); insert into t1 values (4),(NULL);
slave stop; stop slave;
slave start; start slave;
insert into t1 values (NULL),(NULL); insert into t1 values (NULL),(NULL);
flush logs; flush logs;
truncate table t1; truncate table t1;

View File

@ -93,13 +93,13 @@ c int not null comment 'int column'
show create table t1 ; show create table t1 ;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`test_set` set('val1','val2','val3') NOT NULL default '', `test_set` set('val1','val2','val3') character set latin1 NOT NULL default '',
`name` char(20) character set latin1 default 'O''Brien' COMMENT 'O''Brien as default', `name` char(20) character set latin1 default 'O''Brien' COMMENT 'O''Brien as default',
`c` int(11) NOT NULL default '0' COMMENT 'int column' `c` int(11) NOT NULL default '0' COMMENT 'int column'
) TYPE=MyISAM CHARSET=latin1 COMMENT='it''s a table' ) TYPE=MyISAM CHARSET=latin1 COMMENT='it''s a table'
show full columns from t1; show full columns from t1;
Field Type Null Key Default Extra Privileges Comment Field Type Null Key Default Extra Privileges Comment
test_set set('val1','val2','val3') select,insert,update,references test_set set('val1','val2','val3') character set latin1 select,insert,update,references
name char(20) character set latin1 YES O'Brien select,insert,update,references O'Brien as default name char(20) character set latin1 YES O'Brien select,insert,update,references O'Brien as default
c int(11) 0 select,insert,update,references int column c int(11) 0 select,insert,update,references int column
drop table t1; drop table t1;

View File

@ -198,4 +198,22 @@ EXPLAIN SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY No tables used 1 PRIMARY No tables used
2 SUBSELECT searchconthardwarefr3 index NULL PRIMARY 41 NULL 2 where used; Using index 2 SUBSELECT searchconthardwarefr3 index NULL PRIMARY 41 NULL 2 where used; Using index
SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
date
2002-08-03
SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
(SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03')
2002-08-03
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
1
1
1
1
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
Subselect returns more than 1 record
EXPLAIN SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY searchconthardwarefr3 index NULL topic 3 NULL 2 Using index
2 SUBSELECT No tables used
3 UNION No tables used
drop table searchconthardwarefr3; drop table searchconthardwarefr3;

View File

@ -1626,13 +1626,13 @@ create table t1 (a enum (' ','a','b') not null);
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` enum('','a','b') NOT NULL default '' `a` enum('','a','b') character set latin1 NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1 ) TYPE=MyISAM CHARSET=latin1
drop table t1; drop table t1;
create table t1 (a enum (' ','a','b ') not null default 'b '); create table t1 (a enum (' ','a','b ') not null default 'b ');
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` enum('','a','b') NOT NULL default 'b' `a` enum('','a','b') character set latin1 NOT NULL default 'b'
) TYPE=MyISAM CHARSET=latin1 ) TYPE=MyISAM CHARSET=latin1
drop table t1; drop table t1;

View File

@ -61,8 +61,8 @@ blob_col blob YES NULL select,insert,update,references
tinyblob_col tinyblob YES NULL select,insert,update,references tinyblob_col tinyblob YES NULL select,insert,update,references
mediumblob_col mediumblob select,insert,update,references mediumblob_col mediumblob select,insert,update,references
longblob_col longblob select,insert,update,references longblob_col longblob select,insert,update,references
options enum('one','two','tree') MUL one select,insert,update,references options enum('one','two','tree') character set latin1 MUL one select,insert,update,references
flags set('one','two','tree') select,insert,update,references flags set('one','two','tree') character set latin1 select,insert,update,references
show keys from t1; show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE
@ -190,8 +190,8 @@ date_time datetime YES NULL select,insert,update,references
new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references
tinyblob_col tinyblob YES NULL select,insert,update,references tinyblob_col tinyblob YES NULL select,insert,update,references
mediumblob_col mediumblob select,insert,update,references mediumblob_col mediumblob select,insert,update,references
options enum('one','two','tree') MUL one select,insert,update,references options enum('one','two','tree') character set latin1 MUL one select,insert,update,references
flags set('one','two','tree') select,insert,update,references flags set('one','two','tree') character set latin1 select,insert,update,references
new_field varchar(10) character set latin1 new select,insert,update,references new_field varchar(10) character set latin1 new select,insert,update,references
show full columns from t2; show full columns from t2;
Field Type Null Key Default Extra Privileges Comment Field Type Null Key Default Extra Privileges Comment
@ -216,8 +216,8 @@ date_time datetime YES NULL select,insert,update,references
new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references
tinyblob_col tinyblob YES NULL select,insert,update,references tinyblob_col tinyblob YES NULL select,insert,update,references
mediumblob_col mediumblob select,insert,update,references mediumblob_col mediumblob select,insert,update,references
options enum('one','two','tree') one select,insert,update,references options enum('one','two','tree') character set latin1 one select,insert,update,references
flags set('one','two','tree') select,insert,update,references flags set('one','two','tree') character set latin1 select,insert,update,references
new_field varchar(10) character set latin1 new select,insert,update,references new_field varchar(10) character set latin1 new select,insert,update,references
select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null))); select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null)));
auto auto auto auto

View File

@ -3,13 +3,13 @@ create table t1 (a set (' ','a','b') not null);
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` set('','a','b') NOT NULL default '' `a` set('','a','b') character set latin1 NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1 ) TYPE=MyISAM CHARSET=latin1
drop table t1; drop table t1;
create table t1 (a set (' ','a','b ') not null default 'b '); create table t1 (a set (' ','a','b ') not null default 'b ');
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` set('','a','b') NOT NULL default 'b' `a` set('','a','b') character set latin1 NOT NULL default 'b'
) TYPE=MyISAM CHARSET=latin1 ) TYPE=MyISAM CHARSET=latin1
drop table t1; drop table t1;

View File

@ -1,4 +1,5 @@
-- source include/have_bdb.inc -- source include/have_bdb.inc
# test for bug reported by Mark Steele # test for bug reported by Mark Steele
drop table if exists t1; drop table if exists t1;

View File

@ -12,11 +12,11 @@ select * from t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
slave stop; stop slave;
connection master; connection master;
set password for root@"localhost" = password('foo'); set password for root@"localhost" = password('foo');
connection slave; connection slave;
slave start; start slave;
connection master; connection master;
# #
# Give slave time to do at last one failed connect retry # Give slave time to do at last one failed connect retry
@ -43,7 +43,7 @@ sync_with_master;
connection master; connection master;
reset master; reset master;
connection slave; connection slave;
slave stop; stop slave;
reset slave; reset slave;
connection master; connection master;
@ -62,7 +62,7 @@ enable_query_log;
# Try to cause a large relay log lag on the slave # Try to cause a large relay log lag on the slave
connection slave; connection slave;
select get_lock("hold_slave",10); select get_lock("hold_slave",10);
slave start; start slave;
#hope this is long enough for I/O thread to fetch over 16K relay log data #hope this is long enough for I/O thread to fetch over 16K relay log data
sleep 3; sleep 3;
select release_lock("hold_slave"); select release_lock("hold_slave");
@ -100,7 +100,7 @@ wait_for_slave_to_stop;
# show slave status; # show slave status;
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
slave start; start slave;
select count(*) from t1; select count(*) from t1;
connection master1; connection master1;
drop table t1; drop table t1;

View File

@ -3,18 +3,14 @@ drop table if exists t1;
create table t1 (n int auto_increment primary key); create table t1 (n int auto_increment primary key);
set insert_id = 2000; set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL); insert into t1 values (NULL),(NULL),(NULL);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
select * from t1; select * from t1;
connection master; connection master;
--replace_result $SLAVE_MYPORT 9999 --replace_result $SLAVE_MYPORT 9999
show slave hosts; show slave hosts;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave; stop slave;
sync_with_master;
slave stop;
connection master; connection master;
drop table if exists t2; drop table if exists t2;
create table t2(id int auto_increment primary key, created datetime); create table t2(id int auto_increment primary key, created datetime);
@ -23,11 +19,9 @@ insert into t2 set created=now();
select * from t2; select * from t2;
save_master_pos; save_master_pos;
connection slave; connection slave;
slave start; start slave;
sync_with_master; sync_with_master;
select * from t2; select * from t2;
connection master; connection master;
drop table t2; drop table t2;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -2,20 +2,14 @@ source include/master-slave.inc;
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
save_master_pos; sync_slave_with_master;
connection slave; stop slave;
sync_with_master; start slave;
slave stop;
slave start;
connection master; connection master;
insert into t1 values(2); insert into t1 values(2);
save_master_pos;
connection slave;
#let slave catch up #let slave catch up
sync_with_master; sync_slave_with_master;
select * from t1; select * from t1;
connection master; connection master;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -18,7 +18,7 @@ eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT; master_password='',master_port=$MASTER_MYPORT;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
show slave status; show slave status;
slave start; start slave;
sync_with_master; sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
show slave status; show slave status;
@ -26,12 +26,8 @@ connection master;
drop table if exists t1; drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values (10),(45),(90); insert into t1 values (10),(45),(90);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
select * from t1; select * from t1;
connection master; connection master;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -5,17 +5,13 @@ reset master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab'; grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave; connection slave;
slave start; start slave;
connection master; connection master;
drop table if exists t1; drop table if exists t1;
create table t1(n int); create table t1(n int);
insert into t1 values(24); insert into t1 values(24);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
select * from t1; select * from t1;
connection master; connection master;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -10,18 +10,14 @@ server_stop master;
server_start master; server_start master;
connection slave; connection slave;
reset slave; reset slave;
slave start; start slave;
connection master; connection master;
show master logs; show binary logs;
drop table if exists t1; drop table if exists t1;
create table t1(n int); create table t1(n int);
insert into t1 values (3351); insert into t1 values (3351);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
select * from t1; select * from t1;
connection master; connection master;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -7,18 +7,16 @@ show variables like 'rpl_recovery_rank';
show status like 'Rpl_status'; show status like 'Rpl_status';
create table t1(n int); create table t1(n int);
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
show status like 'Rpl_status'; show status like 'Rpl_status';
connection slave_sec; connection slave_sec;
slave start; start slave;
sync_with_master; sync_with_master;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
show status like 'Rpl_status'; show status like 'Rpl_status';
connection slave_ter; connection slave_ter;
slave start; start slave;
sync_with_master; sync_with_master;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
show status like 'Rpl_status'; show status like 'Rpl_status';

View File

@ -7,13 +7,13 @@ connection slave;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root', eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT; master_password='',master_port=$MASTER_MYPORT;
slave start; start slave;
connection master; connection master;
slave stop; stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root', eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT; master_password='',master_port=$SLAVE_MYPORT;
slave start; start slave;
flush logs; flush logs;
sleep 5; sleep 5;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT

View File

@ -2,7 +2,7 @@ source include/master-slave.inc;
#clean up slave binlogs #clean up slave binlogs
connection slave; connection slave;
slave stop; stop slave;
reset master; reset master;
reset slave; reset slave;
let $VERSION=`select version()`; let $VERSION=`select version()`;
@ -26,10 +26,10 @@ flush logs;
save_master_pos; save_master_pos;
connection slave; connection slave;
slave start; start slave;
sync_with_master; sync_with_master;
flush logs; flush logs;
slave stop; stop slave;
connection master; connection master;
# Create some entries for second log # Create some entries for second log
@ -40,12 +40,12 @@ drop table t1;
--replace_result $VERSION VERSION --replace_result $VERSION VERSION
show binlog events; show binlog events;
show binlog events in 'master-bin.002'; show binlog events in 'master-bin.002';
show master logs; show binary logs;
save_master_pos; save_master_pos;
connection slave; connection slave;
slave start; start slave;
sync_with_master; sync_with_master;
show master logs; show binary logs;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
show binlog events in 'slave-bin.001' from 4; show binlog events in 'slave-bin.001' from 4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION

View File

@ -3,25 +3,23 @@
# #
source include/master-slave.inc; source include/master-slave.inc;
show master status; show master status;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
change master to master_log_pos=73; change master to master_log_pos=73;
sleep 5; sleep 5;
slave stop; stop slave;
change master to master_log_pos=73; change master to master_log_pos=73;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
slave start; start slave;
sleep 5; sleep 5;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
change master to master_log_pos=173; change master to master_log_pos=173;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
slave start; start slave;
sleep 2; sleep 2;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
@ -34,11 +32,9 @@ insert into t1 values (1),(2),(3);
save_master_pos; save_master_pos;
connection slave; connection slave;
change master to master_log_pos=79; change master to master_log_pos=79;
slave start; start slave;
sync_with_master; sync_with_master;
select * from t1; select * from t1;
connection master; connection master;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -4,9 +4,7 @@ source include/master-slave.inc;
# first, cause a duplicate key problem on the slave # first, cause a duplicate key problem on the slave
create table t1(n int auto_increment primary key); create table t1(n int auto_increment primary key);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
insert into t1 values (2); insert into t1 values (2);
connection master; connection master;
insert into t1 values(NULL); insert into t1 values(NULL);
@ -16,11 +14,11 @@ connection slave;
sleep 3; # there is no way around this sleep - we have to wait until sleep 3; # there is no way around this sleep - we have to wait until
# the slave tries to run the query, fails and aborts slave thread # the slave tries to run the query, fails and aborts slave thread
delete from t1 where n = 2; delete from t1 where n = 2;
slave start; start slave;
sync_with_master; sync_with_master;
#now the buggy slave would be confused on the offset but it can replicate #now the buggy slave would be confused on the offset but it can replicate
#in order to make it break, we need to stop/start the slave one more time #in order to make it break, we need to stop/start the slave one more time
slave stop; stop slave;
connection master; connection master;
# to be able to really confuse the slave, we need some non-auto-increment # to be able to really confuse the slave, we need some non-auto-increment
# events in the log # events in the log
@ -29,7 +27,7 @@ drop table t2;
insert into t1 values(NULL); insert into t1 values(NULL);
save_master_pos; save_master_pos;
connection slave; connection slave;
slave start; start slave;
#now the truth comes out - if the slave is buggy, it will never sync because #now the truth comes out - if the slave is buggy, it will never sync because
#the slave thread is not able to read events #the slave thread is not able to read events
sync_with_master; sync_with_master;
@ -37,7 +35,5 @@ select * from t1;
#clean up #clean up
connection master; connection master;
drop table t1; drop table t1;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -15,10 +15,10 @@ system cat /dev/null > var/slave-data/master.info;
system chmod 000 var/slave-data/master.info; system chmod 000 var/slave-data/master.info;
connection slave; connection slave;
--error 1201 --error 1201
slave start; start slave;
system chmod 600 var/slave-data/master.info; system chmod 600 var/slave-data/master.info;
--error 1201 --error 1201
slave start; start slave;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
# Will get error 13 on Unix systems becasue file is not readable # Will get error 13 on Unix systems becasue file is not readable
!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root'; !eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
@ -28,7 +28,7 @@ eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master
connection master; connection master;
reset master; reset master;
connection slave; connection slave;
slave start; start slave;
connection master; connection master;
drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4;
@ -40,9 +40,7 @@ create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables"); insert into temp_table values ("testing temporary tables");
create table t1 (s text); create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard'); insert into t1 values('Could not break slave'),('Tried hard');
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
select * from t1; select * from t1;
@ -52,12 +50,10 @@ drop table if exists t2;
create table t2(m int not null auto_increment primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
flush logs; flush logs;
show master logs; show binary logs;
create table t3 select * from temp_table; create table t3 select * from temp_table;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
select * from t3; select * from t3;
connection master; connection master;
@ -83,21 +79,17 @@ wait_for_slave_to_stop;
#restart slave skipping one event #restart slave skipping one event
set global sql_slave_skip_counter=1; set global sql_slave_skip_counter=1;
slave start; start slave;
connection master; connection master;
save_master_pos;
#let slave catch up #let slave catch up
connection slave; sync_slave_with_master;
sync_with_master;
connection master; connection master;
purge master logs to 'master-bin.003'; purge master logs to 'master-bin.003';
show master logs; show binary logs;
insert into t2 values (65); insert into t2 values (65);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT --replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status; show slave status;
select * from t2; select * from t2;
@ -121,12 +113,12 @@ while ($1)
} }
enable_query_log; enable_query_log;
create table t4 select * from temp_table; create table t4 select * from temp_table;
show master logs; show binary logs;
show master status; show master status;
save_master_pos; save_master_pos;
connection slave; connection slave;
#slave stop; #stop slave;
#slave start; #start slave;
sync_with_master; sync_with_master;
select * from t4; select * from t4;
@ -140,6 +132,4 @@ unlock tables;
#clean up #clean up
connection master; connection master;
drop table if exists t1,t2,t3,t4; drop table if exists t1,t2,t3,t4;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -9,22 +9,16 @@ insert into t1 values (NULL),(NULL);
truncate table t1; truncate table t1;
# We have to use 4 in the following to make this test work with all table types # We have to use 4 in the following to make this test work with all table types
insert into t1 values (4),(NULL); insert into t1 values (4),(NULL);
save_master_pos; sync_slave_with_master;
connection slave; stop slave;
sync_with_master; start slave;
slave stop;
slave start;
connection master; connection master;
insert into t1 values (NULL),(NULL); insert into t1 values (NULL),(NULL);
flush logs; flush logs;
truncate table t1; truncate table t1;
insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL); insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
select * from t1; select * from t1;
connection master; connection master;
drop table t1,t2; drop table t1,t2;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;

View File

@ -108,4 +108,10 @@ INSERT INTO searchconthardwarefr3 (topic,date,pseudo) VALUES
('43506','2002-10-02','joce'),('40143','2002-08-03','joce'); ('43506','2002-10-02','joce'),('40143','2002-08-03','joce');
EXPLAIN SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03'; EXPLAIN SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
EXPLAIN SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03'); EXPLAIN SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
-- error 1240
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
EXPLAIN SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1);
drop table searchconthardwarefr3; drop table searchconthardwarefr3;

View File

@ -217,6 +217,10 @@ static void my_win_init(void)
setlocale(LC_CTYPE, ""); /* To get right sortorder */ setlocale(LC_CTYPE, ""); /* To get right sortorder */
/* Clear the OS system variable TZ and avoid the 100% CPU usage */
_putenv( "TZ=" );
_tzset();
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */ /* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,(LPCTSTR)targetKey,0, if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,(LPCTSTR)targetKey,0,
KEY_READ,&hSoftMysql) != ERROR_SUCCESS) KEY_READ,&hSoftMysql) != ERROR_SUCCESS)
@ -240,7 +244,7 @@ static void my_win_init(void)
/* Inserisce i dati come variabili d'ambiente */ /* Inserisce i dati come variabili d'ambiente */
my_env=strdup(EnvString); /* variable for putenv must be allocated ! */ my_env=strdup(EnvString); /* variable for putenv must be allocated ! */
putenv(EnvString) ; putenv(my_env) ;
dimNameValueBuffer = dimName ; dimNameValueBuffer = dimName ;
dimDataValueBuffer = dimData ; dimDataValueBuffer = dimData ;

View File

@ -64,7 +64,7 @@ foreach $table (@ARGV)
{ {
if (uc($row->[1]) eq uc($opt_type)) if (uc($row->[1]) eq uc($opt_type))
{ {
print "$table is alread of type $opt_type; Ignored\n"; print "$table is already of type $opt_type; Ignored\n";
next; next;
} }
} }

View File

@ -4,7 +4,7 @@ use Getopt::Long;
use POSIX qw(strftime); use POSIX qw(strftime);
$|=1; $|=1;
$VER="2.3"; $VER="2.4";
$opt_config_file = undef(); $opt_config_file = undef();
$opt_example = 0; $opt_example = 0;
@ -508,8 +508,8 @@ sub example
[mysqld_multi] [mysqld_multi]
mysqld = @bindir@/mysqld_safe mysqld = @bindir@/mysqld_safe
mysqladmin = @bindir@/mysqladmin mysqladmin = @bindir@/mysqladmin
user = multi_admin user = root
password = multipass password = your_password
[mysqld2] [mysqld2]
socket = /tmp/mysql.sock2 socket = /tmp/mysql.sock2

View File

@ -559,15 +559,15 @@ sub copy_files {
my @cp = ($method); my @cp = ($method);
# add option to preserve mod time etc of copied files # add option to preserve mod time etc of copied files
# not critical, but nice to have # not critical, but nice to have
push @cp, "-p" if $^O =~ m/^(solaris|linux|freebsd)$/; push @cp, "-p" if $^O =~ m/^(solaris|linux|freebsd|darwin)$/;
# add recursive option for scp # add recursive option for scp
push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd|darwin)$/ && $method =~ /^scp\b/;
my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files; my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files;
# add files to copy and the destination directory # add files to copy and the destination directory
+ safe_system( @cp, @non_raid, "'$target'" ); safe_system( @cp, @non_raid, "'$target'" );
foreach my $rd ( @$raid_dirs ) { foreach my $rd ( @$raid_dirs ) {
my @raid = map { "'$_'" } grep { m:$rd/: } @$files; my @raid = map { "'$_'" } grep { m:$rd/: } @$files;

View File

@ -3734,10 +3734,9 @@ void Field_datetime::sql_type(String &res) const
int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
{ {
field_charset=cs;
int error= 0; int error= 0;
#ifdef USE_TIS620 #ifdef USE_TIS620
if (!binary_flag) { if (!binary()) {
ThNormalize((uchar *)ptr, field_length, (uchar *)from, length); ThNormalize((uchar *)ptr, field_length, (uchar *)from, length);
if (length < field_length) { if (length < field_length) {
bfill(ptr + length, field_length - length, ' '); bfill(ptr + length, field_length - length, ' ');
@ -3828,9 +3827,6 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
int Field_string::cmp(const char *a_ptr, const char *b_ptr) int Field_string::cmp(const char *a_ptr, const char *b_ptr)
{ {
if (binary_flag)
return memcmp(a_ptr,b_ptr,field_length);
else
return my_strnncoll(field_charset, return my_strnncoll(field_charset,
(const uchar*)a_ptr,field_length, (const uchar*)a_ptr,field_length,
(const uchar*)b_ptr,field_length); (const uchar*)b_ptr,field_length);
@ -3838,7 +3834,7 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
void Field_string::sort_string(char *to,uint length) void Field_string::sort_string(char *to,uint length)
{ {
if (binary_flag) if (binary())
memcpy((byte*) to,(byte*) ptr,(size_t) length); memcpy((byte*) to,(byte*) ptr,(size_t) length);
else else
{ {
@ -3868,7 +3864,7 @@ void Field_string::sql_type(String &res) const
"varchar" : "char"), "varchar" : "char"),
(int) field_length)); (int) field_length));
res.length((uint) length); res.length((uint) length);
if (binary_flag) if (binary())
res.append(" binary"); res.append(" binary");
else else
{ {
@ -3904,7 +3900,7 @@ int Field_string::pack_cmp(const char *a, const char *b, uint length)
uint a_length= (uint) (uchar) *a++; uint a_length= (uint) (uchar) *a++;
uint b_length= (uint) (uchar) *b++; uint b_length= (uint) (uchar) *b++;
if (binary_flag) if (binary())
{ {
int cmp= memcmp(a,b,min(a_length,b_length)); int cmp= memcmp(a,b,min(a_length,b_length));
return cmp ? cmp : (int) (a_length - b_length); return cmp ? cmp : (int) (a_length - b_length);
@ -3923,7 +3919,7 @@ int Field_string::pack_cmp(const char *b, uint length)
end--; end--;
uint a_length = (uint) (end - ptr); uint a_length = (uint) (end - ptr);
if (binary_flag) if (binary())
{ {
int cmp= memcmp(ptr,b,min(a_length,b_length)); int cmp= memcmp(ptr,b,min(a_length,b_length));
return cmp ? cmp : (int) (a_length - b_length); return cmp ? cmp : (int) (a_length - b_length);
@ -3956,9 +3952,8 @@ uint Field_string::max_packed_col_length(uint max_length)
int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
{ {
int error= 0; int error= 0;
field_charset=cs;
#ifdef USE_TIS620 #ifdef USE_TIS620
if (!binary_flag) if (!binary())
{ {
ThNormalize((uchar *) ptr+2, field_length, (uchar *) from, length); ThNormalize((uchar *) ptr+2, field_length, (uchar *) from, length);
} }
@ -4036,10 +4031,7 @@ int Field_varstring::cmp(const char *a_ptr, const char *b_ptr)
uint a_length=uint2korr(a_ptr); uint a_length=uint2korr(a_ptr);
uint b_length=uint2korr(b_ptr); uint b_length=uint2korr(b_ptr);
int diff; int diff;
if (binary_flag) diff=my_strnncoll(field_charset,
diff=memcmp(a_ptr+2,b_ptr+2,min(a_length,b_length));
else
diff=my_strnncoll(field_charset,
(const uchar*)a_ptr+2,min(a_length,b_length), (const uchar*)a_ptr+2,min(a_length,b_length),
(const uchar*)b_ptr+2,min(a_length,b_length)); (const uchar*)b_ptr+2,min(a_length,b_length));
return diff ? diff : (int) (a_length - b_length); return diff ? diff : (int) (a_length - b_length);
@ -4048,7 +4040,7 @@ int Field_varstring::cmp(const char *a_ptr, const char *b_ptr)
void Field_varstring::sort_string(char *to,uint length) void Field_varstring::sort_string(char *to,uint length)
{ {
uint tot_length=uint2korr(ptr); uint tot_length=uint2korr(ptr);
if (binary_flag) if (binary())
memcpy((byte*) to,(byte*) ptr+2,(size_t) tot_length); memcpy((byte*) to,(byte*) ptr+2,(size_t) tot_length);
else else
{ {
@ -4080,7 +4072,7 @@ void Field_varstring::sql_type(String &res) const
((char*) res.ptr(),"varchar(%u)", ((char*) res.ptr(),"varchar(%u)",
field_length)); field_length));
res.length((uint) length); res.length((uint) length);
if (binary_flag) if (binary())
res.append(" binary"); res.append(" binary");
else else
{ {
@ -4137,7 +4129,7 @@ int Field_varstring::pack_cmp(const char *a, const char *b, uint key_length)
a_length= (uint) (uchar) *a++; a_length= (uint) (uchar) *a++;
b_length= (uint) (uchar) *b++; b_length= (uint) (uchar) *b++;
} }
if (binary_flag) if (binary())
{ {
int cmp= memcmp(a,b,min(a_length,b_length)); int cmp= memcmp(a,b,min(a_length,b_length));
return cmp ? cmp : (int) (a_length - b_length); return cmp ? cmp : (int) (a_length - b_length);
@ -4160,7 +4152,7 @@ int Field_varstring::pack_cmp(const char *b, uint key_length)
{ {
b_length= (uint) (uchar) *b++; b_length= (uint) (uchar) *b++;
} }
if (binary_flag) if (binary())
{ {
int cmp= memcmp(a,b,min(a_length,b_length)); int cmp= memcmp(a,b,min(a_length,b_length));
return cmp ? cmp : (int) (a_length - b_length); return cmp ? cmp : (int) (a_length - b_length);
@ -4192,15 +4184,13 @@ uint Field_varstring::max_packed_col_length(uint max_length)
Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint blob_pack_length, struct st_table *table_arg,uint blob_pack_length,
bool binary_arg, CHARSET_INFO *cs) CHARSET_INFO *cs)
:Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L, :Field_str(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L,
null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
table_arg, cs), table_arg, cs),
packlength(blob_pack_length),binary_flag(binary_arg), geom_flag(true) packlength(blob_pack_length), geom_flag(true)
{ {
flags|= BLOB_FLAG; flags|= BLOB_FLAG;
if (binary_arg)
flags|=BINARY_FLAG;
if (table) if (table)
table->blob_fields++; table->blob_fields++;
} }
@ -4289,7 +4279,6 @@ uint32 Field_blob::get_length(const char *pos)
int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs) int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
{ {
field_charset=cs;
if (!len) if (!len)
{ {
bzero(ptr,Field_blob::pack_length()); bzero(ptr,Field_blob::pack_length());
@ -4303,7 +4292,7 @@ int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
if (table->copy_blobs || len <= MAX_FIELD_WIDTH) if (table->copy_blobs || len <= MAX_FIELD_WIDTH)
{ // Must make a copy { // Must make a copy
#ifdef USE_TIS620 #ifdef USE_TIS620
if (!binary_flag) if (!binary())
{ {
/* If there isn't enough memory, use original string */ /* If there isn't enough memory, use original string */
if ((th_ptr=(char * ) my_malloc(sizeof(char) * len,MYF(0)))) if ((th_ptr=(char * ) my_malloc(sizeof(char) * len,MYF(0))))
@ -4390,13 +4379,9 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
int Field_blob::cmp(const char *a,uint32 a_length, const char *b, int Field_blob::cmp(const char *a,uint32 a_length, const char *b,
uint32 b_length) uint32 b_length)
{ {
int diff; int diff=my_strnncoll(field_charset,
if (binary_flag) (const uchar*)a,min(a_length,b_length),
diff=memcmp(a,b,min(a_length,b_length)); (const uchar*)b,min(a_length,b_length));
else
diff=my_strnncoll(field_charset,
(const uchar*)a,min(a_length,b_length),
(const uchar*)b,min(a_length,b_length));
return diff ? diff : (int) (a_length - b_length); return diff ? diff : (int) (a_length - b_length);
} }
@ -4542,7 +4527,7 @@ void Field_blob::sort_string(char *to,uint length)
if (blob_length > length) if (blob_length > length)
blob_length=length; blob_length=length;
memcpy_fixed(&blob,ptr+packlength,sizeof(char*)); memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
if (binary_flag) if (binary())
{ {
memcpy(to,blob,blob_length); memcpy(to,blob,blob_length);
to+=blob_length; to+=blob_length;
@ -4579,8 +4564,8 @@ void Field_blob::sql_type(String &res) const
case 4: str="long"; break; case 4: str="long"; break;
} }
res.set(str,(uint) strlen(str),default_charset_info); res.set(str,(uint) strlen(str),default_charset_info);
res.append(binary_flag ? "blob" : "text"); res.append(binary() ? "blob" : "text");
if (!binary_flag) if (!binary())
{ {
res.append(" character set "); res.append(" character set ");
res.append(field_charset->name); res.append(field_charset->name);
@ -4640,7 +4625,7 @@ int Field_blob::pack_cmp(const char *a, const char *b, uint key_length)
a_length= (uint) (uchar) *a++; a_length= (uint) (uchar) *a++;
b_length= (uint) (uchar) *b++; b_length= (uint) (uchar) *b++;
} }
if (binary_flag) if (binary())
{ {
int cmp= memcmp(a,b,min(a_length,b_length)); int cmp= memcmp(a,b,min(a_length,b_length));
return cmp ? cmp : (int) (a_length - b_length); return cmp ? cmp : (int) (a_length - b_length);
@ -4668,7 +4653,7 @@ int Field_blob::pack_cmp(const char *b, uint key_length)
{ {
b_length= (uint) (uchar) *b++; b_length= (uint) (uchar) *b++;
} }
if (binary_flag) if (binary())
{ {
int cmp= memcmp(a,b,min(a_length,b_length)); int cmp= memcmp(a,b,min(a_length,b_length));
return cmp ? cmp : (int) (a_length - b_length); return cmp ? cmp : (int) (a_length - b_length);
@ -4921,7 +4906,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
else else
val_ptr->set((const char*) typelib->type_names[tmp-1], val_ptr->set((const char*) typelib->type_names[tmp-1],
(uint) strlen(typelib->type_names[tmp-1]), (uint) strlen(typelib->type_names[tmp-1]),
default_charset_info); field_charset);
return val_ptr; return val_ptr;
} }
@ -4962,6 +4947,15 @@ void Field_enum::sql_type(String &res) const
flag=1; flag=1;
} }
res.append(')'); res.append(')');
if (binary())
{
res.append(" binary");
}
else
{
res.append(" character set ");
res.append(field_charset->name);
}
} }
@ -5065,7 +5059,7 @@ String *Field_set::val_str(String *val_buffer,
val_buffer->append(field_separator); val_buffer->append(field_separator);
String str(typelib->type_names[bitnr], String str(typelib->type_names[bitnr],
(uint) strlen(typelib->type_names[bitnr]), (uint) strlen(typelib->type_names[bitnr]),
default_charset_info); field_charset);
val_buffer->append(str); val_buffer->append(str);
} }
tmp>>=1; tmp>>=1;
@ -5089,6 +5083,15 @@ void Field_set::sql_type(String &res) const
flag=1; flag=1;
} }
res.append(')'); res.append(')');
if (binary())
{
res.append(" binary");
}
else
{
res.append(" character set ");
res.append(field_charset->name);
}
} }
/* returns 1 if the fields are equally defined */ /* returns 1 if the fields are equally defined */
@ -5187,6 +5190,7 @@ Field *make_field(char *ptr, uint32 field_length,
uchar *null_pos, uchar null_bit, uchar *null_pos, uchar null_bit,
uint pack_flag, uint pack_flag,
enum_field_types field_type, enum_field_types field_type,
CHARSET_INFO *field_charset,
Field::utype unireg_check, Field::utype unireg_check,
TYPELIB *interval, TYPELIB *interval,
const char *field_name, const char *field_name,
@ -5201,9 +5205,7 @@ Field *make_field(char *ptr, uint32 field_length,
{ {
if (!f_is_packed(pack_flag)) if (!f_is_packed(pack_flag))
return new Field_string(ptr,field_length,null_pos,null_bit, return new Field_string(ptr,field_length,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table, field_charset);
f_is_binary(pack_flag) != 0,
default_charset_info);
uint pack_length=calc_pack_length((enum_field_types) uint pack_length=calc_pack_length((enum_field_types)
f_packtype(pack_flag), f_packtype(pack_flag),
@ -5212,23 +5214,22 @@ Field *make_field(char *ptr, uint32 field_length,
if (f_is_blob(pack_flag)) if (f_is_blob(pack_flag))
return new Field_blob(ptr,null_pos,null_bit, return new Field_blob(ptr,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table,
pack_length,f_is_binary(pack_flag) != 0, pack_length, field_charset);
default_charset_info);
if (f_is_geom(pack_flag)) if (f_is_geom(pack_flag))
return new Field_geom(ptr,null_pos,null_bit, return new Field_geom(ptr,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table,
pack_length,f_is_binary(pack_flag) != 0); pack_length);
if (interval) if (interval)
{ {
if (f_is_enum(pack_flag)) if (f_is_enum(pack_flag))
return new Field_enum(ptr,field_length,null_pos,null_bit, return new Field_enum(ptr,field_length,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table,
pack_length, interval); pack_length, interval, field_charset);
else else
return new Field_set(ptr,field_length,null_pos,null_bit, return new Field_set(ptr,field_length,null_pos,null_bit,
unireg_check, field_name, table, unireg_check, field_name, table,
pack_length, interval); pack_length, interval, field_charset);
} }
} }

View File

@ -129,7 +129,7 @@ public:
tmp->table=new_table; tmp->table=new_table;
tmp->key_start=tmp->part_of_key=tmp->part_of_sortkey=0; tmp->key_start=tmp->part_of_key=tmp->part_of_sortkey=0;
tmp->unireg_check=Field::NONE; tmp->unireg_check=Field::NONE;
tmp->flags&= (NOT_NULL_FLAG | BLOB_FLAG | UNSIGNED_FLAG | ZEROFILL_FLAG | BINARY_FLAG | ENUM_FLAG | SET_FLAG); tmp->flags&= (NOT_NULL_FLAG | BLOB_FLAG | UNSIGNED_FLAG | ZEROFILL_FLAG | ENUM_FLAG | SET_FLAG);
tmp->reset_fields(); tmp->reset_fields();
} }
return tmp; return tmp;
@ -198,7 +198,7 @@ public:
uint fill_cache_field(struct st_cache_field *copy); uint fill_cache_field(struct st_cache_field *copy);
virtual bool get_date(TIME *ltime,bool fuzzydate); virtual bool get_date(TIME *ltime,bool fuzzydate);
virtual bool get_time(TIME *ltime); virtual bool get_time(TIME *ltime);
virtual CHARSET_INFO *charset(void) { return 0; } virtual CHARSET_INFO *charset(void) { return my_charset_bin; }
friend bool reopen_table(THD *,struct st_table *,bool); friend bool reopen_table(THD *,struct st_table *,bool);
friend int cre_myisam(my_string name, register TABLE *form, uint options, friend int cre_myisam(my_string name, register TABLE *form, uint options,
ulonglong auto_increment_value); ulonglong auto_increment_value);
@ -263,6 +263,7 @@ public:
CHARSET_INFO *charset(void) { return field_charset; } CHARSET_INFO *charset(void) { return field_charset; }
inline void set_charset(CHARSET_INFO *charset) { field_charset=charset; } inline void set_charset(CHARSET_INFO *charset) { field_charset=charset; }
bool binary() const { return field_charset->state & MY_CS_BINSORT ? 1 : 0; }
inline int cmp_image(char *buff,uint length) inline int cmp_image(char *buff,uint length)
{ {
if (binary()) if (binary())
@ -740,28 +741,17 @@ public:
class Field_string :public Field_str { class Field_string :public Field_str {
bool binary_flag;
public: public:
Field_string(char *ptr_arg, uint32 len_arg,uchar *null_ptr_arg, Field_string(char *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
uchar null_bit_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,bool binary_arg, CHARSET_INFO *cs) struct st_table *table_arg, CHARSET_INFO *cs)
:Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, table_arg,cs), unireg_check_arg, field_name_arg, table_arg,cs) {};
binary_flag(binary_arg)
{
if (binary_arg)
flags|=BINARY_FLAG;
}
Field_string(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg, Field_string(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
struct st_table *table_arg, bool binary_arg, CHARSET_INFO *cs) struct st_table *table_arg, CHARSET_INFO *cs)
:Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0, :Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, table_arg, cs), NONE, field_name_arg, table_arg, cs) {};
binary_flag(binary_arg)
{
if (binary_arg)
flags|=BINARY_FLAG;
}
enum_field_types type() const enum_field_types type() const
{ {
@ -770,9 +760,8 @@ public:
FIELD_TYPE_VAR_STRING : FIELD_TYPE_STRING); FIELD_TYPE_VAR_STRING : FIELD_TYPE_STRING);
} }
enum ha_base_keytype key_type() const enum ha_base_keytype key_type() const
{ return binary_flag ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; } { return binary() ? HA_KEYTYPE_BINARY : HA_KEYTYPE_TEXT; }
bool zero_pack() const { return 0; } bool zero_pack() const { return 0; }
bool binary() const { return binary_flag; }
void reset(void) { bfill(ptr,field_length,' '); } void reset(void) { bfill(ptr,field_length,' '); }
int store(const char *to,uint length,CHARSET_INFO *charset); int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr); int store(double nr);
@ -795,34 +784,22 @@ public:
class Field_varstring :public Field_str { class Field_varstring :public Field_str {
bool binary_flag;
public: public:
Field_varstring(char *ptr_arg, uint32 len_arg,uchar *null_ptr_arg, Field_varstring(char *ptr_arg, uint32 len_arg,uchar *null_ptr_arg,
uchar null_bit_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,bool binary_arg, CHARSET_INFO *cs) struct st_table *table_arg, CHARSET_INFO *cs)
:Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, table_arg, cs), unireg_check_arg, field_name_arg, table_arg, cs) {};
binary_flag(binary_arg)
{
if (binary_arg)
flags|=BINARY_FLAG;
}
Field_varstring(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg, Field_varstring(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
struct st_table *table_arg, bool binary_arg, CHARSET_INFO *cs) struct st_table *table_arg, CHARSET_INFO *cs)
:Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0, :Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, table_arg, cs), NONE, field_name_arg, table_arg, cs) {};
binary_flag(binary_arg)
{
if (binary_arg)
flags|=BINARY_FLAG;
}
enum_field_types type() const { return FIELD_TYPE_VAR_STRING; } enum_field_types type() const { return FIELD_TYPE_VAR_STRING; }
enum ha_base_keytype key_type() const enum ha_base_keytype key_type() const
{ return binary_flag ? HA_KEYTYPE_VARBINARY : HA_KEYTYPE_VARTEXT; } { return binary() ? HA_KEYTYPE_VARBINARY : HA_KEYTYPE_VARTEXT; }
bool zero_pack() const { return 0; } bool zero_pack() const { return 0; }
bool binary() const { return binary_flag; }
void reset(void) { bzero(ptr,field_length+2); } void reset(void) { bzero(ptr,field_length+2); }
uint32 pack_length() const { return (uint32) field_length+2; } uint32 pack_length() const { return (uint32) field_length+2; }
uint32 key_length() const { return (uint32) field_length; } uint32 key_length() const { return (uint32) field_length; }
@ -849,26 +826,23 @@ public:
class Field_blob :public Field_str { class Field_blob :public Field_str {
uint packlength; uint packlength;
String value; // For temporaries String value; // For temporaries
bool binary_flag;
bool geom_flag; bool geom_flag;
public: public:
Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint blob_pack_length, struct st_table *table_arg,uint blob_pack_length,
bool binary_arg, CHARSET_INFO *cs); CHARSET_INFO *cs);
Field_blob(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg, Field_blob(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
struct st_table *table_arg, bool binary_arg, CHARSET_INFO *cs) struct st_table *table_arg, CHARSET_INFO *cs)
:Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0, :Field_str((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0,0,
NONE, field_name_arg, table_arg, cs), NONE, field_name_arg, table_arg, cs),
packlength(3),binary_flag(binary_arg), geom_flag(true) packlength(3), geom_flag(true)
{ {
flags|= BLOB_FLAG; flags|= BLOB_FLAG;
if (binary_arg)
flags|=BINARY_FLAG;
} }
enum_field_types type() const { return FIELD_TYPE_BLOB;} enum_field_types type() const { return FIELD_TYPE_BLOB;}
enum ha_base_keytype key_type() const enum ha_base_keytype key_type() const
{ return binary_flag ? HA_KEYTYPE_VARBINARY : HA_KEYTYPE_VARTEXT; } { return binary() ? HA_KEYTYPE_VARBINARY : HA_KEYTYPE_VARTEXT; }
int store(const char *to,uint length,CHARSET_INFO *charset); int store(const char *to,uint length,CHARSET_INFO *charset);
int store(double nr); int store(double nr);
int store(longlong nr); int store(longlong nr);
@ -892,7 +866,6 @@ public:
inline uint32 get_length(uint row_offset=0) inline uint32 get_length(uint row_offset=0)
{ return get_length(ptr+row_offset); } { return get_length(ptr+row_offset); }
uint32 get_length(const char *ptr); uint32 get_length(const char *ptr);
bool binary() const { return binary_flag; }
inline void get_ptr(char **str) inline void get_ptr(char **str)
{ {
memcpy_fixed(str,ptr+packlength,sizeof(char*)); memcpy_fixed(str,ptr+packlength,sizeof(char*));
@ -940,15 +913,13 @@ class Field_geom :public Field_blob {
public: public:
Field_geom(char *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg, Field_geom(char *ptr_arg, uchar *null_ptr_arg, uint null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint blob_pack_length, struct st_table *table_arg,uint blob_pack_length)
bool binary_arg)
:Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, :Field_blob(ptr_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
field_name_arg, table_arg, blob_pack_length,binary_arg, field_name_arg, table_arg, blob_pack_length,my_charset_bin) {}
default_charset_info) {}
Field_geom(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg, Field_geom(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
struct st_table *table_arg, bool binary_arg) struct st_table *table_arg)
:Field_blob(len_arg, maybe_null_arg, field_name_arg, :Field_blob(len_arg, maybe_null_arg, field_name_arg,
table_arg, binary_arg, default_charset_info) {} table_arg, my_charset_bin) {}
enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY; } enum ha_base_keytype key_type() const { return HA_KEYTYPE_VARBINARY; }
void get_key_image(char *buff,uint length, imagetype type); void get_key_image(char *buff,uint length, imagetype type);
@ -965,9 +936,10 @@ public:
uchar null_bit_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint packlength_arg, struct st_table *table_arg,uint packlength_arg,
TYPELIB *typelib_arg) TYPELIB *typelib_arg,
CHARSET_INFO *charset_arg)
:Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, :Field_str(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, table_arg, default_charset_info), unireg_check_arg, field_name_arg, table_arg, charset_arg),
packlength(packlength_arg),typelib(typelib_arg) packlength(packlength_arg),typelib(typelib_arg)
{ {
flags|=ENUM_FLAG; flags|=ENUM_FLAG;
@ -991,7 +963,6 @@ public:
enum_field_types real_type() const { return FIELD_TYPE_ENUM; } enum_field_types real_type() const { return FIELD_TYPE_ENUM; }
virtual bool zero_pack() const { return 0; } virtual bool zero_pack() const { return 0; }
bool optimize_range(uint idx) { return 0; } bool optimize_range(uint idx) { return 0; }
bool binary() const { return 0; }
bool eq_def(Field *field); bool eq_def(Field *field);
}; };
@ -1002,11 +973,11 @@ public:
uchar null_bit_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg, enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint32 packlength_arg, struct st_table *table_arg,uint32 packlength_arg,
TYPELIB *typelib_arg) TYPELIB *typelib_arg, CHARSET_INFO *charset_arg)
:Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, :Field_enum(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
unireg_check_arg, field_name_arg, unireg_check_arg, field_name_arg,
table_arg, packlength_arg, table_arg, packlength_arg,
typelib_arg) typelib_arg,charset_arg)
{ {
flags=(flags & ~ENUM_FLAG) | SET_FLAG; flags=(flags & ~ENUM_FLAG) | SET_FLAG;
} }
@ -1088,6 +1059,7 @@ public:
Field *make_field(char *ptr, uint32 field_length, Field *make_field(char *ptr, uint32 field_length,
uchar *null_pos, uchar null_bit, uchar *null_pos, uchar null_bit,
uint pack_flag, enum_field_types field_type, uint pack_flag, enum_field_types field_type,
CHARSET_INFO *cs,
Field::utype unireg_check, Field::utype unireg_check,
TYPELIB *interval, const char *field_name, TYPELIB *interval, const char *field_name,
struct st_table *table); struct st_table *table);
@ -1135,7 +1107,6 @@ bool test_if_int(const char *str,int length);
#define f_packtype(x) (((x) >> FIELDFLAG_PACK_SHIFT) & 15) #define f_packtype(x) (((x) >> FIELDFLAG_PACK_SHIFT) & 15)
#define f_decimals(x) ((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC)) #define f_decimals(x) ((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC))
#define f_is_alpha(x) (!f_is_num(x)) #define f_is_alpha(x) (!f_is_num(x))
#define f_is_binary(x) ((x) & FIELDFLAG_BINARY)
#define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL) #define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL)
#define f_is_bitfield(x) ((x) & FIELDFLAG_BITFIELD) #define f_is_bitfield(x) ((x) & FIELDFLAG_BITFIELD)
#define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB) #define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB)

View File

@ -498,7 +498,7 @@ static void make_sortkey(register SORTPARAM *param,
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if(use_strnxfrm(cs)) if(use_strnxfrm(cs))
{ {
if (item->binary) if (item->binary())
{ {
if (res->ptr() != (char*) to) if (res->ptr() != (char*) to)
memcpy(to,res->ptr(),length); memcpy(to,res->ptr(),length);
@ -525,7 +525,7 @@ static void make_sortkey(register SORTPARAM *param,
if (res->ptr() != (char*) to) if (res->ptr() != (char*) to)
memcpy(to,res->ptr(),length); memcpy(to,res->ptr(),length);
bzero((char *)to+length,diff); bzero((char *)to+length,diff);
if (!item->binary) if (!item->binary())
my_tosort(cs, (char*) to,length); my_tosort(cs, (char*) to,length);
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
} }
@ -948,7 +948,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
case STRING_RESULT: case STRING_RESULT:
sortorder->length=sortorder->item->max_length; sortorder->length=sortorder->item->max_length;
#ifdef USE_STRCOLL #ifdef USE_STRCOLL
if (!sortorder->item->binary) if (!sortorder->item->binary())
{ {
CHARSET_INFO *cs=sortorder->item->str_value.charset(); CHARSET_INFO *cs=sortorder->item->str_value.charset();
if (use_strnxfrm(cs)) if (use_strnxfrm(cs))

View File

@ -1404,7 +1404,7 @@ get_innobase_type_from_mysql_type(
DBUG_ASSERT((ulint)FIELD_TYPE_DECIMAL < 256); DBUG_ASSERT((ulint)FIELD_TYPE_DECIMAL < 256);
switch (field->type()) { switch (field->type()) {
case FIELD_TYPE_VAR_STRING: if (field->flags & BINARY_FLAG) { case FIELD_TYPE_VAR_STRING: if (field->binary()) {
return(DATA_BINARY); return(DATA_BINARY);
} else if (strcmp( } else if (strcmp(
@ -1414,7 +1414,7 @@ get_innobase_type_from_mysql_type(
} else { } else {
return(DATA_VARMYSQL); return(DATA_VARMYSQL);
} }
case FIELD_TYPE_STRING: if (field->flags & BINARY_FLAG) { case FIELD_TYPE_STRING: if (field->binary()) {
return(DATA_FIXBINARY); return(DATA_FIXBINARY);
} else if (strcmp( } else if (strcmp(

View File

@ -37,7 +37,7 @@ void item_init(void)
Item::Item() Item::Item()
{ {
marker=0; marker=0;
binary=maybe_null=null_value=with_sum_func=unsigned_flag=0; maybe_null=null_value=with_sum_func=unsigned_flag=0;
name=0; name=0;
decimals=0; max_length=0; decimals=0; max_length=0;
next=current_thd->free_list; // Put in free list next=current_thd->free_list; // Put in free list
@ -131,11 +131,8 @@ void Item_field::set_field(Field *field_par)
decimals= field->decimals(); decimals= field->decimals();
table_name=field_par->table_name; table_name=field_par->table_name;
field_name=field_par->field_name; field_name=field_par->field_name;
binary=field_par->binary();
unsigned_flag=test(field_par->flags & UNSIGNED_FLAG); unsigned_flag=test(field_par->flags & UNSIGNED_FLAG);
/* For string fields copy character set from original field */ str_value.set_charset(field_par->charset());
if (!field_par->binary())
str_value.set_charset(((Field_str*)field_par)->charset());
} }
const char *Item_ident::full_name() const const char *Item_ident::full_name() const
@ -670,7 +667,7 @@ int Item::save_in_field(Field *field)
field->result_type() == STRING_RESULT) field->result_type() == STRING_RESULT)
{ {
String *result; String *result;
CHARSET_INFO *cs=field->binary()?default_charset_info:((Field_str*)field)->charset(); CHARSET_INFO *cs=field->binary()?my_charset_bin:((Field_str*)field)->charset();
char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns
str_value.set_quick(buff,sizeof(buff),cs); str_value.set_quick(buff,sizeof(buff),cs);
result=val_str(&str_value); result=val_str(&str_value);
@ -702,7 +699,7 @@ int Item::save_in_field(Field *field)
int Item_string::save_in_field(Field *field) int Item_string::save_in_field(Field *field)
{ {
String *result; String *result;
CHARSET_INFO *cs=field->binary()?default_charset_info:((Field_str*)field)->charset(); CHARSET_INFO *cs=field->binary()?my_charset_bin:((Field_str*)field)->charset();
result=val_str(&str_value); result=val_str(&str_value);
if (null_value) if (null_value)
return set_field_to_null(field); return set_field_to_null(field);
@ -741,15 +738,14 @@ inline uint char_val(char X)
X-'a'+10); X-'a'+10);
} }
Item_varbinary::Item_varbinary(const char *str, uint str_length, Item_varbinary::Item_varbinary(const char *str, uint str_length)
CHARSET_INFO *cs)
{ {
name=(char*) str-2; // Lex makes this start with 0x name=(char*) str-2; // Lex makes this start with 0x
max_length=(str_length+1)/2; max_length=(str_length+1)/2;
char *ptr=(char*) sql_alloc(max_length+1); char *ptr=(char*) sql_alloc(max_length+1);
if (!ptr) if (!ptr)
return; return;
str_value.set(ptr,max_length,cs); str_value.set(ptr,max_length,my_charset_bin);
char *end=ptr+max_length; char *end=ptr+max_length;
if (max_length*2 != str_length) if (max_length*2 != str_length)
*ptr++=char_val(*str++); // Not even, assume 0 prefix *ptr++=char_val(*str++); // Not even, assume 0 prefix
@ -759,7 +755,6 @@ Item_varbinary::Item_varbinary(const char *str, uint str_length,
str+=2; str+=2;
} }
*ptr=0; // Keep purify happy *ptr=0; // Keep purify happy
binary=1; // Binary is default
} }
longlong Item_varbinary::val_int() longlong Item_varbinary::val_int()
@ -887,7 +882,6 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
max_length= (*ref)->max_length; max_length= (*ref)->max_length;
maybe_null= (*ref)->maybe_null; maybe_null= (*ref)->maybe_null;
decimals= (*ref)->decimals; decimals= (*ref)->decimals;
binary= (*ref)->binary;
} }
return 0; return 0;
} }

View File

@ -43,7 +43,6 @@ public:
uint8 marker,decimals; uint8 marker,decimals;
my_bool maybe_null; /* If item may be null */ my_bool maybe_null; /* If item may be null */
my_bool null_value; /* if item is null */ my_bool null_value; /* if item is null */
my_bool binary;
my_bool unsigned_flag; my_bool unsigned_flag;
my_bool with_sum_func; my_bool with_sum_func;
@ -71,6 +70,7 @@ public:
virtual double val_result() { return val(); } virtual double val_result() { return val(); }
virtual longlong val_int_result() { return val_int(); } virtual longlong val_int_result() { return val_int(); }
virtual String *str_result(String* tmp) { return val_str(tmp); } virtual String *str_result(String* tmp) { return val_str(tmp); }
virtual bool is_null_result() { return is_null(); }
virtual table_map used_tables() const { return (table_map) 0L; } virtual table_map used_tables() const { return (table_map) 0L; }
virtual bool basic_const_item() const { return 0; } virtual bool basic_const_item() const { return 0; }
virtual Item *new_item() { return 0; } /* Only for const items */ virtual Item *new_item() { return 0; } /* Only for const items */
@ -83,7 +83,10 @@ public:
virtual void split_sum_func(List<Item> &fields) {} virtual void split_sum_func(List<Item> &fields) {}
virtual bool get_date(TIME *ltime,bool fuzzydate); virtual bool get_date(TIME *ltime,bool fuzzydate);
virtual bool get_time(TIME *ltime); virtual bool get_time(TIME *ltime);
virtual bool is_null() { return 0; } virtual bool is_null() { return 0; };
virtual CHARSET_INFO *charset() const { return str_value.charset(); };
virtual bool binary() const { return str_value.charset()->state & MY_CS_BINSORT ? 1 : 0 ; }
virtual void set_charset(CHARSET_INFO *cs) { str_value.set_charset(cs); }
}; };
@ -124,6 +127,7 @@ public:
double val_result(); double val_result();
longlong val_int_result(); longlong val_int_result();
String *str_result(String* tmp); String *str_result(String* tmp);
bool is_null_result() { return result_field->is_null(); }
bool send(THD *thd, String *str_arg) bool send(THD *thd, String *str_arg)
{ {
return result_field->send(thd,str_arg); return result_field->send(thd,str_arg);
@ -359,7 +363,7 @@ public:
class Item_varbinary :public Item class Item_varbinary :public Item
{ {
public: public:
Item_varbinary(const char *str,uint str_length,CHARSET_INFO *cs); Item_varbinary(const char *str,uint str_length);
~Item_varbinary() {} ~Item_varbinary() {}
enum Type type() const { return VARBIN_ITEM; } enum Type type() const { return VARBIN_ITEM; }
double val() { return (double) Item_varbinary::val_int(); } double val() { return (double) Item_varbinary::val_int(); }
@ -398,25 +402,25 @@ public:
double val() double val()
{ {
double tmp=(*ref)->val_result(); double tmp=(*ref)->val_result();
null_value=(*ref)->null_value; null_value=(*ref)->is_null_result();
return tmp; return tmp;
} }
longlong val_int() longlong val_int()
{ {
longlong tmp=(*ref)->val_int_result(); longlong tmp=(*ref)->val_int_result();
null_value=(*ref)->null_value; null_value=(*ref)->is_null_result();
return tmp; return tmp;
} }
String *val_str(String* tmp) String *val_str(String* tmp)
{ {
tmp=(*ref)->str_result(tmp); tmp=(*ref)->str_result(tmp);
null_value=(*ref)->null_value; null_value=(*ref)->is_null_result();
return tmp; return tmp;
} }
bool is_null() bool is_null()
{ {
(void) (*ref)->val_int_result(); (void) (*ref)->val_int_result();
return (*ref)->null_value; return (*ref)->is_null_result();
} }
bool get_date(TIME *ltime,bool fuzzydate) bool get_date(TIME *ltime,bool fuzzydate)
{ {

View File

@ -56,7 +56,7 @@ bool Item_str_buff::cmp(void)
} }
else if (null_value) else if (null_value)
return 0; // new and old value was null return 0; // new and old value was null
else if (!item->binary) else if (!item->binary())
tmp= sortcmp(&value,res) != 0; tmp= sortcmp(&value,res) != 0;
else else
tmp= stringcmp(&value,res) != 0; tmp= stringcmp(&value,res) != 0;

View File

@ -128,7 +128,7 @@ int Item_bool_func2::compare_string()
if ((res2=args[1]->val_str(&tmp_value2))) if ((res2=args[1]->val_str(&tmp_value2)))
{ {
null_value=0; null_value=0;
return binary ? stringcmp(res1,res2) : sortcmp(res1,res2); return binary() ? stringcmp(res1,res2) : sortcmp(res1,res2);
} }
} }
null_value=1; null_value=1;
@ -199,7 +199,7 @@ longlong Item_func_equal::val_int()
res2=args[1]->val_str(&tmp_value2); res2=args[1]->val_str(&tmp_value2);
if (!res1 || !res2) if (!res1 || !res2)
return test(res1 == res2); return test(res1 == res2);
return (binary ? test(stringcmp(res1,res2) == 0) : return (binary() ? test(stringcmp(res1,res2) == 0) :
test(sortcmp(res1,res2) == 0)); test(sortcmp(res1,res2) == 0));
} }
case REAL_RESULT: case REAL_RESULT:
@ -266,7 +266,7 @@ longlong Item_func_strcmp::val_int()
null_value=1; null_value=1;
return 0; return 0;
} }
int value= binary ? stringcmp(a,b) : sortcmp(a,b); int value= binary() ? stringcmp(a,b) : sortcmp(a,b);
null_value=0; null_value=0;
return !value ? 0 : (value < 0 ? (longlong) -1 : (longlong) 1); return !value ? 0 : (value < 0 ? (longlong) -1 : (longlong) 1);
} }
@ -355,7 +355,7 @@ void Item_func_between::fix_length_and_dec()
if (!args[0] || !args[1] || !args[2]) if (!args[0] || !args[1] || !args[2])
return; return;
cmp_type=args[0]->result_type(); cmp_type=args[0]->result_type();
if (args[0]->binary) if (args[0]->binary())
string_compare=stringcmp; string_compare=stringcmp;
else else
string_compare=sortcmp; string_compare=sortcmp;
@ -511,21 +511,22 @@ Item_func_if::fix_length_and_dec()
if (null1) if (null1)
{ {
cached_result_type= arg2_type; cached_result_type= arg2_type;
binary= args[2]->binary; set_charset(args[2]->charset());
} }
else if (null2) else if (null2)
{ {
cached_result_type= arg1_type; cached_result_type= arg1_type;
binary= args[1]->binary; set_charset(args[1]->charset());
} }
else if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT) else if (arg1_type == STRING_RESULT || arg2_type == STRING_RESULT)
{ {
cached_result_type = STRING_RESULT; cached_result_type = STRING_RESULT;
binary=args[1]->binary | args[2]->binary; set_charset( (args[1]->binary() || args[2]->binary()) ?
my_charset_bin : args[1]->charset());
} }
else else
{ {
binary=1; // Number set_charset(my_charset_bin); // Number
if (arg1_type == REAL_RESULT || arg2_type == REAL_RESULT) if (arg1_type == REAL_RESULT || arg2_type == REAL_RESULT)
cached_result_type = REAL_RESULT; cached_result_type = REAL_RESULT;
else else
@ -663,7 +664,7 @@ Item *Item_func_case::find_item(String *str)
} }
if ((tmp=args[i]->val_str(str))) // If not null if ((tmp=args[i]->val_str(str))) // If not null
{ {
if (first_expr->binary || args[i]->binary) if (first_expr->binary() || args[i]->binary())
{ {
if (stringcmp(tmp,first_expr_str)==0) if (stringcmp(tmp,first_expr_str)==0)
return args[i+1]; return args[i+1];
@ -977,7 +978,7 @@ void Item_func_in::fix_length_and_dec()
{ {
switch (item->result_type()) { switch (item->result_type()) {
case STRING_RESULT: case STRING_RESULT:
if (item->binary) if (item->binary())
array=new in_string(arg_count,(qsort_cmp) stringcmp); /* purecov: inspected */ array=new in_string(arg_count,(qsort_cmp) stringcmp); /* purecov: inspected */
else else
array=new in_string(arg_count,(qsort_cmp) sortcmp); array=new in_string(arg_count,(qsort_cmp) sortcmp);
@ -1003,7 +1004,7 @@ void Item_func_in::fix_length_and_dec()
{ {
switch (item->result_type()) { switch (item->result_type()) {
case STRING_RESULT: case STRING_RESULT:
if (item->binary) if (item->binary())
in_item= new cmp_item_binary_string; in_item= new cmp_item_binary_string;
else else
in_item= new cmp_item_sort_string; in_item= new cmp_item_sort_string;
@ -1275,9 +1276,12 @@ longlong Item_func_like::val_int()
return 0; return 0;
} }
null_value=0; null_value=0;
if ((res->charset()->state & MY_CS_BINSORT) ||
(res2->charset()->state & MY_CS_BINSORT))
set_charset(my_charset_bin);
if (canDoTurboBM) if (canDoTurboBM)
return turboBM_matches(res->ptr(), res->length()) ? 1 : 0; return turboBM_matches(res->ptr(), res->length()) ? 1 : 0;
if (binary) if (binary())
return wild_compare(*res,*res2,escape) ? 0 : 1; return wild_compare(*res,*res2,escape) ? 0 : 1;
else else
return wild_case_compare(*res,*res2,escape) ? 0 : 1; return wild_case_compare(*res,*res2,escape) ? 0 : 1;
@ -1359,7 +1363,9 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
return 1; /* purecov: inspected */ return 1; /* purecov: inspected */
with_sum_func=args[0]->with_sum_func || args[1]->with_sum_func; with_sum_func=args[0]->with_sum_func || args[1]->with_sum_func;
max_length=1; decimals=0; max_length=1; decimals=0;
binary=args[0]->binary || args[1]->binary; if (args[0]->binary() || args[1]->binary())
set_charset(my_charset_bin);
used_tables_cache=args[0]->used_tables() | args[1]->used_tables(); used_tables_cache=args[0]->used_tables() | args[1]->used_tables();
const_item_cache=args[0]->const_item() && args[1]->const_item(); const_item_cache=args[0]->const_item() && args[1]->const_item();
if (!regex_compiled && args[1]->const_item()) if (!regex_compiled && args[1]->const_item())
@ -1374,7 +1380,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
} }
int error; int error;
if ((error=regcomp(&preg,res->c_ptr(), if ((error=regcomp(&preg,res->c_ptr(),
binary ? REG_EXTENDED | REG_NOSUB : binary() ? REG_EXTENDED | REG_NOSUB :
REG_EXTENDED | REG_NOSUB | REG_ICASE, REG_EXTENDED | REG_NOSUB | REG_ICASE,
res->charset()))) res->charset())))
{ {
@ -1421,7 +1427,7 @@ longlong Item_func_regex::val_int()
regex_compiled=0; regex_compiled=0;
} }
if (regcomp(&preg,res2->c_ptr(), if (regcomp(&preg,res2->c_ptr(),
binary ? REG_EXTENDED | REG_NOSUB : binary() ? REG_EXTENDED | REG_NOSUB :
REG_EXTENDED | REG_NOSUB | REG_ICASE, REG_EXTENDED | REG_NOSUB | REG_ICASE,
res->charset())) res->charset()))
@ -1471,7 +1477,7 @@ void Item_func_like::turboBM_compute_suffixes(int* suff)
*splm1 = pattern_len; *splm1 = pattern_len;
if (binary) if (binary())
{ {
int i; int i;
for (i = pattern_len - 2; i >= 0; i--) for (i = pattern_len - 2; i >= 0; i--)
@ -1574,7 +1580,7 @@ void Item_func_like::turboBM_compute_bad_character_shifts()
for (i = bmBc; i < end; i++) for (i = bmBc; i < end; i++)
*i = pattern_len; *i = pattern_len;
if (binary) if (binary())
{ {
for (j = 0; j < plm1; j++) for (j = 0; j < plm1; j++)
bmBc[pattern[j]] = plm1 - j; bmBc[pattern[j]] = plm1 - j;
@ -1605,7 +1611,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
const int tlmpl = text_len - pattern_len; const int tlmpl = text_len - pattern_len;
/* Searching */ /* Searching */
if (binary) if (binary())
{ {
while (j <= tlmpl) while (j <= tlmpl)
{ {

View File

@ -75,7 +75,6 @@ Item_func::Item_func(List<Item> &list)
Sets as a side effect the following class variables: Sets as a side effect the following class variables:
maybe_null Set if any argument may return NULL maybe_null Set if any argument may return NULL
binary Set if any of the arguments is binary
with_sum_func Set if any of the arguments contains a sum function with_sum_func Set if any of the arguments contains a sum function
used_table_cache Set to union of the arguments used table used_table_cache Set to union of the arguments used table
@ -97,7 +96,6 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{ {
Item **arg,**arg_end; Item **arg,**arg_end;
char buff[STACK_BUFF_ALLOC]; // Max argument in function char buff[STACK_BUFF_ALLOC]; // Max argument in function
binary=0;
used_tables_cache=0; used_tables_cache=0;
const_item_cache=1; const_item_cache=1;
@ -105,24 +103,24 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
return 0; // Fatal error if flag is set! return 0; // Fatal error if flag is set!
if (arg_count) if (arg_count)
{ // Print purify happy { // Print purify happy
/*
Set return character set to first argument if we are returning a
string.
*/
if (result_type() == STRING_RESULT)
set_charset((*args)->charset());
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++) for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
{ {
if ((*arg)->fix_fields(thd, tables, arg)) if ((*arg)->fix_fields(thd, tables, arg))
return 1; /* purecov: inspected */ return 1; /* purecov: inspected */
if ((*arg)->maybe_null) if ((*arg)->maybe_null)
maybe_null=1; maybe_null=1;
if ((*arg)->binary) if ((*arg)->binary())
binary=1; set_charset(my_charset_bin);
with_sum_func= with_sum_func || (*arg)->with_sum_func; with_sum_func= with_sum_func || (*arg)->with_sum_func;
used_tables_cache|=(*arg)->used_tables(); used_tables_cache|=(*arg)->used_tables();
const_item_cache&= (*arg)->const_item(); const_item_cache&= (*arg)->const_item();
} }
/*
Set return character set to first argument if we are returning a
string.
*/
if (result_type() == STRING_RESULT)
str_value.set_charset((*args)->str_value.charset());
} }
fix_length_and_dec(); fix_length_and_dec();
return 0; return 0;
@ -230,10 +228,10 @@ Field *Item_func::tmp_table_field(TABLE *t_arg)
break; break;
case STRING_RESULT: case STRING_RESULT:
if (max_length > 255) if (max_length > 255)
res= new Field_blob(max_length, maybe_null, name, t_arg, binary, res= new Field_blob(max_length, maybe_null, name, t_arg,
str_value.charset()); str_value.charset());
else else
res= new Field_string(max_length, maybe_null, name, t_arg, binary, res= new Field_string(max_length, maybe_null, name, t_arg,
str_value.charset()); str_value.charset());
break; break;
} }
@ -743,17 +741,31 @@ double Item_func_round::val()
double Item_func_rand::val() double Item_func_rand::val()
{ {
THD* thd = current_thd;
if (arg_count) if (arg_count)
{ // Only use argument once in query { // Only use argument once in query
uint32 tmp= (uint32) (args[0]->val_int()); uint32 tmp= (uint32) (args[0]->val_int());
randominit(&current_thd->rand,(uint32) (tmp*0x10001L+55555555L), randominit(&thd->rand,(uint32) (tmp*0x10001L+55555555L),
(uint32) (tmp*0x10000001L)); (uint32) (tmp*0x10000001L));
#ifdef DELETE_ITEMS #ifdef DELETE_ITEMS
delete args[0]; delete args[0];
#endif #endif
arg_count=0; arg_count=0;
} }
return rnd(&current_thd->rand); else if (!thd->rand_used)
{
// no need to send a Rand log event if seed was given eg: RAND(seed),
// as it will be replicated in the query as such.
// save the seed only the first time RAND() is used in the query
// once events are forwarded rather than recreated,
// the following can be skipped if inside the slave thread
thd->rand_used=1;
thd->rand_saved_seed1=thd->rand.seed1;
thd->rand_saved_seed2=thd->rand.seed2;
}
return rnd(&thd->rand);
} }
longlong Item_func_sign::val_int() longlong Item_func_sign::val_int()
@ -778,7 +790,6 @@ void Item_func_min_max::fix_length_and_dec()
decimals=0; decimals=0;
max_length=0; max_length=0;
maybe_null=1; maybe_null=1;
binary=0;
cmp_type=args[0]->result_type(); cmp_type=args[0]->result_type();
for (uint i=0 ; i < arg_count ; i++) for (uint i=0 ; i < arg_count ; i++)
{ {
@ -789,8 +800,8 @@ void Item_func_min_max::fix_length_and_dec()
if (!args[i]->maybe_null) if (!args[i]->maybe_null)
maybe_null=0; maybe_null=0;
cmp_type=item_cmp_type(cmp_type,args[i]->result_type()); cmp_type=item_cmp_type(cmp_type,args[i]->result_type());
if (args[i]->binary) if (args[i]->binary())
binary=1; set_charset(my_charset_bin);
} }
} }
@ -836,7 +847,7 @@ String *Item_func_min_max::val_str(String *str)
res2= args[i]->val_str(res == str ? &tmp_value : str); res2= args[i]->val_str(res == str ? &tmp_value : str);
if (res2) if (res2)
{ {
int cmp=binary ? stringcmp(res,res2) : sortcmp(res,res2); int cmp=binary() ? stringcmp(res,res2) : sortcmp(res,res2);
if ((cmp_sign < 0 ? cmp : -cmp) < 0) if ((cmp_sign < 0 ? cmp : -cmp) < 0)
res=res2; res=res2;
} }
@ -926,7 +937,7 @@ longlong Item_func_char_length::val_int()
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
} }
null_value=0; null_value=0;
return (longlong) (!args[0]->binary) ? res->numchars() : res->length(); return (longlong) (!args[0]->binary()) ? res->numchars() : res->length();
} }
@ -934,7 +945,7 @@ longlong Item_func_locate::val_int()
{ {
String *a=args[0]->val_str(&value1); String *a=args[0]->val_str(&value1);
String *b=args[1]->val_str(&value2); String *b=args[1]->val_str(&value2);
bool binary_str = args[0]->binary || args[1]->binary; bool binary_str = args[0]->binary() || args[1]->binary();
if (!a || !b) if (!a || !b)
{ {
null_value=1; null_value=1;
@ -989,7 +1000,7 @@ longlong Item_func_locate::val_int()
return 0; return 0;
} }
#endif /* USE_MB */ #endif /* USE_MB */
return (longlong) (binary ? a->strstr(*b,start) : return (longlong) (binary() ? a->strstr(*b,start) :
(a->strstr_case(*b,start)))+1; (a->strstr_case(*b,start)))+1;
} }
@ -1033,7 +1044,7 @@ longlong Item_func_ord::val_int()
null_value=0; null_value=0;
if (!res->length()) return 0; if (!res->length()) return 0;
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !args[0]->binary) if (use_mb(res->charset()) && !args[0]->binary())
{ {
register const char *str=res->ptr(); register const char *str=res->ptr();
register uint32 n=0, l=my_ismbchar(res->charset(),str,str+res->length()); register uint32 n=0, l=my_ismbchar(res->charset(),str,str+res->length());
@ -1232,7 +1243,7 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func,
args=arguments; args=arguments;
/* Fix all arguments */ /* Fix all arguments */
func->binary=func->maybe_null=0; func->maybe_null=0;
used_tables_cache=0; used_tables_cache=0;
const_item_cache=1; const_item_cache=1;
@ -1253,8 +1264,8 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func,
{ {
if ((*arg)->fix_fields(thd, tables, arg)) if ((*arg)->fix_fields(thd, tables, arg))
return 1; return 1;
if ((*arg)->binary) if ((*arg)->binary())
func->binary=1; func->set_charset(my_charset_bin);
if ((*arg)->maybe_null) if ((*arg)->maybe_null)
func->maybe_null=1; func->maybe_null=1;
func->with_sum_func= func->with_sum_func || (*arg)->with_sum_func; func->with_sum_func= func->with_sum_func || (*arg)->with_sum_func;
@ -2169,8 +2180,9 @@ err:
void Item_func_match::init_search(bool no_order) void Item_func_match::init_search(bool no_order)
{ {
DBUG_ENTER("Item_func_match::init_search");
if (ft_handler) if (ft_handler)
return; DBUG_VOID_RETURN;
if (key == NO_SUCH_KEY) if (key == NO_SUCH_KEY)
concat=new Item_func_concat_ws(new Item_string(" ",1, concat=new Item_func_concat_ws(new Item_string(" ",1,
@ -2183,7 +2195,7 @@ void Item_func_match::init_search(bool no_order)
master->init_search(no_order); master->init_search(no_order);
ft_handler=master->ft_handler; ft_handler=master->ft_handler;
join_key=master->join_key; join_key=master->join_key;
return; DBUG_VOID_RETURN;
} }
String *ft_tmp= 0; String *ft_tmp= 0;
@ -2203,10 +2215,9 @@ void Item_func_match::init_search(bool no_order)
join_key && !no_order); join_key && !no_order);
if (join_key) if (join_key)
{
table->file->ft_handler=ft_handler; table->file->ft_handler=ft_handler;
return;
} DBUG_VOID_RETURN;
} }
@ -2356,13 +2367,14 @@ bool Item_func_match::eq(const Item *item, bool binary_cmp) const
double Item_func_match::val() double Item_func_match::val()
{ {
DBUG_ENTER("Item_func_match::val");
if (ft_handler == NULL) if (ft_handler == NULL)
return -1.0; DBUG_RETURN(-1.0);
if (join_key) if (join_key)
{ {
if (table->file->ft_handler) if (table->file->ft_handler)
return ft_handler->please->get_relevance(ft_handler); DBUG_RETURN(ft_handler->please->get_relevance(ft_handler));
join_key=0; join_key=0;
} }
@ -2370,12 +2382,12 @@ double Item_func_match::val()
{ {
String *a= concat->val_str(&value); String *a= concat->val_str(&value);
if ((null_value= (a == 0))) if ((null_value= (a == 0)))
return 0; DBUG_RETURN(0);
return ft_handler->please->find_relevance(ft_handler, DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
(byte *)a->ptr(), a->length()); (byte *)a->ptr(), a->length()));
} }
else else
return ft_handler->please->find_relevance(ft_handler, record, 0); DBUG_RETURN(ft_handler->please->find_relevance(ft_handler, record, 0));
} }

View File

@ -232,6 +232,8 @@ String *Item_func_concat::val_str(String *str)
use_as_buff= &tmp_value; use_as_buff= &tmp_value;
for (i=1 ; i < arg_count ; i++) for (i=1 ; i < arg_count ; i++)
{ {
if (args[i]->binary())
set_charset(my_charset_bin);
if (res->length() == 0) if (res->length() == 0)
{ {
if (!(res=args[i]->val_str(str))) if (!(res=args[i]->val_str(str)))
@ -260,6 +262,7 @@ String *Item_func_concat::val_str(String *str)
str->append(*res2); str->append(*res2);
} }
res=str; res=str;
res->set_charset(charset());
} }
else if (res == &tmp_value) else if (res == &tmp_value)
{ {
@ -271,6 +274,7 @@ String *Item_func_concat::val_str(String *str)
if (tmp_value.replace(0,0,*res)) if (tmp_value.replace(0,0,*res))
goto null; goto null;
res= &tmp_value; res= &tmp_value;
res->set_charset(charset());
use_as_buff=str; // Put next arg here use_as_buff=str; // Put next arg here
} }
else if (tmp_value.is_alloced() && res2->ptr() >= tmp_value.ptr() && else if (tmp_value.is_alloced() && res2->ptr() >= tmp_value.ptr() &&
@ -289,6 +293,7 @@ String *Item_func_concat::val_str(String *str)
*res)) *res))
goto null; goto null;
res= &tmp_value; res= &tmp_value;
res->set_charset(charset());
use_as_buff=str; // Put next arg here use_as_buff=str; // Put next arg here
} }
else else
@ -298,6 +303,7 @@ String *Item_func_concat::val_str(String *str)
tmp_value.append(*res2)) tmp_value.append(*res2))
goto null; goto null;
res= &tmp_value; res= &tmp_value;
res->set_charset(charset());
use_as_buff=str; use_as_buff=str;
} }
} }
@ -626,7 +632,7 @@ String *Item_func_reverse::val_str(String *str)
ptr = (char *) res->ptr(); ptr = (char *) res->ptr();
end=ptr+res->length(); end=ptr+res->length();
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
{ {
String tmpstr; String tmpstr;
tmpstr.copy(*res); tmpstr.copy(*res);
@ -689,7 +695,7 @@ String *Item_func_replace::val_str(String *str)
goto null; goto null;
#ifdef USE_MB #ifdef USE_MB
binary_str = (args[0]->binary || args[1]->binary || !use_mb(res->charset())); binary_str = (args[0]->binary() || args[1]->binary() || !use_mb(res->charset()));
#endif #endif
if (res2->length() == 0) if (res2->length() == 0)
@ -797,7 +803,7 @@ String *Item_func_insert::val_str(String *str)
args[3]->null_value) args[3]->null_value)
goto null; /* purecov: inspected */ goto null; /* purecov: inspected */
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !args[0]->binary) if (use_mb(res->charset()) && !args[0]->binary())
{ {
start=res->charpos(start); start=res->charpos(start);
length=res->charpos(length,start); length=res->charpos(length,start);
@ -870,7 +876,7 @@ String *Item_func_left::val_str(String *str)
if (length <= 0) if (length <= 0)
return &empty_string; return &empty_string;
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
length = res->charpos(length); length = res->charpos(length);
#endif #endif
if (res->length() > (ulong) length) if (res->length() > (ulong) length)
@ -878,7 +884,7 @@ String *Item_func_left::val_str(String *str)
if (!res->alloced_length()) if (!res->alloced_length())
{ // Don't change const str { // Don't change const str
str_value= *res; // Not malloced string str_value= *res; // Not malloced string
str_value.set_charset(res->charset()); set_charset(res->charset());
res= &str_value; res= &str_value;
} }
res->length((uint) length); res->length((uint) length);
@ -919,7 +925,7 @@ String *Item_func_right::val_str(String *str)
if (res->length() <= (uint) length) if (res->length() <= (uint) length)
return res; /* purecov: inspected */ return res; /* purecov: inspected */
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
{ {
uint start=res->numchars()-(uint) length; uint start=res->numchars()-(uint) length;
if (start<=0) return res; if (start<=0) return res;
@ -952,7 +958,7 @@ String *Item_func_substr::val_str(String *str)
(arg_count == 3 && args[2]->null_value)))) (arg_count == 3 && args[2]->null_value))))
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
{ {
start=res->charpos(start); start=res->charpos(start);
length=res->charpos(length,start); length=res->charpos(length,start);
@ -1012,7 +1018,7 @@ String *Item_func_substr_index::val_str(String *str)
return &empty_string; // Wrong parameters return &empty_string; // Wrong parameters
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
{ {
const char *ptr=res->ptr(); const char *ptr=res->ptr();
const char *strend = ptr+res->length(); const char *strend = ptr+res->length();
@ -1166,7 +1172,7 @@ String *Item_func_rtrim::val_str(String *str)
{ {
char chr=(*remove_str)[0]; char chr=(*remove_str)[0];
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
{ {
while (ptr < end) while (ptr < end)
{ {
@ -1183,7 +1189,7 @@ String *Item_func_rtrim::val_str(String *str)
{ {
const char *r_ptr=remove_str->ptr(); const char *r_ptr=remove_str->ptr();
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
{ {
loop: loop:
while (ptr + remove_length < end) while (ptr + remove_length < end)
@ -1234,7 +1240,7 @@ String *Item_func_trim::val_str(String *str)
while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length)) while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length))
ptr+=remove_length; ptr+=remove_length;
#ifdef USE_MB #ifdef USE_MB
if (use_mb(res->charset()) && !binary) if (use_mb(res->charset()) && !binary())
{ {
char *p=ptr; char *p=ptr;
register uint32 l; register uint32 l;
@ -1979,7 +1985,7 @@ outp:
void Item_func_conv_charset::fix_length_and_dec() void Item_func_conv_charset::fix_length_and_dec()
{ {
max_length = args[0]->max_length*(conv_charset->mbmaxlen?conv_charset->mbmaxlen:1); max_length = args[0]->max_length*(conv_charset->mbmaxlen?conv_charset->mbmaxlen:1);
str_value.set_charset(conv_charset); set_charset(conv_charset);
} }
@ -2054,7 +2060,6 @@ outp:
bool Item_func_conv_charset::fix_fields(THD *thd,struct st_table_list *tables, Item **ref) bool Item_func_conv_charset::fix_fields(THD *thd,struct st_table_list *tables, Item **ref)
{ {
char buff[STACK_BUFF_ALLOC]; // Max argument in function char buff[STACK_BUFF_ALLOC]; // Max argument in function
binary=0;
used_tables_cache=0; used_tables_cache=0;
const_item_cache=1; const_item_cache=1;
@ -2063,9 +2068,8 @@ bool Item_func_conv_charset::fix_fields(THD *thd,struct st_table_list *tables, I
if (args[0]->fix_fields(thd, tables, args)) if (args[0]->fix_fields(thd, tables, args))
return 1; return 1;
maybe_null=args[0]->maybe_null; maybe_null=args[0]->maybe_null;
binary=args[0]->binary;
const_item_cache=args[0]->const_item(); const_item_cache=args[0]->const_item();
str_value.set_charset(conv_charset); set_charset(conv_charset);
fix_length_and_dec(); fix_length_and_dec();
return 0; return 0;
} }
@ -2088,7 +2092,6 @@ String *Item_func_set_collation::val_str(String *str)
bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables, Item **ref) bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables, Item **ref)
{ {
char buff[STACK_BUFF_ALLOC]; // Max argument in function char buff[STACK_BUFF_ALLOC]; // Max argument in function
binary=0;
used_tables_cache=0; used_tables_cache=0;
const_item_cache=1; const_item_cache=1;
@ -2097,8 +2100,7 @@ bool Item_func_set_collation::fix_fields(THD *thd,struct st_table_list *tables,
if (args[0]->fix_fields(thd, tables, args)) if (args[0]->fix_fields(thd, tables, args))
return 1; return 1;
maybe_null=args[0]->maybe_null; maybe_null=args[0]->maybe_null;
binary=args[0]->binary; set_charset(set_collation);
str_value.set_charset(set_collation);
with_sum_func= with_sum_func || args[0]->with_sum_func; with_sum_func= with_sum_func || args[0]->with_sum_func;
used_tables_cache=args[0]->used_tables(); used_tables_cache=args[0]->used_tables();
const_item_cache=args[0]->const_item(); const_item_cache=args[0]->const_item();

View File

@ -411,7 +411,7 @@ class Item_func_char :public Item_str_func
public: public:
Item_func_char(List<Item> &list) :Item_str_func(list) {} Item_func_char(List<Item> &list) :Item_str_func(list) {}
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec() { maybe_null=0; max_length=arg_count; binary=0;} void fix_length_and_dec() { maybe_null=0; max_length=arg_count; }
const char *func_name() const { return "char"; } const char *func_name() const { return "char"; }
}; };
@ -483,7 +483,11 @@ public:
null_value=args[0]->null_value; null_value=args[0]->null_value;
return tmp; return tmp;
} }
void fix_length_and_dec() { binary=1; max_length=args[0]->max_length; } void fix_length_and_dec()
{
str_value.set_charset(my_charset_bin);
max_length=args[0]->max_length;
}
void print(String *str) { print_op(str); } void print(String *str) { print_op(str); }
}; };
@ -496,7 +500,11 @@ public:
String *val_str(String *); String *val_str(String *);
const char *func_name() const { return "load_file"; } const char *func_name() const { return "load_file"; }
void fix_length_and_dec() void fix_length_and_dec()
{ binary=1; maybe_null=1; max_length=MAX_BLOB_WIDTH;} {
str_value.set_charset(my_charset_bin);
maybe_null=1;
max_length=MAX_BLOB_WIDTH;
}
}; };

View File

@ -160,7 +160,6 @@ Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
max_length=item->max_length; max_length=item->max_length;
decimals=item->decimals; decimals=item->decimals;
maybe_null=item->maybe_null; maybe_null=item->maybe_null;
binary=item->binary;
unsigned_flag=item->unsigned_flag; unsigned_flag=item->unsigned_flag;
result_field=0; result_field=0;
null_value=1; null_value=1;
@ -380,7 +379,7 @@ bool Item_sum_min::add()
String *result=args[0]->val_str(&tmp_value); String *result=args[0]->val_str(&tmp_value);
if (!args[0]->null_value && if (!args[0]->null_value &&
(null_value || (null_value ||
(binary ? stringcmp(&value,result) : sortcmp(&value,result)) > 0)) (binary() ? stringcmp(&value,result) : sortcmp(&value,result)) > 0))
{ {
value.copy(*result); value.copy(*result);
null_value=0; null_value=0;
@ -423,7 +422,7 @@ bool Item_sum_max::add()
String *result=args[0]->val_str(&tmp_value); String *result=args[0]->val_str(&tmp_value);
if (!args[0]->null_value && if (!args[0]->null_value &&
(null_value || (null_value ||
(binary ? stringcmp(&value,result) : sortcmp(&value,result)) < 0)) (binary() & MY_CS_BINSORT ? stringcmp(&value,result) : sortcmp(&value,result)) < 0))
{ {
value.copy(*result); value.copy(*result);
null_value=0; null_value=0;
@ -693,7 +692,7 @@ Item_sum_hybrid::min_max_update_str_field(int offset)
result_field->ptr-=offset; result_field->ptr-=offset;
if (result_field->is_null() || if (result_field->is_null() ||
(cmp_sign * (binary ? stringcmp(res_str,&tmp_value) : (cmp_sign * (binary() ? stringcmp(res_str,&tmp_value) :
sortcmp(res_str,&tmp_value)) < 0)) sortcmp(res_str,&tmp_value)) < 0))
result_field->store(res_str->ptr(),res_str->length(),res_str->charset()); result_field->store(res_str->ptr(),res_str->length(),res_str->charset());
else else

View File

@ -1072,6 +1072,13 @@ bool MYSQL_LOG::write(Log_event* event_info)
if (e.write(file)) if (e.write(file))
goto err; goto err;
} }
if (thd && thd->rand_used)
{
Rand_log_event e(thd,thd->rand_saved_seed1,thd->rand_saved_seed2);
e.set_log_pos(this);
if (e.write(file))
goto err;
}
if (thd && thd->variables.convert_set) if (thd && thd->variables.convert_set)
{ {
char buf[1024] = "SET CHARACTER SET "; char buf[1024] = "SET CHARACTER SET ";

View File

@ -348,6 +348,18 @@ void Intvar_log_event::pack_info(String* packet)
net_store_data(packet, tmp.ptr(), tmp.length()); net_store_data(packet, tmp.ptr(), tmp.length());
} }
void Rand_log_event::pack_info(String* packet)
{
char buf1[256], buf[22];
String tmp(buf1, sizeof(buf1), system_charset_info);
tmp.length(0);
tmp.append("randseed1=");
tmp.append(llstr(seed1, buf));
tmp.append(",randseed2=");
tmp.append(llstr(seed2, buf));
net_store_data(packet, tmp.ptr(), tmp.length());
}
void Slave_log_event::pack_info(String* packet) void Slave_log_event::pack_info(String* packet)
{ {
char buf1[256], buf[22], *end; char buf1[256], buf[22], *end;
@ -376,6 +388,9 @@ void Log_event::init_show_field_list(List<Item>* field_list)
field_list->push_back(new Item_empty_string("Info", 20)); field_list->push_back(new Item_empty_string("Info", 20));
} }
/*
* only called by SHOW BINLOG EVENTS
*/
int Log_event::net_send(THD* thd, const char* log_name, my_off_t pos) int Log_event::net_send(THD* thd, const char* log_name, my_off_t pos)
{ {
String* packet = &thd->packet; String* packet = &thd->packet;
@ -610,6 +625,9 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len,
case INTVAR_EVENT: case INTVAR_EVENT:
ev = new Intvar_log_event(buf, old_format); ev = new Intvar_log_event(buf, old_format);
break; break;
case RAND_EVENT:
ev = new Rand_log_event(buf, old_format);
break;
default: default:
break; break;
} }
@ -915,6 +933,41 @@ void Intvar_log_event::print(FILE* file, bool short_form, char* last_db)
} }
#endif #endif
/*****************************************************************************
*
* Rand log event
*
****************************************************************************/
Rand_log_event::Rand_log_event(const char* buf, bool old_format)
:Log_event(buf, old_format)
{
buf += (old_format) ? OLD_HEADER_LEN : LOG_EVENT_HEADER_LEN;
seed1 = uint8korr(buf+RAND_SEED1_OFFSET);
seed2 = uint8korr(buf+RAND_SEED2_OFFSET);
}
int Rand_log_event::write_data(IO_CACHE* file)
{
char buf[16];
int8store(buf + RAND_SEED1_OFFSET, seed1);
int8store(buf + RAND_SEED2_OFFSET, seed2);
return my_b_safe_write(file, (byte*) buf, sizeof(buf));
}
#ifdef MYSQL_CLIENT
void Rand_log_event::print(FILE* file, bool short_form, char* last_db)
{
char llbuff[22];
if (!short_form)
{
print_header(file);
fprintf(file, "\tRand\n");
}
fprintf(file, "SET RAND SEED1=%s;\n", llstr(seed1, llbuff));
fprintf(file, "SET RAND SEED2=%s;\n", llstr(seed2, llbuff));
fflush(file);
}
#endif
int Load_log_event::write_data_header(IO_CACHE* file) int Load_log_event::write_data_header(IO_CACHE* file)
{ {
@ -1926,6 +1979,14 @@ int Intvar_log_event::exec_event(struct st_relay_log_info* rli)
return 0; return 0;
} }
int Rand_log_event::exec_event(struct st_relay_log_info* rli)
{
thd->rand.seed1 = seed1;
thd->rand.seed2 = seed2;
rli->inc_pending(get_event_len());
return 0;
}
int Slave_log_event::exec_event(struct st_relay_log_info* rli) int Slave_log_event::exec_event(struct st_relay_log_info* rli)
{ {
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())

View File

@ -152,6 +152,11 @@ struct sql_ex_info
#define I_TYPE_OFFSET 0 #define I_TYPE_OFFSET 0
#define I_VAL_OFFSET 1 #define I_VAL_OFFSET 1
/* Rand event post-header */
#define RAND_SEED1_OFFSET 0
#define RAND_SEED2_OFFSET 8
/* Load event post-header */ /* Load event post-header */
#define L_THREAD_ID_OFFSET 0 #define L_THREAD_ID_OFFSET 0
@ -199,7 +204,7 @@ enum Log_event_type
START_EVENT = 1, QUERY_EVENT =2, STOP_EVENT=3, ROTATE_EVENT = 4, START_EVENT = 1, QUERY_EVENT =2, STOP_EVENT=3, ROTATE_EVENT = 4,
INTVAR_EVENT=5, LOAD_EVENT=6, SLAVE_EVENT=7, CREATE_FILE_EVENT=8, INTVAR_EVENT=5, LOAD_EVENT=6, SLAVE_EVENT=7, CREATE_FILE_EVENT=8,
APPEND_BLOCK_EVENT=9, EXEC_LOAD_EVENT=10, DELETE_FILE_EVENT=11, APPEND_BLOCK_EVENT=9, EXEC_LOAD_EVENT=10, DELETE_FILE_EVENT=11,
NEW_LOAD_EVENT=12 NEW_LOAD_EVENT=12, RAND_EVENT=13
}; };
enum Int_event_type enum Int_event_type
@ -497,11 +502,39 @@ public:
bool is_valid() { return 1; } bool is_valid() { return 1; }
}; };
/*****************************************************************************
*
* Rand log event class
*
****************************************************************************/
class Rand_log_event: public Log_event
{
public:
ulonglong seed1;
ulonglong seed2;
#ifndef MYSQL_CLIENT
Rand_log_event(THD* thd_arg, ulonglong seed1_arg, ulonglong seed2_arg)
:Log_event(thd_arg),seed1(seed1_arg),seed2(seed2_arg)
{}
void pack_info(String* packet);
int exec_event(struct st_relay_log_info* rli);
#else
void print(FILE* file, bool short_form = 0, char* last_db = 0);
#endif
Rand_log_event(const char* buf, bool old_format);
~Rand_log_event() {}
Log_event_type get_type_code() { return RAND_EVENT;}
int get_data_size() { return sizeof(ulonglong) * 2; }
int write_data(IO_CACHE* file);
bool is_valid() { return 1; }
};
class Stop_log_event: public Log_event class Stop_log_event: public Log_event
{ {
public: public:
#ifndef MYSQL_CLIENT #ifndef MYSQL_CLIENT
Stop_log_event() :Log_event((THD*)0) Stop_log_event() :Log_event((THD*)0)
{} {}
int exec_event(struct st_relay_log_info* rli); int exec_event(struct st_relay_log_info* rli);

View File

@ -290,7 +290,7 @@ int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice
*/ */
static bool kill_in_progress=FALSE; static bool kill_in_progress=FALSE;
static struct rand_struct sql_rand; struct rand_struct sql_rand; // used by sql_class.cc:THD::THD()
static int cleanup_done; static int cleanup_done;
static char **defaults_argv; static char **defaults_argv;
char glob_hostname[FN_REFLEN]; char glob_hostname[FN_REFLEN];
@ -2417,15 +2417,7 @@ static void create_new_thread(THD *thd)
for (uint i=0; i < 8 ; i++) // Generate password teststring for (uint i=0; i < 8 ; i++) // Generate password teststring
thd->scramble[i]= (char) (rnd(&sql_rand)*94+33); thd->scramble[i]= (char) (rnd(&sql_rand)*94+33);
thd->scramble[8]=0; thd->scramble[8]=0;
/*
We need good random number initialization for new thread
Just coping global one will not work
*/
{
ulong tmp=(ulong) (rnd(&sql_rand) * 3000000);
randominit(&(thd->rand), tmp + (ulong) start_time,
tmp + (ulong) thread_id);
}
thd->real_id=pthread_self(); // Keep purify happy thd->real_id=pthread_self(); // Keep purify happy
/* Start a new thread to handle connection */ /* Start a new thread to handle connection */

View File

@ -426,7 +426,17 @@ BOOL NTService::SeekStatus(LPCSTR szInternName, int OperationType)
// open a connection to the SCM // open a connection to the SCM
if (!(scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE))) if (!(scm = OpenSCManager(0, 0,SC_MANAGER_CREATE_SERVICE)))
printf("There is a problem with the Service Control Manager!\n"); {
DWORD ret_error=GetLastError();
if (ret_error == ERROR_ACCESS_DENIED)
{
printf("Install/Remove of the Service Denied!\n");
if(!is_super_user())
printf("That operation should be made by an user with Administrator privileges!\n");
}
else
printf("There is a problem for to open the Service Control Manager!\n");
}
else else
{ {
if (OperationType == 1) if (OperationType == 1)
@ -507,3 +517,82 @@ BOOL NTService::got_service_option(char **argv, char *service_option)
return TRUE; return TRUE;
return FALSE; return FALSE;
} }
/* ------------------------------------------------------------------------
-------------------------------------------------------------------------- */
BOOL NTService::is_super_user()
{
HANDLE hAccessToken;
UCHAR InfoBuffer[1024];
PTOKEN_GROUPS ptgGroups=(PTOKEN_GROUPS)InfoBuffer;
DWORD dwInfoBufferSize;
PSID psidAdministrators;
SID_IDENTIFIER_AUTHORITY siaNtAuthority = SECURITY_NT_AUTHORITY;
UINT x;
BOOL ret_value=FALSE;
if(!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE,&hAccessToken ))
{
if(GetLastError() != ERROR_NO_TOKEN)
return FALSE;
if(!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hAccessToken))
return FALSE;
}
ret_value= GetTokenInformation(hAccessToken,TokenGroups,InfoBuffer,
1024, &dwInfoBufferSize);
CloseHandle(hAccessToken);
if(!ret_value )
return FALSE;
if(!AllocateAndInitializeSid(&siaNtAuthority, 2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&psidAdministrators))
return FALSE;
ret_value = FALSE;
for(x=0;x<ptgGroups->GroupCount;x++)
{
if( EqualSid(psidAdministrators, ptgGroups->Groups[x].Sid) )
{
ret_value = TRUE;
break;
}
}
FreeSid(psidAdministrators);
return ret_value;
}
/* ------------------------------------------------------------------------
-------------------------------------------------------------------------- */
BOOL NTService::IsService(LPCSTR ServiceName)
{
BOOL ret_value=FALSE;
SC_HANDLE service, scm;
if (scm = OpenSCManager(0, 0,SC_MANAGER_ENUMERATE_SERVICE))
{
if ((service = OpenService(scm,ServiceName, SERVICE_ALL_ACCESS )))
{
ret_value=TRUE;
CloseServiceHandle(service);
}
CloseServiceHandle(scm);
}
return ret_value;
}
/* ------------------------------------------------------------------------
-------------------------------------------------------------------------- */
BOOL NTService::got_service_option(char **argv, char *service_option)
{
char *option;
for (option= argv[1]; *option; option++)
if (!strcmp(option, service_option))
return TRUE;
return FALSE;
}

View File

@ -54,7 +54,7 @@ class NTService
BOOL Remove(LPCSTR szInternName); BOOL Remove(LPCSTR szInternName);
BOOL IsService(LPCSTR ServiceName); BOOL IsService(LPCSTR ServiceName);
BOOL got_service_option(char **argv, char *service_option); BOOL got_service_option(char **argv, char *service_option);
BOOL is_super_user();
void Stop(void); //to be called from app. to stop service void Stop(void); //to be called from app. to stop service
protected: protected:

View File

@ -2238,7 +2238,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
{ {
tmp=param->table->file-> tmp=param->table->file->
records_in_range((int) keynr,(byte*)(param->min_key + 1), records_in_range((int) keynr,(byte*)(param->min_key + 1),
min_key_length, (ha_rkey_function)(tmp_min_flag ^ GEOM_FLAG), min_key_length, (ha_rkey_function)(tmp_min_flag ^ GEOM_FLAG),
(byte *)NullS,0,HA_READ_KEY_EXACT); (byte *)NullS,0,HA_READ_KEY_EXACT);
} }
else else
@ -2705,20 +2705,28 @@ int QUICK_SELECT_DESC::get_next()
} }
else else
{ {
DBUG_ASSERT(range->flag & NEAR_MAX || range_reads_after_key(range));
#ifdef NOT_IMPLEMENTED_YET
result=file->index_read(record, (byte*) range->max_key,
range->max_length,
((range->flag & NEAR_MAX) ?
HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV));
#else
/* Heikki changed Sept 11, 2002: since InnoDB does not store the cursor /* Heikki changed Sept 11, 2002: since InnoDB does not store the cursor
position if READ_KEY_EXACT is used to a primary key with all position if READ_KEY_EXACT is used to a primary key with all
key columns specified, we must use below HA_READ_KEY_OR_NEXT, key columns specified, we must use below HA_READ_KEY_OR_NEXT,
so that InnoDB stores the cursor position and is able to move so that InnoDB stores the cursor position and is able to move
the cursor one step backward after the search. */ the cursor one step backward after the search. */
DBUG_ASSERT(range->flag & NEAR_MAX || range_reads_after_key(range));
/* Note: even if max_key is only a prefix, HA_READ_AFTER_KEY will /* Note: even if max_key is only a prefix, HA_READ_AFTER_KEY will
* do the right thing - go past all keys which match the prefix */ * do the right thing - go past all keys which match the prefix */
result=file->index_read(record, (byte*) range->max_key, result=file->index_read(record, (byte*) range->max_key,
range->max_length, range->max_length,
((range->flag & NEAR_MAX) ? ((range->flag & NEAR_MAX) ?
HA_READ_KEY_OR_NEXT : HA_READ_AFTER_KEY)); HA_READ_KEY_OR_NEXT : HA_READ_AFTER_KEY));
result = file->index_prev(record); result = file->index_prev(record);
#endif
} }
if (result) if (result)
{ {

View File

@ -17,7 +17,6 @@ swe7 10
usa7 11 usa7 11
ujis 12 ujis 12
sjis 13 sjis 13
# cp1251 is depreciated. Use cp1251cias, cp1251csas or cp1251bin instead.
cp1251 14 cp1251 14
danish 15 danish 15
hebrew 16 hebrew 16

View File

@ -72,3 +72,22 @@
6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B 5B 5C 5D 5E 5F 60 62 63 64 65 66 67 68 69 6A 6B
6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B
# Unicode mapping (must be 256 elements)
0000 0001 0002 0003 0004 0005 0006 0007 0008 0009 000A 000B 000C 000D 000E 000F
0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 001A 001B 001C 001D 001E 001F
0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 002A 002B 002C 002D 002E 002F
0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 003A 003B 003C 003D 003E 003F
0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 004A 004B 004C 004D 004E 004F
0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 005A 005B 005C 005D 005E 005F
0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 006A 006B 006C 006D 006E 006F
0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 007A 007B 007C 007D 007E 007F
0402 0403 201A 0453 201E 2026 2020 2021 0000 2030 0409 2039 040A 040C 040B 040F
0452 2018 2019 201C 201D 2022 2013 2014 0000 2122 0459 203A 045A 045C 045B 045F
00A0 040E 045E 0408 00A4 0490 00A6 00A7 0401 00A9 0404 00AB 00AC 00AD 00AE 0407
00B0 00B1 0406 0456 0491 00B5 00B6 00B7 0451 2116 0454 00BB 0458 0405 0455 0457
0410 0411 0412 0413 0414 0415 0416 0417 0418 0419 041A 041B 041C 041D 041E 041F
0420 0421 0422 0423 0424 0425 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F
0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 043A 043B 043C 043D 043E 043F
0440 0441 0442 0443 0444 0445 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F

View File

@ -349,7 +349,7 @@ void field_str::add()
if (length > max_length) if (length > max_length)
max_length = length; max_length = length;
if (item->binary) if (item->binary())
{ {
if (stringcmp(res, &min_arg) < 0) if (stringcmp(res, &min_arg) < 0)
min_arg.copy(*res); min_arg.copy(*res);
@ -738,7 +738,7 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows)
{ {
if (must_be_blob) if (must_be_blob)
{ {
if (item->binary) if (item->binary())
answer->append("TINYBLOB", 8); answer->append("TINYBLOB", 8);
else else
answer->append("TINYTEXT", 8); answer->append("TINYTEXT", 8);
@ -756,21 +756,21 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows)
} }
else if (max_length < (1L << 16)) else if (max_length < (1L << 16))
{ {
if (item->binary) if (item->binary())
answer->append("BLOB", 4); answer->append("BLOB", 4);
else else
answer->append("TEXT", 4); answer->append("TEXT", 4);
} }
else if (max_length < (1L << 24)) else if (max_length < (1L << 24))
{ {
if (item->binary) if (item->binary())
answer->append("MEDIUMBLOB", 10); answer->append("MEDIUMBLOB", 10);
else else
answer->append("MEDIUMTEXT", 10); answer->append("MEDIUMTEXT", 10);
} }
else else
{ {
if (item->binary) if (item->binary())
answer->append("LONGBLOB", 8); answer->append("LONGBLOB", 8);
else else
answer->append("LONGTEXT", 8); answer->append("LONGTEXT", 8);

View File

@ -115,7 +115,7 @@ public:
max_arg("",default_charset_info), sum(0), max_arg("",default_charset_info), sum(0),
must_be_blob(0), was_zero_fill(0), must_be_blob(0), was_zero_fill(0),
was_maybe_zerofill(0), can_be_still_num(1) was_maybe_zerofill(0), can_be_still_num(1)
{ init_tree(&tree, 0, 0, sizeof(String), a->binary ? { init_tree(&tree, 0, 0, sizeof(String), a->binary() ?
(qsort_cmp2) stringcmp2 : (qsort_cmp2) sortcmp2, (qsort_cmp2) stringcmp2 : (qsort_cmp2) sortcmp2,
0, (tree_element_free) free_string, NULL); }; 0, (tree_element_free) free_string, NULL); };

View File

@ -1689,6 +1689,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
ha_open_options, ha_open_options,
tmp_table)) tmp_table))
{ {
my_free((char*) tmp_table,MYF(0));
DBUG_RETURN(0); DBUG_RETURN(0);
} }

Some files were not shown because too many files have changed in this diff Show More