summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD/FINISH.sh2
-rwxr-xr-xBUILD/SETUP.sh14
-rwxr-xr-xBUILD/compile-pentium64-debug-max13
-rwxr-xr-x[-rw-r--r--]BUILD/compile-pentium64-valgrind-max0
-rw-r--r--BitKeeper/etc/config1
-rw-r--r--Makefile.am41
-rw-r--r--NEW-RPMS/.cvsignore1
-rw-r--r--VC++Files/isam/isam.dsp260
-rw-r--r--VC++Files/isam/isam.dsw28
-rw-r--r--VC++Files/isam/isam_ia64.dsp260
-rw-r--r--VC++Files/isamchk/isamchk.dsp129
-rw-r--r--VC++Files/isamchk/isamchk_ia64.dsp100
-rw-r--r--VC++Files/libmysqld/libmysqld.dsp4
-rw-r--r--VC++Files/mysql.sln273
-rw-r--r--VC++Files/pack_isam/pack_isam.dsp130
-rw-r--r--VC++Files/pack_isam/pack_isam_ia64.dsp133
-rw-r--r--VC++Files/sql/mysqld.dsp4
-rw-r--r--VC++Files/test1/mysql_thr.c2
-rw-r--r--VC++Files/thr_test/thr_test.c2
-rw-r--r--client/Makefile.am6
-rw-r--r--client/client_priv.h2
-rw-r--r--client/mysql.cc84
-rw-r--r--client/mysqlbinlog.cc47
-rw-r--r--client/mysqlcheck.c3
-rw-r--r--client/mysqldump.c336
-rw-r--r--client/mysqlimport.c7
-rw-r--r--client/mysqltest.c203
-rw-r--r--cmd-line-utils/readline/complete.c2
-rw-r--r--config/ac-macros/yassl.m414
-rw-r--r--configure.in24
-rw-r--r--extra/Makefile.am2
-rw-r--r--extra/yassl/src/Makefile.am4
-rw-r--r--extra/yassl/taocrypt/src/Makefile.am13
-rw-r--r--include/Makefile.am2
-rw-r--r--include/base64.h (renamed from storage/ndb/include/util/Base64.hpp)41
-rw-r--r--include/config-netware.h5
-rw-r--r--include/config-win.h2
-rw-r--r--include/m_ctype.h1
-rw-r--r--include/m_string.h9
-rw-r--r--include/my_base.h2
-rw-r--r--include/my_handler.h2
-rw-r--r--include/my_pthread.h47
-rw-r--r--include/my_sys.h4
-rw-r--r--include/myisam.h14
-rw-r--r--include/mysql_com.h2
-rw-r--r--libmysql/Makefile.am4
-rw-r--r--libmysql_r/Makefile.am4
-rw-r--r--libmysqld/Makefile.am6
-rw-r--r--man/Makefile.am26
-rw-r--r--man/mysql.1.in160
-rw-r--r--man/mysql_fix_privilege_tables.1.in40
-rw-r--r--man/mysql_zap.1.in52
-rw-r--r--man/mysqlaccess.1.in125
-rw-r--r--man/mysqladmin.1.in209
-rw-r--r--man/mysqld.1.in234
-rw-r--r--man/mysqld_multi.1.in94
-rw-r--r--man/mysqld_safe.1.in91
-rw-r--r--man/mysqldump.1.in279
-rw-r--r--man/mysqlman.1 (renamed from man/mysqlman.1.in)2
-rw-r--r--man/mysqlshow.1.in98
-rw-r--r--man/perror.1.in58
-rw-r--r--man/replace.1.in73
-rw-r--r--mysql-test/Makefile.am7
-rw-r--r--mysql-test/README.stress116
-rw-r--r--mysql-test/include/common-tests.inc1832
-rw-r--r--mysql-test/include/gis_generic.inc180
-rw-r--r--mysql-test/include/have_archive.inc6
-rw-r--r--mysql-test/include/have_geometry.inc6
-rw-r--r--mysql-test/include/have_openssl_1.inc4
-rw-r--r--mysql-test/lib/init_db.sql2
-rw-r--r--mysql-test/lib/mtr_cases.pl8
-rw-r--r--mysql-test/lib/mtr_process.pl11
-rw-r--r--mysql-test/my_manage.c22
-rwxr-xr-xmysql-test/mysql-stress-test.pl1148
-rwxr-xr-xmysql-test/mysql-test-run.pl239
-rw-r--r--mysql-test/mysql-test-run.sh233
-rw-r--r--mysql-test/mysql_test_run_new.c1
-rw-r--r--mysql-test/r/alter_table.result12
-rw-r--r--mysql-test/r/analyse.result28
-rw-r--r--mysql-test/r/archive.result2447
-rw-r--r--mysql-test/r/archive_gis.result458
-rw-r--r--mysql-test/r/bdb.result56
-rw-r--r--mysql-test/r/bdb_gis.result458
-rw-r--r--mysql-test/r/binary.result2
-rw-r--r--mysql-test/r/cast.result5
-rw-r--r--mysql-test/r/compress.result2159
-rw-r--r--mysql-test/r/connect.result20
-rw-r--r--mysql-test/r/create.result13
-rw-r--r--mysql-test/r/ctype_big5.result19
-rw-r--r--mysql-test/r/ctype_cp1250_ch.result23
-rw-r--r--mysql-test/r/ctype_cp1251.result2
-rwxr-xr-xmysql-test/r/ctype_cp932.result17
-rw-r--r--mysql-test/r/ctype_cp932_binlog.result17
-rw-r--r--mysql-test/r/ctype_latin1.result3
-rw-r--r--mysql-test/r/ctype_many.result326
-rw-r--r--mysql-test/r/ctype_utf8.result79
-rw-r--r--mysql-test/r/date_formats.result8
-rw-r--r--mysql-test/r/drop_temp_table.result1
-rw-r--r--mysql-test/r/federated.result37
-rw-r--r--mysql-test/r/func_crypt.result3
-rw-r--r--mysql-test/r/func_gconcat.result4
-rw-r--r--mysql-test/r/func_in.result2
-rw-r--r--mysql-test/r/func_math.result33
-rw-r--r--mysql-test/r/func_sapdb.result4
-rw-r--r--mysql-test/r/func_str.result10
-rw-r--r--mysql-test/r/func_time.result51
-rw-r--r--mysql-test/r/gis.result14
-rw-r--r--mysql-test/r/have_openssl_1.require2
-rw-r--r--mysql-test/r/im_life_cycle.result2
-rw-r--r--mysql-test/r/information_schema.result32
-rw-r--r--mysql-test/r/innodb.result109
-rw-r--r--mysql-test/r/innodb_gis.result458
-rw-r--r--mysql-test/r/insert_select.result18
-rw-r--r--mysql-test/r/loaddata.result8
-rw-r--r--mysql-test/r/myisam.result32
-rw-r--r--mysql-test/r/mysql.result1
-rw-r--r--mysql-test/r/mysqlcheck.result34
-rw-r--r--mysql-test/r/mysqldump-max.result6
-rw-r--r--mysql-test/r/mysqldump.result460
-rw-r--r--mysql-test/r/mysqlshow.result1
-rw-r--r--mysql-test/r/mysqltest.result12
-rw-r--r--mysql-test/r/ndb_basic.result4
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result2
-rw-r--r--mysql-test/r/ndb_config.result4
-rw-r--r--mysql-test/r/ndb_gis.result916
-rw-r--r--mysql-test/r/ndb_types.result2
-rw-r--r--mysql-test/r/openssl_1.result12
-rw-r--r--mysql-test/r/query_cache.result16
-rw-r--r--mysql-test/r/range.result7
-rw-r--r--mysql-test/r/rpl_ddl.result434
-rw-r--r--mysql-test/r/rpl_dual_pos_advance.result22
-rw-r--r--mysql-test/r/rpl_multi_update2.result13
-rw-r--r--mysql-test/r/rpl_multi_update3.result72
-rw-r--r--mysql-test/r/rpl_sp.result8
-rw-r--r--mysql-test/r/select.result216
-rw-r--r--mysql-test/r/show_check.result7
-rw-r--r--mysql-test/r/skip_grants.result4
-rw-r--r--mysql-test/r/sp-error.result86
-rw-r--r--mysql-test/r/sp-security.result12
-rw-r--r--mysql-test/r/sp.result222
-rw-r--r--mysql-test/r/sql_mode.result3
-rw-r--r--mysql-test/r/ssl.result2159
-rw-r--r--mysql-test/r/ssl_compress.result2165
-rw-r--r--mysql-test/r/status.result6
-rw-r--r--mysql-test/r/subselect.result1
-rw-r--r--mysql-test/r/subselect2.result3
-rw-r--r--mysql-test/r/subselect_innodb.result20
-rw-r--r--mysql-test/r/system_mysql_db.result2
-rw-r--r--mysql-test/r/type_binary.result113
-rw-r--r--mysql-test/r/type_blob.result76
-rw-r--r--mysql-test/r/type_float.result15
-rw-r--r--mysql-test/r/type_newdecimal.result30
-rw-r--r--mysql-test/r/update.result82
-rw-r--r--mysql-test/r/user_var-binlog.result4
-rw-r--r--mysql-test/r/user_var.result11
-rw-r--r--mysql-test/r/variables.result11
-rw-r--r--mysql-test/r/view.result73
-rw-r--r--mysql-test/r/view_grant.result194
-rw-r--r--mysql-test/r/wait_timeout.result8
-rw-r--r--mysql-test/std_data/loaddata_dq.dat3
-rw-r--r--mysql-test/std_data/ndb_config_mycnf2.cnf31
-rw-r--r--mysql-test/t/alter_table.test12
-rw-r--r--mysql-test/t/analyse.test25
-rw-r--r--mysql-test/t/archive.test11
-rw-r--r--mysql-test/t/archive_gis.test3
-rw-r--r--mysql-test/t/bdb.test1
-rw-r--r--mysql-test/t/bdb_gis.test3
-rw-r--r--mysql-test/t/binary.test2
-rw-r--r--mysql-test/t/cast.test7
-rw-r--r--mysql-test/t/compress.test15
-rw-r--r--mysql-test/t/connect.test82
-rw-r--r--mysql-test/t/create.test9
-rw-r--r--mysql-test/t/ctype_big5.test15
-rw-r--r--mysql-test/t/ctype_cp1250_ch.test21
-rw-r--r--mysql-test/t/ctype_cp1251.test2
-rw-r--r--mysql-test/t/ctype_cp932.test10
-rw-r--r--mysql-test/t/ctype_cp932_binlog.test34
-rw-r--r--mysql-test/t/ctype_latin1.test17
-rw-r--r--mysql-test/t/ctype_many.test4
-rw-r--r--mysql-test/t/ctype_utf8.test66
-rw-r--r--mysql-test/t/date_formats.test8
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/drop_temp_table.test4
-rw-r--r--mysql-test/t/federated.test42
-rw-r--r--mysql-test/t/func_crypt.test6
-rw-r--r--mysql-test/t/func_group.test2
-rw-r--r--mysql-test/t/func_in.test2
-rw-r--r--mysql-test/t/func_math.test22
-rw-r--r--mysql-test/t/func_str.test2
-rw-r--r--mysql-test/t/func_time.test24
-rw-r--r--mysql-test/t/gis.test14
-rw-r--r--mysql-test/t/im_life_cycle.imtest1
-rw-r--r--mysql-test/t/information_schema.test25
-rw-r--r--mysql-test/t/innodb.test116
-rw-r--r--mysql-test/t/innodb_gis.test3
-rw-r--r--mysql-test/t/insert_select.test22
-rw-r--r--mysql-test/t/kill.test1
-rwxr-xr-xmysql-test/t/kill_n_check.sh4
-rw-r--r--mysql-test/t/loaddata.test12
-rw-r--r--mysql-test/t/myisam.test22
-rw-r--r--mysql-test/t/mysql.test2
-rw-r--r--mysql-test/t/mysql_client_test.test4
-rw-r--r--mysql-test/t/mysqlcheck.test11
-rw-r--r--mysql-test/t/mysqldump.test91
-rw-r--r--mysql-test/t/mysqlshow.test4
-rw-r--r--mysql-test/t/mysqltest.test68
-rw-r--r--mysql-test/t/ndb_basic.test9
-rw-r--r--mysql-test/t/ndb_condition_pushdown.test2
-rw-r--r--mysql-test/t/ndb_config.test5
-rw-r--r--mysql-test/t/ndb_gis.test5
-rw-r--r--mysql-test/t/ndb_types.test2
-rw-r--r--mysql-test/t/not_embedded_server-master.opt1
-rw-r--r--mysql-test/t/openssl_1.test19
-rw-r--r--mysql-test/t/query_cache.test13
-rw-r--r--mysql-test/t/range.test5
-rw-r--r--mysql-test/t/rpl_ddl.test107
-rw-r--r--mysql-test/t/rpl_dual_pos_advance-master.opt1
-rw-r--r--mysql-test/t/rpl_dual_pos_advance.test108
-rw-r--r--mysql-test/t/rpl_multi_update2.test27
-rw-r--r--mysql-test/t/rpl_multi_update3.test59
-rw-r--r--mysql-test/t/rpl_openssl.test2
-rw-r--r--mysql-test/t/rpl_sp.test17
-rw-r--r--mysql-test/t/select.test166
-rw-r--r--mysql-test/t/show_check.test13
-rw-r--r--mysql-test/t/skip_grants.test8
-rw-r--r--mysql-test/t/sp-error.test125
-rw-r--r--mysql-test/t/sp-security.test25
-rw-r--r--mysql-test/t/sp.test272
-rw-r--r--mysql-test/t/sql_mode.test3
-rw-r--r--mysql-test/t/ssl.test17
-rw-r--r--mysql-test/t/ssl_compress.test22
-rw-r--r--mysql-test/t/status.test7
-rw-r--r--mysql-test/t/subselect.test5
-rw-r--r--mysql-test/t/subselect2.test2
-rw-r--r--mysql-test/t/subselect_innodb.test22
-rw-r--r--mysql-test/t/type_binary.test67
-rw-r--r--mysql-test/t/type_blob.test23
-rw-r--r--mysql-test/t/type_float.test13
-rw-r--r--mysql-test/t/type_newdecimal.test22
-rw-r--r--mysql-test/t/update.test43
-rw-r--r--mysql-test/t/user_var.test4
-rw-r--r--mysql-test/t/variables.test24
-rw-r--r--mysql-test/t/view.test43
-rw-r--r--mysql-test/t/view_grant.test258
-rw-r--r--mysql-test/t/wait_timeout-master.opt1
-rw-r--r--mysql-test/t/wait_timeout.test11
-rw-r--r--mysys/Makefile.am7
-rw-r--r--mysys/base64.c278
-rw-r--r--mysys/charset.c31
-rw-r--r--mysys/mf_format.c16
-rw-r--r--mysys/mf_keycache.c17
-rw-r--r--mysys/my_getopt.c6
-rw-r--r--mysys/my_handler.c103
-rw-r--r--mysys/my_lib.c15
-rw-r--r--mysys/my_os2cond.c147
-rw-r--r--mysys/my_pthread.c17
-rw-r--r--mysys/my_realloc.c2
-rw-r--r--mysys/thr_alarm.c24
-rw-r--r--mysys/thr_lock.c9
-rw-r--r--mysys/thr_mutex.c2
-rwxr-xr-xnetware/BUILD/compile-linux-tools1
-rwxr-xr-xnetware/BUILD/compile-netware-END1
-rw-r--r--netware/BUILD/compile-netware-src1
-rwxr-xr-xnetware/BUILD/mwenv4
-rw-r--r--netware/mysql.def1
-rw-r--r--netware/mysql_test_run.c2
-rw-r--r--netware/pack_isam.def2
-rw-r--r--scripts/make_binary_distribution.sh12
-rw-r--r--scripts/make_win_src_distribution.sh2
-rw-r--r--scripts/mysql_create_system_tables.sh2
-rw-r--r--scripts/mysql_fix_privilege_tables.sql2
-rw-r--r--scripts/mysqld_safe.sh19
-rw-r--r--server-tools/instance-manager/Makefile.am4
-rw-r--r--server-tools/instance-manager/command.h4
-rw-r--r--server-tools/instance-manager/instance.cc21
-rw-r--r--server-tools/instance-manager/instance_options.cc11
-rw-r--r--server-tools/instance-manager/listener.cc15
-rw-r--r--server-tools/instance-manager/listener.h6
-rw-r--r--server-tools/instance-manager/manager.cc22
-rw-r--r--server-tools/instance-manager/mysql_connection.h7
-rw-r--r--server-tools/instance-manager/options.h8
-rw-r--r--server-tools/instance-manager/parse_output.cc25
-rw-r--r--server-tools/instance-manager/priv.cc36
-rw-r--r--server-tools/instance-manager/priv.h6
-rw-r--r--server-tools/instance-manager/thread_registry.cc23
-rw-r--r--server-tools/instance-manager/thread_registry.h16
-rw-r--r--server-tools/instance-manager/user_map.h7
-rw-r--r--sql-common/client.c5
-rw-r--r--sql/Makefile.am6
-rw-r--r--sql/field.cc67
-rw-r--r--sql/field.h15
-rw-r--r--sql/filesort.cc93
-rw-r--r--sql/ha_archive.cc78
-rw-r--r--sql/ha_archive.h5
-rw-r--r--sql/ha_berkeley.cc1
-rw-r--r--sql/ha_berkeley.h3
-rw-r--r--sql/ha_federated.cc96
-rw-r--r--sql/ha_innodb.cc78
-rw-r--r--sql/ha_myisam.cc13
-rw-r--r--sql/ha_ndbcluster.cc44
-rw-r--r--sql/handler.cc84
-rw-r--r--sql/handler.h3
-rw-r--r--sql/item.cc183
-rw-r--r--sql/item.h35
-rw-r--r--sql/item_cmpfunc.cc14
-rw-r--r--sql/item_cmpfunc.h7
-rw-r--r--sql/item_func.cc228
-rw-r--r--sql/item_geofunc.cc77
-rw-r--r--sql/item_strfunc.cc50
-rw-r--r--sql/item_strfunc.h9
-rw-r--r--sql/item_subselect.cc6
-rw-r--r--sql/item_subselect.h16
-rw-r--r--sql/item_sum.cc4
-rw-r--r--sql/item_timefunc.cc89
-rw-r--r--sql/item_timefunc.h2
-rw-r--r--sql/log.cc73
-rw-r--r--sql/log_event.cc309
-rw-r--r--sql/log_event.h129
-rw-r--r--sql/my_decimal.cc2
-rw-r--r--sql/my_decimal.h60
-rw-r--r--sql/mysql_priv.h19
-rw-r--r--sql/mysqld.cc187
-rw-r--r--sql/opt_range.cc111
-rw-r--r--sql/opt_range.h2
-rw-r--r--sql/parse_file.cc7
-rw-r--r--sql/password.c13
-rw-r--r--sql/protocol.cc4
-rw-r--r--sql/records.cc194
-rw-r--r--sql/repl_failsafe.cc1
-rw-r--r--sql/share/errmsg.txt5
-rw-r--r--sql/slave.cc170
-rw-r--r--sql/slave.h11
-rw-r--r--sql/sp.cc31
-rw-r--r--sql/sp_cache.cc2
-rw-r--r--sql/sp_head.cc51
-rw-r--r--sql/sp_rcontext.cc8
-rw-r--r--sql/sp_rcontext.h11
-rw-r--r--sql/spatial.cc324
-rw-r--r--sql/spatial.h19
-rw-r--r--sql/sql_acl.cc75
-rw-r--r--sql/sql_analyse.cc33
-rw-r--r--sql/sql_base.cc182
-rw-r--r--sql/sql_cache.cc21
-rw-r--r--sql/sql_class.cc21
-rw-r--r--sql/sql_class.h75
-rw-r--r--sql/sql_delete.cc58
-rw-r--r--sql/sql_derived.cc39
-rw-r--r--sql/sql_error.cc2
-rw-r--r--sql/sql_help.cc3
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_lex.cc3
-rw-r--r--sql/sql_lex.h20
-rw-r--r--sql/sql_load.cc16
-rw-r--r--sql/sql_manager.cc12
-rw-r--r--sql/sql_parse.cc248
-rw-r--r--sql/sql_prepare.cc115
-rw-r--r--sql/sql_rename.cc7
-rw-r--r--sql/sql_repl.cc37
-rw-r--r--sql/sql_select.cc159
-rw-r--r--sql/sql_select.h4
-rw-r--r--sql/sql_show.cc35
-rw-r--r--sql/sql_table.cc104
-rw-r--r--sql/sql_trigger.cc76
-rw-r--r--sql/sql_union.cc14
-rw-r--r--sql/sql_update.cc46
-rw-r--r--sql/sql_view.cc186
-rw-r--r--sql/sql_view.h4
-rw-r--r--sql/sql_yacc.yy96
-rw-r--r--sql/structs.h3
-rw-r--r--sql/table.cc335
-rw-r--r--sql/table.h50
-rw-r--r--sql/unireg.cc35
-rw-r--r--storage/heap/_check.c4
-rw-r--r--storage/heap/hp_create.c4
-rw-r--r--storage/innobase/btr/makefilewin16
-rw-r--r--storage/innobase/buf/makefilewin20
-rw-r--r--storage/innobase/data/makefilewin11
-rw-r--r--storage/innobase/dict/makefilewin21
-rw-r--r--storage/innobase/dyn/makefilewin9
-rw-r--r--storage/innobase/eval/makefilewin10
-rw-r--r--storage/innobase/fil/makefilewin10
-rw-r--r--storage/innobase/fsp/makefilewin9
-rw-r--r--storage/innobase/fut/makefilewin12
-rw-r--r--storage/innobase/ha/makefilewin10
-rw-r--r--storage/innobase/ibuf/makefilewin7
-rw-r--r--storage/innobase/include/Makefile.am2
-rw-r--r--storage/innobase/include/makefilewin.i34
-rw-r--r--storage/innobase/include/rem0rec.h9
-rw-r--r--storage/innobase/include/rem0rec.ic16
-rw-r--r--storage/innobase/lock/makefilewin7
-rw-r--r--storage/innobase/log/makefilewin10
-rw-r--r--storage/innobase/mach/makefilewin9
-rw-r--r--storage/innobase/makefilewin164
-rw-r--r--storage/innobase/mem/makefilewin10
-rw-r--r--storage/innobase/mtr/makefilewin14
-rw-r--r--storage/innobase/my_cnf63
-rw-r--r--storage/innobase/os/makefilewin17
-rw-r--r--storage/innobase/page/makefilewin12
-rw-r--r--storage/innobase/pars/makefilewin26
-rw-r--r--storage/innobase/que/makefilewin7
-rw-r--r--storage/innobase/read/makefilewin7
-rw-r--r--storage/innobase/rem/makefilewin12
-rw-r--r--storage/innobase/row/makefilewin34
-rw-r--r--storage/innobase/row/row0upd.c12
-rw-r--r--storage/innobase/srv/makefilewin15
-rw-r--r--storage/innobase/sync/makefilewin14
-rw-r--r--storage/innobase/thr/makefilewin9
-rw-r--r--storage/innobase/trx/makefilewin26
-rw-r--r--storage/innobase/usr/makefilewin7
-rw-r--r--storage/innobase/ut/makefilewin21
-rw-r--r--storage/myisam/mi_check.c251
-rw-r--r--storage/myisam/mi_delete.c6
-rw-r--r--storage/myisam/mi_rkey.c4
-rw-r--r--storage/myisam/mi_rnext_same.c4
-rw-r--r--storage/myisam/mi_search.c65
-rw-r--r--storage/myisam/mi_write.c6
-rw-r--r--storage/myisam/myisamchk.c23
-rw-r--r--storage/myisam/myisamdef.h7
-rw-r--r--storage/myisam/sort.c8
-rw-r--r--storage/myisammrg/myrg_queue.c4
-rw-r--r--storage/ndb/config/type_ndbapi.mk.am4
-rw-r--r--storage/ndb/config/type_util.mk.am4
-rw-r--r--storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp2
-rw-r--r--storage/ndb/include/mgmapi/mgmapi_config_parameters.h1
-rw-r--r--storage/ndb/include/mgmapi/ndbd_exit_codes.h2
-rw-r--r--storage/ndb/include/transporter/TransporterCallback.hpp72
-rw-r--r--storage/ndb/src/common/mgmcommon/IPCConfig.cpp24
-rw-r--r--storage/ndb/src/common/transporter/SHM_Transporter.cpp22
-rw-r--r--storage/ndb/src/common/transporter/SHM_Transporter.hpp2
-rw-r--r--storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp28
-rw-r--r--storage/ndb/src/common/transporter/SHM_Transporter.win32.cpp6
-rw-r--r--storage/ndb/src/common/transporter/Transporter.hpp3
-rw-r--r--storage/ndb/src/common/transporter/TransporterRegistry.cpp4
-rw-r--r--storage/ndb/src/common/util/Base64.cpp212
-rw-r--r--storage/ndb/src/common/util/Makefile.am2
-rw-r--r--storage/ndb/src/common/util/Parser.cpp7
-rw-r--r--storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp76
-rw-r--r--storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp30
-rw-r--r--storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp10
-rw-r--r--storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp10
-rw-r--r--storage/ndb/src/kernel/error/ndbd_exit_codes.c4
-rw-r--r--storage/ndb/src/kernel/vm/FastScheduler.cpp15
-rw-r--r--storage/ndb/src/kernel/vm/TransporterCallback.cpp92
-rw-r--r--storage/ndb/src/kernel/vm/VMSignal.hpp10
-rw-r--r--storage/ndb/src/mgmapi/mgmapi.cpp14
-rw-r--r--storage/ndb/src/mgmsrv/ConfigInfo.cpp350
-rw-r--r--storage/ndb/src/mgmsrv/InitConfigFileParser.cpp19
-rw-r--r--storage/ndb/src/mgmsrv/MgmtSrvr.cpp38
-rw-r--r--storage/ndb/src/mgmsrv/MgmtSrvr.hpp8
-rw-r--r--storage/ndb/src/mgmsrv/Services.cpp13
-rw-r--r--storage/ndb/src/ndbapi/TransporterFacade.cpp13
-rw-r--r--storage/ndb/test/ndbapi/testBackup.cpp11
-rw-r--r--storage/ndb/test/ndbapi/testOperations.cpp3
-rw-r--r--storage/ndb/test/src/HugoCalculator.cpp1
-rw-r--r--storage/ndb/tools/ndb_condig.cpp105
-rw-r--r--strings/conf_to_src.c79
-rw-r--r--strings/ctype-big5.c23
-rw-r--r--strings/ctype-bin.c13
-rw-r--r--strings/ctype-cp932.c4
-rw-r--r--strings/ctype-czech.c1
-rw-r--r--strings/ctype-euc_kr.c2
-rw-r--r--strings/ctype-eucjpms.c2
-rw-r--r--strings/ctype-extra.c1
-rw-r--r--strings/ctype-gb2312.c2
-rw-r--r--strings/ctype-gbk.c2
-rw-r--r--strings/ctype-latin1.c7
-rw-r--r--strings/ctype-simple.c3
-rw-r--r--strings/ctype-sjis.c2
-rw-r--r--strings/ctype-tis620.c4
-rw-r--r--strings/ctype-uca.c37
-rw-r--r--strings/ctype-ucs2.c4
-rw-r--r--strings/ctype-ujis.c2
-rw-r--r--strings/ctype-utf8.c3
-rw-r--r--strings/ctype-win1250ch.c111
-rw-r--r--strings/decimal.c6
-rw-r--r--strings/longlong2str-x86.s141
-rw-r--r--strings/my_strtoll10.c9
-rw-r--r--strings/xml.c2
-rw-r--r--support-files/MacOSX/make_mysql_pkg.pl475
-rw-r--r--support-files/my-huge.cnf.sh2
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh2
-rw-r--r--support-files/my-large.cnf.sh2
-rw-r--r--support-files/mysql.spec.sh151
-rw-r--r--tests/mysql_client_test.c73
-rw-r--r--vio/Makefile.am10
-rw-r--r--vio/vio.c16
-rw-r--r--vio/viosocket.c9
487 files changed, 26824 insertions, 7405 deletions
diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh
index 6ee8b27e472..a0e702515e6 100644
--- a/BUILD/FINISH.sh
+++ b/BUILD/FINISH.sh
@@ -13,7 +13,7 @@ path=`dirname $0`
if [ -z "$just_clean" ]
then
commands="$commands
-CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" \
+CC=\"$CC\" CFLAGS=\"$cflags\" CXX=\"$CXX\" CXXFLAGS=\"$cxxflags\" CXXLDFLAGS=\"$CXXLDFLAGS\" \
$configure"
fi
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index e37418cbf63..cd1a348dfbc 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -44,17 +44,21 @@ set -e
export AM_MAKEFLAGS
AM_MAKEFLAGS="-j 4"
+# SSL library to use. Should be changed to --with-yassl
+SSL_LIBRARY=--with-openssl
+
# If you are not using codefusion add "-Wpointer-arith" to WARNINGS
# The following warning flag will give too many warnings:
# -Wshadow -Wunused -Winline (The later isn't usable in C++ as
# __attribute()__ doesn't work with gnu C++)
+
global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings"
#debug_extra_warnings="-Wuninitialized"
c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
-base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition"
-base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine"
-max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-openssl --with-embedded-server --with-big-tables --with-partition"
+base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
+base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
+max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-embedded-server --with-big-tables --with-partition $SSL_LIBRARY"
max_configs="$base_max_configs --with-embedded-server"
max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
@@ -104,6 +108,10 @@ else
make=make
fi
+if test -z "$CC" ; then
+ CC=gcc
+fi
+
if test -z "$CXX" ; then
CXX=gcc
fi
diff --git a/BUILD/compile-pentium64-debug-max b/BUILD/compile-pentium64-debug-max
new file mode 100755
index 00000000000..f0745c88c90
--- /dev/null
+++ b/BUILD/compile-pentium64-debug-max
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+path=`dirname $0`
+. "$path/SETUP.sh" $@ --with-debug=full
+
+extra_flags="$pentium64_cflags $debug_cflags $max_cflags"
+c_warnings="$c_warnings $debug_extra_warnings"
+cxx_warnings="$cxx_warnings $debug_extra_warnings"
+extra_configs="$pentium_configs $debug_configs $max_configs"
+
+extra_configs="$extra_configs "
+
+. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max
index 2e4ff8e0082..2e4ff8e0082 100644..100755
--- a/BUILD/compile-pentium64-valgrind-max
+++ b/BUILD/compile-pentium64-valgrind-max
diff --git a/BitKeeper/etc/config b/BitKeeper/etc/config
index 81e867e514f..b68810b77ac 100644
--- a/BitKeeper/etc/config
+++ b/BitKeeper/etc/config
@@ -73,5 +73,6 @@ hours:
[nick:]checkout:get
[jonas:]checkout:get
[tomas:]checkout:get
+[guilhem:]checkout:get
checkout:edit
eoln:unix
diff --git a/Makefile.am b/Makefile.am
index cb8f09023d6..17b21873c6f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -99,36 +99,35 @@ tags:
support-files/build-tags
.PHONY: init-db bin-dist
-# Test installation. Ports are configurable from the environment.
-
-MYSQL_TEST_MANAGER_PORT = 9305
-MYSQL_TEST_MASTER_PORT = 9306
-MYSQL_TEST_SLAVE_PORT = 9308
-MYSQL_TEST_NDB_PORT = 9350
-MYSQL_TEST_RUN_ARGS = --manager-port=$(MYSQL_TEST_MANAGER_PORT) \
- --master_port=$(MYSQL_TEST_MASTER_PORT) \
- --slave_port=$(MYSQL_TEST_SLAVE_PORT) \
- --ndbcluster_port=$(MYSQL_TEST_NDB_PORT)
+# Target 'test' will run the regression test suite using the built server.
+#
+# If you are running in a shared environment, users can avoid clashing
+# port numbers by setting individual small numbers 1-100 to the
+# environment variable MTR_BUILD_THREAD. The script "mysql-test-run"
+# will then calculate the various port numbers it needs from this,
+# making sure each user use different ports.
test:
cd mysql-test ; \
- ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) && \
- ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol
+ ./mysql-test-run && \
+ ./mysql-test-run --ps-protocol
test-force:
- cd mysql-test ; \
- ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --force ; \
- ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force
+ cd mysql-test; \
+ ./mysql-test-run --force && \
+ ./mysql-test-run --ps-protocol --force
+# We are testing a new Perl version of the test script
test-pl:
- cd mysql-test ; \
- ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) && \
- ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol
+ cd mysql-test; \
+ ./mysql-test-run.pl && \
+ ./mysql-test-run.pl --ps-protocol
test-force-pl:
- cd mysql-test ; \
- ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --force ; \
- ./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force
+ cd mysql-test; \
+ ./mysql-test-run.pl --force && \
+ ./mysql-test-run.pl --ps-protocol --force
# Don't update the files from bitkeeper
%::SCCS/s.%
+
diff --git a/NEW-RPMS/.cvsignore b/NEW-RPMS/.cvsignore
deleted file mode 100644
index eee690e5a6c..00000000000
--- a/NEW-RPMS/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-MySQL-*.rpm
diff --git a/VC++Files/isam/isam.dsp b/VC++Files/isam/isam.dsp
deleted file mode 100644
index 759a1b6ee03..00000000000
--- a/VC++Files/isam/isam.dsp
+++ /dev/null
@@ -1,260 +0,0 @@
-# Microsoft Developer Studio Project File - Name="isam" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=isam - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "isam.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "isam.mak" CFG="isam - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "isam - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "isam - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "isam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
-!MESSAGE "isam - Win32 TLS" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "isam - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "release"
-# PROP Intermediate_Dir "release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\lib_release\isam.lib"
-
-!ELSEIF "$(CFG)" == "isam - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "debug"
-# PROP Intermediate_Dir "debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib"
-
-!ELSEIF "$(CFG)" == "isam - Win32 TLS_DEBUG"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "isam___Win32_TLS_DEBUG"
-# PROP BASE Intermediate_Dir "isam___Win32_TLS_DEBUG"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "isam___Win32_TLS_DEBUG"
-# PROP Intermediate_Dir "isam___Win32_TLS_DEBUG"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
-# ADD LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
-
-!ELSEIF "$(CFG)" == "isam - Win32 TLS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "isam___Win32_TLS"
-# PROP BASE Intermediate_Dir "isam___Win32_TLS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "isam___Win32_TLS"
-# PROP Intermediate_Dir "isam___Win32_TLS"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
-# ADD LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "isam - Win32 Release"
-# Name "isam - Win32 Debug"
-# Name "isam - Win32 TLS_DEBUG"
-# Name "isam - Win32 TLS"
-# Begin Source File
-
-SOURCE=.\_cache.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_dbug.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_dynrec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_key.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_locking.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_packrec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_page.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_search.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_statrec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\changed.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\close.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\create.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\delete.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\extra.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\info.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\log.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\open.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\panic.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\range.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfirst.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rkey.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rlast.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rnext.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rprev.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rrnd.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rsame.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rsamepos.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\static.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\update.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\write.c
-# End Source File
-# End Target
-# End Project
diff --git a/VC++Files/isam/isam.dsw b/VC++Files/isam/isam.dsw
deleted file mode 100644
index c18224a6d73..00000000000
--- a/VC++Files/isam/isam.dsw
+++ /dev/null
@@ -1,28 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "isam"=".\isam.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
diff --git a/VC++Files/isam/isam_ia64.dsp b/VC++Files/isam/isam_ia64.dsp
deleted file mode 100644
index f9dce0bed4a..00000000000
--- a/VC++Files/isam/isam_ia64.dsp
+++ /dev/null
@@ -1,260 +0,0 @@
-# Microsoft Developer Studio Project File - Name="isam" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=isam - WinIA64 TLS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "isam.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "isam.mak" CFG="isam - WinIA64 TLS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "isam - WinIA64 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "isam - WinIA64 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE "isam - WinIA64 TLS_DEBUG" (based on "Win32 (x86) Static Library")
-!MESSAGE "isam - WinIA64 TLS" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "isam - WinIA64 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "release"
-# PROP Intermediate_Dir "release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN64" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\lib_release\isam.lib"
-
-!ELSEIF "$(CFG)" == "isam - WinIA64 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "debug"
-# PROP Intermediate_Dir "debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN64" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /MTd /W3 /Zi /Od /GF /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib"
-
-!ELSEIF "$(CFG)" == "isam - WinIA64 TLS_DEBUG"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "isam___WinIA64_TLS_DEBUG"
-# PROP BASE Intermediate_Dir "isam___WinIA64_TLS_DEBUG"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "isam___WinIA64_TLS_DEBUG"
-# PROP Intermediate_Dir "isam___WinIA64_TLS_DEBUG"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /GF /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MTd /W3 /Zi /O2 /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
-# ADD LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
-
-!ELSEIF "$(CFG)" == "isam - WinIA64 TLS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "isam___WinIA64_TLS"
-# PROP BASE Intermediate_Dir "isam___WinIA64_TLS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "isam___WinIA64_TLS"
-# PROP Intermediate_Dir "isam___WinIA64_TLS"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
-# ADD LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "isam - WinIA64 Release"
-# Name "isam - WinIA64 Debug"
-# Name "isam - WinIA64 TLS_DEBUG"
-# Name "isam - WinIA64 TLS"
-# Begin Source File
-
-SOURCE=.\_cache.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_dbug.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_dynrec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_key.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_locking.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_packrec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_page.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_search.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\_statrec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\changed.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\close.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\create.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\delete.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\extra.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\info.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\log.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\open.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\panic.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\range.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rfirst.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rkey.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rlast.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rnext.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rprev.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rrnd.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rsame.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rsamepos.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\static.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\update.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\write.c
-# End Source File
-# End Target
-# End Project
diff --git a/VC++Files/isamchk/isamchk.dsp b/VC++Files/isamchk/isamchk.dsp
deleted file mode 100644
index 2026be94ea0..00000000000
--- a/VC++Files/isamchk/isamchk.dsp
+++ /dev/null
@@ -1,129 +0,0 @@
-# Microsoft Developer Studio Project File - Name="isamchk" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=isamchk - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "isamchk.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "isamchk.mak" CFG="isamchk - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "isamchk - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "isamchk - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "isamchk - Win32 classic" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "isamchk - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "release"
-# PROP Intermediate_Dir "release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x41d /d "NDEBUG"
-# ADD RSC /l 0x41d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "isamchk - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "isamchk_"
-# PROP BASE Intermediate_Dir "isamchk_"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "debug"
-# PROP Intermediate_Dir "debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /Fr /YX
-# ADD BASE RSC /l 0x41d /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/isamchk.exe" /pdbtype:sept
-# SUBTRACT LINK32 /verbose /pdb:none
-
-!ELSEIF "$(CFG)" == "isamchk - Win32 classic"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "isamchk___Win32_classic"
-# PROP BASE Intermediate_Dir "isamchk___Win32_classic"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "classic"
-# PROP Intermediate_Dir "classic"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D LICENSE=Commercial /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x41d /d "NDEBUG"
-# ADD RSC /l 0x41d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/isamchk.exe"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/isamchk.exe" /libpath:"..\lib_release\\"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "isamchk - Win32 Release"
-# Name "isamchk - Win32 Debug"
-# Name "isamchk - Win32 classic"
-# Begin Source File
-
-SOURCE=..\isam\isamchk.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\isam\sort.c
-# End Source File
-# End Target
-# End Project
diff --git a/VC++Files/isamchk/isamchk_ia64.dsp b/VC++Files/isamchk/isamchk_ia64.dsp
deleted file mode 100644
index 61eab230e1f..00000000000
--- a/VC++Files/isamchk/isamchk_ia64.dsp
+++ /dev/null
@@ -1,100 +0,0 @@
-# Microsoft Developer Studio Project File - Name="isamchk" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=isamchk - WinIA64 classic
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "isamchk_ia64.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "isamchk_ia64.mak" CFG="isamchk - WinIA64 classic"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "isamchk - WinIA64 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "isamchk - WinIA64 classic" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "isamchk - WinIA64 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "release"
-# PROP Intermediate_Dir "release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN64" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x41d /d "NDEBUG"
-# ADD RSC /l 0x41d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:IA64
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /out:"../client_release/isamchk.exe" /machine:IA64
-
-!ELSEIF "$(CFG)" == "isamchk - WinIA64 classic"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "isamchk___WinIA64_classic"
-# PROP BASE Intermediate_Dir "isamchk___WinIA64_classic"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "classic"
-# PROP Intermediate_Dir "classic"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D LICENSE=Commercial /D "_IA64_" /D "WIN64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x41d /d "NDEBUG"
-# ADD RSC /l 0x41d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /out:"../client_release/isamchk.exe" /machine:IA64
-# ADD LINK32 ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/isamchk.exe" /libpath:"..\lib_release\\" /machine:IA64
-
-!ENDIF
-
-# Begin Target
-
-# Name "isamchk - WinIA64 Release"
-# Name "isamchk - WinIA64 classic"
-# Begin Source File
-
-SOURCE=..\isam\isamchk.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\isam\sort.c
-# End Source File
-# End Target
-# End Project
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp
index 9ee0165b01a..9c4485210a6 100644
--- a/VC++Files/libmysqld/libmysqld.dsp
+++ b/VC++Files/libmysqld/libmysqld.dsp
@@ -552,6 +552,10 @@ SOURCE=..\sql\sql_trigger.cpp
# End Source File
# Begin Source File
+SOURCE=..\sql\sql_cursor.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\sql\sql_udf.cpp
# End Source File
# Begin Source File
diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln
index ffa2050bbed..e119fe8d8a3 100644
--- a/VC++Files/mysql.sln
+++ b/VC++Files/mysql.sln
@@ -299,26 +299,27 @@ Global
Embedded_Debug = Embedded_Debug
Embedded_Pro = Embedded_Pro
Embedded_Release = Embedded_Release
+ Embedded_ProGPL = Embedded_ProGPL
Max = Max
Max nt = Max nt
nt = nt
pro = pro
pro nt = pro nt
+ pro gpl = pro gpl
+ pro gpl nt = pro gpl nt
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.ActiveCfg = Max|Win32
- {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.ActiveCfg = Max|Win32
- {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.classic nt.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.ActiveCfg = Debug|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Debug.Build.0 = Debug|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.ActiveCfg = Max|Win32
- {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Classic.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.ActiveCfg = Debug|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Debug.Build.0 = Debug|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.ActiveCfg = Max|Win32
- {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Pro.Build.0 = Max|Win32
+ {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_ProGPL.ActiveCfg = Max|Win32
+ {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_ProGPL.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.ActiveCfg = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Embedded_Release.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Max.ActiveCfg = Max|Win32
@@ -328,9 +329,11 @@ Global
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.ActiveCfg = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.nt.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.ActiveCfg = Max|Win32
- {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.ActiveCfg = Max|Win32
- {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro nt.Build.0 = Max|Win32
+ {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl.ActiveCfg = Max|Win32
+ {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl.Build.0 = Max|Win32
+ {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl nt.ActiveCfg = Max|Win32
+ {6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.pro gpl nt.Build.0 = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.ActiveCfg = Max|Win32
{6EEF697A-3772-48D8-A5BA-EF11B9AC46E3}.Release.Build.0 = Max|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.classic.ActiveCfg = Release|Win32
@@ -340,6 +343,7 @@ Global
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Classic.ActiveCfg = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Debug.ActiveCfg = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Pro.ActiveCfg = Release|Win32
+ {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_ProGPL.ActiveCfg = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Embedded_Release.ActiveCfg = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.ActiveCfg = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Max.Build.0 = Release|Win32
@@ -351,6 +355,10 @@ Global
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro.Build.0 = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.ActiveCfg = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro nt.Build.0 = Release|Win32
+ {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl.ActiveCfg = Release|Win32
+ {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl.Build.0 = Release|Win32
+ {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl nt.ActiveCfg = Release|Win32
+ {1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.pro gpl nt.Build.0 = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.ActiveCfg = Release|Win32
{1FD8A136-B86A-4B54-95B0-FA4E2EE2CCBC}.Release.Build.0 = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.classic.ActiveCfg = Release|Win32
@@ -365,6 +373,8 @@ Global
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.ActiveCfg = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Pro.Build.0 = Release|Win32
+ {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_ProGPL.Build.0 = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.ActiveCfg = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Embedded_Release.Build.0 = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Max.ActiveCfg = Release|Win32
@@ -377,6 +387,10 @@ Global
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro.Build.0 = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.ActiveCfg = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro nt.Build.0 = Release|Win32
+ {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl.ActiveCfg = Release|Win32
+ {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl.Build.0 = Release|Win32
+ {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl nt.ActiveCfg = Release|Win32
+ {FC369DF4-AEB7-4531-BF34-A638C4363BFE}.pro gpl nt.Build.0 = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.ActiveCfg = Release|Win32
{FC369DF4-AEB7-4531-BF34-A638C4363BFE}.Release.Build.0 = Release|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.classic.ActiveCfg = Release|Win32
@@ -391,6 +405,8 @@ Global
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.ActiveCfg = TLS|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Pro.Build.0 = TLS|Win32
+ {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_ProGPL.ActiveCfg = TLS|Win32
+ {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_ProGPL.Build.0 = TLS|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.ActiveCfg = TLS|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Embedded_Release.Build.0 = TLS|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Max.ActiveCfg = Release|Win32
@@ -403,6 +419,10 @@ Global
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro.Build.0 = Release|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.ActiveCfg = Release|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro nt.Build.0 = Release|Win32
+ {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl.ActiveCfg = Release|Win32
+ {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl.Build.0 = Release|Win32
+ {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl nt.ActiveCfg = Release|Win32
+ {C70A6DC7-7D45-4C16-8654-7E57713A4C04}.pro gpl nt.Build.0 = Release|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.ActiveCfg = Release|Win32
{C70A6DC7-7D45-4C16-8654-7E57713A4C04}.Release.Build.0 = Release|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.classic.ActiveCfg = Release|Win32
@@ -417,6 +437,8 @@ Global
{13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Debug.Build.0 = Debug|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.ActiveCfg = Release|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Pro.Build.0 = Release|Win32
+ {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_ProGPL.Build.0 = Release|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.ActiveCfg = Release|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.Embedded_Release.Build.0 = Release|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.Max.ActiveCfg = Release|Win32
@@ -429,6 +451,10 @@ Global
{13D37150-54D0-46C5-9519-03923243C7C7}.pro.Build.0 = Release|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.ActiveCfg = nt|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.pro nt.Build.0 = nt|Win32
+ {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl.ActiveCfg = Release|Win32
+ {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl.Build.0 = Release|Win32
+ {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl nt.ActiveCfg = nt|Win32
+ {13D37150-54D0-46C5-9519-03923243C7C7}.pro gpl nt.Build.0 = nt|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.Release.ActiveCfg = Release|Win32
{13D37150-54D0-46C5-9519-03923243C7C7}.Release.Build.0 = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.classic.ActiveCfg = Release|Win32
@@ -440,6 +466,8 @@ Global
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Classic.ActiveCfg = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Debug.ActiveCfg = Debug|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Pro.ActiveCfg = Release|Win32
+ {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_ProGPL.ActiveCfg = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Embedded_Release.ActiveCfg = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.ActiveCfg = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Max.Build.0 = Release|Win32
@@ -451,6 +479,10 @@ Global
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro.Build.0 = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.ActiveCfg = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro nt.Build.0 = Release|Win32
+ {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl.ActiveCfg = Release|Win32
+ {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl.Build.0 = Release|Win32
+ {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl nt.ActiveCfg = Release|Win32
+ {1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.pro gpl nt.Build.0 = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.ActiveCfg = Release|Win32
{1FC6EB72-1D0F-4E40-8851-1CC5DEB94F0F}.Release.Build.0 = Release|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.classic.ActiveCfg = classic|Win32
@@ -462,6 +494,8 @@ Global
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Debug.Build.0 = Debug|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.ActiveCfg = pro|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Pro.Build.0 = pro|Win32
+ {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_ProGPL.Build.0 = Release|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.ActiveCfg = Release|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Embedded_Release.Build.0 = Release|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Max.ActiveCfg = classic|Win32
@@ -469,6 +503,8 @@ Global
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.nt.ActiveCfg = classic|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro.ActiveCfg = pro|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro nt.ActiveCfg = pro|Win32
+ {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro gpl.ActiveCfg = Release|Win32
+ {93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.pro gpl nt.ActiveCfg = Release|Win32
{93CA92A0-D7B8-4FAE-9EBB-D92EFBF631C9}.Release.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic.Build.0 = Release|Win32
@@ -476,9 +512,10 @@ Global
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.classic nt.Build.0 = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.ActiveCfg = Debug|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Debug.Build.0 = Debug|Win32
- {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Classic.ActiveCfg = Debug|Win32
+ {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Classic.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Debug.ActiveCfg = Debug|Win32
- {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Pro.ActiveCfg = Release|Win32
+ {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_ProGPL.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Embedded_Release.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Max.Build.0 = Release|Win32
@@ -490,6 +527,10 @@ Global
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro.Build.0 = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro nt.Build.0 = Release|Win32
+ {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl.ActiveCfg = Release|Win32
+ {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl.Build.0 = Release|Win32
+ {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl nt.ActiveCfg = Release|Win32
+ {2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.pro gpl nt.Build.0 = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.ActiveCfg = Release|Win32
{2794E434-7CCE-44DB-B2FB-789ABE53D6B9}.Release.Build.0 = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic.ActiveCfg = classic|Win32
@@ -498,9 +539,10 @@ Global
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.classic nt.Build.0 = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.ActiveCfg = Debug|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Debug.Build.0 = Debug|Win32
- {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Classic.ActiveCfg = Debug|Win32
+ {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Classic.ActiveCfg = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Debug.ActiveCfg = Debug|Win32
- {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Pro.ActiveCfg = Release|Win32
+ {B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_ProGPL.ActiveCfg = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Embedded_Release.ActiveCfg = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.ActiveCfg = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Max.Build.0 = Release|Win32
@@ -512,6 +554,10 @@ Global
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro.Build.0 = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.ActiveCfg = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro nt.Build.0 = Release|Win32
+ {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl.ActiveCfg = Release|Win32
+ {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl.Build.0 = Release|Win32
+ {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl nt.ActiveCfg = Release|Win32
+ {B0EC3594-CD67-4364-826E-BA75EF2050F8}.pro gpl nt.Build.0 = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.ActiveCfg = Release|Win32
{B0EC3594-CD67-4364-826E-BA75EF2050F8}.Release.Build.0 = Release|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.classic.ActiveCfg = Release|Win32
@@ -526,6 +572,8 @@ Global
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Debug.Build.0 = Debug|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.ActiveCfg = TLS|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Pro.Build.0 = TLS|Win32
+ {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_ProGPL.ActiveCfg = TLS|Win32
+ {262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_ProGPL.Build.0 = TLS|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.ActiveCfg = TLS|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Embedded_Release.Build.0 = TLS|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Max.ActiveCfg = Release|Win32
@@ -538,6 +586,10 @@ Global
{262280A8-37D5-4037-BDFB-242468DFB3D2}.pro.Build.0 = Release|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.ActiveCfg = Release|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.pro nt.Build.0 = Release|Win32
+ {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl.ActiveCfg = Release|Win32
+ {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl.Build.0 = Release|Win32
+ {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl nt.ActiveCfg = Release|Win32
+ {262280A8-37D5-4037-BDFB-242468DFB3D2}.pro gpl nt.Build.0 = Release|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.ActiveCfg = Release|Win32
{262280A8-37D5-4037-BDFB-242468DFB3D2}.Release.Build.0 = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.classic.ActiveCfg = Release|Win32
@@ -549,6 +601,7 @@ Global
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Classic.ActiveCfg = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Debug.ActiveCfg = Debug|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Pro.ActiveCfg = Release|Win32
+ {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_ProGPL.ActiveCfg = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Embedded_Release.ActiveCfg = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.ActiveCfg = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Max.Build.0 = Release|Win32
@@ -560,6 +613,10 @@ Global
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro.Build.0 = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.ActiveCfg = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro nt.Build.0 = Release|Win32
+ {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl.ActiveCfg = Release|Win32
+ {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl.Build.0 = Release|Win32
+ {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl nt.ActiveCfg = Release|Win32
+ {4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.pro gpl nt.Build.0 = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.ActiveCfg = Release|Win32
{4C5D0EB1-B953-4BE9-A48B-4F3A874E6635}.Release.Build.0 = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.classic.ActiveCfg = classic|Win32
@@ -568,9 +625,10 @@ Global
{87CD9881-D234-4306-BBC6-0668C6168C0F}.classic nt.Build.0 = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.ActiveCfg = Debug|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Debug.Build.0 = Debug|Win32
- {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Classic.ActiveCfg = Debug|Win32
+ {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Classic.ActiveCfg = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Debug.ActiveCfg = Debug|Win32
- {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Pro.ActiveCfg = Release|Win32
+ {87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_ProGPL.ActiveCfg = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Embedded_Release.ActiveCfg = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.ActiveCfg = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Max.Build.0 = Release|Win32
@@ -582,6 +640,10 @@ Global
{87CD9881-D234-4306-BBC6-0668C6168C0F}.pro.Build.0 = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.ActiveCfg = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.pro nt.Build.0 = Release|Win32
+ {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl.ActiveCfg = Release|Win32
+ {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl.Build.0 = Release|Win32
+ {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl nt.ActiveCfg = Release|Win32
+ {87CD9881-D234-4306-BBC6-0668C6168C0F}.pro gpl nt.Build.0 = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.ActiveCfg = Release|Win32
{87CD9881-D234-4306-BBC6-0668C6168C0F}.Release.Build.0 = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.classic.ActiveCfg = classic|Win32
@@ -593,6 +655,7 @@ Global
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Classic.ActiveCfg = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Debug.ActiveCfg = Debug|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Pro.ActiveCfg = Release|Win32
+ {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_ProGPL.ActiveCfg = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Embedded_Release.ActiveCfg = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.ActiveCfg = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Max.Build.0 = Release|Win32
@@ -604,6 +667,10 @@ Global
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro.Build.0 = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.ActiveCfg = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro nt.Build.0 = Release|Win32
+ {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl.ActiveCfg = Release|Win32
+ {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl.Build.0 = Release|Win32
+ {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl nt.ActiveCfg = Release|Win32
+ {194F5EE6-9440-4298-A6FE-A9B4B480B44C}.pro gpl nt.Build.0 = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.ActiveCfg = Release|Win32
{194F5EE6-9440-4298-A6FE-A9B4B480B44C}.Release.Build.0 = Release|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.classic.ActiveCfg = Release|Win32
@@ -618,6 +685,8 @@ Global
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Debug.Build.0 = Debug|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.ActiveCfg = TLS|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Pro.Build.0 = TLS|Win32
+ {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_ProGPL.ActiveCfg = TLS|Win32
+ {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_ProGPL.Build.0 = TLS|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.ActiveCfg = TLS|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Embedded_Release.Build.0 = TLS|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Max.ActiveCfg = Release|Win32
@@ -630,6 +699,10 @@ Global
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro.Build.0 = Release|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.ActiveCfg = Release|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro nt.Build.0 = Release|Win32
+ {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl.ActiveCfg = Release|Win32
+ {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl.Build.0 = Release|Win32
+ {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl nt.ActiveCfg = Release|Win32
+ {D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.pro gpl nt.Build.0 = Release|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.ActiveCfg = Release|Win32
{D8E4B489-C5DD-407D-99DB-FE7C7A5A83A0}.Release.Build.0 = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.classic.ActiveCfg = classic|Win32
@@ -641,6 +714,7 @@ Global
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Classic.ActiveCfg = classic|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Debug.ActiveCfg = Debug|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Pro.ActiveCfg = classic|Win32
+ {EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_ProGPL.ActiveCfg = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Embedded_Release.ActiveCfg = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.ActiveCfg = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Max.Build.0 = Release|Win32
@@ -652,6 +726,10 @@ Global
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro.Build.0 = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.ActiveCfg = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro nt.Build.0 = Release|Win32
+ {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl.ActiveCfg = Release|Win32
+ {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl.Build.0 = Release|Win32
+ {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl nt.ActiveCfg = Release|Win32
+ {EF833A1E-E358-4B6C-9C27-9489E85041CC}.pro gpl nt.Build.0 = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.ActiveCfg = Release|Win32
{EF833A1E-E358-4B6C-9C27-9489E85041CC}.Release.Build.0 = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.classic.ActiveCfg = classic|Win32
@@ -662,7 +740,8 @@ Global
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Debug.Build.0 = Debug|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Classic.ActiveCfg = Debug|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Debug.ActiveCfg = Debug|Win32
- {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Pro.ActiveCfg = Release|Win32
+ {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_ProGPL.ActiveCfg = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Embedded_Release.ActiveCfg = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.ActiveCfg = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Max.Build.0 = Release|Win32
@@ -674,6 +753,10 @@ Global
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro.Build.0 = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.ActiveCfg = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro nt.Build.0 = Release|Win32
+ {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl.ActiveCfg = Release|Win32
+ {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl.Build.0 = Release|Win32
+ {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl nt.ActiveCfg = Release|Win32
+ {F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.pro gpl nt.Build.0 = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.ActiveCfg = Release|Win32
{F9868FD3-7AE2-486D-BAB3-A299E11F6AC1}.Release.Build.0 = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.classic.ActiveCfg = classic|Win32
@@ -684,7 +767,8 @@ Global
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Debug.Build.0 = Debug|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Classic.ActiveCfg = Debug|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Debug.ActiveCfg = Debug|Win32
- {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Pro.ActiveCfg = Release|Win32
+ {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_ProGPL.ActiveCfg = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Embedded_Release.ActiveCfg = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.ActiveCfg = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Max.Build.0 = Release|Win32
@@ -696,6 +780,10 @@ Global
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro.Build.0 = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.ActiveCfg = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro nt.Build.0 = Release|Win32
+ {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl.ActiveCfg = Release|Win32
+ {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl.Build.0 = Release|Win32
+ {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl nt.ActiveCfg = Release|Win32
+ {D2B00DE0-F6E9-40AF-B90D-A257D014F098}.pro gpl nt.Build.0 = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.ActiveCfg = Release|Win32
{D2B00DE0-F6E9-40AF-B90D-A257D014F098}.Release.Build.0 = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.classic.ActiveCfg = classic|Win32
@@ -707,6 +795,7 @@ Global
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Classic.ActiveCfg = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Debug.ActiveCfg = Debug|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Pro.ActiveCfg = Release|Win32
+ {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_ProGPL.ActiveCfg = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Embedded_Release.ActiveCfg = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.ActiveCfg = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Max.Build.0 = Release|Win32
@@ -718,6 +807,10 @@ Global
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro.Build.0 = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.ActiveCfg = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro nt.Build.0 = Release|Win32
+ {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl.ActiveCfg = Release|Win32
+ {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl.Build.0 = Release|Win32
+ {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl nt.ActiveCfg = Release|Win32
+ {DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.pro gpl nt.Build.0 = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.ActiveCfg = Release|Win32
{DC3A4D26-B533-465B-A3C7-9DBBC06DC8BB}.Release.Build.0 = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.classic.ActiveCfg = classic|Win32
@@ -728,7 +821,8 @@ Global
{67154F28-D076-419E-B149-819EF548E670}.Debug.Build.0 = Debug|Win32
{67154F28-D076-419E-B149-819EF548E670}.Embedded_Classic.ActiveCfg = Debug|Win32
{67154F28-D076-419E-B149-819EF548E670}.Embedded_Debug.ActiveCfg = Debug|Win32
- {67154F28-D076-419E-B149-819EF548E670}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {67154F28-D076-419E-B149-819EF548E670}.Embedded_Pro.ActiveCfg = Release|Win32
+ {67154F28-D076-419E-B149-819EF548E670}.Embedded_ProGPL.ActiveCfg = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.Embedded_Release.ActiveCfg = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.Max.ActiveCfg = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.Max.Build.0 = Release|Win32
@@ -740,6 +834,10 @@ Global
{67154F28-D076-419E-B149-819EF548E670}.pro.Build.0 = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.pro nt.ActiveCfg = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.pro nt.Build.0 = Release|Win32
+ {67154F28-D076-419E-B149-819EF548E670}.pro gpl.ActiveCfg = Release|Win32
+ {67154F28-D076-419E-B149-819EF548E670}.pro gpl.Build.0 = Release|Win32
+ {67154F28-D076-419E-B149-819EF548E670}.pro gpl nt.ActiveCfg = Release|Win32
+ {67154F28-D076-419E-B149-819EF548E670}.pro gpl nt.Build.0 = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.Release.ActiveCfg = Release|Win32
{67154F28-D076-419E-B149-819EF548E670}.Release.Build.0 = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.classic.ActiveCfg = Release|Win32
@@ -750,7 +848,8 @@ Global
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Debug.Build.0 = Debug|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Classic.ActiveCfg = Debug|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Debug.ActiveCfg = Debug|Win32
- {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Pro.ActiveCfg = Release|Win32
+ {26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_ProGPL.ActiveCfg = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Embedded_Release.ActiveCfg = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.ActiveCfg = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Max.Build.0 = Release|Win32
@@ -762,6 +861,10 @@ Global
{26383276-4843-494B-8BE0-8936ED3EBAAB}.pro.Build.0 = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.ActiveCfg = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.pro nt.Build.0 = Release|Win32
+ {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl.ActiveCfg = Release|Win32
+ {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl.Build.0 = Release|Win32
+ {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl nt.ActiveCfg = Release|Win32
+ {26383276-4843-494B-8BE0-8936ED3EBAAB}.pro gpl nt.Build.0 = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.ActiveCfg = Release|Win32
{26383276-4843-494B-8BE0-8936ED3EBAAB}.Release.Build.0 = Release|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.classic.ActiveCfg = classic|Win32
@@ -773,6 +876,7 @@ Global
{62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Classic.ActiveCfg = Release|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Debug.ActiveCfg = Debug|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Pro.ActiveCfg = Release|Win32
+ {62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_ProGPL.ActiveCfg = Release|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.Embedded_Release.ActiveCfg = Release|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.Max.ActiveCfg = Max|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.Max.Build.0 = Max|Win32
@@ -784,6 +888,10 @@ Global
{62E85884-3ACF-4F4C-873B-60B878147890}.pro.Build.0 = pro|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.ActiveCfg = pro nt|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.pro nt.Build.0 = pro nt|Win32
+ {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl.ActiveCfg = Release|Win32
+ {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl.Build.0 = Release|Win32
+ {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl nt.ActiveCfg = nt|Win32
+ {62E85884-3ACF-4F4C-873B-60B878147890}.pro gpl nt.Build.0 = nt|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.Release.ActiveCfg = Release|Win32
{62E85884-3ACF-4F4C-873B-60B878147890}.Release.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.classic.ActiveCfg = classic|Win32
@@ -795,6 +903,7 @@ Global
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Classic.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Debug.ActiveCfg = Debug|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Pro.ActiveCfg = Release|Win32
+ {37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_ProGPL.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Embedded_Release.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Max.Build.0 = Release|Win32
@@ -806,6 +915,10 @@ Global
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro.Build.0 = pro|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.ActiveCfg = pro|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro nt.Build.0 = pro|Win32
+ {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl.ActiveCfg = Release|Win32
+ {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl.Build.0 = Release|Win32
+ {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl nt.ActiveCfg = Release|Win32
+ {37D9BA79-302E-4582-A545-CB5FF7982EA3}.pro gpl nt.Build.0 = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.ActiveCfg = Release|Win32
{37D9BA79-302E-4582-A545-CB5FF7982EA3}.Release.Build.0 = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.classic.ActiveCfg = classic|Win32
@@ -817,6 +930,7 @@ Global
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Classic.ActiveCfg = classic|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Debug.ActiveCfg = Debug|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Pro.ActiveCfg = classic|Win32
+ {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_ProGPL.ActiveCfg = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Embedded_Release.ActiveCfg = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.ActiveCfg = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Max.Build.0 = Release|Win32
@@ -828,6 +942,10 @@ Global
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro.Build.0 = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.ActiveCfg = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro nt.Build.0 = Release|Win32
+ {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl.ActiveCfg = Release|Win32
+ {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl.Build.0 = Release|Win32
+ {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl nt.ActiveCfg = Release|Win32
+ {89F24ECE-9953-40EF-BDF4-B41F5631E92B}.pro gpl nt.Build.0 = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.ActiveCfg = Release|Win32
{89F24ECE-9953-40EF-BDF4-B41F5631E92B}.Release.Build.0 = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.classic.ActiveCfg = classic|Win32
@@ -839,6 +957,7 @@ Global
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Classic.ActiveCfg = classic|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Debug.ActiveCfg = Debug|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Pro.ActiveCfg = classic|Win32
+ {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_ProGPL.ActiveCfg = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Embedded_Release.ActiveCfg = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.ActiveCfg = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Max.Build.0 = Release|Win32
@@ -850,6 +969,10 @@ Global
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro.Build.0 = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.ActiveCfg = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro nt.Build.0 = Release|Win32
+ {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl.ActiveCfg = Release|Win32
+ {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl.Build.0 = Release|Win32
+ {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl nt.ActiveCfg = Release|Win32
+ {AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.pro gpl nt.Build.0 = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.ActiveCfg = Release|Win32
{AD95DAD3-6DB9-4F8B-A345-7A39A83AAD3D}.Release.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.classic.ActiveCfg = Release|Win32
@@ -861,6 +984,7 @@ Global
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Classic.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Debug.ActiveCfg = Debug|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Pro.ActiveCfg = Release|Win32
+ {94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_ProGPL.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Embedded_Release.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Max.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Max.Build.0 = Release|Win32
@@ -872,6 +996,10 @@ Global
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.pro nt.Build.0 = Release|Win32
+ {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl.ActiveCfg = Release|Win32
+ {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl.Build.0 = Release|Win32
+ {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl nt.ActiveCfg = Release|Win32
+ {94B86159-C581-42CD-825D-C69CBC237E5C}.pro gpl nt.Build.0 = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Release.ActiveCfg = Release|Win32
{94B86159-C581-42CD-825D-C69CBC237E5C}.Release.Build.0 = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.classic.ActiveCfg = classic|Win32
@@ -882,7 +1010,8 @@ Global
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Debug.Build.0 = Debug|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Classic.ActiveCfg = Debug|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Debug.ActiveCfg = Debug|Win32
- {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Pro.ActiveCfg = Release|Win32
+ {3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_ProGPL.ActiveCfg = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Embedded_Release.ActiveCfg = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.ActiveCfg = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Max.Build.0 = Release|Win32
@@ -894,6 +1023,10 @@ Global
{3737BFE2-EF25-464F-994D-BD28A9F84528}.pro.Build.0 = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.ActiveCfg = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.pro nt.Build.0 = Release|Win32
+ {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl.ActiveCfg = Release|Win32
+ {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl.Build.0 = Release|Win32
+ {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl nt.ActiveCfg = Release|Win32
+ {3737BFE2-EF25-464F-994D-BD28A9F84528}.pro gpl nt.Build.0 = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.ActiveCfg = Release|Win32
{3737BFE2-EF25-464F-994D-BD28A9F84528}.Release.Build.0 = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.classic.ActiveCfg = Release|Win32
@@ -908,6 +1041,8 @@ Global
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Debug.Build.0 = Debug|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.ActiveCfg = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Pro.Build.0 = Release|Win32
+ {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_ProGPL.Build.0 = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.ActiveCfg = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Embedded_Release.Build.0 = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Max.ActiveCfg = Release|Win32
@@ -920,6 +1055,10 @@ Global
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro.Build.0 = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.ActiveCfg = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro nt.Build.0 = Release|Win32
+ {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl.ActiveCfg = Release|Win32
+ {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl.Build.0 = Release|Win32
+ {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl nt.ActiveCfg = Release|Win32
+ {BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.pro gpl nt.Build.0 = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.ActiveCfg = Release|Win32
{BA86AE72-0CF5-423D-BBA2-E12B0D72EBFB}.Release.Build.0 = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.classic.ActiveCfg = Release|Win32
@@ -934,6 +1073,8 @@ Global
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Debug.Build.0 = Debug|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Pro.ActiveCfg = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Pro.Build.0 = Release|Win32
+ {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_ProGPL.Build.0 = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Release.ActiveCfg = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Embedded_Release.Build.0 = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Max.ActiveCfg = Release|Win32
@@ -946,6 +1087,10 @@ Global
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro.Build.0 = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.ActiveCfg = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro nt.Build.0 = Release|Win32
+ {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl.ActiveCfg = Release|Win32
+ {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl.Build.0 = Release|Win32
+ {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl nt.ActiveCfg = Release|Win32
+ {DB28DE80-837F-4497-9AA9-CC0A20584C98}.pro gpl nt.Build.0 = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.ActiveCfg = Release|Win32
{DB28DE80-837F-4497-9AA9-CC0A20584C98}.Release.Build.0 = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.ActiveCfg = TLS|Win32
@@ -960,6 +1105,8 @@ Global
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.Build.0 = TLS_DEBUG|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.ActiveCfg = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Pro.Build.0 = TLS|Win32
+ {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_ProGPL.ActiveCfg = TLS|Win32
+ {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_ProGPL.Build.0 = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.ActiveCfg = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.Build.0 = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.ActiveCfg = Max|Win32
@@ -972,6 +1119,10 @@ Global
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.Build.0 = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.ActiveCfg = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro nt.Build.0 = Release|Win32
+ {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl.ActiveCfg = Release|Win32
+ {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl.Build.0 = Release|Win32
+ {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl nt.ActiveCfg = Release|Win32
+ {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro gpl nt.Build.0 = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.ActiveCfg = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Release.Build.0 = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.classic.ActiveCfg = classic|Win32
@@ -982,7 +1133,8 @@ Global
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Debug.Build.0 = Debug|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Classic.ActiveCfg = Debug|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Debug.ActiveCfg = Debug|Win32
- {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Pro.ActiveCfg = Release|Win32
+ {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_ProGPL.ActiveCfg = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Embedded_Release.ActiveCfg = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.ActiveCfg = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Max.Build.0 = Release|Win32
@@ -994,6 +1146,10 @@ Global
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro.Build.0 = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.ActiveCfg = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro nt.Build.0 = Release|Win32
+ {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl.ActiveCfg = Release|Win32
+ {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl.Build.0 = Release|Win32
+ {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl nt.ActiveCfg = Release|Win32
+ {AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.pro gpl nt.Build.0 = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.ActiveCfg = Release|Win32
{AC47623D-933C-4A80-83BB-B6AF7CB28B4B}.Release.Build.0 = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.classic.ActiveCfg = Release|Win32
@@ -1008,6 +1164,8 @@ Global
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Debug.Build.0 = Debug|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.ActiveCfg = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Pro.Build.0 = Release|Win32
+ {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_ProGPL.Build.0 = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.ActiveCfg = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Embedded_Release.Build.0 = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Max.ActiveCfg = Release|Win32
@@ -1020,6 +1178,10 @@ Global
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro.Build.0 = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.ActiveCfg = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro nt.Build.0 = Release|Win32
+ {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl.ActiveCfg = Release|Win32
+ {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl.Build.0 = Release|Win32
+ {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl nt.ActiveCfg = Release|Win32
+ {207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.pro gpl nt.Build.0 = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.ActiveCfg = Release|Win32
{207E9014-C4D1-4F6D-B76F-BC7DD7E31113}.Release.Build.0 = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.classic.ActiveCfg = classic|Win32
@@ -1031,6 +1193,7 @@ Global
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Classic.ActiveCfg = classic|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Debug.ActiveCfg = Debug|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Pro.ActiveCfg = classic|Win32
+ {16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_ProGPL.ActiveCfg = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Embedded_Release.ActiveCfg = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.ActiveCfg = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Max.Build.0 = Release|Win32
@@ -1042,6 +1205,10 @@ Global
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro.Build.0 = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.ActiveCfg = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro nt.Build.0 = Release|Win32
+ {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl.ActiveCfg = Release|Win32
+ {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl.Build.0 = Release|Win32
+ {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl nt.ActiveCfg = Release|Win32
+ {16699B52-ECC6-4A96-A99F-A043059BA2E7}.pro gpl nt.Build.0 = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.ActiveCfg = Release|Win32
{16699B52-ECC6-4A96-A99F-A043059BA2E7}.Release.Build.0 = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.classic.ActiveCfg = Release|Win32
@@ -1056,6 +1223,8 @@ Global
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Debug.Build.0 = Debug|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.ActiveCfg = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Pro.Build.0 = Release|Win32
+ {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_ProGPL.Build.0 = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.ActiveCfg = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Embedded_Release.Build.0 = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Max.ActiveCfg = Release|Win32
@@ -1068,22 +1237,31 @@ Global
{EEC1300B-85A5-497C-B3E1-F708021DF859}.pro.Build.0 = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.ActiveCfg = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.pro nt.Build.0 = Release|Win32
+ {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl.ActiveCfg = Release|Win32
+ {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl.Build.0 = Release|Win32
+ {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl nt.ActiveCfg = Release|Win32
+ {EEC1300B-85A5-497C-B3E1-F708021DF859}.pro gpl nt.Build.0 = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.ActiveCfg = Release|Win32
{EEC1300B-85A5-497C-B3E1-F708021DF859}.Release.Build.0 = Release|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.ActiveCfg = Release|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic.Build.0 = Release|Win32
- {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic nt.ActiveCfg = Debug|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.classic nt.ActiveCfg = Release|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.ActiveCfg = Debug|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Debug.Build.0 = Debug|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Classic.ActiveCfg = Debug|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Debug.ActiveCfg = Debug|Win32
- {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Pro.ActiveCfg = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_ProGPL.ActiveCfg = Release|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Embedded_Release.ActiveCfg = Release|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max.ActiveCfg = Release|Win32
- {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max nt.ActiveCfg = Debug|Win32
- {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.nt.ActiveCfg = Debug|Win32
- {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro.ActiveCfg = Debug|Win32
- {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro nt.ActiveCfg = Debug|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Max nt.ActiveCfg = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.nt.ActiveCfg = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro.ActiveCfg = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro nt.ActiveCfg = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl.ActiveCfg = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl.Build.0 = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl nt.ActiveCfg = Release|Win32
+ {8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.pro gpl nt.Build.0 = Release|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.ActiveCfg = Release|Win32
{8CB5AB80-05DA-49DA-BC9F-EAC20667E0D0}.Release.Build.0 = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.classic.ActiveCfg = Release|Win32
@@ -1092,12 +1270,15 @@ Global
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Classic.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Debug.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Pro.ActiveCfg = Release|Win32
+ {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_ProGPL.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Embedded_Release.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Max nt.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.nt.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro nt.ActiveCfg = Release|Win32
+ {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro gpl.ActiveCfg = Release|Win32
+ {6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.pro gpl nt.ActiveCfg = Release|Win32
{6F01B69C-B1A5-4C45-B3A9-744E1EB0BED5}.Release.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.classic.Build.0 = Release|Win32
@@ -1108,6 +1289,7 @@ Global
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Classic.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Debug.ActiveCfg = Debug|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Pro.ActiveCfg = Release|Win32
+ {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_ProGPL.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Embedded_Release.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Max.Build.0 = Release|Win32
@@ -1119,6 +1301,10 @@ Global
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro.Build.0 = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro nt.Build.0 = Release|Win32
+ {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl.ActiveCfg = Release|Win32
+ {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl.Build.0 = Release|Win32
+ {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl nt.ActiveCfg = Release|Win32
+ {7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.pro gpl nt.Build.0 = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.ActiveCfg = Release|Win32
{7FFA3009-E0E1-4E4E-9CDF-F408AA108CC8}.Release.Build.0 = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.classic.ActiveCfg = Release|Win32
@@ -1133,6 +1319,8 @@ Global
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Debug.Build.0 = Debug|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.ActiveCfg = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Pro.Build.0 = Release|Win32
+ {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_ProGPL.Build.0 = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.ActiveCfg = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Embedded_Release.Build.0 = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Max.ActiveCfg = Release|Win32
@@ -1145,6 +1333,10 @@ Global
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro.Build.0 = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.ActiveCfg = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro nt.Build.0 = Release|Win32
+ {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl.ActiveCfg = Release|Win32
+ {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl.Build.0 = Release|Win32
+ {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl nt.ActiveCfg = Release|Win32
+ {F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.pro gpl nt.Build.0 = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.ActiveCfg = Release|Win32
{F74653C4-8003-4A79-8F53-FC69E0AD7A9B}.Release.Build.0 = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.classic.ActiveCfg = Release|Win32
@@ -1159,6 +1351,8 @@ Global
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Debug.Build.0 = Debug|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.ActiveCfg = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Pro.Build.0 = Release|Win32
+ {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_ProGPL.Build.0 = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.ActiveCfg = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Embedded_Release.Build.0 = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Max.ActiveCfg = Release|Win32
@@ -1171,6 +1365,10 @@ Global
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro.Build.0 = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.ActiveCfg = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro nt.Build.0 = Release|Win32
+ {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl.ActiveCfg = Release|Win32
+ {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl.Build.0 = Release|Win32
+ {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl nt.ActiveCfg = Release|Win32
+ {8762A9B8-72A9-462E-A9A2-F3265081F8AF}.pro gpl nt.Build.0 = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.ActiveCfg = Release|Win32
{8762A9B8-72A9-462E-A9A2-F3265081F8AF}.Release.Build.0 = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.classic.ActiveCfg = classic|Win32
@@ -1181,7 +1379,8 @@ Global
{8961F149-C68A-4154-A499-A2AB39E607E8}.Debug.Build.0 = Debug|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Classic.ActiveCfg = Debug|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Debug.ActiveCfg = Debug|Win32
- {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Pro.ActiveCfg = Release|Win32
+ {8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_ProGPL.ActiveCfg = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.Embedded_Release.ActiveCfg = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.Max.ActiveCfg = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.Max.Build.0 = Release|Win32
@@ -1193,6 +1392,10 @@ Global
{8961F149-C68A-4154-A499-A2AB39E607E8}.pro.Build.0 = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.ActiveCfg = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.pro nt.Build.0 = Release|Win32
+ {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl.ActiveCfg = Release|Win32
+ {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl.Build.0 = Release|Win32
+ {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl nt.ActiveCfg = Release|Win32
+ {8961F149-C68A-4154-A499-A2AB39E607E8}.pro gpl nt.Build.0 = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.Release.ActiveCfg = Release|Win32
{8961F149-C68A-4154-A499-A2AB39E607E8}.Release.Build.0 = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic.ActiveCfg = Release|Win32
@@ -1201,9 +1404,10 @@ Global
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.classic nt.Build.0 = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.ActiveCfg = Debug|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Debug.Build.0 = Debug|Win32
- {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Classic.ActiveCfg = Debug|Win32
+ {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Classic.ActiveCfg = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Debug.ActiveCfg = Debug|Win32
- {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Pro.ActiveCfg = Release|Win32
+ {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_ProGPL.ActiveCfg = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Embedded_Release.ActiveCfg = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.ActiveCfg = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Max.Build.0 = Release|Win32
@@ -1214,6 +1418,10 @@ Global
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro.Build.0 = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.ActiveCfg = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro nt.Build.0 = Release|Win32
+ {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl.ActiveCfg = Release|Win32
+ {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl.Build.0 = Release|Win32
+ {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl nt.ActiveCfg = Release|Win32
+ {DA224DAB-5006-42BE-BB77-16E8BE5326D5}.pro gpl nt.Build.0 = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.ActiveCfg = Release|Win32
{DA224DAB-5006-42BE-BB77-16E8BE5326D5}.Release.Build.0 = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.classic.ActiveCfg = Release|Win32
@@ -1225,6 +1433,7 @@ Global
{6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Classic.ActiveCfg = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Debug.ActiveCfg = Debug|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Pro.ActiveCfg = Release|Win32
+ {6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_ProGPL.ActiveCfg = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.Embedded_Release.ActiveCfg = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.Max.ActiveCfg = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.Max.Build.0 = Release|Win32
@@ -1236,6 +1445,10 @@ Global
{6189F838-21C6-42A1-B2D0-9146316573F7}.pro.Build.0 = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.ActiveCfg = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.pro nt.Build.0 = Release|Win32
+ {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl.ActiveCfg = Release|Win32
+ {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl.Build.0 = Release|Win32
+ {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl nt.ActiveCfg = Release|Win32
+ {6189F838-21C6-42A1-B2D0-9146316573F7}.pro gpl nt.Build.0 = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.Release.ActiveCfg = Release|Win32
{6189F838-21C6-42A1-B2D0-9146316573F7}.Release.Build.0 = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.classic.ActiveCfg = Release|Win32
@@ -1250,6 +1463,8 @@ Global
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Debug.Build.0 = Debug|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.ActiveCfg = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Pro.Build.0 = Release|Win32
+ {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_ProGPL.ActiveCfg = Release|Win32
+ {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_ProGPL.Build.0 = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.ActiveCfg = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Embedded_Release.Build.0 = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Max.ActiveCfg = Release|Win32
@@ -1262,6 +1477,10 @@ Global
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro.Build.0 = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.ActiveCfg = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro nt.Build.0 = Release|Win32
+ {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl.ActiveCfg = Release|Win32
+ {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl.Build.0 = Release|Win32
+ {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl nt.ActiveCfg = Release|Win32
+ {6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.pro gpl nt.Build.0 = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.ActiveCfg = Release|Win32
{6D524B3E-210A-4FCD-8D41-FEC0D21E83AC}.Release.Build.0 = Release|Win32
EndGlobalSection
diff --git a/VC++Files/pack_isam/pack_isam.dsp b/VC++Files/pack_isam/pack_isam.dsp
deleted file mode 100644
index f5f8f0bcd7a..00000000000
--- a/VC++Files/pack_isam/pack_isam.dsp
+++ /dev/null
@@ -1,130 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pack_isam" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pack_isam - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pack_isam.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pack_isam.mak" CFG="pack_isam - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pack_isam - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pack_isam - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "pack_isam - Win32 classic" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pack_isam - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "release"
-# PROP Intermediate_Dir "release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe"
-
-!ELSEIF "$(CFG)" == "pack_isam - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "debug"
-# PROP Intermediate_Dir "debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
-# SUBTRACT CPP /Fr
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /debug /machine:I386 /out:"../client_debug/pack_isam.exe" /pdbtype:sept
-
-!ELSEIF "$(CFG)" == "pack_isam - Win32 classic"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "pack_isam___Win32_classic"
-# PROP BASE Intermediate_Dir "pack_isam___Win32_classic"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "classic"
-# PROP Intermediate_Dir "classic"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/pack_isam.exe"
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/pack_isam.exe" /libpath:"..\lib_release\\"
-
-!ENDIF
-
-# Begin Target
-
-# Name "pack_isam - Win32 Release"
-# Name "pack_isam - Win32 Debug"
-# Name "pack_isam - Win32 classic"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\isam\pack_isam.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/VC++Files/pack_isam/pack_isam_ia64.dsp b/VC++Files/pack_isam/pack_isam_ia64.dsp
deleted file mode 100644
index 58b88f02f08..00000000000
--- a/VC++Files/pack_isam/pack_isam_ia64.dsp
+++ /dev/null
@@ -1,133 +0,0 @@
-# Microsoft Developer Studio Project File - Name="pack_isam" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pack_isam - WinIA64 classic
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pack_isam_ia64.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pack_isam_ia64.mak" CFG="pack_isam - WinIA64 classic"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pack_isam - WinIA64 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pack_isam - WinIA64 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "pack_isam - WinIA64 classic" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pack_isam - WinIA64 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "release"
-# PROP Intermediate_Dir "release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WinIA64" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /D "_IA64_" /D "WinIA64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:IA64
-# ADD LINK32 ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /out:"../client_release/pack_isam.exe" /machine:IA64
-
-!ELSEIF "$(CFG)" == "pack_isam - WinIA64 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "debug"
-# PROP Intermediate_Dir "debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WinIA64" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Zi /Od /I "../include" /I "../isam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "_IA64_" /D "WinIA64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# SUBTRACT CPP /Fr
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:IA64
-# ADD LINK32 ..\lib_debug\dbug.lib ..\lib_debug\isam.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /incremental:no /debug /out:"../client_debug/pack_isam.exe" /machine:IA64
-
-!ELSEIF "$(CFG)" == "pack_isam - WinIA64 classic"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "pack_isam___WinIA64 _classic"
-# PROP BASE Intermediate_Dir "pack_isam___WinIA64 _classic"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "classic"
-# PROP Intermediate_Dir "classic"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../isam" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NDEBUG" /FD /c
-# ADD CPP /nologo /MT /W3 /Zi /O2 /I "../include" /I "../isam" /D "_CONSOLE" /D "_WINDOWS" /D LICENSE=Commercial /D "DBUG_OFF" /D "_MBCS" /D "NDEBUG" /D "_IA64_" /D "WinIA64" /D "WIN32" /D "_AFX_NO_DAO_SUPPORT" /FD /G2 /EHsc /Wp64 /Zm600 /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /out:"../client_release/pack_isam.exe" /machine:IA64
-# ADD LINK32 ..\lib_release\isam.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj bufferoverflowU.lib /nologo /subsystem:console /out:"../client_classic/pack_isam.exe" /libpath:"..\lib_release\\" /machine:IA64
-
-!ENDIF
-
-# Begin Target
-
-# Name "pack_isam - WinIA64 Release"
-# Name "pack_isam - WinIA64 Debug"
-# Name "pack_isam - WinIA64 classic"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\isam\pack_isam.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp
index 56319ac1aaf..db0ba956c41 100644
--- a/VC++Files/sql/mysqld.dsp
+++ b/VC++Files/sql/mysqld.dsp
@@ -1855,6 +1855,10 @@ SOURCE=.\sql_trigger.cpp
# End Source File
# Begin Source File
+SOURCE=.\sql_cursor.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\sql_udf.cpp
# End Source File
# Begin Source File
diff --git a/VC++Files/test1/mysql_thr.c b/VC++Files/test1/mysql_thr.c
index de1d936806e..a1ac09f2784 100644
--- a/VC++Files/test1/mysql_thr.c
+++ b/VC++Files/test1/mysql_thr.c
@@ -33,7 +33,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
-#define pthread_handler_t unsigned __cdecl *
+#define pthread_handler_t unsigned __cdecl
typedef unsigned (__cdecl *pthread_handler)(void *);
#define pthread_self() GetCurrentThread()
diff --git a/VC++Files/thr_test/thr_test.c b/VC++Files/thr_test/thr_test.c
index 100fcb9c45e..efb9ea27ba7 100644
--- a/VC++Files/thr_test/thr_test.c
+++ b/VC++Files/thr_test/thr_test.c
@@ -44,7 +44,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
-#define pthread_handler_t unsigned __cdecl *
+#define pthread_handler_t unsigned __cdecl
typedef unsigned (__cdecl *pthread_handler)(void *);
#define pthread_self() GetCurrentThread()
diff --git a/client/Makefile.am b/client/Makefile.am
index d47e9f98f5e..cf9d2884ded 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -22,8 +22,10 @@ else
yassl_dummy_link_fix=
endif
#AUTOMAKE_OPTIONS = nostdinc
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)/regex $(openssl_includes)
+INCLUDES = -I$(top_builddir)/include \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/regex \
+ $(openssl_includes) $(yassl_includes)
LIBS = @CLIENT_LIBS@
LDADD= @CLIENT_EXTRA_LDFLAGS@ \
$(top_builddir)/libmysql/libmysqlclient.la
diff --git a/client/client_priv.h b/client/client_priv.h
index 18102fa8b16..a9d5364df49 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -51,5 +51,5 @@ enum options_client
#endif
OPT_TRIGGERS,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
- OPT_AUTO_CLOSE
+ OPT_TZ_UTC, OPT_AUTO_CLOSE
};
diff --git a/client/mysql.cc b/client/mysql.cc
index 2dcfffdd3ac..441687e2e4e 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -320,7 +320,7 @@ static void initialize_readline (char *name);
static void fix_history(String *final_command);
#endif
-static COMMANDS *find_command (char *name,char cmd_name);
+static COMMANDS *find_command(char *name,char cmd_name);
static bool add_line(String &buffer,char *line,char *in_string,
bool *ml_comment);
static void remove_cntrl(String &buffer);
@@ -1010,10 +1010,12 @@ static int read_and_execute(bool interactive)
#elif defined(__WIN__)
if (!tmpbuf.is_alloced())
tmpbuf.alloc(65535);
+ tmpbuf.length(0);
buffer.length(0);
unsigned long clen;
do
{
+ line= my_cgets((char*)tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
buffer.append(line, clen);
/*
if we got buffer fully filled than there is a chance that
@@ -1109,10 +1111,12 @@ static int read_and_execute(bool interactive)
}
-static COMMANDS *find_command (char *name,char cmd_char)
+static COMMANDS *find_command(char *name,char cmd_char)
{
uint len;
char *end;
+ DBUG_ENTER("find_command");
+ DBUG_PRINT("enter",("name: '%s' char: %d", name ? name : "NULL", cmd_char));
if (!name)
{
@@ -1124,12 +1128,17 @@ static COMMANDS *find_command (char *name,char cmd_char)
while (my_isspace(charset_info,*name))
name++;
/*
- As special case we allow row that starts with word delimiter
- to be able to change delimiter if someone has delimiter 'delimiter'.
+ If there is an \\g in the row or if the row has a delimiter but
+ this is not a delimiter command, let add_line() take care of
+ parsing the row and calling find_command()
*/
if (strstr(name, "\\g") || (strstr(name, delimiter) &&
- strncmp(name, "delimiter", 9)))
- return ((COMMANDS *) 0);
+ !(strlen(name) >= 9 &&
+ !my_strnncoll(charset_info,
+ (uchar*) name, 9,
+ (const uchar*) "delimiter",
+ 9))))
+ DBUG_RETURN((COMMANDS *) 0);
if ((end=strcont(name," \t")))
{
len=(uint) (end - name);
@@ -1145,15 +1154,18 @@ static COMMANDS *find_command (char *name,char cmd_char)
for (uint i= 0; commands[i].name; i++)
{
if (commands[i].func &&
- ((name &&
+ ((name &&
!my_strnncoll(charset_info,(uchar*)name,len,
(uchar*)commands[i].name,len) &&
!commands[i].name[len] &&
(!end || (end && commands[i].takes_params))) ||
!name && commands[i].cmd_char == cmd_char))
- return (&commands[i]);
+ {
+ DBUG_PRINT("exit",("found command: %s", commands[i].name));
+ DBUG_RETURN(&commands[i]);
+ }
}
- return ((COMMANDS *) 0);
+ DBUG_RETURN((COMMANDS *) 0);
}
@@ -1164,15 +1176,16 @@ static bool add_line(String &buffer,char *line,char *in_string,
char buff[80], *pos, *out;
COMMANDS *com;
bool need_space= 0;
+ DBUG_ENTER("add_line");
if (!line[0] && buffer.is_empty())
- return 0;
+ DBUG_RETURN(0);
#ifdef HAVE_READLINE
if (status.add_to_history && line[0] && not_in_history(line))
add_history(line);
#endif
#ifdef USE_MB
- char *strend=line+(uint) strlen(line);
+ char *end_of_line=line+(uint) strlen(line);
#endif
for (pos=out=line ; (inchar= (uchar) *pos) ; pos++)
@@ -1181,13 +1194,19 @@ static bool add_line(String &buffer,char *line,char *in_string,
buffer.is_empty())
continue;
#ifdef USE_MB
- int l;
+ int length;
if (use_mb(charset_info) &&
- (l = my_ismbchar(charset_info, pos, strend))) {
- while (l--)
- *out++ = *pos++;
- pos--;
- continue;
+ (length= my_ismbchar(charset_info, pos, end_of_line)))
+ {
+ if (!*ml_comment)
+ {
+ while (length--)
+ *out++ = *pos++;
+ pos--;
+ }
+ else
+ pos+= length - 1;
+ continue;
}
#endif
if (!*ml_comment && inchar == '\\')
@@ -1207,7 +1226,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
const String tmp(line,(uint) (out-line), charset_info);
buffer.append(tmp);
if ((*com->func)(&buffer,pos-1) > 0)
- return 1; // Quit
+ DBUG_RETURN(1); // Quit
if (com->takes_params)
{
for (pos++ ;
@@ -1225,29 +1244,40 @@ static bool add_line(String &buffer,char *line,char *in_string,
{
sprintf(buff,"Unknown command '\\%c'.",inchar);
if (put_info(buff,INFO_ERROR) > 0)
- return 1;
+ DBUG_RETURN(1);
*out++='\\';
*out++=(char) inchar;
continue;
}
}
-
- else if (!*ml_comment && (*pos == *delimiter &&
- is_prefix(pos + 1, delimiter + 1)) &&
- !*in_string)
+ else if (!*ml_comment && !*in_string &&
+ (*pos == *delimiter && is_prefix(pos + 1, delimiter + 1) ||
+ buffer.length() == 0 && (out - line) >= 9 &&
+ !my_strcasecmp(charset_info, line, "delimiter")))
{
uint old_delimiter_length= delimiter_length;
if (out != line)
buffer.append(line, (uint) (out - line)); // Add this line
if ((com= find_command(buffer.c_ptr(), 0)))
{
+ if (com->func == com_delimiter)
+ {
+ /*
+ Delimiter wants the get rest of the given line as argument to
+ allow one to change ';' to ';;' and back
+ */
+ char *end= strend(pos);
+ buffer.append(pos, (uint) (end - pos));
+ /* Ensure pos will point at \0 after the pos+= below */
+ pos= end - old_delimiter_length + 1;
+ }
if ((*com->func)(&buffer, buffer.c_ptr()) > 0)
- return 1; // Quit
+ DBUG_RETURN(1); // Quit
}
else
{
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
- return 1;
+ DBUG_RETURN(1);
}
buffer.length(0);
out= line;
@@ -1299,9 +1329,9 @@ static bool add_line(String &buffer,char *line,char *in_string,
if (buffer.length() + length >= buffer.alloced_length())
buffer.realloc(buffer.length()+length+IO_SIZE);
if (!(*ml_comment) && buffer.append(line,length))
- return 1;
+ DBUG_RETURN(1);
}
- return 0;
+ DBUG_RETURN(0);
}
/*****************************************************************
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 5345d6d0f54..6cba3c0cb44 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -62,6 +62,7 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 };
void sql_print_error(const char *format, ...);
static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0;
+static bool opt_hexdump= 0;
static const char* database= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
static ulonglong offset = 0;
@@ -489,12 +490,13 @@ static bool check_database(const char *log_dbname)
-int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev,
+int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
my_off_t pos)
{
char ll_buff[21];
Log_event_type ev_type= ev->get_type_code();
DBUG_ENTER("process_event");
+ print_event_info->short_form= short_form;
/*
Format events are not concerned by --offset and such, we always need to
@@ -522,12 +524,17 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev,
}
if (!short_form)
fprintf(result_file, "# at %s\n",llstr(pos,ll_buff));
-
+
+ if (!opt_hexdump)
+ print_event_info->hexdump_from= 0; /* Disabled */
+ else
+ print_event_info->hexdump_from= pos;
+
switch (ev_type) {
case QUERY_EVENT:
if (check_database(((Query_log_event*)ev)->db))
goto end;
- ev->print(result_file, short_form, last_event_info);
+ ev->print(result_file, print_event_info);
break;
case CREATE_FILE_EVENT:
{
@@ -547,7 +554,8 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev,
filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
below.
*/
- ce->print(result_file, short_form, last_event_info, TRUE);
+ ce->print(result_file, print_event_info, TRUE);
+
// If this binlog is not 3.23 ; why this test??
if (description_event->binlog_version >= 3)
{
@@ -558,13 +566,13 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev,
break;
}
case APPEND_BLOCK_EVENT:
- ev->print(result_file, short_form, last_event_info);
+ ev->print(result_file, print_event_info);
if (load_processor.process((Append_block_log_event*) ev))
break; // Error
break;
case EXEC_LOAD_EVENT:
{
- ev->print(result_file, short_form, last_event_info);
+ ev->print(result_file, print_event_info);
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
/*
@@ -574,7 +582,7 @@ int process_event(LAST_EVENT_INFO *last_event_info, Log_event *ev,
*/
if (ce)
{
- ce->print(result_file, short_form, last_event_info, TRUE);
+ ce->print(result_file, print_event_info, TRUE);
my_free((char*)ce->fname,MYF(MY_WME));
delete ce;
}
@@ -586,7 +594,8 @@ Create_file event for file_id: %u\n",exv->file_id);
case FORMAT_DESCRIPTION_EVENT:
delete description_event;
description_event= (Format_description_log_event*) ev;
- ev->print(result_file, short_form, last_event_info);
+ print_event_info->common_header_len= description_event->common_header_len;
+ ev->print(result_file, print_event_info);
/*
We don't want this event to be deleted now, so let's hide it (I
(Guilhem) should later see if this triggers a non-serious Valgrind
@@ -596,7 +605,7 @@ Create_file event for file_id: %u\n",exv->file_id);
ev= 0;
break;
case BEGIN_LOAD_QUERY_EVENT:
- ev->print(result_file, short_form, last_event_info);
+ ev->print(result_file, print_event_info);
load_processor.process((Begin_load_query_log_event*) ev);
break;
case EXECUTE_LOAD_QUERY_EVENT:
@@ -613,7 +622,7 @@ Create_file event for file_id: %u\n",exv->file_id);
if (fname)
{
- exlq->print(result_file, short_form, last_event_info, fname);
+ exlq->print(result_file, print_event_info, fname);
my_free(fname, MYF(MY_WME));
}
else
@@ -622,7 +631,7 @@ Begin_load_query event for file_id: %u\n", exlq->file_id);
break;
}
default:
- ev->print(result_file, short_form, last_event_info);
+ ev->print(result_file, print_event_info);
}
}
@@ -669,6 +678,9 @@ static struct my_option my_long_options[] =
0, 0},
{"help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.",
+ (gptr*) &opt_hexdump, (gptr*) &opt_hexdump, 0, GET_BOOL, NO_ARG,
+ 0, 0, 0, 0, 0, 0},
{"host", 'h', "Get the binlog from server.", (gptr*) &host, (gptr*) &host,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"offset", 'o', "Skip the first N entries.", (gptr*) &offset, (gptr*) &offset,
@@ -1002,8 +1014,9 @@ static int dump_remote_log_entries(const char* logname)
{
char buf[128];
- LAST_EVENT_INFO last_event_info;
- uint len, logname_len;
+ PRINT_EVENT_INFO print_event_info;
+ ulong len;
+ uint logname_len;
NET* net;
int error= 0;
my_off_t old_off= start_position_mot;
@@ -1124,7 +1137,7 @@ could be out of memory");
len= 1; // fake Rotate, so don't increment old_off
}
}
- if ((error= process_event(&last_event_info,ev,old_off)))
+ if ((error= process_event(&print_event_info, ev, old_off)))
{
error= ((error < 0) ? 0 : 1);
goto err;
@@ -1143,7 +1156,7 @@ could be out of memory");
goto err;
}
- if ((error= process_event(&last_event_info,ev,old_off)))
+ if ((error= process_event(&print_event_info, ev, old_off)))
{
my_close(file,MYF(MY_WME));
error= ((error < 0) ? 0 : 1);
@@ -1272,7 +1285,7 @@ static int dump_local_log_entries(const char* logname)
{
File fd = -1;
IO_CACHE cache,*file= &cache;
- LAST_EVENT_INFO last_event_info;
+ PRINT_EVENT_INFO print_event_info;
byte tmp_buff[BIN_LOG_HEADER_SIZE];
int error= 0;
@@ -1344,7 +1357,7 @@ static int dump_local_log_entries(const char* logname)
// file->error == 0 means EOF, that's OK, we break in this case
break;
}
- if ((error= process_event(&last_event_info,ev,old_off)))
+ if ((error= process_event(&print_event_info, ev, old_off)))
{
if (error < 0)
error= 0;
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 35d57e0394e..2eb3e55c2e9 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -497,6 +497,9 @@ static int process_all_tables_in_db(char *database)
static int use_db(char *database)
{
+ if (mysql_get_server_version(sock) >= 50003 &&
+ !my_strcasecmp(&my_charset_latin1, database, "information_schema"))
+ return 1;
if (mysql_select_db(sock, database))
{
DBerror(sock, "when selecting the database");
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 460297cd1b2..b92b971ea4f 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -30,7 +30,7 @@
** master/autocommit code by Brian Aker <brian@tangent.org>
** SSL by
** Andrei Errapart <andreie@no.spam.ee>
-** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
+** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up
** and adapted to mysqldump 05/11/01 by Jani Tolonen
** Added --single-transaction option 06/06/2002 by Peter Zaitsev
@@ -92,7 +92,7 @@ static my_bool verbose=0,tFlag=0,dFlag=0,quick= 1, extended_insert= 1,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0,
opt_complete_insert= 0, opt_drop_database= 0,
- opt_dump_triggers= 0, opt_routines=0;
+ opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*sock=0;
static my_bool insert_pat_inited=0;
@@ -342,7 +342,7 @@ static struct my_option my_long_options[] =
{"result-file", 'r',
"Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"routines", 'R', "Dump routines FUNCTIONS and PROCEDURES.",
+ {"routines", 'R', "Dump stored routines (functions and procedures).",
(gptr*) &opt_routines, (gptr*) &opt_routines, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"set-charset", OPT_SET_CHARSET,
@@ -385,6 +385,9 @@ static struct my_option my_long_options[] =
{"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table",
(gptr*) &opt_dump_triggers, (gptr*) &opt_dump_triggers, 0, GET_BOOL,
NO_ARG, 1, 0, 0, 0, 0, 0},
+ {"tz-utc", OPT_TZ_UTC,
+ "SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
+ (gptr*) &opt_tz_utc, (gptr*) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
#ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.",
(gptr*) &current_user, (gptr*) &current_user, 0, GET_STR, REQUIRED_ARG,
@@ -509,6 +512,13 @@ static void write_header(FILE *sql_file, char *db_name)
"\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;"
"\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;"
"\n/*!40101 SET NAMES %s */;\n",default_charset);
+
+ if (opt_tz_utc)
+ {
+ fprintf(sql_file, "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n");
+ fprintf(sql_file, "/*!40103 SET TIME_ZONE='+00:00' */;\n");
+ }
+
if (!path)
{
fprintf(md_result_file,"\
@@ -535,6 +545,9 @@ static void write_footer(FILE *sql_file)
}
else if (!opt_compact)
{
+ if (opt_tz_utc)
+ fprintf(sql_file,"/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\n");
+
fprintf(sql_file,"\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n");
if (!path)
{
@@ -902,6 +915,20 @@ static int dbConnect(char *host, char *user,char *passwd)
safe_exit(EX_MYSQLERR);
return 1;
}
+ /*
+ set time_zone to UTC to allow dumping date types between servers with
+ different time zone settings
+ */
+ if (opt_tz_utc)
+ {
+ my_snprintf(buff, sizeof(buff), "/*!40103 SET TIME_ZONE='+00:00' */");
+ if (mysql_query_with_error_report(sock, 0, buff))
+ {
+ mysql_close(sock);
+ safe_exit(EX_MYSQLERR);
+ return 1;
+ }
+ }
return 0;
} /* dbConnect */
@@ -948,6 +975,22 @@ static my_bool test_if_special_chars(const char *str)
+/*
+ quote_name(name, buff, force)
+
+ Quotes char string, taking into account compatible mode
+
+ Args
+
+ name Unquoted string containing that which will be quoted
+ buff The buffer that contains the quoted value, also returned
+ force Flag to make it ignore 'test_if_special_chars'
+
+ Returns
+
+ buff quoted string
+
+*/
static char *quote_name(const char *name, char *buff, my_bool force)
{
char *to= buff;
@@ -1172,23 +1215,25 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
This function has logic to print the appropriate syntax depending on whether
this is a procedure or functions
- RETURN 0 succes, 1 if error
+ RETURN
+ 0 Success
+ 1 Error
*/
-static uint dump_routines_for_db (char *db)
+static uint dump_routines_for_db(char *db)
{
char query_buff[512];
- const char *routine_type[]={"FUNCTION", "PROCEDURE"};
- char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3], *routine_name;
+ const char *routine_type[]= {"FUNCTION", "PROCEDURE"};
+ char db_name_buff[NAME_LEN*2+3], name_buff[NAME_LEN*2+3];
+ char *routine_name;
int i;
- FILE *sql_file = md_result_file;
+ FILE *sql_file= md_result_file;
MYSQL_RES *routine_res, *routine_list_res;
MYSQL_ROW row, routine_list_row;
-
DBUG_ENTER("dump_routines_for_db");
+ DBUG_PRINT("enter", ("db: '%s'", db));
mysql_real_escape_string(sock, db_name_buff, db, strlen(db));
- DBUG_PRINT("enter", ("db: '%s'", db_name_buff));
/* nice comments */
if (opt_comments)
@@ -1201,10 +1246,10 @@ static uint dump_routines_for_db (char *db)
if (lock_tables)
mysql_query(sock, "LOCK TABLES mysql.proc READ");
- fprintf(sql_file, "DELIMITER //\n");
+ fprintf(sql_file, "DELIMITER ;;\n");
/* 0, retrieve and dump functions, 1, procedures */
- for (i=0; i <= 1; i++)
+ for (i= 0; i <= 1; i++)
{
my_snprintf(query_buff, sizeof(query_buff),
"SHOW %s STATUS WHERE Db = '%s'",
@@ -1216,18 +1261,18 @@ static uint dump_routines_for_db (char *db)
if (mysql_num_rows(routine_list_res))
{
- while((routine_list_row= mysql_fetch_row(routine_list_res)))
+ while ((routine_list_row= mysql_fetch_row(routine_list_res)))
{
DBUG_PRINT("info", ("retrieving CREATE %s for %s", routine_type[i],
name_buff));
- routine_name=quote_name(routine_list_row[1], name_buff, 0);
+ routine_name= quote_name(routine_list_row[1], name_buff, 0);
my_snprintf(query_buff, sizeof(query_buff), "SHOW CREATE %s %s",
routine_type[i], routine_name);
if (mysql_query_with_error_report(sock, &routine_res, query_buff))
DBUG_RETURN(1);
- while ((row=mysql_fetch_row(routine_res)))
+ while ((row= mysql_fetch_row(routine_res)))
{
/*
if the user has EXECUTE privilege he see routine names, but NOT the
@@ -1238,16 +1283,18 @@ static uint dump_routines_for_db (char *db)
if (strlen(row[2]))
{
if (opt_drop)
- fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */ //\n",
+ fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;;\n",
routine_type[i], routine_name);
/*
- we need to change sql_mode only for the CREATE PROCEDURE/FUNCTION
- otherwise we may need to re-quote routine_name
+ we need to change sql_mode only for the CREATE
+ PROCEDURE/FUNCTION otherwise we may need to re-quote routine_name
*/;
- fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/ //\n",
+ fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\"*/;;\n",
row[1] /* sql_mode */);
- fprintf(sql_file, "/*!50003 %s */ //\n", row[2]);
- fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //\n");
+ fprintf(sql_file, "/*!50003 %s */;;\n", row[2]);
+ fprintf(sql_file,
+ "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/"
+ ";;\n");
}
} /* end of routine printing */
} /* end of list of routines */
@@ -1281,42 +1328,44 @@ static uint dump_routines_for_db (char *db)
static uint get_table_structure(char *table, char *db, char *table_type,
char *ignore_flag)
{
- MYSQL_RES *tableRes;
- MYSQL_ROW row;
- my_bool init=0;
- uint num_fields;
+ my_bool init=0, delayed, write_data, complete_insert;
+ my_ulonglong num_fields;
char *result_table, *opt_quoted_table;
const char *insert_option;
char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
- char table_buff2[NAME_LEN*2+3];
- char query_buff[512];
+ char table_buff2[NAME_LEN*2+3], query_buff[512];
FILE *sql_file = md_result_file;
int len;
+ MYSQL_RES *result;
+ MYSQL_ROW row;
DBUG_ENTER("get_table_structure");
- DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
+ DBUG_PRINT("enter", ("db: %s table: %s", db, table));
*ignore_flag= check_if_ignore_table(table, table_type);
- if (opt_delayed && (*ignore_flag & IGNORE_INSERT_DELAYED))
+ delayed= opt_delayed;
+ if (delayed && (*ignore_flag & IGNORE_INSERT_DELAYED))
+ {
+ delayed= 0;
if (verbose)
fprintf(stderr,
- "-- Unable to use delayed inserts for table '%s' because it's of\
- type %s\n", table, table_type);
+ "-- Warning: Unable to use delayed inserts for table '%s' "
+ "because it's of type %s\n", table, table_type);
+ }
- if (!(*ignore_flag & IGNORE_DATA))
+ complete_insert= 0;
+ if ((write_data= !(*ignore_flag & IGNORE_DATA)))
{
+ complete_insert= opt_complete_insert;
if (!insert_pat_inited)
insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024);
else
dynstr_set(&insert_pat, "");
}
- insert_option= ((opt_delayed && opt_ignore &&
- !(*ignore_flag & IGNORE_INSERT_DELAYED)) ?
- " DELAYED IGNORE " :
- opt_delayed && !(*ignore_flag & IGNORE_INSERT_DELAYED) ? " DELAYED " :
- opt_ignore ? " IGNORE " : "");
+ insert_option= ((delayed && opt_ignore) ? " DELAYED IGNORE " :
+ delayed ? " DELAYED " : opt_ignore ? " IGNORE " : "");
if (verbose)
fprintf(stderr, "-- Retrieving table structure for table %s...\n", table);
@@ -1375,71 +1424,82 @@ static uint get_table_structure(char *table, char *db, char *table_type,
check_io(sql_file);
}
- tableRes= mysql_store_result(sock);
- field= mysql_fetch_field_direct(tableRes, 0);
+ result= mysql_store_result(sock);
+ field= mysql_fetch_field_direct(result, 0);
if (strcmp(field->name, "View") == 0)
{
if (verbose)
fprintf(stderr, "-- It's a view, create dummy table for view\n");
- mysql_free_result(tableRes);
+ mysql_free_result(result);
- /* Create a dummy table for the view. ie. a table which has the
- same columns as the view should have. This table is dropped
- just before the view is created. The table is used to handle the
- case where a view references another view, which hasn't yet been
- created(during the load of the dump). BUG#10927 */
+ /*
+ Create a table with the same name as the view and with columns of
+ the same name in order to satisfy views that depend on this view.
+ The table will be removed when the actual view is created.
- /* Create temp table by selecting from the view */
+ The properties of each column, aside from the data type, are not
+ preserved in this temporary table, because they are not necessary.
+
+ This will not be necessary once we can determine dependencies
+ between views and can simply dump them in the appropriate order.
+ */
my_snprintf(query_buff, sizeof(query_buff),
- "CREATE TEMPORARY TABLE %s SELECT * FROM %s WHERE 0",
- result_table, result_table);
+ "SHOW FIELDS FROM %s", result_table);
if (mysql_query_with_error_report(sock, 0, query_buff))
{
safe_exit(EX_MYSQLERR);
DBUG_RETURN(0);
}
- /* Get CREATE statement for the temp table */
- my_snprintf(query_buff, sizeof(query_buff), "SHOW CREATE TABLE %s",
- result_table);
- if (mysql_query_with_error_report(sock, 0, query_buff))
+ if ((result= mysql_store_result(sock)))
{
- safe_exit(EX_MYSQLERR);
- DBUG_RETURN(0);
+ if (mysql_num_rows(result))
+ {
+ if (opt_drop)
+ {
+ fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
+ opt_quoted_table);
+ fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n",
+ opt_quoted_table);
+ check_io(sql_file);
+ }
+
+ fprintf(sql_file, "/*!50001 CREATE TABLE %s (\n", result_table);
+ /*
+ Get first row, following loop will prepend comma - keeps
+ from having to know if the row being printed is last to
+ determine if there should be a _trailing_ comma.
+ */
+ row= mysql_fetch_row(result);
+
+ fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0),
+ row[1]);
+
+ while((row= mysql_fetch_row(result)))
+ {
+ /* col name, col type */
+ fprintf(sql_file, ",\n %s %s",
+ quote_name(row[0], name_buff, 0), row[1]);
+ }
+ fprintf(sql_file, "\n) */;\n");
+ check_io(sql_file);
+ }
}
- tableRes= mysql_store_result(sock);
- row= mysql_fetch_row(tableRes);
+ mysql_free_result(result);
- if (opt_drop)
- fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n",
- opt_quoted_table);
-
- /* Print CREATE statement but remove TEMPORARY */
- fprintf(sql_file, "/*!50001 CREATE %s*/;\n", row[1]+17);
- check_io(sql_file);
-
- mysql_free_result(tableRes);
-
- /* Drop the temp table */
- my_snprintf(buff, sizeof(buff),
- "DROP TEMPORARY TABLE %s", result_table);
- if (mysql_query_with_error_report(sock, 0, buff))
- {
- safe_exit(EX_MYSQLERR);
- DBUG_RETURN(0);
- }
was_views= 1;
DBUG_RETURN(0);
}
- row= mysql_fetch_row(tableRes);
+
+ row= mysql_fetch_row(result);
fprintf(sql_file, "%s;\n", row[1]);
check_io(sql_file);
- mysql_free_result(tableRes);
+ mysql_free_result(result);
}
my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
result_table);
- if (mysql_query_with_error_report(sock, &tableRes, query_buff))
+ if (mysql_query_with_error_report(sock, &result, query_buff))
{
if (path)
my_fclose(sql_file, MYF(MY_WME));
@@ -1448,17 +1508,18 @@ static uint get_table_structure(char *table, char *db, char *table_type,
}
/*
- if *ignore_flag & IGNORE_DATA is true, then we don't build up insert statements
- for the table's data. Note: in subsequent lines of code, this test will
- have to be performed each time we are appending to insert_pat.
+ If write_data is true, then we build up insert statements for
+ the table's data. Note: in subsequent lines of code, this test
+ will have to be performed each time we are appending to
+ insert_pat.
*/
- if (!(*ignore_flag & IGNORE_DATA))
+ if (write_data)
{
dynstr_append_mem(&insert_pat, "INSERT ", 7);
dynstr_append(&insert_pat, insert_option);
dynstr_append_mem(&insert_pat, "INTO ", 5);
dynstr_append(&insert_pat, opt_quoted_table);
- if (opt_complete_insert)
+ if (complete_insert)
{
dynstr_append_mem(&insert_pat, " (", 2);
}
@@ -1470,20 +1531,21 @@ static uint get_table_structure(char *table, char *db, char *table_type,
}
}
- while ((row=mysql_fetch_row(tableRes)))
+ while ((row= mysql_fetch_row(result)))
{
- if (init)
+ if (complete_insert)
{
- if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
+ if (init)
+ {
dynstr_append_mem(&insert_pat, ", ", 2);
- }
- init=1;
- if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
+ }
+ init=1;
dynstr_append(&insert_pat,
quote_name(row[SHOW_FIELDNAME], name_buff, 0));
+ }
}
- num_fields= (uint) mysql_num_rows(tableRes);
- mysql_free_result(tableRes);
+ num_fields= mysql_num_rows(result);
+ mysql_free_result(result);
}
else
{
@@ -1494,7 +1556,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
result_table);
- if (mysql_query_with_error_report(sock, &tableRes, query_buff))
+ if (mysql_query_with_error_report(sock, &result, query_buff))
{
safe_exit(EX_MYSQLERR);
DBUG_RETURN(0);
@@ -1528,7 +1590,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
check_io(sql_file);
}
- if (!(*ignore_flag & IGNORE_DATA))
+ if (write_data)
{
dynstr_append_mem(&insert_pat, "INSERT ", 7);
dynstr_append(&insert_pat, insert_option);
@@ -1544,9 +1606,9 @@ static uint get_table_structure(char *table, char *db, char *table_type,
}
}
- while ((row=mysql_fetch_row(tableRes)))
+ while ((row= mysql_fetch_row(result)))
{
- ulong *lengths=mysql_fetch_lengths(tableRes);
+ ulong *lengths= mysql_fetch_lengths(result);
if (init)
{
if (!opt_xml && !tFlag)
@@ -1554,18 +1616,18 @@ static uint get_table_structure(char *table, char *db, char *table_type,
fputs(",\n",sql_file);
check_io(sql_file);
}
- if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
+ if (complete_insert)
dynstr_append_mem(&insert_pat, ", ", 2);
}
init=1;
- if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
+ if (opt_complete_insert)
dynstr_append(&insert_pat,
quote_name(row[SHOW_FIELDNAME], name_buff, 0));
if (!tFlag)
{
if (opt_xml)
{
- print_xml_row(sql_file, "field", tableRes, &row);
+ print_xml_row(sql_file, "field", result, &row);
continue;
}
@@ -1589,15 +1651,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
check_io(sql_file);
}
}
- num_fields = (uint) mysql_num_rows(tableRes);
- mysql_free_result(tableRes);
+ num_fields= mysql_num_rows(result);
+ mysql_free_result(result);
if (!tFlag)
{
/* Make an sql-file, if path was given iow. option -T was given */
char buff[20+FN_REFLEN];
uint keynr,primary_key;
my_snprintf(buff, sizeof(buff), "show keys from %s", result_table);
- if (mysql_query_with_error_report(sock, &tableRes, buff))
+ if (mysql_query_with_error_report(sock, &result, buff))
{
if (mysql_errno(sock) == ER_WRONG_OBJECT)
{
@@ -1616,7 +1678,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
/* Find first which key is primary key */
keynr=0;
primary_key=INT_MAX;
- while ((row=mysql_fetch_row(tableRes)))
+ while ((row= mysql_fetch_row(result)))
{
if (atoi(row[3]) == 1)
{
@@ -1632,13 +1694,13 @@ static uint get_table_structure(char *table, char *db, char *table_type,
}
}
}
- mysql_data_seek(tableRes,0);
+ mysql_data_seek(result,0);
keynr=0;
- while ((row=mysql_fetch_row(tableRes)))
+ while ((row= mysql_fetch_row(result)))
{
if (opt_xml)
{
- print_xml_row(sql_file, "key", tableRes, &row);
+ print_xml_row(sql_file, "key", result, &row);
continue;
}
@@ -1679,7 +1741,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
my_snprintf(buff, sizeof(buff), "show table status like %s",
quote_for_like(table, show_name_buff));
- if (mysql_query_with_error_report(sock, &tableRes, buff))
+ if (mysql_query_with_error_report(sock, &result, buff))
{
if (mysql_errno(sock) != ER_PARSE_ERROR)
{ /* If old MySQL version */
@@ -1689,7 +1751,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
result_table,mysql_error(sock));
}
}
- else if (!(row=mysql_fetch_row(tableRes)))
+ else if (!(row= mysql_fetch_row(result)))
{
fprintf(stderr,
"Error: Couldn't read status information for table %s (%s)\n",
@@ -1698,18 +1760,18 @@ static uint get_table_structure(char *table, char *db, char *table_type,
else
{
if (opt_xml)
- print_xml_row(sql_file, "options", tableRes, &row);
+ print_xml_row(sql_file, "options", result, &row);
else
{
fputs("/*!",sql_file);
- print_value(sql_file,tableRes,row,"engine=","Engine",0);
- print_value(sql_file,tableRes,row,"","Create_options",0);
- print_value(sql_file,tableRes,row,"comment=","Comment",1);
+ print_value(sql_file,result,row,"engine=","Engine",0);
+ print_value(sql_file,result,row,"","Create_options",0);
+ print_value(sql_file,result,row,"comment=","Comment",1);
fputs(" */",sql_file);
check_io(sql_file);
}
}
- mysql_free_result(tableRes); /* Is always safe to free */
+ mysql_free_result(result); /* Is always safe to free */
}
continue_xml:
if (!opt_xml)
@@ -1719,7 +1781,7 @@ continue_xml:
check_io(sql_file);
}
}
- if (opt_complete_insert && !(*ignore_flag & IGNORE_DATA))
+ if (opt_complete_insert)
{
dynstr_append_mem(&insert_pat, ") VALUES ", 9);
if (!extended_insert)
@@ -1747,15 +1809,19 @@ continue_xml:
static void dump_triggers_for_table (char *table, char *db)
{
- MYSQL_RES *result;
- MYSQL_ROW row;
char *result_table;
char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3];
char query_buff[512];
+ uint old_opt_compatible_mode=opt_compatible_mode;
FILE *sql_file = md_result_file;
+ MYSQL_RES *result;
+ MYSQL_ROW row;
DBUG_ENTER("dump_triggers_for_table");
DBUG_PRINT("enter", ("db: %s, table: %s", db, table));
+
+ /* Do not use ANSI_QUOTES on triggers in dump */
+ opt_compatible_mode&= ~MASK_ANSI_QUOTES;
result_table= quote_name(table, table_buff, 1);
my_snprintf(query_buff, sizeof(query_buff),
@@ -1771,11 +1837,11 @@ static void dump_triggers_for_table (char *table, char *db)
}
if (mysql_num_rows(result))
fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n\
-DELIMITER //;\n");
- while ((row=mysql_fetch_row(result)))
+DELIMITER ;;\n");
+ while ((row= mysql_fetch_row(result)))
{
- fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\" */ //\n\
-/*!50003 CREATE TRIGGER %s %s %s ON %s FOR EACH ROW%s */ //\n\n",
+ fprintf(sql_file, "/*!50003 SET SESSION SQL_MODE=\"%s\" */;;\n\
+/*!50003 CREATE TRIGGER %s %s %s ON %s FOR EACH ROW%s */;;\n\n",
row[6], /* sql_mode */
quote_name(row[0], name_buff, 0), /* Trigger */
row[4], /* Timing */
@@ -1785,9 +1851,14 @@ DELIMITER //;\n");
}
if (mysql_num_rows(result))
fprintf(sql_file,
- "DELIMITER ;//\n\
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;");
+ "DELIMITER ;\n"
+ "/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;\n");
mysql_free_result(result);
+ /*
+ make sure to set back opt_compatible mode to
+ original value
+ */
+ opt_compatible_mode=old_opt_compatible_mode;
DBUG_VOID_RETURN;
}
@@ -1812,10 +1883,10 @@ static char *add_load_option(char *ptr,const char *object,
/*
-** Allow the user to specify field terminator strings like:
-** "'", "\", "\\" (escaped backslash), "\t" (tab), "\n" (newline)
-** This is done by doubleing ' and add a end -\ if needed to avoid
-** syntax errors from the SQL parser.
+ Allow the user to specify field terminator strings like:
+ "'", "\", "\\" (escaped backslash), "\t" (tab), "\n" (newline)
+ This is done by doubling ' and add a end -\ if needed to avoid
+ syntax errors from the SQL parser.
*/
static char *field_escape(char *to,const char *from,uint length)
@@ -1874,7 +1945,7 @@ static void dump_table(char *table, char *db)
{
char ignore_flag;
char query_buf[QUERY_LENGTH], *end, buff[256],table_buff[NAME_LEN+3];
- char table_type[NAME_LEN];
+ char table_type[NAME_LEN];
char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table;
char *query= query_buf;
int error= 0;
@@ -1889,7 +1960,7 @@ static void dump_table(char *table, char *db)
Make sure you get the create table info before the following check for
--no-data flag below. Otherwise, the create table info won't be printed.
*/
- num_fields= get_table_structure(table, db, (char *)&table_type, &ignore_flag);
+ num_fields= get_table_structure(table, db, table_type, &ignore_flag);
/* Check --no-data flag */
if (dFlag)
@@ -1901,7 +1972,9 @@ static void dump_table(char *table, char *db)
DBUG_VOID_RETURN;
}
- DBUG_PRINT("info", ("ignore_flag %x num_fields %d", ignore_flag, num_fields));
+ DBUG_PRINT("info",
+ ("ignore_flag: %x num_fields: %d", (int) ignore_flag,
+ num_fields));
/*
If the table type is a merge table or any type that has to be
_completely_ ignored and no data dumped
@@ -1910,7 +1983,7 @@ static void dump_table(char *table, char *db)
{
if (verbose)
fprintf(stderr,
- "-- Skipping data for table '%s' because it's of type %s\n",
+ "-- Warning: Skipping data for table '%s' because it's of type %s\n",
table, table_type);
DBUG_VOID_RETURN;
}
@@ -1927,7 +2000,6 @@ static void dump_table(char *table, char *db)
result_table= quote_name(table,table_buff, 1);
opt_quoted_table= quote_name(table, table_buff2, 0);
-
if (verbose)
fprintf(stderr, "-- Sending SELECT query...\n");
if (path)
@@ -2058,10 +2130,10 @@ static void dump_table(char *table, char *db)
check_io(md_result_file);
}
- while ((row=mysql_fetch_row(res)))
+ while ((row= mysql_fetch_row(res)))
{
uint i;
- ulong *lengths=mysql_fetch_lengths(res);
+ ulong *lengths= mysql_fetch_lengths(res);
rownr++;
if (!extended_insert && !opt_xml)
{
@@ -2989,7 +3061,7 @@ char check_if_ignore_table(const char *table_name, char *table_type)
DBUG_RETURN(result); /* assume table is ok */
}
if (!(row[1]))
- strmake(table_type,"VIEW", NAME_LEN-1);
+ strmake(table_type, "VIEW", NAME_LEN-1);
else
{
/*
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index ca0a751e963..19d4ef16ef9 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -518,6 +518,13 @@ int main(int argc, char **argv)
free_defaults(argv_to_free);
return(1); /* purecov: deadcode */
}
+
+ if (mysql_query(sock, "set @@character_set_database=binary;"))
+ {
+ db_error(sock); /* We shall countinue here, if --force was given */
+ return(1);
+ }
+
if (lock_tables)
lock_table(sock, argc, argv);
for (; *argv != NULL; argv++)
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 264140cefa8..58c0928c36d 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -77,7 +77,6 @@
#define PAD_SIZE 128
#define MAX_CONS 128
#define MAX_INCLUDE_DEPTH 16
-#define LAZY_GUESS_BUF_SIZE 8192
#define INIT_Q_LINES 1024
#define MIN_VAR_ALLOC 32
#define BLOCK_STACK_DEPTH 32
@@ -143,7 +142,8 @@ typedef struct
long code;
} st_error;
-static st_error global_error[] = {
+static st_error global_error[] =
+{
#include <mysqld_ername.h>
{ 0, 0 }
};
@@ -218,7 +218,8 @@ static int ps_match_re(char *);
static char *ps_eprint(int);
static void ps_free_reg(void);
-static const char *embedded_server_groups[] = {
+static const char *embedded_server_groups[]=
+{
"server",
"embedded",
"mysqltest_SERVER",
@@ -735,9 +736,7 @@ err:
static int check_result(DYNAMIC_STRING* ds, const char *fname,
my_bool require_option)
{
- int error= RESULT_OK;
int res= dyn_string_cmp(ds, fname);
-
DBUG_ENTER("check_result");
if (res && require_option)
@@ -747,18 +746,16 @@ static int check_result(DYNAMIC_STRING* ds, const char *fname,
break; /* ok */
case RESULT_LENGTH_MISMATCH:
verbose_msg("Result length mismatch");
- error= RESULT_LENGTH_MISMATCH;
break;
case RESULT_CONTENT_MISMATCH:
verbose_msg("Result content mismatch");
- error= RESULT_CONTENT_MISMATCH;
break;
default: /* impossible */
die("Unknown error code from dyn_string_cmp()");
}
- if (error)
+ if (res != RESULT_OK)
reject_dump(fname, ds->str, ds->length);
- DBUG_RETURN(error);
+ DBUG_RETURN(res);
}
@@ -1286,7 +1283,7 @@ int do_modify_var(struct st_query *query, const char *name,
if (*p != '$')
die("First argument to %s must be a variable (start with $)", name);
v= var_get(p, &p, 1, 0);
- switch (operator){
+ switch (operator) {
case DO_DEC:
v->int_val--;
break;
@@ -1839,23 +1836,28 @@ void free_replace()
DBUG_VOID_RETURN;
}
-
-int select_connection_name(const char *name)
+struct connection * find_connection_by_name(const char *name)
{
struct connection *con;
- DBUG_ENTER("select_connection2");
- DBUG_PRINT("enter",("name: '%s'", name));
-
for (con= cons; con < next_con; con++)
{
if (!strcmp(con->name, name))
{
- cur_con= con;
- DBUG_RETURN(0);
+ return con;
}
}
- die("connection '%s' not found in connection pool", name);
- DBUG_RETURN(1); /* Never reached */
+ return 0; /* Connection not found */
+}
+
+
+int select_connection_name(const char *name)
+{
+ DBUG_ENTER("select_connection2");
+ DBUG_PRINT("enter",("name: '%s'", name));
+
+ if (!(cur_con= find_connection_by_name(name)))
+ die("connection '%s' not found in connection pool", name);
+ DBUG_RETURN(0);
}
@@ -1885,7 +1887,7 @@ int close_connection(struct st_query *q)
DBUG_PRINT("enter",("name: '%s'",p));
if (!*p)
- die("Missing connection name in connect");
+ die("Missing connection name in disconnect");
name= p;
while (*p && !my_isspace(charset_info,*p))
p++;
@@ -1908,6 +1910,14 @@ int close_connection(struct st_query *q)
}
#endif
mysql_close(&con->mysql);
+ my_free(con->name, MYF(0));
+ /*
+ When the connection is closed set name to "closed_connection"
+ to make it possible to reuse the connection name.
+ The connection slot will not be reused
+ */
+ if (!(con->name = my_strdup("closed_connection", MYF(MY_WME))))
+ die("Out of memory");
DBUG_RETURN(0);
}
}
@@ -1921,20 +1931,35 @@ int close_connection(struct st_query *q)
future to handle quotes. For now we assume that anything that is not
a comma, a space or ) belongs to the argument. space is a chopper, comma or
) are delimiters/terminators
+
+ SYNOPSIS
+ safe_get_param
+ str - string to get param from
+ arg - pointer to string where result will be stored
+ msg - Message to display if param is not found
+ if msg is 0 this param is not required and param may be empty
+
+ RETURNS
+ pointer to str after param
+
*/
char* safe_get_param(char *str, char** arg, const char *msg)
{
DBUG_ENTER("safe_get_param");
+ if(!*str)
+ {
+ if (msg)
+ die(msg);
+ *arg= str;
+ DBUG_RETURN(str);
+ }
while (*str && my_isspace(charset_info,*str))
str++;
*arg= str;
- for (; *str && *str != ',' && *str != ')' ; str++)
- {
- if (my_isspace(charset_info,*str))
- *str= 0;
- }
- if (!*str)
+ while (*str && *str != ',' && *str != ')')
+ str++;
+ if (msg && !*arg)
die(msg);
*str++= 0;
@@ -2119,71 +2144,137 @@ err:
}
+/*
+ Open a new connection to MySQL Server with the parameters
+ specified
+
+ SYNOPSIS
+ do_connect()
+ q called command
+
+ DESCRIPTION
+ connect(<name>,<host>,<user>,<pass>,<db>,[<port>,<sock>[<opts>]]);
+
+ <name> - name of the new connection
+ <host> - hostname of server
+ <user> - user to connect as
+ <pass> - password used when connecting
+ <db> - initial db when connected
+ <port> - server port
+ <sock> - server socket
+ <opts> - options to use for the connection
+ SSL - use SSL if available
+ COMPRESS - use compression if available
+
+ */
+
int do_connect(struct st_query *q)
{
char *con_name, *con_user,*con_pass, *con_host, *con_port_str,
- *con_db, *con_sock;
- char *p= q->first_argument;
+ *con_db, *con_sock, *con_options;
+ char *con_buf, *p;
char buff[FN_REFLEN];
int con_port;
+ bool con_ssl= 0;
+ bool con_compress= 0;
int free_con_sock= 0;
int error= 0;
int create_conn= 1;
+ VAR *var_port, *var_sock;
DBUG_ENTER("do_connect");
- DBUG_PRINT("enter",("connect: %s",p));
+ DBUG_PRINT("enter",("connect: %s", q->first_argument));
+
+ /* Make a copy of query before parsing, safe_get_param will modify */
+ if (!(con_buf= my_strdup(q->first_argument, MYF(MY_WME))))
+ die("Could not allocate con_buf");
+ p= con_buf;
if (*p != '(')
die("Syntax error in connect - expected '(' found '%c'", *p);
p++;
- p= safe_get_param(p, &con_name, "missing connection name");
- p= safe_get_param(p, &con_host, "missing connection host");
- p= safe_get_param(p, &con_user, "missing connection user");
- p= safe_get_param(p, &con_pass, "missing connection password");
- p= safe_get_param(p, &con_db, "missing connection db");
- if (!*p || *p == ';') /* Default port and sock */
- {
- con_port= port;
- con_sock= (char*) unix_sock;
- }
- else
+ p= safe_get_param(p, &con_name, "Missing connection name");
+ p= safe_get_param(p, &con_host, "Missing connection host");
+ p= safe_get_param(p, &con_user, "Missing connection user");
+ p= safe_get_param(p, &con_pass, "Missing connection password");
+ p= safe_get_param(p, &con_db, "Missing connection db");
+
+ /* Port */
+ p= safe_get_param(p, &con_port_str, 0);
+ if (*con_port_str)
{
- VAR* var_port, *var_sock;
- p= safe_get_param(p, &con_port_str, "missing connection port");
if (*con_port_str == '$')
{
if (!(var_port= var_get(con_port_str, 0, 0, 0)))
- die("Unknown variable '%s'", con_port_str+1);
+ die("Unknown variable '%s'", con_port_str+1);
con_port= var_port->int_val;
}
else
+ {
con_port= atoi(con_port_str);
- p= safe_get_param(p, &con_sock, "missing connection socket");
+ if (con_port == 0)
+ die("Illegal argument for port: '%s'", con_port_str);
+ }
+ }
+ else
+ {
+ con_port= port;
+ }
+
+ /* Sock */
+ p= safe_get_param(p, &con_sock, 0);
+ if (*con_sock)
+ {
if (*con_sock == '$')
{
if (!(var_sock= var_get(con_sock, 0, 0, 0)))
- die("Unknown variable '%s'", con_sock+1);
+ die("Unknown variable '%s'", con_sock+1);
if (!(con_sock= (char*)my_malloc(var_sock->str_val_len+1, MYF(0))))
- die("Out of memory");
+ die("Out of memory");
free_con_sock= 1;
memcpy(con_sock, var_sock->str_val, var_sock->str_val_len);
con_sock[var_sock->str_val_len]= 0;
}
}
- q->last_argument= p;
+ else
+ {
+ con_sock= (char*) unix_sock;
+ }
+
+ /* Options */
+ p= safe_get_param(p, &con_options, 0);
+ while (*con_options)
+ {
+ char* str= con_options;
+ while (*str && !my_isspace(charset_info, *str))
+ str++;
+ *str++= 0;
+ if (!strcmp(con_options, "SSL"))
+ con_ssl= 1;
+ else if (!strcmp(con_options, "COMPRESS"))
+ con_compress= 1;
+ else
+ die("Illegal option to connect: %s", con_options);
+ con_options= str;
+ }
+ /* Note: 'p' is pointing into the copy 'con_buf' */
+ q->last_argument= q->first_argument + (p - con_buf);
if (next_con == cons_end)
die("Connection limit exhausted - increase MAX_CONS in mysqltest.c");
+ if (find_connection_by_name(con_name))
+ die("Connection %s already exists", con_name);
+
if (!mysql_init(&next_con->mysql))
die("Failed on mysql_init()");
- if (opt_compress)
+ if (opt_compress || con_compress)
mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, charset_name);
#ifdef HAVE_OPENSSL
- if (opt_use_ssl)
+ if (opt_use_ssl || con_ssl)
mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#endif
@@ -2214,6 +2305,7 @@ int do_connect(struct st_query *q)
}
if (free_con_sock)
my_free(con_sock, MYF(MY_WME));
+ my_free(con_buf, MYF(MY_WME));
DBUG_RETURN(error);
}
@@ -3524,19 +3616,24 @@ static int run_query_stmt(MYSQL *mysql, struct st_query *q, int flags)
/* Read result from each column */
for (col_idx= 0; col_idx < num_fields; col_idx++)
{
- /* FIXME is string terminated? */
- const char *val= (const char *)bind[col_idx].buffer;
- ulonglong len= *bind[col_idx].length;
+ const char *val;
+ ulonglong len;
if (col_idx < max_replace_column && replace_column[col_idx])
{
val= replace_column[col_idx];
len= strlen(val);
}
- if (*bind[col_idx].is_null)
+ else if (*bind[col_idx].is_null)
{
val= "NULL";
len= 4;
}
+ else
+ {
+ /* FIXME is string terminated? */
+ val= (const char *) bind[col_idx].buffer;
+ len= *bind[col_idx].length;
+ }
if (!display_result_vertically)
{
if (col_idx) /* No tab before first col */
diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c
index 41ea22d815e..df0a698b81f 100644
--- a/cmd-line-utils/readline/complete.c
+++ b/cmd-line-utils/readline/complete.c
@@ -21,7 +21,7 @@
59 Temple Place, Suite 330, Boston, MA 02111 USA. */
#define READLINE_LIBRARY
-#ifndef _XOPEN_SOURCE
+#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__)
#define _XOPEN_SOURCE 500
#endif
diff --git a/config/ac-macros/yassl.m4 b/config/ac-macros/yassl.m4
index 972e4530dab..9d9a4d55000 100644
--- a/config/ac-macros/yassl.m4
+++ b/config/ac-macros/yassl.m4
@@ -15,12 +15,11 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [
fi
AC_MSG_RESULT([using bundled yaSSL])
yassl_dir="extra/yassl"
- openssl_libs="\
- -L\$(top_builddir)/extra/yassl/src -lyassl\
- -L\$(top_builddir)/extra/yassl/taocrypt/src -ltaocrypt"
- openssl_includes="-I\$(top_srcdir)/extra/yassl/include"
+ yassl_libs="-L\$(top_srcdir)/extra/yassl/src -lyassl -L\$(top_srcdir)/extra/yassl/taocrypt/src -ltaocrypt"
+ yassl_libs_with_path="\$(top_srcdir)/extra/yassl/src/libyassl.a \$(top_srcdir)/extra/yassl/taocrypt/src/libtaocrypt.a"
+ yassl_includes="-I\$(top_srcdir)/extra/yassl/include"
AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.])
-
+ AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for OpenSSL emulation.])
# System specific checks
yassl_integer_extra_cxxflags=""
case $host_cpu--$CXX_VERSION in
@@ -36,8 +35,9 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [
yassl_dir=""
AC_MSG_RESULT(no)
fi
- AC_SUBST(openssl_libs)
- AC_SUBST(openssl_includes)
+ AC_SUBST(yassl_libs)
+ AC_SUBST(yassl_includes)
AC_SUBST(yassl_dir)
+ AC_SUBST(yassl_libs_with_path)
AM_CONDITIONAL([HAVE_YASSL], [ test "with_yassl" = "yes" ])
])
diff --git a/configure.in b/configure.in
index 7573a2e255b..821339d966c 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# Don't forget to also update the NDB lines below.
-AM_INIT_AUTOMAKE(mysql, 5.1.2-alpha)
+AM_INIT_AUTOMAKE(mysql, 5.1.3-alpha)
AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
@@ -1022,7 +1022,7 @@ case $SYSTEM_TYPE in
*darwin5*)
if test "$ac_cv_prog_gcc" = "yes"
then
- FLAGS="-traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
+ FLAGS="-traditional-cpp -DHAVE_DARWIN5_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
CFLAGS="$CFLAGS $FLAGS"
CXXFLAGS="$CXXFLAGS $FLAGS"
MAX_C_OPTIMIZE="-O"
@@ -1032,23 +1032,13 @@ case $SYSTEM_TYPE in
*darwin6*)
if test "$ac_cv_prog_gcc" = "yes"
then
- FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
+ FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
CFLAGS="$CFLAGS $FLAGS"
CXXFLAGS="$CXXFLAGS $FLAGS"
MAX_C_OPTIMIZE="-O"
fi
;;
- *darwin[[7-8]]*)
- # don't forget to escape [] like above
- if test "$ac_cv_prog_gcc" = "yes"
- then
- FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT"
- CFLAGS="$CFLAGS $FLAGS"
- CXXFLAGS="$CXXFLAGS $FLAGS"
- MAX_C_OPTIMIZE="-O"
- fi
- ;;
- *darwin9*)
+ *darwin*)
if test "$ac_cv_prog_gcc" = "yes"
then
FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT"
@@ -1140,7 +1130,7 @@ dnl Is this the right match for DEC OSF on alpha?
sql/Makefile.in)
# Use gen_lex_hash.linux instead of gen_lex_hash
# Add library dependencies to mysqld_DEPENDENCIES
- lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(ndbcluster_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)"
+ lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(ndbcluster_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs) \$(yassl_libs)"
cat > $filesed << EOF
s,\(^.*\$(MAKE) gen_lex_hash\)\$(EXEEXT),#\1,
s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
@@ -2283,10 +2273,14 @@ AC_ARG_WITH(man,
if test "$with_man" = "yes"
then
man_dirs="man"
+ man1_files=`ls -1 $srcdir/man/*.1 | sed -e 's;^.*man/;;'`
+ man1_files=`echo $man1_files`
else
man_dirs=""
+ man1_files=""
fi
AC_SUBST(man_dirs)
+AC_SUBST(man1_files)
# Shall we build the bench code?
AC_ARG_WITH(bench,
diff --git a/extra/Makefile.am b/extra/Makefile.am
index 91ec8318f08..457fddce673 100644
--- a/extra/Makefile.am
+++ b/extra/Makefile.am
@@ -26,7 +26,7 @@ CLEANFILES = $(BUILT_SOURCES)
DIST_SUBDIRS= yassl
# This will build mysqld_error.h and sql_state.h
-$(top_builddir)/include/mysqld_error.h: comp_err$(EXEEXT)
+$(top_builddir)/include/mysqld_error.h: comp_err
$(top_builddir)/extra/comp_err \
--charset=$(top_srcdir)/sql/share/charsets \
--out-dir=$(top_builddir)/sql/share/ \
diff --git a/extra/yassl/src/Makefile.am b/extra/yassl/src/Makefile.am
index 83397e24168..4ebb9a2d862 100644
--- a/extra/yassl/src/Makefile.am
+++ b/extra/yassl/src/Makefile.am
@@ -1,7 +1,7 @@
INCLUDES = -I../include -I../taocrypt/include -I../mySTL
-noinst_LTLIBRARIES = libyassl.la
-libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
+noinst_LIBRARIES = libyassl.a
+libyassl_a_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
EXTRA_DIST = ../include/*.hpp ../include/openssl/*.h
diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am
index c4fc4607622..9ce083e9e56 100644
--- a/extra/yassl/taocrypt/src/Makefile.am
+++ b/extra/yassl/taocrypt/src/Makefile.am
@@ -1,12 +1,15 @@
INCLUDES = -I../include -I../../mySTL
-noinst_LTLIBRARIES = libtaocrypt.la libtaoint.la
-libtaocrypt_la_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp asn.cpp \
+noinst_LIBRARIES = libtaoint.a libtaocrypt.a
+
+libtaoint_a_SOURCES = integer.cpp
+libtaoint_a_CXXFLAGS = @yassl_integer_extra_cxxflags@
+
+libtaocrypt_a_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp asn.cpp \
coding.cpp dh.cpp des.cpp dsa.cpp file.cpp hash.cpp \
md2.cpp md5.cpp misc.cpp random.cpp ripemd.cpp rsa.cpp sha.cpp \
template_instnt.cpp
-libtaocrypt_la_LIBADD = libtaoint.la
-libtaoint_la_SOURCES = integer.cpp
-libtaoint_la_CXXFLAGS = @yassl_integer_extra_cxxflags@
+libtaocrypt_a_LIBADD = libtaoint_a-integer.o
+
EXTRA_DIST = ../include/*.hpp
AM_CXXFLAGS = -DYASSL_PURE_C
diff --git a/include/Makefile.am b/include/Makefile.am
index 53b83bd7d88..9f5570f8af4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -29,7 +29,7 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \
mysys_err.h my_base.h help_start.h help_end.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
- thr_lock.h t_ctype.h violite.h md5.h \
+ thr_lock.h t_ctype.h violite.h md5.h base64.h \
mysql_version.h.in my_handler.h my_time.h decimal.h
# mysql_version.h are generated
diff --git a/storage/ndb/include/util/Base64.hpp b/include/base64.h
index f4b11ad9214..fcc2f8b40dc 100644
--- a/storage/ndb/include/util/Base64.hpp
+++ b/include/base64.h
@@ -14,15 +14,38 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifndef __BASE64_HPP_INCLUDED__
-#define __BASE64_HPP_INCLUDED__
+#ifndef __BASE64_H_INCLUDED__
+#define __BASE64_H_INCLUDED__
-#include <UtilBuffer.hpp>
-#include <BaseString.hpp>
+#ifdef __cplusplus
+extern "C" {
+#endif
-int base64_encode(const UtilBuffer &src, BaseString &dst);
-int base64_encode(const void * s, size_t src_len, BaseString &dst);
-int base64_decode(const BaseString &src, UtilBuffer &dst);
-int base64_decode(const char * s, size_t len, UtilBuffer &dst);
-#endif /* !__BASE64_HPP_INCLUDED__ */
+#include <mysys_priv.h>
+
+/*
+ Calculate how much memory needed for dst of base64_encode()
+*/
+int base64_needed_encoded_length(int length_of_data);
+
+/*
+ Calculate how much memory needed for dst of base64_decode()
+*/
+int base64_needed_decoded_length(int length_of_encoded_data);
+
+/*
+ Encode data as a base64 string
+*/
+int base64_encode(const void *src, size_t src_len, char *dst);
+
+/*
+ Decode a base64 string into data
+*/
+int base64_decode(const char *src, size_t src_len, void *dst);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !__BASE64_H_INCLUDED__ */
diff --git a/include/config-netware.h b/include/config-netware.h
index 4c46ccd3ec7..7def0053bf2 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -118,15 +118,12 @@ extern "C" {
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
-/* Kernel call on NetWare that will only yield if our time slice is up */
-void kYieldIfTimeSliceUp(void);
-
/* Some macros for portability */
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
/* extra protection against CPU Hogs on NetWare */
-#define NETWARE_YIELD kYieldIfTimeSliceUp()
+#define NETWARE_YIELD pthread_yield()
/* Screen mode for help texts */
#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)
diff --git a/include/config-win.h b/include/config-win.h
index 4eaf97cd4f5..fe099c11a2f 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -193,7 +193,7 @@ typedef uint rf_SetTimer;
/* Convert some simple functions to Posix */
-#define sigset(A,B) signal((A),(B))
+#define my_sigset(A,B) signal((A),(B))
#define finite(A) _finite(A)
#define sleep(A) Sleep((A)*1000)
#define popen(A) popen(A,B) _popen((A),(B))
diff --git a/include/m_ctype.h b/include/m_ctype.h
index e0a26c4ce56..b7361cb7d7b 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -231,6 +231,7 @@ typedef struct charset_info_st
uint mbmaxlen;
uint16 min_sort_char;
uint16 max_sort_char; /* For LIKE optimization */
+ uchar pad_char;
my_bool escape_with_backslash_is_dangerous;
MY_CHARSET_HANDLER *cset;
diff --git a/include/m_string.h b/include/m_string.h
index 33ba9c155c2..c02ce92cd88 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -129,15 +129,6 @@ extern void bmove_align(gptr dst,const gptr src,uint len);
#define bmove512(A,B,C) memcpy(A,B,C)
#endif
-#ifdef HAVE_purify
-#define memcpy_overlap(A,B,C) \
-DBUG_ASSERT((A) <= (B) || ((B)+(C)) <= (A)); \
-bmove((byte*) (A),(byte*) (B),(size_t) (C));
-#else
-#define memcpy_overlap(A,B,C) memcpy((A), (B), (C))
-#endif /* HAVE_purify */
-
-
/* Prototypes for string functions */
#if !defined(bfill) && !defined(HAVE_BFILL)
diff --git a/include/my_base.h b/include/my_base.h
index 0a2f5c2393e..4a6a384c438 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -248,6 +248,7 @@ enum ha_base_keytype {
#define HA_OPTION_CHECKSUM 32
#define HA_OPTION_DELAY_KEY_WRITE 64
#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */
+#define HA_OPTION_CREATE_FROM_ENGINE 256
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */
#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */
@@ -258,7 +259,6 @@ enum ha_base_keytype {
#define HA_CREATE_TMP_TABLE 4
#define HA_CREATE_CHECKSUM 8
#define HA_CREATE_DELAY_KEY_WRITE 64
-#define HA_CREATE_FROM_ENGINE 128
/* Bits in flag to _status */
diff --git a/include/my_handler.h b/include/my_handler.h
index c076ba0c2c9..d531e0fb3e1 100644
--- a/include/my_handler.h
+++ b/include/my_handler.h
@@ -88,4 +88,6 @@ extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
register uchar *b, uint key_length, uint nextflag,
uint *diff_pos);
+extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a);
+
#endif /* _my_handler_h */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 1dd1ead7dfa..ee2c801ff6e 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -25,10 +25,10 @@
#endif
#ifdef __cplusplus
-#define EXTERN_C extern "C"
+#define EXTERNC extern "C"
extern "C" {
#else
-#define EXTERN_C
+#define EXTERNC
#endif /* __cplusplus */
#if defined(__WIN__) || defined(OS2)
@@ -80,10 +80,10 @@ struct timespec { /* For pthread_cond_timedwait() */
typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self
#ifdef OS2
-#define pthread_handler_t EXTERN_C void * _Optlink
+#define pthread_handler_t EXTERNC void * _Optlink
typedef void * (_Optlink *pthread_handler)(void *);
#else
-#define pthread_handler_t EXTERN_C void * __cdecl
+#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
#endif
@@ -187,7 +187,7 @@ typedef int pthread_attr_t; /* Needed by Unixware 7.0.0 */
#define pthread_key_create(A,B) thr_keycreate((A),(B))
#define pthread_key_delete(A) thr_keydelete(A)
-#define pthread_handler_t EXTERN_C void *
+#define pthread_handler_t EXTERNC void *
#define pthread_key(T,V) pthread_key_t V
void * my_pthread_getspecific_imp(pthread_key_t key);
@@ -265,7 +265,7 @@ extern int my_pthread_getprio(pthread_t thread_id);
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
#define pthread_detach_this_thread()
-#define pthread_handler_t EXTERN_C void *
+#define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *);
/* Test first for RTS or FSU threads */
@@ -292,8 +292,6 @@ extern int my_pthread_create_detached;
#undef HAVE_PTHREAD_RWLOCK_RDLOCK
#undef HAVE_SNPRINTF
-#define sigset(A,B) pthread_signal((A),(void (*)(int)) (B))
-#define signal(A,B) pthread_signal((A),(void (*)(int)) (B))
#define my_pthread_attr_setprio(A,B)
#endif /* defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM) */
@@ -325,14 +323,26 @@ extern int my_pthread_cond_init(pthread_cond_t *mp,
#if !defined(HAVE_SIGWAIT) && !defined(HAVE_mit_thread) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#endif
-#if !defined(HAVE_SIGSET) && !defined(HAVE_mit_thread) && !defined(sigset)
-#define sigset(A,B) do { struct sigaction s; sigset_t set; \
- sigemptyset(&set); \
- s.sa_handler = (B); \
- s.sa_mask = set; \
- s.sa_flags = 0; \
- sigaction((A), &s, (struct sigaction *) NULL); \
- } while (0)
+
+
+/*
+ We define my_sigset() and use that instead of the system sigset() so that
+ we can favor an implementation based on sigaction(). On some systems, such
+ as Mac OS X, sigset() results in flags such as SA_RESTART being set, and
+ we want to make sure that no such flags are set.
+*/
+#if defined(HAVE_SIGACTION) && !defined(my_sigset)
+#define my_sigset(A,B) do { struct sigaction s; sigset_t set; \
+ sigemptyset(&set); \
+ s.sa_handler = (B); \
+ s.sa_mask = set; \
+ s.sa_flags = 0; \
+ sigaction((A), &s, (struct sigaction *) NULL); \
+ } while (0)
+#elif defined(HAVE_SIGSET) && !defined(my_sigset)
+#define my_sigset(A,B) sigset((A),(B))
+#elif !defined(my_sigset)
+#define my_sigset(A,B) signal((A),(B))
#endif
#ifndef my_pthread_setprio
@@ -412,16 +422,13 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#endif
-#ifdef HAVE_DARWIN_THREADS
+#ifdef HAVE_DARWIN5_THREADS
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy(0)
#define pthread_condattr_init(A) pthread_dummy(0)
#define pthread_condattr_destroy(A) pthread_dummy(0)
-#define pthread_signal(A,B) pthread_dummy(0)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
-#undef sigset
-#define sigset(A,B) pthread_signal((A),(void (*)(int)) (B))
#endif
#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
diff --git a/include/my_sys.h b/include/my_sys.h
index 422bd171eb5..76031806b82 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -98,7 +98,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_RETURN_REAL_PATH 32 /* return full path for file */
#define MY_SAFE_PATH 64 /* Return NULL if too long path */
#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
-#define MY_UNIX_PATH 256 /* convert path to UNIX format */
/* My seek flags */
#define MY_SEEK_SET 0
@@ -159,7 +158,8 @@ extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags);
extern char *my_strdup_with_length(const byte *from, uint length,
myf MyFlags);
-#define my_free(PTR,FG) my_no_flags_free(PTR)
+/* we do use FG (as a no-op) in below so that a typo on FG is caught */
+#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
#define CALLER_INFO_PROTO /* nothing */
#define CALLER_INFO /* nothing */
#define ORIG_CALLER_INFO /* nothing */
diff --git a/include/myisam.h b/include/myisam.h
index 39cc61ad204..56717524bb2 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -392,7 +392,9 @@ typedef enum
/* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
MI_STATS_METHOD_NULLS_NOT_EQUAL,
/* Treat NULLs as equal when collecting statistics (like 4.0 did) */
- MI_STATS_METHOD_NULLS_EQUAL
+ MI_STATS_METHOD_NULLS_EQUAL,
+ /* Ignore NULLs - count only tuples without NULLs in the index components */
+ MI_STATS_METHOD_IGNORE_NULLS
} enum_mi_stats_method;
typedef struct st_mi_check_param
@@ -419,7 +421,14 @@ typedef struct st_mi_check_param
int tmpfile_createflag;
myf myf_rw;
IO_CACHE read_cache;
+
+ /*
+ The next two are used to collect statistics, see update_key_parts for
+ description.
+ */
ulonglong unique_count[MI_MAX_KEY_SEG+1];
+ ulonglong notnull_count[MI_MAX_KEY_SEG+1];
+
ha_checksum key_crc[MI_MAX_POSSIBLE_KEY];
ulong rec_per_key_part[MI_MAX_KEY_SEG*MI_MAX_POSSIBLE_KEY];
void *thd;
@@ -479,7 +488,8 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
my_bool repair);
int update_state_info(MI_CHECK *param, MI_INFO *info,uint update);
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
- ulonglong *unique, ulonglong records);
+ ulonglong *unique, ulonglong *notnull,
+ ulonglong records);
int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
my_off_t length, const char *type);
int movepoint(MI_INFO *info,byte *record,my_off_t oldpos,
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 251b9e76e91..cef63115ad3 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -411,7 +411,7 @@ my_bool check_scramble(const char *reply, const char *message,
const unsigned char *hash_stage2);
void get_salt_from_password(unsigned char *res, const char *password);
void make_password_from_salt(char *to, const unsigned char *hash_stage2);
-void octet2hex(char *to, const unsigned char *str, unsigned int len);
+char *octet2hex(char *to, const char *str, unsigned int len);
/* end of password.c */
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index 4bd9eddafb0..403ff415378 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -22,9 +22,9 @@
target = libmysqlclient.la
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
-LIBS = @CLIENT_LIBS@
+LIBS = @CLIENT_LIBS@ @yassl_libs@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- $(openssl_includes) @ZLIB_INCLUDES@
+ $(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@
include $(srcdir)/Makefile.shared
diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am
index 65255066d45..6ab09368cc5 100644
--- a/libmysql_r/Makefile.am
+++ b/libmysql_r/Makefile.am
@@ -22,10 +22,10 @@
target = libmysqlclient_r.la
target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
-LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
+LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ @yassl_libs@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
- $(openssl_includes) @ZLIB_INCLUDES@
+ $(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
include $(top_srcdir)/libmysql/Makefile.shared
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 9b651d9bc02..f5479bfb207 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -29,7 +29,7 @@ INCLUDES= @bdb_includes@ \
-I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
-I$(top_srcdir)/regex \
- $(openssl_includes) @ZLIB_INCLUDES@
+ $(openssl_includes) $(yassl_includes) @ZLIB_INCLUDES@
noinst_LIBRARIES = libmysqld_int.a
pkglib_LIBRARIES = libmysqld.a
@@ -81,7 +81,9 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \
- $(top_builddir)/vio/libvio.a
+ $(top_builddir)/vio/libvio.a \
+ @yassl_libs_with_path@
+
#
# To make it easy for the end user to use the embedded library we
diff --git a/man/Makefile.am b/man/Makefile.am
index 8d18165191a..9702c4b2ace 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -17,30 +17,8 @@
## Process this file with automake to create Makefile.in
-man_MANS = mysql.1 mysql_zap.1 mysqlaccess.1 \
- mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \
- perror.1 replace.1 mysqld_safe.1 mysql_fix_privilege_tables.1
-
-EXTRA_DIST = mysql.1.in mysql_zap.1.in \
- mysqlaccess.1.in mysqladmin.1.in mysqld.1.in mysqld_multi.1.in \
- mysqldump.1.in mysqlshow.1.in perror.1.in replace.1.in mysqlman.1.in \
- mysqld_safe.1.in mysql_fix_privilege_tables.1.in
-
-CLEANFILES = $(man_MANS)
-
-SUFFIXES = .in
-
-.in:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
- -e 's!@''sysconfdir''@!@sysconfdir@!' \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
- $< > $@-t
- @MV@ $@-t $@
+man1_MANS = @man1_files@
+EXTRA_DIST = $(man1_MANS)
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/man/mysql.1.in b/man/mysql.1.in
deleted file mode 100644
index c4463aa658b..00000000000
--- a/man/mysql.1.in
+++ /dev/null
@@ -1,160 +0,0 @@
-.TH mysql 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-mysql \- text-based client for mysqld, a SQL-based relational database daemon
-.SH USAGE
-mysql [OPTIONS] [Database]
-.SH SYNOPSIS
-.B mysql
-.RB [ \-B | \-\-batch ]
-.RB [ \-# | \-\-debug=
-.IR logfile ]
-.RB [ \-T | \-\-debug-info ]
-.RB [ \-e | \-\-exec=
-.IR command ]
-.RB [ \-f | \-\-force ]
-.RB [ \-? | \-\-help ]
-.RB [ \-h | \-\-host=
-.IR hostname ]
-.RB [ \-n | \-\-unbuffered ]
-.RB [ \-p[pwd] ]
-.RI [ \-\-password=[pwd] ]
-.RB [ \-P | \-\-port=
-.IR pnum ]
-.RB [ \-q | \-\-quick ]
-.RB [ \-r | \-\-raw ]
-.RB [ \-s | \-\-silent ]
-.RB [ \-S | \-\-socket=
-.IR snum ]
-.RB [ \-u | \-\-user=
-.IR uname ]
-.RB [ \-v | \-\-verbose ]
-.RB [ \-V | \-\-version ]
-.RB [ \-w | \-\-wait ]
-.SH DESCRIPTION
-The
-.IR mysql
-program provides a curses-based interface to the SQL-based database
-server daemon,
-.IR mysqld (1).
-Full fuller documentation, refer to the HTML documents installed with
-the package.
-.SH OPTIONS
-.TP
-.BR \-B | \-\-batch
-Print results with a tab as separator,
-each row on a new line.
-.TP
-\fB\-#\fP|\fB\-\-debug=\fP\fIlogfile\fP
-Employ the specified debug log.
-.TP
-.BR \-T | \-\-debug-info
-Print debug information upon exiting.
-.TP
-\fB\-e | \-\-exec=\fP\fPcommand\fP
-Execute the specified command and quit
-.BR ( \-\-batch
-is implicit).
-.TP
-.BR \-f | \-\-force
-Continue even if the face of a SQL error.
-.TP
-.BR \-? | \-\-help
-Display a help message and exit.
-.TP
-\fB\-h\fP|\fP\-\-host=\fP\fIhostname\fP
-Connect to the specified host.
-.TP
-.BR \-n | \-\-unbuffered
-Flush the buffer after each query.
-.TP
-\fB\-p\fP|\fB\-\-password\fP[\fB=\fP\fIpwd\fP]
-Employ the specified password when connecting to the database server.
-If a password is not supplied, it will be requested interactively.
-.TP
-\fB\-P\fR|\fB\-\-port=\fP\fIpnum\fP
-Employ the specified port number for connecting to the database server.
-.TP
-.BR \-q | \-\-quick
-Do not cache the result; print it row by row.
-This may slow down the server if the output is suspended.
-.TP
-.BR \-r | \-\-raw
-Write fields without conversion.
-(used with
-.BR \-\-batch ).
-.TP
-.BR \-s | \-\-silent
-Silent mode: reduce the amount of output.
-.TP
-\fB\-S\fP|\fB\-\-socket=\fP\fIsnum\fP
-Employ the specified socket file for connecting to the database server.
-.TP
-\fB\-u\fP|\fB\-\-user=\fP\fIuname\fP
-Employ the specified user name for logging in to the server.
-.TP
-.BR \-v | \-\-verbose
-Verbose mode: write more
-Specifying this option
-.I twice
-produces a tabular output format.
-.TP
-.BR \-V | \-\-version
-Print the
-.I mysql
-version number and exit.
-.TP
-.BR \-w | \-\-wait
-Wait and retry if the database server connection is down.
-.SH FILES
-.TP 2.2i
-.I /etc/my.cnf
-MySQL configuration file
-.TP
-.I @bindir@/mysql
-Client executable
-.TP
-.I @libexecdir@/mysqld
-Server executable
-.TP
-.I @bindir@/mysqld_safe
-executable shell script for starting mysqld safely
-.TP
-.I @localstatedir@
-location of database files
-.SH EXAMPLE
-You can also read a backup dump file back into MySQL with:
-.TP
-.BR mysql
-\fP\fIdatabase\fP
-.BR <
-backup-file.sql
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 6.3, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/)
-This software comes with no warranty.
-Manual page by R. P. C. Rodgers,
-Lister Hill National Center for Biomedical Communication,
-U.S. National Library of Medicine
-(rodgers@nlm.nih.gov).
-.\" end of man page
diff --git a/man/mysql_fix_privilege_tables.1.in b/man/mysql_fix_privilege_tables.1.in
deleted file mode 100644
index fe1016e8d98..00000000000
--- a/man/mysql_fix_privilege_tables.1.in
+++ /dev/null
@@ -1,40 +0,0 @@
-.TH mysql 1 "17 March 2003" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-mysql_fix_privilege_tables \- Fixes MySQL privilege tables.
-.SH SYNOPSIS
-mysql_fix_privilege_tables [mysql_root_password]
-.SH DESCRIPTION
-This scripts updates the mysql.user, mysql.db, mysql.host and the
-mysql.func tables to MySQL 3.22.14 and above.
-
-This is needed if you want to use the new GRANT functions,
-CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 3.23
-
-If you get 'Access denied' errors, run the script again
-and give the MySQL root user password as an argument.
-
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-This manpage was written by Christian Hammers <ch@debian.org>.
-
-MySQL is available at http://www.mysql.com/.
-.\" end of man page
diff --git a/man/mysql_zap.1.in b/man/mysql_zap.1.in
deleted file mode 100644
index fb030427dc2..00000000000
--- a/man/mysql_zap.1.in
+++ /dev/null
@@ -1,52 +0,0 @@
-.TH zap 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-zap - a perl script used to kill processes
-.SH USAGE
-/usr/bin/mysql_zap [-signal] [-?Ift] pattern
-.SH SYNOPSIS
-.B zap
-.RB [ \-I | \-? ]
-.RB [ \-f ]
-.RB [ \-t ]
-.SH DESCRIPTION
-.TP
-.BR zap
-supports by executing
-.TP
-.BR \-I | \-?
-info
-.TP
-.BR \-f
-force
-.TP
-.BR \-t
-test
-.SH NOTE
-If
-.BR -f
-isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If
-.BR -t
-is given the processes is only shown on stdout.
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
-.\" end of man page
diff --git a/man/mysqlaccess.1.in b/man/mysqlaccess.1.in
deleted file mode 100644
index e0b3d314a10..00000000000
--- a/man/mysqlaccess.1.in
+++ /dev/null
@@ -1,125 +0,0 @@
-.TH mysqlaccess 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-.BR mysqlaccess \- Create new users to mysql.
-.SH USAGE
-mysqlaccess [host [user [db]]] OPTIONS
-.SH SYNOPSIS
-.B mysqlaccess
-.RB [ \-? | \-\-help ]
-.RB [ \-v | \-\-version ]
-.RB [ \-p | \-\-password=# ]
-.RB [ \-h | \-\-host=# ]
-.RB [ \-d | \-\-db=# ]
-.RB [ \-U | \-\-superuser=# ]
-.RB [ \-P | \-\-spassword=# ]
-.RB [ \-H | \-\-rhost=# ]
-.RB [ \-\-old_server ]
-.RB [ \-b | \-\-brief ]
-.RB [ \-t | \-\-table ]
-.RB [ \-\-relnotes]
-.RB [ \-\-plan ]
-.RB [ \-\-howto ]
-.RB [ \-\-debug=N ]
-.RB [ \-\-copy ]
-.RB [ \-\-preview ]
-.RB [ \-\-commit ]
-.RB [ \-\-rollback ]
-.SH DESCRIPTION
-.TP
-.BR \-? | \-\-help
-display this helpscreen and exit
-.TP
-.BR \-v | \-\-version
-print information on the program `mysqlaccess'
-.TP
-.BR \-u | \-\-user=#
-username for logging in to the db
-.TP
-.BR \-p | \-\-password=#
-validate password for user
-.TP
-.BR \-h | \-\-host=#
-name or IP\-number of the host
-.TP
-.BR \-d | \-\-db=#
-name of the database
-.TP
-.BR \-U | \-\-superuser=#
-connect as superuser
-.TP
-.BR \-P | \-\-spassword=#
-password for superuser
-.TP
-.BR \-H | \-\-rhost=#
-remote MySQL\-server to connect to
-.TP
-.BR \-\-old_server
-connect to old MySQL\-server (before v3.21) which
-does not yet know how to handle full where clauses.
-.TP
-.BR \-b | \-\-brief
-single\-line tabular report
-.TP
-.BR \-t | \-\-table
-report in table\-format
-.TP
-.BR \-\-relnotes
-print release\-notes
-.TP
-.BR \-\-plan
-print suggestions/ideas for future releases
-.TP
-.BR \-\-howto
-some examples of how to run `mysqlaccess'
-.TP
-.BR \-\-debug=N
-enter debuglevel N (0..3)
-.TP
-.BR \-\-copy
-reload temporary grant\-tables from original ones
-.TP
-.BR \-\-preview
-show differences in privileges after making
-changes in (temporary) grant\-tables
-.TP
-.BR \-\-commit
-copy grant\-rules from temporary tables to grant\-tables
-(!don't forget to do an mysqladmin reload)
-.TP
-.BR \-\-rollback
-undo the last changes to the grant\-tables.
-.SH NOTE
-At least the user and the db must be given (even with wildcards)
-If no host is given, `localhost' is assumed
-Wildcards (*,?,%,_) are allowed for host, user and db, but be sure
-to escape them from your shell!! (i.e., type \\* or '*')
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-
-.\" end of man page
diff --git a/man/mysqladmin.1.in b/man/mysqladmin.1.in
deleted file mode 100644
index e62cb32dc78..00000000000
--- a/man/mysqladmin.1.in
+++ /dev/null
@@ -1,209 +0,0 @@
-.TH mysqladmin 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
- mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations
-.SH OPTION SYNOPSIS
-.B mysqladmin
-.RB [ \-# | \-\-debug=
-.IR logfile ]
-.RB [ \-f | \-\-force ]
-.RB [ \-? | \-\-help ]
-.BR [ --character-sets-dir=\fP\fIdirectory\fP ]
-.RB [ \-C | \-\-compress ]
-.RB [ \-h | \-\-host=[#] ]
-.RB [ \-p[pwd] ]
-.RI [ \-\-password=[pwd] ]
-.RB [ \-P | \-\-port=
-.IR pnum ]
-.RB [ \-i | \-\-sleep=
-.IR sec ]
-.RB [ \-E | \-\-vertical ]
-.RB [ \-s | \-\-silent ]
-.RB [ \-S | \-\-socket=
-.IR # ]
-.RB [ \-r | \-\-relative ]
-.RB [ \-t | \-\-timeout=
-.IR # ]
-.RB [ \-u | \-\-user=
-.IR uname ]
-.RB [ \-v | \-\-verbose ]
-.RB [ \-V | \-\-version ]
-.RB [ \-w | \-\-wait[=retries] ]
-.SH OPTION DESCRIPTION
-You can get a list of the options your version of
-.IR mysqladmin
-supports by executing
-.BR "mysqladmin \-\-help"
-.SH OPTIONS
-.TP
-.BR \-# | \-\-debug=\fP\fIlogfile\fP
-Output debug log. Often this is 'd:t:o,filename`
-.TP
-.BR \-f | \-\-force
-Don't ask for confirmation on drop database; with
-multiple commands, continue even if an error occurs
-.TP
-.BR \-? | \-\-help
- Display help and exit
-.TP
-.BR --character-sets-dir=\fP\fIdirectory\fP
-Set the character set directory
-.TP
-.BR \-C | \-\-compress
-Use compression in server/client protocol
-.TP
-\fB\-h\fP|\fP\-\-host=\fP\fIhostname\fP
-Connect to host
-.TP
-\fB\-p\fP|\fB\-\-password\fP[\fB=\fP\fIpwd\fP]
-Password to use when connecting to server
-If password is not given it's asked from the tty
-.TP
-\fB\-P\fR|\fB\-\-port=\fP\fIpnum\fP
-Port number to use for connection
-.TP
-\fB\-i\fR|\fB\-\-sleep=\fP\fIsec\fP
-Execute commands again and again with a sleep between
-.TP
-.BR \-r | \-\-relative
-Show difference between current and previous values
-when used with
-.BR -i
-. Currently works only with
-extended-status
-.TP
-.BR \-E | \-\-vertical
-Print output vertically. Is similar to
-.BR --relative,
-but prints output vertically.
-.TP
-.BR \-s | \-\-silent
-Silently exit if one can't connect to server
-.TP
-\fB\-S\fR|\fB\-\-socket=\fP\fIfile\fP
-Socket file to use for connection
-.TP
-\fB\-t\fR|\fB\-\-timeout=\fP\fIsec\fP
-Timeout for connection to the mysqld server
-.TP
-\fB\-u\fP|\fB\-\-user=\fP\fIuname\fP
-User for login if not current user
-.TP
-.BR \-v | \-\-verbose
-Write more information
-.TP
-.BR \-V | \-\-version
-Output version information and exit
-.TP
-.BR \-w | \-\-wait
- Wait and retry if connection is down
-.SH COMMAND SYNOPSIS
-.B MySQLADMIN
-.RB [ "create \fP\fIdatabasename\fP "]
-.RB [ "drop \fP\fIdatabasename\fP" ]
-.RB [ extended-status ]
-.RB [ flush-hosts ]
-.RB [ flush-logs ]
-.RB [ flush-tables ]
-.RB [ flush-privileges ]
-.RB [ " kill id,id,... " ]
-.RB [ "password \fP\fInew-password\fP "]
-.RB [ ping ]
-.RB [ processlist ]
-.RB [ reload ]
-.RB [ refresh ]
-.RB [ shutdown ]
-.RB [ slave-start ]
-.RB [ slave-stop ]
-.RB [ status ]
-.RB [ variables ]
-.RB [ version ]
-
-.SH COMMANDS
-Where command is a one or more of: (Commands may be shortened)
-.TP
-.BR "create databasename"
-Create a new database
-.TP
-.BR "drop databasename"
-Delete a database and all its tables
-.TP
-.BR extended-status
-Gives an extended status message from the server
-.TP
-.BR flush-hosts
-Flush all cached hosts
-.TP
-.BR flush-logs
-Flush all logs
-.TP
-.BR flush-status
-Clear status variables
-.TP
-.BR flush-tables
-Flush all tables
-.TP
-.BR flush-threads
-Flush the thread cache
-.TP
-.BR flush-privileges
-Reload grant tables (same as reload)
-.TP
-.BR "kill id,id,..."
-Kill mysql threads
-.TP
-.BR "password \fP\fInew-password\fP"
-Change old password to new-password
-.TP
-.BR ping
-Check if mysqld is alive
-.TP
-.BR processlist
-Show list of active threads in server
-.TP
-.BR reload
-Reload grant tables
-.TP
-.BR refresh
-Flush all tables and close and open logfiles
-.TP
-.BR shutdown
-Take server down
-.TP
-.BR status
-Gives a short status message from the server
-.TP
-.BR variables
-Prints variables available
-.TP
-.BR version
-Get version info from server
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-.\" end of man page
-
diff --git a/man/mysqld.1.in b/man/mysqld.1.in
deleted file mode 100644
index 73f07337f25..00000000000
--- a/man/mysqld.1.in
+++ /dev/null
@@ -1,234 +0,0 @@
-.TH mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-mysqld \- The MySQL server demon
-.SH USAGE
-mysqld [OPTIONS]
-.SH SYNOPSIS
-.B mysqld
-.RB [ \-\-ansi ]
-.RB [ \-b | \-\-basedir=\fP\fIpath\fP ]
-.RB [ \-\-big-tables ]
-.RB [ \-\-bind\-address=IP ]
-.RB [ \-\-character\-sets\-dir=\fP\fIpath\fP ]
-.RB [ \-\-chroot=\fP\fIpath\fP ]
-.RB [ \-h | \-\-datadir=\fP\fIpath\fP ]
-.RB [ \-\-default\-character\-set=\fP\fIcharset\fP ]
-.RB [ \-\-default\-table\-type=\fP\fItype \fP]
-.RB [ \-\-delay\-key\-write\-for\-all\-tables ]
-.RB [ \-\-enable\-locking ]
-.RB [ \-T | \-\-exit\-info]
-.RB [ \-\-flush ]
-.RB [ \-? | \-\-help ]
-.RB [ \-\-init\-file=file ]
-.RB [ \-L | \-\-language=... ]
-.RB [ \-l | \-\-log[=file] ]
-.RB [ \-\-log\-isam[=file] ]
-.RB [ \-\-log\-slow\-queries\fP\fI[=file]\fP ]
-.RB [ \-\-log\-update\fP\fI[=file]\fP ]
-.RB [ \-\-log\-long\-format ]
-.RB [ \-\-low\-priority\-updates ]
-.RB [ \-\-memlock ]
-.RB [ " \-\-myisam\-recover [=option[,option...]]] where option is one of DEFAULT, BACKUP, FORCE or QUICK." ]
-.RB [ \-\-pid\-file=\fP\fIpath\fP ]
-.RB [ \-P | \-\-port=... ]
-.RB [ \-o | \-\-old\-protocol ]
-.RB [ \-\-one\-thread ]
-.RB [ \-O | \-\-set\-variable var=\fP\fIoption\fP ]
-.RB [ \-Sg | \-\-skip\-grant\-tables ]
-.RB [ \-\-safe\-mode ]
-.RB [ \-\-secure ]
-.RB [ \-\-skip\-concurrent\-insert ]
-.RB [ \-\-skip\-delay\-key\-write ]
-.RB [ \-\-skip\-locking ]
-.RB [ \-\-skip\-name\-resolve ]
-.RB [ \-\-skip\-networking ]
-.RB [ \-\-skip\-new ]
-.RB [ \-\-skip\-host\-cache ]
-.RB [ \-\-skip\-show\-database ]
-.RB [ \-\-skip\-thread\-priority ]
-.RB [ \-\-socket=path ]
-.RB [ \-t | \-\-tmpdir=\fP\fIpath \fP]
-.RB [ \-u | \-\-user=\fP\fIuser_name\fP ]
-.RB [ \-V | \-\-version ]
-.SH DESCRIPTION
-.TP
-.BR --ansi
-Use ANSI SQL syntax instead of MySQL syntax. See section 5.2 Running MySQL in ANSI Mode.
-.TP
-.BR -b | --basedir=\fP\fIpath \fP
-Path to installation directory. All paths are usually resolved relative to this.
-.TP
-.BR --big-tables
-Allow big result sets by saving all temporary sets on file. It solves most 'table full' errors, but also slows down the queries where in\-memory tables would suffice. Since Version 3.23.2, MySQL is able to solve it automaticaly by using memory for small temporary tables and switching to disk tables where necessary.
-.TP
-.BR \-\-bind\-address=\fP\fIIP \fP
-IP address to bind to.
-.TP
-.BR \-\-character\-sets\-dir=\fP\fIpath \fP
-Directory where character sets are. See section 10.1.1 The Character Set Used for Data and Sorting.
-.TP
-.BR \-\-chroot=\fP\fIpath \fP
-Chroot mysqld daemon during startup. Recommended security measure. It will somewhat limit LOAD DATA INFILE and SELECT ... INTO OUTFILE though.
-.TP
-.BR \-h | \-\-datadir=\fP\fIpath \fP
-Path to the database root.
-.TP
-.BR \-\-default\-character\-set=\fP\fIcharset \fP
-Set the default character set. See section 10.1.1 The Character Set Used for Data and Sorting.
-.TP
-.BR \-\-default\-table\-type=\fP\fItype \fP
-Set the default table type for tables. See section 8 MySQL Table Types.
-.TP
-.BR \-\-delay\-key\-write\-for\-all\-tables
-Don't flush key buffers between writes for any MyISAM table. See Mysql Manual section 12.2.3 Tuning Server Parameters.
-.TP
-.BR \-\-enable\-locking
-Enable system locking.
-.TP
-.BR \-T | \-\-exit\-info
-Print some debug info at exit.
-.TP
-.BR \-\-flush
-Flush all changes to disk after each SQL command. Normally MySQL only does a write of all changes to disk after each SQL command and lets the operating system handle the syncing to disk. See section 20.2 What to Do if MySQL Keeps Crashing.
-.TP
-.BR \-? | \-\-help
-Display short help and exit.
-.TP
-.BR \-\-init\-file=\fP\fIfile \fP
-Read SQL commands from this file at startup.
-.TP
-.BR \-L | \-\-language=...
-Client error messages in given language. May be given as a full path. See Mysql Manual section 10.1 What Languages Are Supported by MySQL?.
-.TP
-.BR \-l | \-\-log\fP\fI[=file] \fP
-Log connections and queries to file.
-.TP
-.BR \-\-log\-isam\fP\fI[=file] \fP
-Log all ISAM/MyISAM changes to file (only used when debugging ISAM/MyISAM).
-.TP
-.BR \-\-log\-slow\-queries\fP\fI[=file] \fP
-Log all queries that have taken more than long_query_time seconds to execute to file. See Mysql Manual section 21.5 The Slow Query Log.
-.TP
-.BR \-\-log\-update\fP\fI[=file] \fP
-Log updates to file.# where # is a unique number if not given. See Mysql Manual section 21.3 The Update Log.
-.TP
-.BR \-\-log\-long\-format
-Log some extra information to update log. If you are using
-.BR \-\-log\-slow\-queries
-then queries that are not using indexes are logged to the slow query log.
-.TP
-.BR \-\-low\-priority\-updates
-Table\-modifying operations (INSERT/DELETE/UPDATE) will have lower priority than selects. It can also be done via {INSERT | REPLACE | UPDATE | DELETE} LOW_PRIORITY ... to lower the priority of only one query, or by SET OPTION SQL_LOW_PRIORITY_UPDATES=1 to change the priority in one thread. See Mysql Manual section 12.2.9 Table Locking Issues.
-.TP
-.BR \-\-memlock
-Lock the mysqld process in memory. This works only if your system supports the mlockall() system call. This may help if you have a problem where the operating system is causing mysqld to swap on disk.
-.TP
-.BR " \-\-myisam\-recover [=option[,option...]]] where option is one of DEFAULT, BACKUP, FORCE or QUICK. "
-If this option is used, mysqld will on open check if the table is marked as crashed or if if the table wasn't closed properly (The last option only works if you are running with \-\-skip\-locking). If this is the case mysqld will run check on the table. If the table was corrupted, mysqld will attempt to repair it. The following options affects how the repair works.
-.BR DEFAULT
-The same as not giving any option to \-\-myisam\-recover.
-.BR BACKUP
-If the data table was changed during recover, save a backup of the `table_name.MYD' data file as `table_name\-datetime.BAK'.
-.BR FORCE
-Run recover even if we will loose more than one row from the .MYD file.
-.BR QUICK
-Don't check the rows in the table if there isn't any delete blocks.
-Before a table is automaticly repaired, mysqld will add a note about this in the error log. If you want to be able to recover from most things without user intervention, you should use the options BACKUP,FORCE. This will force a repair of a table even if some rows would be deleted, but it will keep the old data file as a backup so that you can later examine what happened.
-.TP
-.BR \-\-pid\-file=\fP\fIpath \fP
-Path to pid file used by mysqld_safe.
-.TP
-.BR \-P | \-\-port=...
-Port number to listen for TCP/IP connections.
-.TP
-.BR \-o | \-\-old\-protocol
-Use the 3.20 protocol for compatibility with some very old clients. See Mysql Manual section 4.17.3 Upgrading from Version 3.20 to Version 3.21.
-.TP
-.BR \-\-one\-thread
-Only use one thread (for debugging under Linux). See Mysql Manual section H.1 Debugging a MySQL server.
-.TP
-.BR \-O | " \-\-set\-variable var=\fP\fIoption\fP "
-Give a variable a value. \-\-help lists variables. You can find a full description for all variables in the SHOW VARIABLES section in this manual. See Mysql Manual section 7.28.4 SHOW VARIABLES. The tuning server parameters section includes information of how to optimize these. See Mysql Manual section 12.2.3 Tuning Server Parameters.
-.TP
-.BR \-Sg | \-\-skip\-grant\-tables
-This option causes the server not to use the privilege system at all. This gives everyone full access to all databases! (You can tell a running server to start using the grant tables again by executing mysqladmin flush\-privileges or mysqladmin reload.)
-.TP
-.BR \-\-safe\-mode
-Skip some optimize stages. Implies
-.BR \-\-skip\-delay\-key\-write.
-.TP
-.BR \-\-secure
-IP numbers returned by the gethostbyname() system call are checked to make sure they resolve back to the original hostname. This makes it harder for someone on the outside to get access by pretending to be another host. This option also adds some sanity checks of hostnames. The option is turned off by default in MySQL Version 3.21 because sometimes it takes a long time to perform backward resolutions. MySQL Version 3.22 caches hostnames (unless \-\-skip\-host\-cache is used) and has this option enabled by default.
-.TP
-.BR \-\-skip\-concurrent\-insert
-Turn off the ability to select and insert at the same time on MyISAM tables. (This is only to be used if you think you have found a bug in this feature).
-.TP
-.BR \-\-skip\-delay\-key\-write
-Ignore the delay_key_write option for all tables. See Mysql Manual section 12.2.3 Tuning Server Parameters.
-.TP
-.BR \-\-skip\-locking
-Don't use system locking. To use isamchk or myisamchk you must shut down the server. See Mysql Manual section 1.6 How Stable Is MySQL?. Note that in MySQL Version 3.23 you can use REPAIR and CHECK to repair/check MyISAM tables.
-.TP
-.BR \-\-skip\-name\-resolve
-Hostnames are not resolved. All Host column values in the grant tables must be IP numbers or localhost.
-.TP
-.BR \-\-skip\-networking
-Don't listen for TCP/IP connections at all. All interaction with mysqld must be made via Unix sockets. This option is highly recommended for systems where only local requests are allowed. However, this option is unsuitable for systems that use MIT\-pthreads, because the MIT\-pthreads package doesn't support Unix sockets.
-.TP
-.BR \-\-skip\-new
-Don't use new, possible wrong routines. Implies
-.BR \-\-skip\-delay\-key\-write
-. This will also set default table type to ISAM. See Mysql Manual section 8.3 ISAM Tables.
-.TP
-.BR \-\-skip\-host\-cache
-Never use host name cache for faster name\-ip resolution, but query DNS server on every connect instead.
-.TP
-.BR \-\-skip\-show\-database
-Don't allow 'SHOW DATABASE' commands, unless the user has process privilege.
-.TP
-.BR \-\-skip\-thread\-priority
-Disable using thread priorities for faster response time.
-.TP
-.BR \-\-socket=\fP\fIpath \fP
-Socket file to use for local connections instead of default /tmp/mysql.sock.
-.TP
-.BR \-t | \-\-tmpdir=\fP\fIpath\fP
-Path for temporary files. It may be useful if your default /tmp directory resides on a partition too small to hold temporary tables.
-.TP
-.BR \-u | \-\-user=\fP\fIuser_name \fP
-Run mysqld daemon as user user_name. This option is mandatory when starting mysqld as root.
-.TP
-.BR \-V | \-\-version
-Output version information and exit.
-
-.SH NOTE
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-
-.\" end of man page
diff --git a/man/mysqld_multi.1.in b/man/mysqld_multi.1.in
deleted file mode 100644
index 58e5c71d01d..00000000000
--- a/man/mysqld_multi.1.in
+++ /dev/null
@@ -1,94 +0,0 @@
-.TH mysqld_multi 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports.
-.SH USAGE
-mysqld_multi [OPTIONS] {start|stop|report} [GNR,GNR,GNR...]
-.SH SYNOPSIS
-.B mysqld_multi
-.RB [ --config-file=... ]
-.RB [ --example ]
-.RB [ --help ]
-.RB [ --log=... ]
-.RB [ --mysqladmin=... ]
-.RB [ --mysqld=... ]
-.RB [ --no-log ]
-.RB [ --password=... ]
-.RB [ --tcp-ip ]
-.RB [ --user=... ]
-.RB [ --version ]
-.SH DESCRIPTION
-.TP
-.BR mysqld_multi
-.TP
-.BR --config-file=...
-Alternative config file. NOTE: This will not affect this program\'s own options (group [mysqld_multi]), but only groups [mysqld#]. Without this option everything will be searched from the ordinary my.cnf file.
-.TP
-.BR --example
-Give an example of a config file.
-.TP
-.BR --help
-Print this help and exit.
-.TP
-.BR --log=...
-Log file. Full path to and the name for the log file. NOTE: If the file exists, everything will be appended.
-.TP
-.BR --mysqladmin=...
-mysqladmin binary to be used for a server shutdown.
-.TP
-.BR --mysqld=...
-mysqld binary to be used. Note that you can give mysqld_safe to this option also. The options are passed to mysqld. Just make sure you have mysqld in your environment variable PATH or fix mysqld_safe.
-.TP
-.BR --no-log
-Print to stdout instead of the log file. By default the log file is turned on.
-.TP
-.BR --password=...
-Password for user for mysqladmin.
-.TP
-.BR --tcp-ip
-Connect to the MySQL server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be running, but can be accessed only via the TCP/IP port. By default connecting is done via the UNIX socket.
-.TP
-.BR --user=...
-MySQL user for mysqladmin.
-.TP
-.BR --version
-Print the version number and exit.
-.SH NOTE
-Please see the mysql manual for more detailed information on this.
-
-
-
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-
-.SH AUTHOR
-
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-
-
-.\" end of man page
-
-
diff --git a/man/mysqld_safe.1.in b/man/mysqld_safe.1.in
deleted file mode 100644
index 5aabd232a11..00000000000
--- a/man/mysqld_safe.1.in
+++ /dev/null
@@ -1,91 +0,0 @@
-.TH safe_mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-mysqld_safe \- start the mysqld daemon on Unix.
-.SH SYNOPSIS
-.B mysqld_safe
-.RB [ \-\-basedir=\fP\fIpath\fP ]
-.RB [ \-\-core\-file\-size=# ]
-.RB [ \-\-defaults\-extra\-file=\fP\fIpath\fP ]
-.RB [ \-\-defaults\-file=\fP\fIpath\fP ]
-.RB [ \-\-open\-files=# ]
-.RB [ \-\-datadir=\fP\fIpath\fP ]
-.RB [ \-\-err\-log=\fP\fIpath \fP]
-.RB [ \-\-ledir=path ]
-.RB [ \-\-log=\fP\fIpath\fP ]
-.RB [ \-\-no\-defaults ]
-.RB [ \-\-open\-files=# ]
-.RB [ \-\-pid\-file=\fP\fIpath\fP ]
-.RB [ \-\-port=# ]
-.RB [ \-\-socket=\fP\fIpath\fP ]
-.RB [ \-\-timezone=# ]
-.RB [ \-\-user=# ]
-.SH DESCRIPTION
-mysqld_safe adds some safety features such as restarting the server when an
-error occurs and logging run-time information to a log file.
-.BR
-.TP
-.BR \-\-basedir=\fP\fIpath \fP
-.TP
-.BR \-\-core\-file\-size=#
-Size of the core file mysqld should be able to create. Passed to ulimit \-c.
-.TP
-.BR \-\-defaults\-extra\-file=\fP\fIpath \fP
-.TP
-.BR \-\-defaults\-file=\fP\fIpath \fP
-.TP
-.BR \-\-datadir=\fP\fIpath \fP
-.TP
-.BR \-\-err\-log=\fP\fIpath \fP
-.TP
-.BR \-\-ledir=\fP\fIpath \fP
-Path to mysqld
-.TP
-.BR \-\-log=\fP\fIpath \fP
-.TP
-.BR \-\-no\-defaults
-.TP
-.BR \-\-open\-files=#
-Number of files mysqld should be able to open. Passed to ulimit \-n.
-.TP
-.BR \-\-pid\-file=\fP\fIpath \fP
-.TP
-.BR \-\-port=#
-.TP
-.BR \-\-socket=\fP\fIpath \fP
-.TP
-.BR \-\-timezone=#
-Set the timezone (the TZ) variable to the value of this parameter.
-.TP
-.BR \-\-user=#
-.SH NOTE
-Note that all options on the command line to mysqld_safe are passed to mysqld. If you wants to use any options in mysqld_safe that mysqld doesn't support, you must specify these in the option file.
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-
-.\" end of man page
diff --git a/man/mysqldump.1.in b/man/mysqldump.1.in
deleted file mode 100644
index 0f581429af7..00000000000
--- a/man/mysqldump.1.in
+++ /dev/null
@@ -1,279 +0,0 @@
-.TH mysqldump 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-mysqldump \- text\-based client for dumping or backing up mysql databases, tables and or data.
-
-.SH USAGE
-.BR "mysqldump [\fP\fIOPTIONS\fP] database [\fP\fItables\fP]"
-.TP
-OR
-.BR "mysqldump [\fP\fIOPTIONS\fP] \-\-databases [\fP\fIOPTIONS\fP] DB1 [\fP\fIDB2 DB3...\fP]"
-.TP
-OR
-.BR "mysqldump [\fP\fIOPTIONS\fP] \-\-all-databases [\fP\fIOPTIONS\fP]"
-
-.SH OPTION SYNOPSIS
-.B mysqldump
-.RB [ \-A | \-\-all-databases ]
-.RB [ \-a | \-\-all ]
-.RB [ \-# | \-\-debug=... ]
-.RB [ \-\-character-sets-dir=...]
-.RB [ \-? | \-\-help ]
-.RB [ \-B | \-\-databases ]
-.RB [ \-c | \-\-complete-insert ]
-.RB [ \-C | \-\-compress ]
-.RB [ \-\-default-character-set=...]
-.RB [ \-e | \-\-extended-insert ]
-.RB [ \-\-add-drop-table ]
-.RB [ \-\-add-locks ]
-.RB [ \-\-allow-keywords ]
-.RB [ \-\-delayed-insert ]
-.RB [ \-F | \-\-flush-logs ]
-.RB [ \-f | \-\-force ]
-.RB [ \-h | \-\-host=... ]
-.RB [ \-l | \-\-lock-tables ]
-.RB [ \-n | \-\-no-create-db ]
-.RB [ \-t | \-\-no-create-info ]
-.RB [ \-d | \-\-no-data ]
-.RB [ \-O | \-\-set-variable var=\fP\fIoption\fP ]
-.RB [ \-\-opt ]
-.RB [ \-p | \-\-password\fP\fI[=...]\fP ]
-.RB [ \-P | \-\-port=... ]
-.RB [ \-q | \-\-quick ]
-.RB [ \-Q | \-\-quote-names ]
-.RB [ \-S | \-\-socket=... ]
-.RB [ \-\-tables ]
-.RB [ \-T | \-\-tab=... ]
-.RB [ \-u | \-\-user=# ]
-.RB [ \-v | \-\-verbose ]
-.RB [ \-V | \-\-version ]
-.RB [ \-w | \-\-where= ]
-.RB [ \-\-delayed ]
-.RB [ \-e | \-\-extended-insert ]
-.RB [ \-\-fields\-terminated\-by=... ]
-.RB [ \-\-fields\-enclosed\-by=... ]
-.RB [ \-\-fields-optionally\-enclosed\-by=... ]
-.RB [ \-\-fields\-escaped\-by=... ]
-.RB [ \-\-lines\-terminated\-by=... ]
-.RB [ \-v | \-\-verbose ]
-.RB [ \-V | \-\-version ]
-.RB [ "\-O net_buffer_length=#, where # < 16M" ]
-.SH DESCRIPTION
-Dumping definition and data mysql database or table
-.IR mysqldump
-supports by executing
-.TP
-.BR \-A | \-\-all\-databases
-Dump all the databases. This will be same as
-.BR \-\-databases
-with all databases selected.
-.TP
-.BR \-a | \-\-all
-Include all MySQL specific create options.
-.TP
-.BR \-# | \-\-debug=...
-Output debug log. Often this is 'd:t:o,filename`.
-.TP
-.BR \-\-character\-sets\-dir=...
-Directory where character sets are
-.TP
-.BR \-? | \-\-help
-Display this help message and exit.
-.TP
-.BR \-B | \-\-databases
-To dump several databases. Note the difference in
-usage; In this case no tables are given. All name
-arguments are regarded as databasenames.
-'USE db_name;' will be included in the output
-.TP
-.BR \-c | \-\-complete\-insert
-Use complete insert statements.
-.TP
-.BR \-C | \-\-compress
-Use compression in server/client protocol.
-.TP
-.BR \-\-default\-character\-set=...
-Set the default character set
-.TP
-.BR \-e | \-\-extended\-insert
-Allows utilization of the new, much faster
-INSERT syntax.
-.TP
-.BR \-\-add\-drop\-table
-Add a 'drop table' before each create.
-.TP
-.BR \-\-add\-locks
-Add locks around insert statements.
-.TP
-.BR \-\-allow\-keywords
-Allow creation of column names that are keywords.
-.TP
-.BR \-\-delayed\-insert
-Insert rows with INSERT DELAYED.
-.TP
-.BR \-F | \-\-flush\-logs
-Flush logs file in server before starting dump.
-.TP
-.BR \-f | \-\-force
-Continue even if we get an sql\-error.
-.TP
-.BR \-h | \-\-host=...
-Connect to host.
-.TP
-.BR \-l | \-\-lock\-tables
-Lock all tables for read.
-.TP
-.BR \-n | \-\-no\-create\-db
-\&'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;'
-will not be put in the output. The above line will
-be added otherwise, if
-.BR \-\-databases
-or
-.BR \-\-all\-databases
-option was given.
-.TP
-.BR \-t | \-\-no\-create\-info
-Don't write table creation info.
-.TP
-.BR \-d | \-\-no\-data
-No row information.
-.TP
-.BR \-O | "\-\-set\-variable var=option"
-give a variable a value.
-.BR \-\-help
-lists variables
-.TP
-.BR \-\-opt
-Same as
-.BR " \-\-add\-drop\-table \-\-add\-locks \-\-all \-\-extended\-insert \-\-quick \-\-lock\-tables "
-.TP
-.BR \-p | \-\-password[=...]
-Password to use when connecting to server.
-If password is not given it's solicited on the tty.
-.TP
-.BR \-P | \-\-port=...
-Port number to use for connection.
-.TP
-.BR \-q | \-\-quick
-Don't buffer query, dump directly to stdout.
-.TP
-.BR \-Q | \-\-quote\-names
-Quote table and column names with `
-.TP
-.BR \-S | \-\-socket=...
-Socket file to use for connection.
-.TP
-.BR \-\-tables
-\fP\fIOverrides \fPoption
-.BR \-\-databases (\-B).
-.TP
-.BR \-T | \-\-tab=...
-Creates tab separated textfile for each table to
-given path. (creates .sql and .txt files).
-NOTE: This only works if mysqldump is run on
-the same machine as the mysqld daemon.
-.TP
-.BR \-u | \-\-user=#
-User for login if not current user.
-.TP
-.BR \-v | \-\-verbose
-Print info about the various stages.
-.TP
-.BR \-V | \-\-version
-Output version information and exit.
-.TP
-.BR \-w | \-\-where=
-dump only selected records; QUOTES mandatory!
-.TP
-.BR \-\-delayed
-Insert rows with the INSERT DELAYED command.
-.TP
-.BR \-e | \-\-extended-insert
-Use the new multiline INSERT syntax. (Gives more compact and faster inserts statements.)
-.TP
-.BR \-\-fields\-terminated\-by=...
-.TP
-.BR \-\-fields\-enclosed\-by=...
-.TP
-.TP
-.BR \-\-fields-optionally\-enclosed\-by=...
-.TP
-.BR \-\-fields\-escaped\-by=...
-.TP
-.BR \-\-lines\-terminated\-by=...
-These options are used with the
-.BR -T
-option and have the same meaning as the corresponding clauses for LOAD DATA INFILE. See Mysql manual section 7.23 LOAD DATA INFILE Syntax.
-.TP
-.BR \-v | \-\-verbose
-Verbose mode. Print out more information on what the program does.
-.TP
-.BR \-V | \-\-version
-Print version information and exit.
-.TP
-.BR "\-O net_buffer_length=#, where # < 16M "
-When creating multi-row-insert statements (as with option
-.BR --extended-insert
-or
-.BR --opt
-), mysqldump will create rows up to net_buffer_length length. If you increase this variable, you should also ensure that the max_allowed_packet variable in the MySQL server is bigger than the net_buffer_length.
-.SH EXAMPLES
-.TP
-The most normal use of mysqldump is probably for making a backup of whole
-databases. See the section on Database Backups in the MySQL Reference Manual.
-.TP
-mysqldump \-\-opt \fP\fIdatabase\fP > backup-file.sql
-.TP
-You can read this back into MySQL with:
-.TP
-.BR mysql
-\fP\fIdatabase\fP
-.BR <
-backup-file.sql
-.TP
-or
-.TP
-.BR mysql
-\-e 'source /patch\-to\-backup/backup\-file.sql' database
-.TP
-However, it's also very useful to populate another MySQL server with information from a database:
-.TP
-mysqldump \-\-opt \fP\fIdatabase\fP | mysql \-\-host=\fP\fIremote\-host\fP \-C database
-.TP
-It is possible to dump several databases with one command:
-.TP
-mysqldump \-\-databases database1 [ database2 database3... ] > my_databases.sql
-.TP
-If all the databases are wanted, one can use:
-.TP
-mysqldump \fP\fI\-\-all\-databases\fP > all_databases.sql
-
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-
-.\" end of man page
diff --git a/man/mysqlman.1.in b/man/mysqlman.1
index b09b01ca759..2170942ebd9 100644
--- a/man/mysqlman.1.in
+++ b/man/mysqlman.1
@@ -1,4 +1,4 @@
-.TH mysqlman 1 "20 July 2004" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
+.TH mysqlman 1 "20 July 2004" "MySQL" "MySQL database"
.SH NAME
mysqlman \- default man page for mysql
.SH "DESCRIPTION"
diff --git a/man/mysqlshow.1.in b/man/mysqlshow.1.in
deleted file mode 100644
index 2db79ae070e..00000000000
--- a/man/mysqlshow.1.in
+++ /dev/null
@@ -1,98 +0,0 @@
-.TH mysqlshow 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-.BR mysqlshow
- \- Shows the structure of a mysql database (databases,tables and columns)
-.SH USAGE
-shell> mysqlshow [\fP\fIOPTIONS\fP] [\fP\fIdatabase [table [column]]\fP]
-.SH SYNOPSIS
-.B mysqlshow
-.RB [ \-# | \-\-debug=...]
-.RB [ \-? | \-\-help ]
-.RB [ \-c | \-\-character\-sets\-dir=...]
-.RB [ \-C | \-\-compress ]
-.RB [ \-h | \-\-host=... ]
-.RB [ \-i | \-\-status ]
-.RB [ \-k | \-\-keys ]
-.RB [ \-p | \-\-password\fP\fI[=...]\fP ]
-.RB [ \-P | \-\-port=... ]
-.RB [ \-S | \-\-socket=... ]
-.RB [ \-u | \-\-user=# ]
-.RB [ \-V | \-\-version ]
-.SH DESCRIPTION
-.TP
-.BR \-# | \-\-debug=...
-output debug log. Often this is 'd:t:o,filename`
-.TP
-.BR \-? | \-\-help
-display help and exit
-.TP
-.BR \-c | \-\-character\-sets\-dir=...
-Directory where character sets are
-.TP
-.BR \-C | \-\-compress
-Use compression in server/client protocol
-.TP
-.BR \-h | \-\-host=...
-connect to host
-.TP
-.BR \-i | \-\-status
-Shows a lot of extra information about each table
-.TP
-.BR \-k | \-\-keys
-show keys for table
-.TP
-.BR \-p | \-\-password \fP\fI[=...] \fP
-password to use when connecting to server
-If password is not given it's asked from the tty.
-.TP
-.BR \-P | \-\-port=...
-Port number to use for connection
-.TP
-.BR \-S | \-\-socket=...
-Socket file to use for connection
-.TP
-.BR \-u | \-\-user=#
-user for login if not current user
-.TP
-.BR \-V | \-\-version
-output version information and exit
-
-
-.SH NOTE
-If last argument contains a shell or SQL wildcard (*,?,% or _) then only
-what's matched by the wildcard is shown.
-If no database is given then all matching databases are shown.
-If no table is given then all matching tables in database are shown
-If no column is given then all matching columns and columntypes in table
-are shown
-
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysql_zap(1),
-perror(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-
-.\" end of man page
diff --git a/man/perror.1.in b/man/perror.1.in
deleted file mode 100644
index 45b343a9c3f..00000000000
--- a/man/perror.1.in
+++ /dev/null
@@ -1,58 +0,0 @@
-.TH perror 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-perror \- describes a system or MySQL error code.
-.SH SYNOPSIS
-perror [OPTIONS] [ERRORCODE [ERRORCODE...]]
-.SH DESCRIPTION
-Can be used to display a description for a system error code, or an MyISAM/ISAM table handler error code.
-The error messages are mostly system dependent.
-.SH OPTIONS
-.TP
-.BR \-? | \-\-help
-Displays this help and exits.
-.TP
-.BR \-I | \-\-info
-Synonym for the above.
-.TP
-.BR \-s | \-\-silent
-Only print the error message
-.TP
-.BR \-v | \-\-verbose
-Print error code and message (default).
-.TP
-.BR \-V | \-\-version
-Displays version information and exits.
-.SH EXAMPLE
-shell> perror 64 79
-Error code 64: Machine is not on the network
-Error code 79: Can not access a needed shared library
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-replace(1)
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-
-.\" end of man page
diff --git a/man/replace.1.in b/man/replace.1.in
deleted file mode 100644
index 618ed0f5bea..00000000000
--- a/man/replace.1.in
+++ /dev/null
@@ -1,73 +0,0 @@
-.TH replace 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
-.SH NAME
-.TP
-replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.
-.SH USAGE
-replace [-?svIV] from to from to ... -- [files]
-.TP
-or
-.TP
-replace [-?svIV] from to from to ... < fromfile > tofile
-.SH SYNOPSIS
-.B replace
-.RB [ -? | -I ]
-.RB [ -s ]
-.RB [ -v ]
-.SH DESCRIPTION
-.TP
-.BR replace
-.TP
-.BR -? | -I
-info
-.TP
-.BR -s
-silent
-.TP
-.BR -v
-verbose
-.SH EXTRA INFO
-.B Special characters in from string:
-.TP
-\\^
-Match start of line.
-.TP
-\\$
-Match end of line.
-.TP
-\\b
-Match space-character, start of line or end of line. For a end \\b the next replace starts locking at the end space-character. A \\b alone in a string matches only a space-character.
-.SH EXAMPLE
-this command swaps a and b in the given files:
-.TP
-shell> replace a b b a -- file1 file2 ...
-.SH "SEE ALSO"
-isamchk(1),
-isamlog(1),
-mysql(1),
-mysqlaccess(1),
-mysqladmin(1),
-mysqld(1),
-mysqld_multi(1),
-mysqld_safe(1),
-mysqldump(1),
-mysql_fix_privilege_tables(1),
-mysqlshow(1),
-mysql_zap(1),
-perror(1),
-.P
-For more information please refer to the MySQL reference
-manual, which may already be installed locally and which
-is also available online at http://dev.mysql.com/doc/mysql/en
-.SH BUGS
-Please refer to http://bugs.mysql.com/ to report bugs.
-.SH AUTHOR
-Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
-Michael (Monty) Widenius (monty@mysql.com),
-MySQL AB (http://www.mysql.com/).
-This software comes with no warranty.
-Manual page by L. (Kill-9) Pedersen
-(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
-system developer (http://www.mercurmedia.com)
-.\" end of man page
-
-
diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am
index 9b0db5774f5..f1194d7fc2f 100644
--- a/mysql-test/Makefile.am
+++ b/mysql-test/Makefile.am
@@ -53,7 +53,8 @@ dist-hook:
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t
+ $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
+ $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
@@ -61,6 +62,7 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data
+ $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(distdir)/lib
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
@@ -78,7 +80,7 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
+ $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
@@ -89,6 +91,7 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
+ $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
diff --git a/mysql-test/README.stress b/mysql-test/README.stress
new file mode 100644
index 00000000000..001ecceef1b
--- /dev/null
+++ b/mysql-test/README.stress
@@ -0,0 +1,116 @@
+
+Overview
+--------
+
+Stress script is designed to perform testsing of mysql server in
+multi-thread environment.
+
+Stress script allows:
+
+ - to use for stress testing mysqltest binary as test engine
+ - to use for stress testing both regular test suite and any
+ additional test suites (e.g. mysql-test-extra-5.0)
+ - to specify files with lists of tests both for initialization of
+ stress db and for further testing itself
+ - to define number of threads that will be concurrently used in testing
+ - to define limitations for test run. e.g. number of tests or loops
+ for execution or duration of testing, delay between test executions, etc.
+ - to get readable log file which can be used for identification of
+ errors arose during testing
+
+All functionality regarding stress testing was implemeted in
+mysql-stress-test.pl script and there are two ways to run stress test:
+
+ - for most cases it is enough to use options below for starting of
+ stress test from mysql-test-run wrapper. In this case server will
+ be run automatically, all preparation steps will be performed
+ and after that stress test will be started.
+
+ - in advanced case one can run mysql-stress-test.pl script directly.
+ But it requires to perform some preparation steps and to specify a
+ bunch of options as well so this way may look a bit complicate.
+
+Usage
+-----
+
+Below is list of stress test specific options for mysql-test-run:
+
+--stress
+ Enable stress mode
+
+--stress-suite=<suite name>
+ Test suite name that will be used in stress testing.
+ We assume that all suites are located in mysql-test/suite directory
+ There is one special suite name - <main|default> that corresponds
+ to regular test suite located in mysql-test directory.
+
+--stress-threads=<number of threads>
+ Number of threads that will be used in stress testing
+
+--stress-tests-file=<filename with list of tests>
+ Filename with list of tests(without .test suffix) that will be used in
+ stress testing. Default filename is stress_tests.txt and default
+ location of this file is suite/<suite name>/stress_tests.txt
+
+--stress-init-file=<filename with list of tests>
+ Filename with list of tests(without .test suffix) that will be used in
+ stress testing for initialization of stress db. These tests will be
+ executed only once before starting of test itself. Default filename
+ is stress_init.txt and default location of this file is
+ suite/<suite name>/stress_init.txt
+
+--stress-mode=<method which will be used for choosing tests from the list>
+ Possible values are: random(default), seq
+
+ There are two possible modes which affect order of selecting of tests
+ from the list:
+ - in random mode tests will be selected in random order
+ - in seq mode each thread will execute tests in the loop one by one as
+ they specified in the list file.
+
+--stress-test-count= <number>
+ Total number of tests that will be executed concurrently by all threads
+
+--stress-loop-count= <number>
+ Total number of loops in seq mode that will be executed concurrently
+ by all threads
+
+--stress-test-duration= <number>
+ Duration of stress testing in seconds
+
+Examples
+--------
+
+1. Example of simple command line to start stress test:
+
+ mysql-test-run --stress alias
+
+Runs stress test with default values for number of threads and number of tests,
+with test 'alias' from suite 'main'.
+
+2. Using in stress testing tests from other suites:
+
+ - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
+ --stress-suite=example --stress-tests-file=testslist.txt
+
+ Will run stress test with 10 threads, will execute 1000 tests by all
+ threads, test will be used from suite 'example', list of test will be
+ taken from file 'testslist.txt'
+
+ - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
+ --stress-suite=example sum_distinct
+
+ Will run stress test with 10 threads, will execute 1000 tests by all
+ threads, test will be used from suite 'example', list of test contains
+ only one test 'sum_distinct'
+
+3. Debugging of issues found with stress test
+
+ Right now stress test is not fully integrated in mysql-test-run
+ and does not support --gdb option so to debug issue found with stress
+ test you have to start separately mysql server under debuger and then
+ run stress test as:
+
+ - mysql-test-run --extern --stress --stress-threads=10 \
+ --stress-test-count=1000 --stress-suite=example \
+ sum_distinct
diff --git a/mysql-test/include/common-tests.inc b/mysql-test/include/common-tests.inc
new file mode 100644
index 00000000000..46d0182d17f
--- /dev/null
+++ b/mysql-test/include/common-tests.inc
@@ -0,0 +1,1832 @@
+#
+# This file contains a generic set of test that is run from
+# different test scripts to test for example ssl encrypted
+# and compressed connection
+#
+#
+
+#
+# Simple select test
+#
+
+--disable_warnings
+drop table if exists t1,t2,t3,t4;
+--enable_warnings
+
+CREATE TABLE t1 (
+ Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+ Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+);
+
+INSERT INTO t1 VALUES (9410,9412);
+
+select period from t1;
+select * from t1;
+select t1.* from t1;
+
+#
+# Create test table
+#
+
+CREATE TABLE t2 (
+ auto int not null auto_increment,
+ fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+ companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+ fld3 char(30) DEFAULT '' NOT NULL,
+ fld4 char(35) DEFAULT '' NOT NULL,
+ fld5 char(35) DEFAULT '' NOT NULL,
+ fld6 char(4) DEFAULT '' NOT NULL,
+ UNIQUE fld1 (fld1),
+ KEY fld3 (fld3),
+ PRIMARY KEY (auto)
+);
+
+#
+# Populate table
+#
+
+--disable_query_log
+INSERT INTO t2 VALUES (1,000001,00,'Omaha','teethe','neat','');
+INSERT INTO t2 VALUES (2,011401,37,'breaking','dreaded','Steinberg','W');
+INSERT INTO t2 VALUES (3,011402,37,'Romans','scholastics','jarring','');
+INSERT INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
+INSERT INTO t2 VALUES (5,011501,37,'bewilderingly','wallet','balled','');
+INSERT INTO t2 VALUES (6,011701,37,'astound','parters','persist','W');
+INSERT INTO t2 VALUES (7,011702,37,'admonishing','eschew','attainments','');
+INSERT INTO t2 VALUES (8,011703,37,'sumac','quitter','fanatic','');
+INSERT INTO t2 VALUES (9,012001,37,'flanking','neat','measures','FAS');
+INSERT INTO t2 VALUES (10,012003,37,'combed','Steinberg','rightfulness','');
+INSERT INTO t2 VALUES (11,012004,37,'subjective','jarring','capably','');
+INSERT INTO t2 VALUES (12,012005,37,'scatterbrain','tinily','impulsive','');
+INSERT INTO t2 VALUES (13,012301,37,'Eulerian','balled','starlet','');
+INSERT INTO t2 VALUES (14,012302,36,'dubbed','persist','terminators','');
+INSERT INTO t2 VALUES (15,012303,37,'Kane','attainments','untying','');
+INSERT INTO t2 VALUES (16,012304,37,'overlay','fanatic','announces','FAS');
+INSERT INTO t2 VALUES (17,012305,37,'perturb','measures','featherweight','FAS');
+INSERT INTO t2 VALUES (18,012306,37,'goblins','rightfulness','pessimist','FAS');
+INSERT INTO t2 VALUES (19,012501,37,'annihilates','capably','daughter','');
+INSERT INTO t2 VALUES (20,012602,37,'Wotan','impulsive','decliner','FAS');
+INSERT INTO t2 VALUES (21,012603,37,'snatching','starlet','lawgiver','');
+INSERT INTO t2 VALUES (22,012604,37,'concludes','terminators','stated','');
+INSERT INTO t2 VALUES (23,012605,37,'laterally','untying','readable','');
+INSERT INTO t2 VALUES (24,012606,37,'yelped','announces','attrition','');
+INSERT INTO t2 VALUES (25,012701,37,'grazing','featherweight','cascade','FAS');
+INSERT INTO t2 VALUES (26,012702,37,'Baird','pessimist','motors','FAS');
+INSERT INTO t2 VALUES (27,012703,37,'celery','daughter','interrogate','');
+INSERT INTO t2 VALUES (28,012704,37,'misunderstander','decliner','pests','W');
+INSERT INTO t2 VALUES (29,013601,37,'handgun','lawgiver','stairway','');
+INSERT INTO t2 VALUES (30,013602,37,'foldout','stated','dopers','FAS');
+INSERT INTO t2 VALUES (31,013603,37,'mystic','readable','testicle','W');
+INSERT INTO t2 VALUES (32,013604,37,'succumbed','attrition','Parsifal','W');
+INSERT INTO t2 VALUES (33,013605,37,'Nabisco','cascade','leavings','');
+INSERT INTO t2 VALUES (34,013606,37,'fingerings','motors','postulation','W');
+INSERT INTO t2 VALUES (35,013607,37,'aging','interrogate','squeaking','');
+INSERT INTO t2 VALUES (36,013608,37,'afield','pests','contrasted','');
+INSERT INTO t2 VALUES (37,013609,37,'ammonium','stairway','leftover','');
+INSERT INTO t2 VALUES (38,013610,37,'boat','dopers','whiteners','');
+INSERT INTO t2 VALUES (39,013801,37,'intelligibility','testicle','erases','W');
+INSERT INTO t2 VALUES (40,013802,37,'Augustine','Parsifal','Punjab','W');
+INSERT INTO t2 VALUES (41,013803,37,'teethe','leavings','Merritt','');
+INSERT INTO t2 VALUES (42,013804,37,'dreaded','postulation','Quixotism','');
+INSERT INTO t2 VALUES (43,013901,37,'scholastics','squeaking','sweetish','FAS');
+INSERT INTO t2 VALUES (44,016001,37,'audiology','contrasted','dogging','FAS');
+INSERT INTO t2 VALUES (45,016201,37,'wallet','leftover','scornfully','FAS');
+INSERT INTO t2 VALUES (46,016202,37,'parters','whiteners','bellow','');
+INSERT INTO t2 VALUES (47,016301,37,'eschew','erases','bills','');
+INSERT INTO t2 VALUES (48,016302,37,'quitter','Punjab','cupboard','FAS');
+INSERT INTO t2 VALUES (49,016303,37,'neat','Merritt','sureties','FAS');
+INSERT INTO t2 VALUES (50,016304,37,'Steinberg','Quixotism','puddings','');
+INSERT INTO t2 VALUES (51,018001,37,'jarring','sweetish','tapestry','');
+INSERT INTO t2 VALUES (52,018002,37,'tinily','dogging','fetters','');
+INSERT INTO t2 VALUES (53,018003,37,'balled','scornfully','bivalves','');
+INSERT INTO t2 VALUES (54,018004,37,'persist','bellow','incurring','');
+INSERT INTO t2 VALUES (55,018005,37,'attainments','bills','Adolph','');
+INSERT INTO t2 VALUES (56,018007,37,'fanatic','cupboard','pithed','');
+INSERT INTO t2 VALUES (57,018008,37,'measures','sureties','emergency','');
+INSERT INTO t2 VALUES (58,018009,37,'rightfulness','puddings','Miles','');
+INSERT INTO t2 VALUES (59,018010,37,'capably','tapestry','trimmings','');
+INSERT INTO t2 VALUES (60,018012,37,'impulsive','fetters','tragedies','W');
+INSERT INTO t2 VALUES (61,018013,37,'starlet','bivalves','skulking','W');
+INSERT INTO t2 VALUES (62,018014,37,'terminators','incurring','flint','');
+INSERT INTO t2 VALUES (63,018015,37,'untying','Adolph','flopping','W');
+INSERT INTO t2 VALUES (64,018016,37,'announces','pithed','relaxing','FAS');
+INSERT INTO t2 VALUES (65,018017,37,'featherweight','emergency','offload','FAS');
+INSERT INTO t2 VALUES (66,018018,37,'pessimist','Miles','suites','W');
+INSERT INTO t2 VALUES (67,018019,37,'daughter','trimmings','lists','FAS');
+INSERT INTO t2 VALUES (68,018020,37,'decliner','tragedies','animized','FAS');
+INSERT INTO t2 VALUES (69,018021,37,'lawgiver','skulking','multilayer','W');
+INSERT INTO t2 VALUES (70,018022,37,'stated','flint','standardizes','FAS');
+INSERT INTO t2 VALUES (71,018023,37,'readable','flopping','Judas','');
+INSERT INTO t2 VALUES (72,018024,37,'attrition','relaxing','vacuuming','W');
+INSERT INTO t2 VALUES (73,018025,37,'cascade','offload','dentally','W');
+INSERT INTO t2 VALUES (74,018026,37,'motors','suites','humanness','W');
+INSERT INTO t2 VALUES (75,018027,37,'interrogate','lists','inch','W');
+INSERT INTO t2 VALUES (76,018028,37,'pests','animized','Weissmuller','W');
+INSERT INTO t2 VALUES (77,018029,37,'stairway','multilayer','irresponsibly','W');
+INSERT INTO t2 VALUES (78,018030,37,'dopers','standardizes','luckily','FAS');
+INSERT INTO t2 VALUES (79,018032,37,'testicle','Judas','culled','W');
+INSERT INTO t2 VALUES (80,018033,37,'Parsifal','vacuuming','medical','FAS');
+INSERT INTO t2 VALUES (81,018034,37,'leavings','dentally','bloodbath','FAS');
+INSERT INTO t2 VALUES (82,018035,37,'postulation','humanness','subschema','W');
+INSERT INTO t2 VALUES (83,018036,37,'squeaking','inch','animals','W');
+INSERT INTO t2 VALUES (84,018037,37,'contrasted','Weissmuller','Micronesia','');
+INSERT INTO t2 VALUES (85,018038,37,'leftover','irresponsibly','repetitions','');
+INSERT INTO t2 VALUES (86,018039,37,'whiteners','luckily','Antares','');
+INSERT INTO t2 VALUES (87,018040,37,'erases','culled','ventilate','W');
+INSERT INTO t2 VALUES (88,018041,37,'Punjab','medical','pityingly','');
+INSERT INTO t2 VALUES (89,018042,37,'Merritt','bloodbath','interdependent','');
+INSERT INTO t2 VALUES (90,018043,37,'Quixotism','subschema','Graves','FAS');
+INSERT INTO t2 VALUES (91,018044,37,'sweetish','animals','neonatal','');
+INSERT INTO t2 VALUES (92,018045,37,'dogging','Micronesia','scribbled','FAS');
+INSERT INTO t2 VALUES (93,018046,37,'scornfully','repetitions','chafe','W');
+INSERT INTO t2 VALUES (94,018048,37,'bellow','Antares','honoring','');
+INSERT INTO t2 VALUES (95,018049,37,'bills','ventilate','realtor','');
+INSERT INTO t2 VALUES (96,018050,37,'cupboard','pityingly','elite','');
+INSERT INTO t2 VALUES (97,018051,37,'sureties','interdependent','funereal','');
+INSERT INTO t2 VALUES (98,018052,37,'puddings','Graves','abrogating','');
+INSERT INTO t2 VALUES (99,018053,50,'tapestry','neonatal','sorters','');
+INSERT INTO t2 VALUES (100,018054,37,'fetters','scribbled','Conley','');
+INSERT INTO t2 VALUES (101,018055,37,'bivalves','chafe','lectured','');
+INSERT INTO t2 VALUES (102,018056,37,'incurring','honoring','Abraham','');
+INSERT INTO t2 VALUES (103,018057,37,'Adolph','realtor','Hawaii','W');
+INSERT INTO t2 VALUES (104,018058,37,'pithed','elite','cage','');
+INSERT INTO t2 VALUES (105,018059,36,'emergency','funereal','hushes','');
+INSERT INTO t2 VALUES (106,018060,37,'Miles','abrogating','Simla','');
+INSERT INTO t2 VALUES (107,018061,37,'trimmings','sorters','reporters','');
+INSERT INTO t2 VALUES (108,018101,37,'tragedies','Conley','Dutchman','FAS');
+INSERT INTO t2 VALUES (109,018102,37,'skulking','lectured','descendants','FAS');
+INSERT INTO t2 VALUES (110,018103,37,'flint','Abraham','groupings','FAS');
+INSERT INTO t2 VALUES (111,018104,37,'flopping','Hawaii','dissociate','');
+INSERT INTO t2 VALUES (112,018201,37,'relaxing','cage','coexist','W');
+INSERT INTO t2 VALUES (113,018202,37,'offload','hushes','Beebe','');
+INSERT INTO t2 VALUES (114,018402,37,'suites','Simla','Taoism','');
+INSERT INTO t2 VALUES (115,018403,37,'lists','reporters','Connally','');
+INSERT INTO t2 VALUES (116,018404,37,'animized','Dutchman','fetched','FAS');
+INSERT INTO t2 VALUES (117,018405,37,'multilayer','descendants','checkpoints','FAS');
+INSERT INTO t2 VALUES (118,018406,37,'standardizes','groupings','rusting','');
+INSERT INTO t2 VALUES (119,018409,37,'Judas','dissociate','galling','');
+INSERT INTO t2 VALUES (120,018601,37,'vacuuming','coexist','obliterates','');
+INSERT INTO t2 VALUES (121,018602,37,'dentally','Beebe','traitor','');
+INSERT INTO t2 VALUES (122,018603,37,'humanness','Taoism','resumes','FAS');
+INSERT INTO t2 VALUES (123,018801,37,'inch','Connally','analyzable','FAS');
+INSERT INTO t2 VALUES (124,018802,37,'Weissmuller','fetched','terminator','FAS');
+INSERT INTO t2 VALUES (125,018803,37,'irresponsibly','checkpoints','gritty','FAS');
+INSERT INTO t2 VALUES (126,018804,37,'luckily','rusting','firearm','W');
+INSERT INTO t2 VALUES (127,018805,37,'culled','galling','minima','');
+INSERT INTO t2 VALUES (128,018806,37,'medical','obliterates','Selfridge','');
+INSERT INTO t2 VALUES (129,018807,37,'bloodbath','traitor','disable','');
+INSERT INTO t2 VALUES (130,018808,37,'subschema','resumes','witchcraft','W');
+INSERT INTO t2 VALUES (131,018809,37,'animals','analyzable','betroth','W');
+INSERT INTO t2 VALUES (132,018810,37,'Micronesia','terminator','Manhattanize','');
+INSERT INTO t2 VALUES (133,018811,37,'repetitions','gritty','imprint','');
+INSERT INTO t2 VALUES (134,018812,37,'Antares','firearm','peeked','');
+INSERT INTO t2 VALUES (135,019101,37,'ventilate','minima','swelling','');
+INSERT INTO t2 VALUES (136,019102,37,'pityingly','Selfridge','interrelationships','W');
+INSERT INTO t2 VALUES (137,019103,37,'interdependent','disable','riser','');
+INSERT INTO t2 VALUES (138,019201,37,'Graves','witchcraft','Gandhian','W');
+INSERT INTO t2 VALUES (139,030501,37,'neonatal','betroth','peacock','A');
+INSERT INTO t2 VALUES (140,030502,50,'scribbled','Manhattanize','bee','A');
+INSERT INTO t2 VALUES (141,030503,37,'chafe','imprint','kanji','');
+INSERT INTO t2 VALUES (142,030504,37,'honoring','peeked','dental','');
+INSERT INTO t2 VALUES (143,031901,37,'realtor','swelling','scarf','FAS');
+INSERT INTO t2 VALUES (144,036001,37,'elite','interrelationships','chasm','A');
+INSERT INTO t2 VALUES (145,036002,37,'funereal','riser','insolence','A');
+INSERT INTO t2 VALUES (146,036004,37,'abrogating','Gandhian','syndicate','');
+INSERT INTO t2 VALUES (147,036005,37,'sorters','peacock','alike','');
+INSERT INTO t2 VALUES (148,038001,37,'Conley','bee','imperial','A');
+INSERT INTO t2 VALUES (149,038002,37,'lectured','kanji','convulsion','A');
+INSERT INTO t2 VALUES (150,038003,37,'Abraham','dental','railway','A');
+INSERT INTO t2 VALUES (151,038004,37,'Hawaii','scarf','validate','A');
+INSERT INTO t2 VALUES (152,038005,37,'cage','chasm','normalizes','A');
+INSERT INTO t2 VALUES (153,038006,37,'hushes','insolence','comprehensive','');
+INSERT INTO t2 VALUES (154,038007,37,'Simla','syndicate','chewing','');
+INSERT INTO t2 VALUES (155,038008,37,'reporters','alike','denizen','');
+INSERT INTO t2 VALUES (156,038009,37,'Dutchman','imperial','schemer','');
+INSERT INTO t2 VALUES (157,038010,37,'descendants','convulsion','chronicle','');
+INSERT INTO t2 VALUES (158,038011,37,'groupings','railway','Kline','');
+INSERT INTO t2 VALUES (159,038012,37,'dissociate','validate','Anatole','');
+INSERT INTO t2 VALUES (160,038013,37,'coexist','normalizes','partridges','');
+INSERT INTO t2 VALUES (161,038014,37,'Beebe','comprehensive','brunch','');
+INSERT INTO t2 VALUES (162,038015,37,'Taoism','chewing','recruited','');
+INSERT INTO t2 VALUES (163,038016,37,'Connally','denizen','dimensions','W');
+INSERT INTO t2 VALUES (164,038017,37,'fetched','schemer','Chicana','W');
+INSERT INTO t2 VALUES (165,038018,37,'checkpoints','chronicle','announced','');
+INSERT INTO t2 VALUES (166,038101,37,'rusting','Kline','praised','FAS');
+INSERT INTO t2 VALUES (167,038102,37,'galling','Anatole','employing','');
+INSERT INTO t2 VALUES (168,038103,37,'obliterates','partridges','linear','');
+INSERT INTO t2 VALUES (169,038104,37,'traitor','brunch','quagmire','');
+INSERT INTO t2 VALUES (170,038201,37,'resumes','recruited','western','A');
+INSERT INTO t2 VALUES (171,038202,37,'analyzable','dimensions','relishing','');
+INSERT INTO t2 VALUES (172,038203,37,'terminator','Chicana','serving','A');
+INSERT INTO t2 VALUES (173,038204,37,'gritty','announced','scheduling','');
+INSERT INTO t2 VALUES (174,038205,37,'firearm','praised','lore','');
+INSERT INTO t2 VALUES (175,038206,37,'minima','employing','eventful','');
+INSERT INTO t2 VALUES (176,038208,37,'Selfridge','linear','arteriole','A');
+INSERT INTO t2 VALUES (177,042801,37,'disable','quagmire','disentangle','');
+INSERT INTO t2 VALUES (178,042802,37,'witchcraft','western','cured','A');
+INSERT INTO t2 VALUES (179,046101,37,'betroth','relishing','Fenton','W');
+INSERT INTO t2 VALUES (180,048001,37,'Manhattanize','serving','avoidable','A');
+INSERT INTO t2 VALUES (181,048002,37,'imprint','scheduling','drains','A');
+INSERT INTO t2 VALUES (182,048003,37,'peeked','lore','detectably','FAS');
+INSERT INTO t2 VALUES (183,048004,37,'swelling','eventful','husky','');
+INSERT INTO t2 VALUES (184,048005,37,'interrelationships','arteriole','impelling','');
+INSERT INTO t2 VALUES (185,048006,37,'riser','disentangle','undoes','');
+INSERT INTO t2 VALUES (186,048007,37,'Gandhian','cured','evened','');
+INSERT INTO t2 VALUES (187,048008,37,'peacock','Fenton','squeezes','');
+INSERT INTO t2 VALUES (188,048101,37,'bee','avoidable','destroyer','FAS');
+INSERT INTO t2 VALUES (189,048102,37,'kanji','drains','rudeness','');
+INSERT INTO t2 VALUES (190,048201,37,'dental','detectably','beaner','FAS');
+INSERT INTO t2 VALUES (191,048202,37,'scarf','husky','boorish','');
+INSERT INTO t2 VALUES (192,048203,37,'chasm','impelling','Everhart','');
+INSERT INTO t2 VALUES (193,048204,37,'insolence','undoes','encompass','A');
+INSERT INTO t2 VALUES (194,048205,37,'syndicate','evened','mushrooms','');
+INSERT INTO t2 VALUES (195,048301,37,'alike','squeezes','Alison','A');
+INSERT INTO t2 VALUES (196,048302,37,'imperial','destroyer','externally','FAS');
+INSERT INTO t2 VALUES (197,048303,37,'convulsion','rudeness','pellagra','');
+INSERT INTO t2 VALUES (198,048304,37,'railway','beaner','cult','');
+INSERT INTO t2 VALUES (199,048305,37,'validate','boorish','creek','A');
+INSERT INTO t2 VALUES (200,048401,37,'normalizes','Everhart','Huffman','');
+INSERT INTO t2 VALUES (201,048402,37,'comprehensive','encompass','Majorca','FAS');
+INSERT INTO t2 VALUES (202,048403,37,'chewing','mushrooms','governing','A');
+INSERT INTO t2 VALUES (203,048404,37,'denizen','Alison','gadfly','FAS');
+INSERT INTO t2 VALUES (204,048405,37,'schemer','externally','reassigned','FAS');
+INSERT INTO t2 VALUES (205,048406,37,'chronicle','pellagra','intentness','W');
+INSERT INTO t2 VALUES (206,048407,37,'Kline','cult','craziness','');
+INSERT INTO t2 VALUES (207,048408,37,'Anatole','creek','psychic','');
+INSERT INTO t2 VALUES (208,048409,37,'partridges','Huffman','squabbled','');
+INSERT INTO t2 VALUES (209,048410,37,'brunch','Majorca','burlesque','');
+INSERT INTO t2 VALUES (210,048411,37,'recruited','governing','capped','');
+INSERT INTO t2 VALUES (211,048412,37,'dimensions','gadfly','extracted','A');
+INSERT INTO t2 VALUES (212,048413,37,'Chicana','reassigned','DiMaggio','');
+INSERT INTO t2 VALUES (213,048601,37,'announced','intentness','exclamation','FAS');
+INSERT INTO t2 VALUES (214,048602,37,'praised','craziness','subdirectory','');
+INSERT INTO t2 VALUES (215,048603,37,'employing','psychic','fangs','');
+INSERT INTO t2 VALUES (216,048604,37,'linear','squabbled','buyer','A');
+INSERT INTO t2 VALUES (217,048801,37,'quagmire','burlesque','pithing','A');
+INSERT INTO t2 VALUES (218,050901,37,'western','capped','transistorizing','A');
+INSERT INTO t2 VALUES (219,051201,37,'relishing','extracted','nonbiodegradable','');
+INSERT INTO t2 VALUES (220,056002,37,'serving','DiMaggio','dislocate','');
+INSERT INTO t2 VALUES (221,056003,37,'scheduling','exclamation','monochromatic','FAS');
+INSERT INTO t2 VALUES (222,056004,37,'lore','subdirectory','batting','');
+INSERT INTO t2 VALUES (223,056102,37,'eventful','fangs','postcondition','A');
+INSERT INTO t2 VALUES (224,056203,37,'arteriole','buyer','catalog','FAS');
+INSERT INTO t2 VALUES (225,056204,37,'disentangle','pithing','Remus','');
+INSERT INTO t2 VALUES (226,058003,37,'cured','transistorizing','devices','A');
+INSERT INTO t2 VALUES (227,058004,37,'Fenton','nonbiodegradable','bike','A');
+INSERT INTO t2 VALUES (228,058005,37,'avoidable','dislocate','qualify','');
+INSERT INTO t2 VALUES (229,058006,37,'drains','monochromatic','detained','');
+INSERT INTO t2 VALUES (230,058007,37,'detectably','batting','commended','');
+INSERT INTO t2 VALUES (231,058101,37,'husky','postcondition','civilize','');
+INSERT INTO t2 VALUES (232,058102,37,'impelling','catalog','Elmhurst','');
+INSERT INTO t2 VALUES (233,058103,37,'undoes','Remus','anesthetizing','');
+INSERT INTO t2 VALUES (234,058105,37,'evened','devices','deaf','');
+INSERT INTO t2 VALUES (235,058111,37,'squeezes','bike','Brigham','');
+INSERT INTO t2 VALUES (236,058112,37,'destroyer','qualify','title','');
+INSERT INTO t2 VALUES (237,058113,37,'rudeness','detained','coarse','');
+INSERT INTO t2 VALUES (238,058114,37,'beaner','commended','combinations','');
+INSERT INTO t2 VALUES (239,058115,37,'boorish','civilize','grayness','');
+INSERT INTO t2 VALUES (240,058116,37,'Everhart','Elmhurst','innumerable','FAS');
+INSERT INTO t2 VALUES (241,058117,37,'encompass','anesthetizing','Caroline','A');
+INSERT INTO t2 VALUES (242,058118,37,'mushrooms','deaf','fatty','FAS');
+INSERT INTO t2 VALUES (243,058119,37,'Alison','Brigham','eastbound','');
+INSERT INTO t2 VALUES (244,058120,37,'externally','title','inexperienced','');
+INSERT INTO t2 VALUES (245,058121,37,'pellagra','coarse','hoarder','A');
+INSERT INTO t2 VALUES (246,058122,37,'cult','combinations','scotch','W');
+INSERT INTO t2 VALUES (247,058123,37,'creek','grayness','passport','A');
+INSERT INTO t2 VALUES (248,058124,37,'Huffman','innumerable','strategic','FAS');
+INSERT INTO t2 VALUES (249,058125,37,'Majorca','Caroline','gated','');
+INSERT INTO t2 VALUES (250,058126,37,'governing','fatty','flog','');
+INSERT INTO t2 VALUES (251,058127,37,'gadfly','eastbound','Pipestone','');
+INSERT INTO t2 VALUES (252,058128,37,'reassigned','inexperienced','Dar','');
+INSERT INTO t2 VALUES (253,058201,37,'intentness','hoarder','Corcoran','');
+INSERT INTO t2 VALUES (254,058202,37,'craziness','scotch','flyers','A');
+INSERT INTO t2 VALUES (255,058303,37,'psychic','passport','competitions','W');
+INSERT INTO t2 VALUES (256,058304,37,'squabbled','strategic','suppliers','FAS');
+INSERT INTO t2 VALUES (257,058602,37,'burlesque','gated','skips','');
+INSERT INTO t2 VALUES (258,058603,37,'capped','flog','institutes','');
+INSERT INTO t2 VALUES (259,058604,37,'extracted','Pipestone','troop','A');
+INSERT INTO t2 VALUES (260,058605,37,'DiMaggio','Dar','connective','W');
+INSERT INTO t2 VALUES (261,058606,37,'exclamation','Corcoran','denies','');
+INSERT INTO t2 VALUES (262,058607,37,'subdirectory','flyers','polka','');
+INSERT INTO t2 VALUES (263,060401,36,'fangs','competitions','observations','FAS');
+INSERT INTO t2 VALUES (264,061701,36,'buyer','suppliers','askers','');
+INSERT INTO t2 VALUES (265,066201,36,'pithing','skips','homeless','FAS');
+INSERT INTO t2 VALUES (266,066501,36,'transistorizing','institutes','Anna','');
+INSERT INTO t2 VALUES (267,068001,36,'nonbiodegradable','troop','subdirectories','W');
+INSERT INTO t2 VALUES (268,068002,36,'dislocate','connective','decaying','FAS');
+INSERT INTO t2 VALUES (269,068005,36,'monochromatic','denies','outwitting','W');
+INSERT INTO t2 VALUES (270,068006,36,'batting','polka','Harpy','W');
+INSERT INTO t2 VALUES (271,068007,36,'postcondition','observations','crazed','');
+INSERT INTO t2 VALUES (272,068008,36,'catalog','askers','suffocate','');
+INSERT INTO t2 VALUES (273,068009,36,'Remus','homeless','provers','FAS');
+INSERT INTO t2 VALUES (274,068010,36,'devices','Anna','technically','');
+INSERT INTO t2 VALUES (275,068011,36,'bike','subdirectories','Franklinizations','');
+INSERT INTO t2 VALUES (276,068202,36,'qualify','decaying','considered','');
+INSERT INTO t2 VALUES (277,068302,36,'detained','outwitting','tinnily','');
+INSERT INTO t2 VALUES (278,068303,36,'commended','Harpy','uninterruptedly','');
+INSERT INTO t2 VALUES (279,068401,36,'civilize','crazed','whistled','A');
+INSERT INTO t2 VALUES (280,068501,36,'Elmhurst','suffocate','automate','');
+INSERT INTO t2 VALUES (281,068502,36,'anesthetizing','provers','gutting','W');
+INSERT INTO t2 VALUES (282,068503,36,'deaf','technically','surreptitious','');
+INSERT INTO t2 VALUES (283,068602,36,'Brigham','Franklinizations','Choctaw','');
+INSERT INTO t2 VALUES (284,068603,36,'title','considered','cooks','');
+INSERT INTO t2 VALUES (285,068701,36,'coarse','tinnily','millivolt','FAS');
+INSERT INTO t2 VALUES (286,068702,36,'combinations','uninterruptedly','counterpoise','');
+INSERT INTO t2 VALUES (287,068703,36,'grayness','whistled','Gothicism','');
+INSERT INTO t2 VALUES (288,076001,36,'innumerable','automate','feminine','');
+INSERT INTO t2 VALUES (289,076002,36,'Caroline','gutting','metaphysically','W');
+INSERT INTO t2 VALUES (290,076101,36,'fatty','surreptitious','sanding','A');
+INSERT INTO t2 VALUES (291,076102,36,'eastbound','Choctaw','contributorily','');
+INSERT INTO t2 VALUES (292,076103,36,'inexperienced','cooks','receivers','FAS');
+INSERT INTO t2 VALUES (293,076302,36,'hoarder','millivolt','adjourn','');
+INSERT INTO t2 VALUES (294,076303,36,'scotch','counterpoise','straggled','A');
+INSERT INTO t2 VALUES (295,076304,36,'passport','Gothicism','druggists','');
+INSERT INTO t2 VALUES (296,076305,36,'strategic','feminine','thanking','FAS');
+INSERT INTO t2 VALUES (297,076306,36,'gated','metaphysically','ostrich','');
+INSERT INTO t2 VALUES (298,076307,36,'flog','sanding','hopelessness','FAS');
+INSERT INTO t2 VALUES (299,076402,36,'Pipestone','contributorily','Eurydice','');
+INSERT INTO t2 VALUES (300,076501,36,'Dar','receivers','excitation','W');
+INSERT INTO t2 VALUES (301,076502,36,'Corcoran','adjourn','presumes','FAS');
+INSERT INTO t2 VALUES (302,076701,36,'flyers','straggled','imaginable','FAS');
+INSERT INTO t2 VALUES (303,078001,36,'competitions','druggists','concoct','W');
+INSERT INTO t2 VALUES (304,078002,36,'suppliers','thanking','peering','W');
+INSERT INTO t2 VALUES (305,078003,36,'skips','ostrich','Phelps','FAS');
+INSERT INTO t2 VALUES (306,078004,36,'institutes','hopelessness','ferociousness','FAS');
+INSERT INTO t2 VALUES (307,078005,36,'troop','Eurydice','sentences','');
+INSERT INTO t2 VALUES (308,078006,36,'connective','excitation','unlocks','');
+INSERT INTO t2 VALUES (309,078007,36,'denies','presumes','engrossing','W');
+INSERT INTO t2 VALUES (310,078008,36,'polka','imaginable','Ruth','');
+INSERT INTO t2 VALUES (311,078101,36,'observations','concoct','tying','');
+INSERT INTO t2 VALUES (312,078103,36,'askers','peering','exclaimers','');
+INSERT INTO t2 VALUES (313,078104,36,'homeless','Phelps','synergy','');
+INSERT INTO t2 VALUES (314,078105,36,'Anna','ferociousness','Huey','W');
+INSERT INTO t2 VALUES (315,082101,36,'subdirectories','sentences','merging','');
+INSERT INTO t2 VALUES (316,083401,36,'decaying','unlocks','judges','A');
+INSERT INTO t2 VALUES (317,084001,36,'outwitting','engrossing','Shylock','W');
+INSERT INTO t2 VALUES (318,084002,36,'Harpy','Ruth','Miltonism','');
+INSERT INTO t2 VALUES (319,086001,36,'crazed','tying','hen','W');
+INSERT INTO t2 VALUES (320,086102,36,'suffocate','exclaimers','honeybee','FAS');
+INSERT INTO t2 VALUES (321,086201,36,'provers','synergy','towers','');
+INSERT INTO t2 VALUES (322,088001,36,'technically','Huey','dilutes','W');
+INSERT INTO t2 VALUES (323,088002,36,'Franklinizations','merging','numerals','FAS');
+INSERT INTO t2 VALUES (324,088003,36,'considered','judges','democracy','FAS');
+INSERT INTO t2 VALUES (325,088004,36,'tinnily','Shylock','Ibero-','');
+INSERT INTO t2 VALUES (326,088101,36,'uninterruptedly','Miltonism','invalids','');
+INSERT INTO t2 VALUES (327,088102,36,'whistled','hen','behavior','');
+INSERT INTO t2 VALUES (328,088103,36,'automate','honeybee','accruing','');
+INSERT INTO t2 VALUES (329,088104,36,'gutting','towers','relics','A');
+INSERT INTO t2 VALUES (330,088105,36,'surreptitious','dilutes','rackets','');
+INSERT INTO t2 VALUES (331,088106,36,'Choctaw','numerals','Fischbein','W');
+INSERT INTO t2 VALUES (332,088201,36,'cooks','democracy','phony','W');
+INSERT INTO t2 VALUES (333,088203,36,'millivolt','Ibero-','cross','FAS');
+INSERT INTO t2 VALUES (334,088204,36,'counterpoise','invalids','cleanup','');
+INSERT INTO t2 VALUES (335,088302,37,'Gothicism','behavior','conspirator','');
+INSERT INTO t2 VALUES (336,088303,37,'feminine','accruing','label','FAS');
+INSERT INTO t2 VALUES (337,088305,37,'metaphysically','relics','university','');
+INSERT INTO t2 VALUES (338,088402,37,'sanding','rackets','cleansed','FAS');
+INSERT INTO t2 VALUES (339,088501,36,'contributorily','Fischbein','ballgown','');
+INSERT INTO t2 VALUES (340,088502,36,'receivers','phony','starlet','');
+INSERT INTO t2 VALUES (341,088503,36,'adjourn','cross','aqueous','');
+INSERT INTO t2 VALUES (342,098001,58,'straggled','cleanup','portrayal','A');
+INSERT INTO t2 VALUES (343,098002,58,'druggists','conspirator','despising','W');
+INSERT INTO t2 VALUES (344,098003,58,'thanking','label','distort','W');
+INSERT INTO t2 VALUES (345,098004,58,'ostrich','university','palmed','');
+INSERT INTO t2 VALUES (346,098005,58,'hopelessness','cleansed','faced','');
+INSERT INTO t2 VALUES (347,098006,58,'Eurydice','ballgown','silverware','');
+INSERT INTO t2 VALUES (348,141903,29,'excitation','starlet','assessor','');
+INSERT INTO t2 VALUES (349,098008,58,'presumes','aqueous','spiders','');
+INSERT INTO t2 VALUES (350,098009,58,'imaginable','portrayal','artificially','');
+INSERT INTO t2 VALUES (351,098010,58,'concoct','despising','reminiscence','');
+INSERT INTO t2 VALUES (352,098011,58,'peering','distort','Mexican','');
+INSERT INTO t2 VALUES (353,098012,58,'Phelps','palmed','obnoxious','');
+INSERT INTO t2 VALUES (354,098013,58,'ferociousness','faced','fragile','');
+INSERT INTO t2 VALUES (355,098014,58,'sentences','silverware','apprehensible','');
+INSERT INTO t2 VALUES (356,098015,58,'unlocks','assessor','births','');
+INSERT INTO t2 VALUES (357,098016,58,'engrossing','spiders','garages','');
+INSERT INTO t2 VALUES (358,098017,58,'Ruth','artificially','panty','');
+INSERT INTO t2 VALUES (359,098018,58,'tying','reminiscence','anteater','');
+INSERT INTO t2 VALUES (360,098019,58,'exclaimers','Mexican','displacement','A');
+INSERT INTO t2 VALUES (361,098020,58,'synergy','obnoxious','drovers','A');
+INSERT INTO t2 VALUES (362,098021,58,'Huey','fragile','patenting','A');
+INSERT INTO t2 VALUES (363,098022,58,'merging','apprehensible','far','A');
+INSERT INTO t2 VALUES (364,098023,58,'judges','births','shrieks','');
+INSERT INTO t2 VALUES (365,098024,58,'Shylock','garages','aligning','W');
+INSERT INTO t2 VALUES (366,098025,37,'Miltonism','panty','pragmatism','');
+INSERT INTO t2 VALUES (367,106001,36,'hen','anteater','fevers','W');
+INSERT INTO t2 VALUES (368,108001,36,'honeybee','displacement','reexamines','A');
+INSERT INTO t2 VALUES (369,108002,36,'towers','drovers','occupancies','');
+INSERT INTO t2 VALUES (370,108003,36,'dilutes','patenting','sweats','FAS');
+INSERT INTO t2 VALUES (371,108004,36,'numerals','far','modulators','');
+INSERT INTO t2 VALUES (372,108005,36,'democracy','shrieks','demand','W');
+INSERT INTO t2 VALUES (373,108007,36,'Ibero-','aligning','Madeira','');
+INSERT INTO t2 VALUES (374,108008,36,'invalids','pragmatism','Viennese','W');
+INSERT INTO t2 VALUES (375,108009,36,'behavior','fevers','chillier','W');
+INSERT INTO t2 VALUES (376,108010,36,'accruing','reexamines','wildcats','FAS');
+INSERT INTO t2 VALUES (377,108011,36,'relics','occupancies','gentle','');
+INSERT INTO t2 VALUES (378,108012,36,'rackets','sweats','Angles','W');
+INSERT INTO t2 VALUES (379,108101,36,'Fischbein','modulators','accuracies','');
+INSERT INTO t2 VALUES (380,108102,36,'phony','demand','toggle','');
+INSERT INTO t2 VALUES (381,108103,36,'cross','Madeira','Mendelssohn','W');
+INSERT INTO t2 VALUES (382,108111,50,'cleanup','Viennese','behaviorally','');
+INSERT INTO t2 VALUES (383,108105,36,'conspirator','chillier','Rochford','');
+INSERT INTO t2 VALUES (384,108106,36,'label','wildcats','mirror','W');
+INSERT INTO t2 VALUES (385,108107,36,'university','gentle','Modula','');
+INSERT INTO t2 VALUES (386,108108,50,'cleansed','Angles','clobbering','');
+INSERT INTO t2 VALUES (387,108109,36,'ballgown','accuracies','chronography','');
+INSERT INTO t2 VALUES (388,108110,36,'starlet','toggle','Eskimoizeds','');
+INSERT INTO t2 VALUES (389,108201,36,'aqueous','Mendelssohn','British','W');
+INSERT INTO t2 VALUES (390,108202,36,'portrayal','behaviorally','pitfalls','');
+INSERT INTO t2 VALUES (391,108203,36,'despising','Rochford','verify','W');
+INSERT INTO t2 VALUES (392,108204,36,'distort','mirror','scatter','FAS');
+INSERT INTO t2 VALUES (393,108205,36,'palmed','Modula','Aztecan','');
+INSERT INTO t2 VALUES (394,108301,36,'faced','clobbering','acuity','W');
+INSERT INTO t2 VALUES (395,108302,36,'silverware','chronography','sinking','W');
+INSERT INTO t2 VALUES (396,112101,36,'assessor','Eskimoizeds','beasts','FAS');
+INSERT INTO t2 VALUES (397,112102,36,'spiders','British','Witt','W');
+INSERT INTO t2 VALUES (398,113701,36,'artificially','pitfalls','physicists','FAS');
+INSERT INTO t2 VALUES (399,116001,36,'reminiscence','verify','folksong','A');
+INSERT INTO t2 VALUES (400,116201,36,'Mexican','scatter','strokes','FAS');
+INSERT INTO t2 VALUES (401,116301,36,'obnoxious','Aztecan','crowder','');
+INSERT INTO t2 VALUES (402,116302,36,'fragile','acuity','merry','');
+INSERT INTO t2 VALUES (403,116601,36,'apprehensible','sinking','cadenced','');
+INSERT INTO t2 VALUES (404,116602,36,'births','beasts','alimony','A');
+INSERT INTO t2 VALUES (405,116603,36,'garages','Witt','principled','A');
+INSERT INTO t2 VALUES (406,116701,36,'panty','physicists','golfing','');
+INSERT INTO t2 VALUES (407,116702,36,'anteater','folksong','undiscovered','');
+INSERT INTO t2 VALUES (408,118001,36,'displacement','strokes','irritates','');
+INSERT INTO t2 VALUES (409,118002,36,'drovers','crowder','patriots','A');
+INSERT INTO t2 VALUES (410,118003,36,'patenting','merry','rooms','FAS');
+INSERT INTO t2 VALUES (411,118004,36,'far','cadenced','towering','W');
+INSERT INTO t2 VALUES (412,118005,36,'shrieks','alimony','displease','');
+INSERT INTO t2 VALUES (413,118006,36,'aligning','principled','photosensitive','');
+INSERT INTO t2 VALUES (414,118007,36,'pragmatism','golfing','inking','');
+INSERT INTO t2 VALUES (415,118008,36,'fevers','undiscovered','gainers','');
+INSERT INTO t2 VALUES (416,118101,36,'reexamines','irritates','leaning','A');
+INSERT INTO t2 VALUES (417,118102,36,'occupancies','patriots','hydrant','A');
+INSERT INTO t2 VALUES (418,118103,36,'sweats','rooms','preserve','');
+INSERT INTO t2 VALUES (419,118202,36,'modulators','towering','blinded','A');
+INSERT INTO t2 VALUES (420,118203,36,'demand','displease','interactions','A');
+INSERT INTO t2 VALUES (421,118204,36,'Madeira','photosensitive','Barry','');
+INSERT INTO t2 VALUES (422,118302,36,'Viennese','inking','whiteness','A');
+INSERT INTO t2 VALUES (423,118304,36,'chillier','gainers','pastimes','W');
+INSERT INTO t2 VALUES (424,118305,36,'wildcats','leaning','Edenization','');
+INSERT INTO t2 VALUES (425,118306,36,'gentle','hydrant','Muscat','');
+INSERT INTO t2 VALUES (426,118307,36,'Angles','preserve','assassinated','');
+INSERT INTO t2 VALUES (427,123101,36,'accuracies','blinded','labeled','');
+INSERT INTO t2 VALUES (428,123102,36,'toggle','interactions','glacial','A');
+INSERT INTO t2 VALUES (429,123301,36,'Mendelssohn','Barry','implied','W');
+INSERT INTO t2 VALUES (430,126001,36,'behaviorally','whiteness','bibliographies','W');
+INSERT INTO t2 VALUES (431,126002,36,'Rochford','pastimes','Buchanan','');
+INSERT INTO t2 VALUES (432,126003,36,'mirror','Edenization','forgivably','FAS');
+INSERT INTO t2 VALUES (433,126101,36,'Modula','Muscat','innuendo','A');
+INSERT INTO t2 VALUES (434,126301,36,'clobbering','assassinated','den','FAS');
+INSERT INTO t2 VALUES (435,126302,36,'chronography','labeled','submarines','W');
+INSERT INTO t2 VALUES (436,126402,36,'Eskimoizeds','glacial','mouthful','A');
+INSERT INTO t2 VALUES (437,126601,36,'British','implied','expiring','');
+INSERT INTO t2 VALUES (438,126602,36,'pitfalls','bibliographies','unfulfilled','FAS');
+INSERT INTO t2 VALUES (439,126702,36,'verify','Buchanan','precession','');
+INSERT INTO t2 VALUES (440,128001,36,'scatter','forgivably','nullified','');
+INSERT INTO t2 VALUES (441,128002,36,'Aztecan','innuendo','affects','');
+INSERT INTO t2 VALUES (442,128003,36,'acuity','den','Cynthia','');
+INSERT INTO t2 VALUES (443,128004,36,'sinking','submarines','Chablis','A');
+INSERT INTO t2 VALUES (444,128005,36,'beasts','mouthful','betterments','FAS');
+INSERT INTO t2 VALUES (445,128007,36,'Witt','expiring','advertising','');
+INSERT INTO t2 VALUES (446,128008,36,'physicists','unfulfilled','rubies','A');
+INSERT INTO t2 VALUES (447,128009,36,'folksong','precession','southwest','FAS');
+INSERT INTO t2 VALUES (448,128010,36,'strokes','nullified','superstitious','A');
+INSERT INTO t2 VALUES (449,128011,36,'crowder','affects','tabernacle','W');
+INSERT INTO t2 VALUES (450,128012,36,'merry','Cynthia','silk','A');
+INSERT INTO t2 VALUES (451,128013,36,'cadenced','Chablis','handsomest','A');
+INSERT INTO t2 VALUES (452,128014,36,'alimony','betterments','Persian','A');
+INSERT INTO t2 VALUES (453,128015,36,'principled','advertising','analog','W');
+INSERT INTO t2 VALUES (454,128016,36,'golfing','rubies','complex','W');
+INSERT INTO t2 VALUES (455,128017,36,'undiscovered','southwest','Taoist','');
+INSERT INTO t2 VALUES (456,128018,36,'irritates','superstitious','suspend','');
+INSERT INTO t2 VALUES (457,128019,36,'patriots','tabernacle','relegated','');
+INSERT INTO t2 VALUES (458,128020,36,'rooms','silk','awesome','W');
+INSERT INTO t2 VALUES (459,128021,36,'towering','handsomest','Bruxelles','');
+INSERT INTO t2 VALUES (460,128022,36,'displease','Persian','imprecisely','A');
+INSERT INTO t2 VALUES (461,128023,36,'photosensitive','analog','televise','');
+INSERT INTO t2 VALUES (462,128101,36,'inking','complex','braking','');
+INSERT INTO t2 VALUES (463,128102,36,'gainers','Taoist','true','FAS');
+INSERT INTO t2 VALUES (464,128103,36,'leaning','suspend','disappointing','FAS');
+INSERT INTO t2 VALUES (465,128104,36,'hydrant','relegated','navally','W');
+INSERT INTO t2 VALUES (466,128106,36,'preserve','awesome','circus','');
+INSERT INTO t2 VALUES (467,128107,36,'blinded','Bruxelles','beetles','');
+INSERT INTO t2 VALUES (468,128108,36,'interactions','imprecisely','trumps','');
+INSERT INTO t2 VALUES (469,128202,36,'Barry','televise','fourscore','W');
+INSERT INTO t2 VALUES (470,128203,36,'whiteness','braking','Blackfoots','');
+INSERT INTO t2 VALUES (471,128301,36,'pastimes','true','Grady','');
+INSERT INTO t2 VALUES (472,128302,36,'Edenization','disappointing','quiets','FAS');
+INSERT INTO t2 VALUES (473,128303,36,'Muscat','navally','floundered','FAS');
+INSERT INTO t2 VALUES (474,128304,36,'assassinated','circus','profundity','W');
+INSERT INTO t2 VALUES (475,128305,36,'labeled','beetles','Garrisonian','W');
+INSERT INTO t2 VALUES (476,128307,36,'glacial','trumps','Strauss','');
+INSERT INTO t2 VALUES (477,128401,36,'implied','fourscore','cemented','FAS');
+INSERT INTO t2 VALUES (478,128502,36,'bibliographies','Blackfoots','contrition','A');
+INSERT INTO t2 VALUES (479,128503,36,'Buchanan','Grady','mutations','');
+INSERT INTO t2 VALUES (480,128504,36,'forgivably','quiets','exhibits','W');
+INSERT INTO t2 VALUES (481,128505,36,'innuendo','floundered','tits','');
+INSERT INTO t2 VALUES (482,128601,36,'den','profundity','mate','A');
+INSERT INTO t2 VALUES (483,128603,36,'submarines','Garrisonian','arches','');
+INSERT INTO t2 VALUES (484,128604,36,'mouthful','Strauss','Moll','');
+INSERT INTO t2 VALUES (485,128702,36,'expiring','cemented','ropers','');
+INSERT INTO t2 VALUES (486,128703,36,'unfulfilled','contrition','bombast','');
+INSERT INTO t2 VALUES (487,128704,36,'precession','mutations','difficultly','A');
+INSERT INTO t2 VALUES (488,138001,36,'nullified','exhibits','adsorption','');
+INSERT INTO t2 VALUES (489,138002,36,'affects','tits','definiteness','FAS');
+INSERT INTO t2 VALUES (490,138003,36,'Cynthia','mate','cultivation','A');
+INSERT INTO t2 VALUES (491,138004,36,'Chablis','arches','heals','A');
+INSERT INTO t2 VALUES (492,138005,36,'betterments','Moll','Heusen','W');
+INSERT INTO t2 VALUES (493,138006,36,'advertising','ropers','target','FAS');
+INSERT INTO t2 VALUES (494,138007,36,'rubies','bombast','cited','A');
+INSERT INTO t2 VALUES (495,138008,36,'southwest','difficultly','congresswoman','W');
+INSERT INTO t2 VALUES (496,138009,36,'superstitious','adsorption','Katherine','');
+INSERT INTO t2 VALUES (497,138102,36,'tabernacle','definiteness','titter','A');
+INSERT INTO t2 VALUES (498,138103,36,'silk','cultivation','aspire','A');
+INSERT INTO t2 VALUES (499,138104,36,'handsomest','heals','Mardis','');
+INSERT INTO t2 VALUES (500,138105,36,'Persian','Heusen','Nadia','W');
+INSERT INTO t2 VALUES (501,138201,36,'analog','target','estimating','FAS');
+INSERT INTO t2 VALUES (502,138302,36,'complex','cited','stuck','A');
+INSERT INTO t2 VALUES (503,138303,36,'Taoist','congresswoman','fifteenth','A');
+INSERT INTO t2 VALUES (504,138304,36,'suspend','Katherine','Colombo','');
+INSERT INTO t2 VALUES (505,138401,29,'relegated','titter','survey','A');
+INSERT INTO t2 VALUES (506,140102,29,'awesome','aspire','staffing','');
+INSERT INTO t2 VALUES (507,140103,29,'Bruxelles','Mardis','obtain','');
+INSERT INTO t2 VALUES (508,140104,29,'imprecisely','Nadia','loaded','');
+INSERT INTO t2 VALUES (509,140105,29,'televise','estimating','slaughtered','');
+INSERT INTO t2 VALUES (510,140201,29,'braking','stuck','lights','A');
+INSERT INTO t2 VALUES (511,140701,29,'true','fifteenth','circumference','');
+INSERT INTO t2 VALUES (512,141501,29,'disappointing','Colombo','dull','A');
+INSERT INTO t2 VALUES (513,141502,29,'navally','survey','weekly','A');
+INSERT INTO t2 VALUES (514,141901,29,'circus','staffing','wetness','');
+INSERT INTO t2 VALUES (515,141902,29,'beetles','obtain','visualized','');
+INSERT INTO t2 VALUES (516,142101,29,'trumps','loaded','Tannenbaum','');
+INSERT INTO t2 VALUES (517,142102,29,'fourscore','slaughtered','moribund','');
+INSERT INTO t2 VALUES (518,142103,29,'Blackfoots','lights','demultiplex','');
+INSERT INTO t2 VALUES (519,142701,29,'Grady','circumference','lockings','');
+INSERT INTO t2 VALUES (520,143001,29,'quiets','dull','thugs','FAS');
+INSERT INTO t2 VALUES (521,143501,29,'floundered','weekly','unnerves','');
+INSERT INTO t2 VALUES (522,143502,29,'profundity','wetness','abut','');
+INSERT INTO t2 VALUES (523,148001,29,'Garrisonian','visualized','Chippewa','A');
+INSERT INTO t2 VALUES (524,148002,29,'Strauss','Tannenbaum','stratifications','A');
+INSERT INTO t2 VALUES (525,148003,29,'cemented','moribund','signaled','');
+INSERT INTO t2 VALUES (526,148004,29,'contrition','demultiplex','Italianizes','A');
+INSERT INTO t2 VALUES (527,148005,29,'mutations','lockings','algorithmic','A');
+INSERT INTO t2 VALUES (528,148006,29,'exhibits','thugs','paranoid','FAS');
+INSERT INTO t2 VALUES (529,148007,29,'tits','unnerves','camping','A');
+INSERT INTO t2 VALUES (530,148009,29,'mate','abut','signifying','A');
+INSERT INTO t2 VALUES (531,148010,29,'arches','Chippewa','Patrice','W');
+INSERT INTO t2 VALUES (532,148011,29,'Moll','stratifications','search','A');
+INSERT INTO t2 VALUES (533,148012,29,'ropers','signaled','Angeles','A');
+INSERT INTO t2 VALUES (534,148013,29,'bombast','Italianizes','semblance','');
+INSERT INTO t2 VALUES (535,148023,36,'difficultly','algorithmic','taxed','');
+INSERT INTO t2 VALUES (536,148015,29,'adsorption','paranoid','Beatrice','');
+INSERT INTO t2 VALUES (537,148016,29,'definiteness','camping','retrace','');
+INSERT INTO t2 VALUES (538,148017,29,'cultivation','signifying','lockout','');
+INSERT INTO t2 VALUES (539,148018,29,'heals','Patrice','grammatic','');
+INSERT INTO t2 VALUES (540,148019,29,'Heusen','search','helmsman','');
+INSERT INTO t2 VALUES (541,148020,29,'target','Angeles','uniform','W');
+INSERT INTO t2 VALUES (542,148021,29,'cited','semblance','hamming','');
+INSERT INTO t2 VALUES (543,148022,29,'congresswoman','taxed','disobedience','');
+INSERT INTO t2 VALUES (544,148101,29,'Katherine','Beatrice','captivated','A');
+INSERT INTO t2 VALUES (545,148102,29,'titter','retrace','transferals','A');
+INSERT INTO t2 VALUES (546,148201,29,'aspire','lockout','cartographer','A');
+INSERT INTO t2 VALUES (547,148401,29,'Mardis','grammatic','aims','FAS');
+INSERT INTO t2 VALUES (548,148402,29,'Nadia','helmsman','Pakistani','');
+INSERT INTO t2 VALUES (549,148501,29,'estimating','uniform','burglarized','FAS');
+INSERT INTO t2 VALUES (550,148502,29,'stuck','hamming','saucepans','A');
+INSERT INTO t2 VALUES (551,148503,29,'fifteenth','disobedience','lacerating','A');
+INSERT INTO t2 VALUES (552,148504,29,'Colombo','captivated','corny','');
+INSERT INTO t2 VALUES (553,148601,29,'survey','transferals','megabytes','FAS');
+INSERT INTO t2 VALUES (554,148602,29,'staffing','cartographer','chancellor','');
+INSERT INTO t2 VALUES (555,150701,29,'obtain','aims','bulk','A');
+INSERT INTO t2 VALUES (556,152101,29,'loaded','Pakistani','commits','A');
+INSERT INTO t2 VALUES (557,152102,29,'slaughtered','burglarized','meson','W');
+INSERT INTO t2 VALUES (558,155202,36,'lights','saucepans','deputies','');
+INSERT INTO t2 VALUES (559,155203,29,'circumference','lacerating','northeaster','A');
+INSERT INTO t2 VALUES (560,155204,29,'dull','corny','dipole','');
+INSERT INTO t2 VALUES (561,155205,29,'weekly','megabytes','machining','0');
+INSERT INTO t2 VALUES (562,156001,29,'wetness','chancellor','therefore','');
+INSERT INTO t2 VALUES (563,156002,29,'visualized','bulk','Telefunken','');
+INSERT INTO t2 VALUES (564,156102,29,'Tannenbaum','commits','salvaging','');
+INSERT INTO t2 VALUES (565,156301,29,'moribund','meson','Corinthianizes','A');
+INSERT INTO t2 VALUES (566,156302,29,'demultiplex','deputies','restlessly','A');
+INSERT INTO t2 VALUES (567,156303,29,'lockings','northeaster','bromides','');
+INSERT INTO t2 VALUES (568,156304,29,'thugs','dipole','generalized','A');
+INSERT INTO t2 VALUES (569,156305,29,'unnerves','machining','mishaps','');
+INSERT INTO t2 VALUES (570,156306,29,'abut','therefore','quelling','');
+INSERT INTO t2 VALUES (571,156501,29,'Chippewa','Telefunken','spiritual','A');
+INSERT INTO t2 VALUES (572,158001,29,'stratifications','salvaging','beguiles','FAS');
+INSERT INTO t2 VALUES (573,158002,29,'signaled','Corinthianizes','Trobriand','FAS');
+INSERT INTO t2 VALUES (574,158101,29,'Italianizes','restlessly','fleeing','A');
+INSERT INTO t2 VALUES (575,158102,29,'algorithmic','bromides','Armour','A');
+INSERT INTO t2 VALUES (576,158103,29,'paranoid','generalized','chin','A');
+INSERT INTO t2 VALUES (577,158201,29,'camping','mishaps','provers','A');
+INSERT INTO t2 VALUES (578,158202,29,'signifying','quelling','aeronautic','A');
+INSERT INTO t2 VALUES (579,158203,29,'Patrice','spiritual','voltage','W');
+INSERT INTO t2 VALUES (580,158204,29,'search','beguiles','sash','');
+INSERT INTO t2 VALUES (581,158301,29,'Angeles','Trobriand','anaerobic','A');
+INSERT INTO t2 VALUES (582,158302,29,'semblance','fleeing','simultaneous','A');
+INSERT INTO t2 VALUES (583,158303,29,'taxed','Armour','accumulating','A');
+INSERT INTO t2 VALUES (584,158304,29,'Beatrice','chin','Medusan','A');
+INSERT INTO t2 VALUES (585,158305,29,'retrace','provers','shouted','A');
+INSERT INTO t2 VALUES (586,158306,29,'lockout','aeronautic','freakish','');
+INSERT INTO t2 VALUES (587,158501,29,'grammatic','voltage','index','FAS');
+INSERT INTO t2 VALUES (588,160301,29,'helmsman','sash','commercially','');
+INSERT INTO t2 VALUES (589,166101,50,'uniform','anaerobic','mistiness','A');
+INSERT INTO t2 VALUES (590,166102,50,'hamming','simultaneous','endpoint','');
+INSERT INTO t2 VALUES (591,168001,29,'disobedience','accumulating','straight','A');
+INSERT INTO t2 VALUES (592,168002,29,'captivated','Medusan','flurried','');
+INSERT INTO t2 VALUES (593,168003,29,'transferals','shouted','denotative','A');
+INSERT INTO t2 VALUES (594,168101,29,'cartographer','freakish','coming','FAS');
+INSERT INTO t2 VALUES (595,168102,29,'aims','index','commencements','FAS');
+INSERT INTO t2 VALUES (596,168103,29,'Pakistani','commercially','gentleman','');
+INSERT INTO t2 VALUES (597,168104,29,'burglarized','mistiness','gifted','');
+INSERT INTO t2 VALUES (598,168202,29,'saucepans','endpoint','Shanghais','');
+INSERT INTO t2 VALUES (599,168301,29,'lacerating','straight','sportswriting','A');
+INSERT INTO t2 VALUES (600,168502,29,'corny','flurried','sloping','A');
+INSERT INTO t2 VALUES (601,168503,29,'megabytes','denotative','navies','');
+INSERT INTO t2 VALUES (602,168601,29,'chancellor','coming','leaflet','A');
+INSERT INTO t2 VALUES (603,173001,40,'bulk','commencements','shooter','');
+INSERT INTO t2 VALUES (604,173701,40,'commits','gentleman','Joplin','FAS');
+INSERT INTO t2 VALUES (605,173702,40,'meson','gifted','babies','');
+INSERT INTO t2 VALUES (606,176001,40,'deputies','Shanghais','subdivision','FAS');
+INSERT INTO t2 VALUES (607,176101,40,'northeaster','sportswriting','burstiness','W');
+INSERT INTO t2 VALUES (608,176201,40,'dipole','sloping','belted','FAS');
+INSERT INTO t2 VALUES (609,176401,40,'machining','navies','assails','FAS');
+INSERT INTO t2 VALUES (610,176501,40,'therefore','leaflet','admiring','W');
+INSERT INTO t2 VALUES (611,176601,40,'Telefunken','shooter','swaying','0');
+INSERT INTO t2 VALUES (612,176602,40,'salvaging','Joplin','Goldstine','FAS');
+INSERT INTO t2 VALUES (613,176603,40,'Corinthianizes','babies','fitting','');
+INSERT INTO t2 VALUES (614,178001,40,'restlessly','subdivision','Norwalk','W');
+INSERT INTO t2 VALUES (615,178002,40,'bromides','burstiness','weakening','W');
+INSERT INTO t2 VALUES (616,178003,40,'generalized','belted','analogy','FAS');
+INSERT INTO t2 VALUES (617,178004,40,'mishaps','assails','deludes','');
+INSERT INTO t2 VALUES (618,178005,40,'quelling','admiring','cokes','');
+INSERT INTO t2 VALUES (619,178006,40,'spiritual','swaying','Clayton','');
+INSERT INTO t2 VALUES (620,178007,40,'beguiles','Goldstine','exhausts','');
+INSERT INTO t2 VALUES (621,178008,40,'Trobriand','fitting','causality','');
+INSERT INTO t2 VALUES (622,178101,40,'fleeing','Norwalk','sating','FAS');
+INSERT INTO t2 VALUES (623,178102,40,'Armour','weakening','icon','');
+INSERT INTO t2 VALUES (624,178103,40,'chin','analogy','throttles','');
+INSERT INTO t2 VALUES (625,178201,40,'provers','deludes','communicants','FAS');
+INSERT INTO t2 VALUES (626,178202,40,'aeronautic','cokes','dehydrate','FAS');
+INSERT INTO t2 VALUES (627,178301,40,'voltage','Clayton','priceless','FAS');
+INSERT INTO t2 VALUES (628,178302,40,'sash','exhausts','publicly','');
+INSERT INTO t2 VALUES (629,178401,40,'anaerobic','causality','incidentals','FAS');
+INSERT INTO t2 VALUES (630,178402,40,'simultaneous','sating','commonplace','');
+INSERT INTO t2 VALUES (631,178403,40,'accumulating','icon','mumbles','');
+INSERT INTO t2 VALUES (632,178404,40,'Medusan','throttles','furthermore','W');
+INSERT INTO t2 VALUES (633,178501,40,'shouted','communicants','cautioned','W');
+INSERT INTO t2 VALUES (634,186002,37,'freakish','dehydrate','parametrized','A');
+INSERT INTO t2 VALUES (635,186102,37,'index','priceless','registration','A');
+INSERT INTO t2 VALUES (636,186201,40,'commercially','publicly','sadly','FAS');
+INSERT INTO t2 VALUES (637,186202,40,'mistiness','incidentals','positioning','');
+INSERT INTO t2 VALUES (638,186203,40,'endpoint','commonplace','babysitting','');
+INSERT INTO t2 VALUES (639,186302,37,'straight','mumbles','eternal','A');
+INSERT INTO t2 VALUES (640,188007,37,'flurried','furthermore','hoarder','');
+INSERT INTO t2 VALUES (641,188008,37,'denotative','cautioned','congregates','');
+INSERT INTO t2 VALUES (642,188009,37,'coming','parametrized','rains','');
+INSERT INTO t2 VALUES (643,188010,37,'commencements','registration','workers','W');
+INSERT INTO t2 VALUES (644,188011,37,'gentleman','sadly','sags','A');
+INSERT INTO t2 VALUES (645,188012,37,'gifted','positioning','unplug','W');
+INSERT INTO t2 VALUES (646,188013,37,'Shanghais','babysitting','garage','A');
+INSERT INTO t2 VALUES (647,188014,37,'sportswriting','eternal','boulder','A');
+INSERT INTO t2 VALUES (648,188015,37,'sloping','hoarder','hollowly','A');
+INSERT INTO t2 VALUES (649,188016,37,'navies','congregates','specifics','');
+INSERT INTO t2 VALUES (650,188017,37,'leaflet','rains','Teresa','');
+INSERT INTO t2 VALUES (651,188102,37,'shooter','workers','Winsett','');
+INSERT INTO t2 VALUES (652,188103,37,'Joplin','sags','convenient','A');
+INSERT INTO t2 VALUES (653,188202,37,'babies','unplug','buckboards','FAS');
+INSERT INTO t2 VALUES (654,188301,40,'subdivision','garage','amenities','');
+INSERT INTO t2 VALUES (655,188302,40,'burstiness','boulder','resplendent','FAS');
+INSERT INTO t2 VALUES (656,188303,40,'belted','hollowly','priding','FAS');
+INSERT INTO t2 VALUES (657,188401,37,'assails','specifics','configurations','');
+INSERT INTO t2 VALUES (658,188402,37,'admiring','Teresa','untidiness','A');
+INSERT INTO t2 VALUES (659,188503,37,'swaying','Winsett','Brice','W');
+INSERT INTO t2 VALUES (660,188504,37,'Goldstine','convenient','sews','FAS');
+INSERT INTO t2 VALUES (661,188505,37,'fitting','buckboards','participated','');
+INSERT INTO t2 VALUES (662,190701,37,'Norwalk','amenities','Simon','FAS');
+INSERT INTO t2 VALUES (663,190703,50,'weakening','resplendent','certificates','');
+INSERT INTO t2 VALUES (664,191701,37,'analogy','priding','Fitzpatrick','');
+INSERT INTO t2 VALUES (665,191702,37,'deludes','configurations','Evanston','A');
+INSERT INTO t2 VALUES (666,191703,37,'cokes','untidiness','misted','');
+INSERT INTO t2 VALUES (667,196001,37,'Clayton','Brice','textures','A');
+INSERT INTO t2 VALUES (668,196002,37,'exhausts','sews','save','');
+INSERT INTO t2 VALUES (669,196003,37,'causality','participated','count','');
+INSERT INTO t2 VALUES (670,196101,37,'sating','Simon','rightful','A');
+INSERT INTO t2 VALUES (671,196103,37,'icon','certificates','chaperone','');
+INSERT INTO t2 VALUES (672,196104,37,'throttles','Fitzpatrick','Lizzy','A');
+INSERT INTO t2 VALUES (673,196201,37,'communicants','Evanston','clenched','A');
+INSERT INTO t2 VALUES (674,196202,37,'dehydrate','misted','effortlessly','');
+INSERT INTO t2 VALUES (675,196203,37,'priceless','textures','accessed','');
+INSERT INTO t2 VALUES (676,198001,37,'publicly','save','beaters','A');
+INSERT INTO t2 VALUES (677,198003,37,'incidentals','count','Hornblower','FAS');
+INSERT INTO t2 VALUES (678,198004,37,'commonplace','rightful','vests','A');
+INSERT INTO t2 VALUES (679,198005,37,'mumbles','chaperone','indulgences','FAS');
+INSERT INTO t2 VALUES (680,198006,37,'furthermore','Lizzy','infallibly','A');
+INSERT INTO t2 VALUES (681,198007,37,'cautioned','clenched','unwilling','FAS');
+INSERT INTO t2 VALUES (682,198008,37,'parametrized','effortlessly','excrete','FAS');
+INSERT INTO t2 VALUES (683,198009,37,'registration','accessed','spools','A');
+INSERT INTO t2 VALUES (684,198010,37,'sadly','beaters','crunches','FAS');
+INSERT INTO t2 VALUES (685,198011,37,'positioning','Hornblower','overestimating','FAS');
+INSERT INTO t2 VALUES (686,198012,37,'babysitting','vests','ineffective','');
+INSERT INTO t2 VALUES (687,198013,37,'eternal','indulgences','humiliation','A');
+INSERT INTO t2 VALUES (688,198014,37,'hoarder','infallibly','sophomore','');
+INSERT INTO t2 VALUES (689,198015,37,'congregates','unwilling','star','');
+INSERT INTO t2 VALUES (690,198017,37,'rains','excrete','rifles','');
+INSERT INTO t2 VALUES (691,198018,37,'workers','spools','dialysis','');
+INSERT INTO t2 VALUES (692,198019,37,'sags','crunches','arriving','');
+INSERT INTO t2 VALUES (693,198020,37,'unplug','overestimating','indulge','');
+INSERT INTO t2 VALUES (694,198021,37,'garage','ineffective','clockers','');
+INSERT INTO t2 VALUES (695,198022,37,'boulder','humiliation','languages','');
+INSERT INTO t2 VALUES (696,198023,50,'hollowly','sophomore','Antarctica','A');
+INSERT INTO t2 VALUES (697,198024,37,'specifics','star','percentage','');
+INSERT INTO t2 VALUES (698,198101,37,'Teresa','rifles','ceiling','A');
+INSERT INTO t2 VALUES (699,198103,37,'Winsett','dialysis','specification','');
+INSERT INTO t2 VALUES (700,198105,37,'convenient','arriving','regimented','A');
+INSERT INTO t2 VALUES (701,198106,37,'buckboards','indulge','ciphers','');
+INSERT INTO t2 VALUES (702,198201,37,'amenities','clockers','pictures','A');
+INSERT INTO t2 VALUES (703,198204,37,'resplendent','languages','serpents','A');
+INSERT INTO t2 VALUES (704,198301,53,'priding','Antarctica','allot','A');
+INSERT INTO t2 VALUES (705,198302,53,'configurations','percentage','realized','A');
+INSERT INTO t2 VALUES (706,198303,53,'untidiness','ceiling','mayoral','A');
+INSERT INTO t2 VALUES (707,198304,53,'Brice','specification','opaquely','A');
+INSERT INTO t2 VALUES (708,198401,37,'sews','regimented','hostess','FAS');
+INSERT INTO t2 VALUES (709,198402,37,'participated','ciphers','fiftieth','');
+INSERT INTO t2 VALUES (710,198403,37,'Simon','pictures','incorrectly','');
+INSERT INTO t2 VALUES (711,202101,37,'certificates','serpents','decomposition','FAS');
+INSERT INTO t2 VALUES (712,202301,37,'Fitzpatrick','allot','stranglings','');
+INSERT INTO t2 VALUES (713,202302,37,'Evanston','realized','mixture','FAS');
+INSERT INTO t2 VALUES (714,202303,37,'misted','mayoral','electroencephalography','FAS');
+INSERT INTO t2 VALUES (715,202304,37,'textures','opaquely','similarities','FAS');
+INSERT INTO t2 VALUES (716,202305,37,'save','hostess','charges','W');
+INSERT INTO t2 VALUES (717,202601,37,'count','fiftieth','freest','FAS');
+INSERT INTO t2 VALUES (718,202602,37,'rightful','incorrectly','Greenberg','FAS');
+INSERT INTO t2 VALUES (719,202605,37,'chaperone','decomposition','tinting','');
+INSERT INTO t2 VALUES (720,202606,37,'Lizzy','stranglings','expelled','W');
+INSERT INTO t2 VALUES (721,202607,37,'clenched','mixture','warm','');
+INSERT INTO t2 VALUES (722,202901,37,'effortlessly','electroencephalography','smoothed','');
+INSERT INTO t2 VALUES (723,202902,37,'accessed','similarities','deductions','FAS');
+INSERT INTO t2 VALUES (724,202903,37,'beaters','charges','Romano','W');
+INSERT INTO t2 VALUES (725,202904,37,'Hornblower','freest','bitterroot','');
+INSERT INTO t2 VALUES (726,202907,37,'vests','Greenberg','corset','');
+INSERT INTO t2 VALUES (727,202908,37,'indulgences','tinting','securing','');
+INSERT INTO t2 VALUES (728,203101,37,'infallibly','expelled','environing','FAS');
+INSERT INTO t2 VALUES (729,203103,37,'unwilling','warm','cute','');
+INSERT INTO t2 VALUES (730,203104,37,'excrete','smoothed','Crays','');
+INSERT INTO t2 VALUES (731,203105,37,'spools','deductions','heiress','FAS');
+INSERT INTO t2 VALUES (732,203401,37,'crunches','Romano','inform','FAS');
+INSERT INTO t2 VALUES (733,203402,37,'overestimating','bitterroot','avenge','');
+INSERT INTO t2 VALUES (734,203404,37,'ineffective','corset','universals','');
+INSERT INTO t2 VALUES (735,203901,37,'humiliation','securing','Kinsey','W');
+INSERT INTO t2 VALUES (736,203902,37,'sophomore','environing','ravines','FAS');
+INSERT INTO t2 VALUES (737,203903,37,'star','cute','bestseller','');
+INSERT INTO t2 VALUES (738,203906,37,'rifles','Crays','equilibrium','');
+INSERT INTO t2 VALUES (739,203907,37,'dialysis','heiress','extents','0');
+INSERT INTO t2 VALUES (740,203908,37,'arriving','inform','relatively','');
+INSERT INTO t2 VALUES (741,203909,37,'indulge','avenge','pressure','FAS');
+INSERT INTO t2 VALUES (742,206101,37,'clockers','universals','critiques','FAS');
+INSERT INTO t2 VALUES (743,206201,37,'languages','Kinsey','befouled','');
+INSERT INTO t2 VALUES (744,206202,37,'Antarctica','ravines','rightfully','FAS');
+INSERT INTO t2 VALUES (745,206203,37,'percentage','bestseller','mechanizing','FAS');
+INSERT INTO t2 VALUES (746,206206,37,'ceiling','equilibrium','Latinizes','');
+INSERT INTO t2 VALUES (747,206207,37,'specification','extents','timesharing','');
+INSERT INTO t2 VALUES (748,206208,37,'regimented','relatively','Aden','');
+INSERT INTO t2 VALUES (749,208001,37,'ciphers','pressure','embassies','');
+INSERT INTO t2 VALUES (750,208002,37,'pictures','critiques','males','FAS');
+INSERT INTO t2 VALUES (751,208003,37,'serpents','befouled','shapelessly','FAS');
+INSERT INTO t2 VALUES (752,208004,37,'allot','rightfully','genres','FAS');
+INSERT INTO t2 VALUES (753,208008,37,'realized','mechanizing','mastering','');
+INSERT INTO t2 VALUES (754,208009,37,'mayoral','Latinizes','Newtonian','');
+INSERT INTO t2 VALUES (755,208010,37,'opaquely','timesharing','finishers','FAS');
+INSERT INTO t2 VALUES (756,208011,37,'hostess','Aden','abates','');
+INSERT INTO t2 VALUES (757,208101,37,'fiftieth','embassies','teem','');
+INSERT INTO t2 VALUES (758,208102,37,'incorrectly','males','kiting','FAS');
+INSERT INTO t2 VALUES (759,208103,37,'decomposition','shapelessly','stodgy','FAS');
+INSERT INTO t2 VALUES (760,208104,37,'stranglings','genres','scalps','FAS');
+INSERT INTO t2 VALUES (761,208105,37,'mixture','mastering','feed','FAS');
+INSERT INTO t2 VALUES (762,208110,37,'electroencephalography','Newtonian','guitars','');
+INSERT INTO t2 VALUES (763,208111,37,'similarities','finishers','airships','');
+INSERT INTO t2 VALUES (764,208112,37,'charges','abates','store','');
+INSERT INTO t2 VALUES (765,208113,37,'freest','teem','denounces','');
+INSERT INTO t2 VALUES (766,208201,37,'Greenberg','kiting','Pyle','FAS');
+INSERT INTO t2 VALUES (767,208203,37,'tinting','stodgy','Saxony','');
+INSERT INTO t2 VALUES (768,208301,37,'expelled','scalps','serializations','FAS');
+INSERT INTO t2 VALUES (769,208302,37,'warm','feed','Peruvian','FAS');
+INSERT INTO t2 VALUES (770,208305,37,'smoothed','guitars','taxonomically','FAS');
+INSERT INTO t2 VALUES (771,208401,37,'deductions','airships','kingdom','A');
+INSERT INTO t2 VALUES (772,208402,37,'Romano','store','stint','A');
+INSERT INTO t2 VALUES (773,208403,37,'bitterroot','denounces','Sault','A');
+INSERT INTO t2 VALUES (774,208404,37,'corset','Pyle','faithful','');
+INSERT INTO t2 VALUES (775,208501,37,'securing','Saxony','Ganymede','FAS');
+INSERT INTO t2 VALUES (776,208502,37,'environing','serializations','tidiness','FAS');
+INSERT INTO t2 VALUES (777,208503,37,'cute','Peruvian','gainful','FAS');
+INSERT INTO t2 VALUES (778,208504,37,'Crays','taxonomically','contrary','FAS');
+INSERT INTO t2 VALUES (779,208505,37,'heiress','kingdom','Tipperary','FAS');
+INSERT INTO t2 VALUES (780,210101,37,'inform','stint','tropics','W');
+INSERT INTO t2 VALUES (781,210102,37,'avenge','Sault','theorizers','');
+INSERT INTO t2 VALUES (782,210103,37,'universals','faithful','renew','0');
+INSERT INTO t2 VALUES (783,210104,37,'Kinsey','Ganymede','already','');
+INSERT INTO t2 VALUES (784,210105,37,'ravines','tidiness','terminal','');
+INSERT INTO t2 VALUES (785,210106,37,'bestseller','gainful','Hegelian','');
+INSERT INTO t2 VALUES (786,210107,37,'equilibrium','contrary','hypothesizer','');
+INSERT INTO t2 VALUES (787,210401,37,'extents','Tipperary','warningly','FAS');
+INSERT INTO t2 VALUES (788,213201,37,'relatively','tropics','journalizing','FAS');
+INSERT INTO t2 VALUES (789,213203,37,'pressure','theorizers','nested','');
+INSERT INTO t2 VALUES (790,213204,37,'critiques','renew','Lars','');
+INSERT INTO t2 VALUES (791,213205,37,'befouled','already','saplings','');
+INSERT INTO t2 VALUES (792,213206,37,'rightfully','terminal','foothill','');
+INSERT INTO t2 VALUES (793,213207,37,'mechanizing','Hegelian','labeled','');
+INSERT INTO t2 VALUES (794,216101,37,'Latinizes','hypothesizer','imperiously','FAS');
+INSERT INTO t2 VALUES (795,216103,37,'timesharing','warningly','reporters','FAS');
+INSERT INTO t2 VALUES (796,218001,37,'Aden','journalizing','furnishings','FAS');
+INSERT INTO t2 VALUES (797,218002,37,'embassies','nested','precipitable','FAS');
+INSERT INTO t2 VALUES (798,218003,37,'males','Lars','discounts','FAS');
+INSERT INTO t2 VALUES (799,218004,37,'shapelessly','saplings','excises','FAS');
+INSERT INTO t2 VALUES (800,143503,50,'genres','foothill','Stalin','');
+INSERT INTO t2 VALUES (801,218006,37,'mastering','labeled','despot','FAS');
+INSERT INTO t2 VALUES (802,218007,37,'Newtonian','imperiously','ripeness','FAS');
+INSERT INTO t2 VALUES (803,218008,37,'finishers','reporters','Arabia','');
+INSERT INTO t2 VALUES (804,218009,37,'abates','furnishings','unruly','');
+INSERT INTO t2 VALUES (805,218010,37,'teem','precipitable','mournfulness','');
+INSERT INTO t2 VALUES (806,218011,37,'kiting','discounts','boom','FAS');
+INSERT INTO t2 VALUES (807,218020,37,'stodgy','excises','slaughter','A');
+INSERT INTO t2 VALUES (808,218021,50,'scalps','Stalin','Sabine','');
+INSERT INTO t2 VALUES (809,218022,37,'feed','despot','handy','FAS');
+INSERT INTO t2 VALUES (810,218023,37,'guitars','ripeness','rural','');
+INSERT INTO t2 VALUES (811,218024,37,'airships','Arabia','organizer','');
+INSERT INTO t2 VALUES (812,218101,37,'store','unruly','shipyard','FAS');
+INSERT INTO t2 VALUES (813,218102,37,'denounces','mournfulness','civics','FAS');
+INSERT INTO t2 VALUES (814,218103,37,'Pyle','boom','inaccuracy','FAS');
+INSERT INTO t2 VALUES (815,218201,37,'Saxony','slaughter','rules','FAS');
+INSERT INTO t2 VALUES (816,218202,37,'serializations','Sabine','juveniles','FAS');
+INSERT INTO t2 VALUES (817,218203,37,'Peruvian','handy','comprised','W');
+INSERT INTO t2 VALUES (818,218204,37,'taxonomically','rural','investigations','');
+INSERT INTO t2 VALUES (819,218205,37,'kingdom','organizer','stabilizes','A');
+INSERT INTO t2 VALUES (820,218301,37,'stint','shipyard','seminaries','FAS');
+INSERT INTO t2 VALUES (821,218302,37,'Sault','civics','Hunter','A');
+INSERT INTO t2 VALUES (822,218401,37,'faithful','inaccuracy','sporty','FAS');
+INSERT INTO t2 VALUES (823,218402,37,'Ganymede','rules','test','FAS');
+INSERT INTO t2 VALUES (824,218403,37,'tidiness','juveniles','weasels','');
+INSERT INTO t2 VALUES (825,218404,37,'gainful','comprised','CERN','');
+INSERT INTO t2 VALUES (826,218407,37,'contrary','investigations','tempering','');
+INSERT INTO t2 VALUES (827,218408,37,'Tipperary','stabilizes','afore','FAS');
+INSERT INTO t2 VALUES (828,218409,37,'tropics','seminaries','Galatean','');
+INSERT INTO t2 VALUES (829,218410,37,'theorizers','Hunter','techniques','W');
+INSERT INTO t2 VALUES (830,226001,37,'renew','sporty','error','');
+INSERT INTO t2 VALUES (831,226002,37,'already','test','veranda','');
+INSERT INTO t2 VALUES (832,226003,37,'terminal','weasels','severely','');
+INSERT INTO t2 VALUES (833,226004,37,'Hegelian','CERN','Cassites','FAS');
+INSERT INTO t2 VALUES (834,226005,37,'hypothesizer','tempering','forthcoming','');
+INSERT INTO t2 VALUES (835,226006,37,'warningly','afore','guides','');
+INSERT INTO t2 VALUES (836,226007,37,'journalizing','Galatean','vanish','FAS');
+INSERT INTO t2 VALUES (837,226008,37,'nested','techniques','lied','A');
+INSERT INTO t2 VALUES (838,226203,37,'Lars','error','sawtooth','FAS');
+INSERT INTO t2 VALUES (839,226204,37,'saplings','veranda','fated','FAS');
+INSERT INTO t2 VALUES (840,226205,37,'foothill','severely','gradually','');
+INSERT INTO t2 VALUES (841,226206,37,'labeled','Cassites','widens','');
+INSERT INTO t2 VALUES (842,226207,37,'imperiously','forthcoming','preclude','');
+INSERT INTO t2 VALUES (843,226208,37,'reporters','guides','Jobrel','');
+INSERT INTO t2 VALUES (844,226209,37,'furnishings','vanish','hooker','');
+INSERT INTO t2 VALUES (845,226210,37,'precipitable','lied','rainstorm','');
+INSERT INTO t2 VALUES (846,226211,37,'discounts','sawtooth','disconnects','');
+INSERT INTO t2 VALUES (847,228001,37,'excises','fated','cruelty','');
+INSERT INTO t2 VALUES (848,228004,37,'Stalin','gradually','exponentials','A');
+INSERT INTO t2 VALUES (849,228005,37,'despot','widens','affective','A');
+INSERT INTO t2 VALUES (850,228006,37,'ripeness','preclude','arteries','');
+INSERT INTO t2 VALUES (851,228007,37,'Arabia','Jobrel','Crosby','FAS');
+INSERT INTO t2 VALUES (852,228008,37,'unruly','hooker','acquaint','');
+INSERT INTO t2 VALUES (853,228009,37,'mournfulness','rainstorm','evenhandedly','');
+INSERT INTO t2 VALUES (854,228101,37,'boom','disconnects','percentage','');
+INSERT INTO t2 VALUES (855,228108,37,'slaughter','cruelty','disobedience','');
+INSERT INTO t2 VALUES (856,228109,37,'Sabine','exponentials','humility','');
+INSERT INTO t2 VALUES (857,228110,37,'handy','affective','gleaning','A');
+INSERT INTO t2 VALUES (858,228111,37,'rural','arteries','petted','A');
+INSERT INTO t2 VALUES (859,228112,37,'organizer','Crosby','bloater','A');
+INSERT INTO t2 VALUES (860,228113,37,'shipyard','acquaint','minion','A');
+INSERT INTO t2 VALUES (861,228114,37,'civics','evenhandedly','marginal','A');
+INSERT INTO t2 VALUES (862,228115,37,'inaccuracy','percentage','apiary','A');
+INSERT INTO t2 VALUES (863,228116,37,'rules','disobedience','measures','');
+INSERT INTO t2 VALUES (864,228117,37,'juveniles','humility','precaution','');
+INSERT INTO t2 VALUES (865,228118,37,'comprised','gleaning','repelled','');
+INSERT INTO t2 VALUES (866,228119,37,'investigations','petted','primary','FAS');
+INSERT INTO t2 VALUES (867,228120,37,'stabilizes','bloater','coverings','');
+INSERT INTO t2 VALUES (868,228121,37,'seminaries','minion','Artemia','A');
+INSERT INTO t2 VALUES (869,228122,37,'Hunter','marginal','navigate','');
+INSERT INTO t2 VALUES (870,228201,37,'sporty','apiary','spatial','');
+INSERT INTO t2 VALUES (871,228206,37,'test','measures','Gurkha','');
+INSERT INTO t2 VALUES (872,228207,37,'weasels','precaution','meanwhile','A');
+INSERT INTO t2 VALUES (873,228208,37,'CERN','repelled','Melinda','A');
+INSERT INTO t2 VALUES (874,228209,37,'tempering','primary','Butterfield','');
+INSERT INTO t2 VALUES (875,228210,37,'afore','coverings','Aldrich','A');
+INSERT INTO t2 VALUES (876,228211,37,'Galatean','Artemia','previewing','A');
+INSERT INTO t2 VALUES (877,228212,37,'techniques','navigate','glut','A');
+INSERT INTO t2 VALUES (878,228213,37,'error','spatial','unaffected','');
+INSERT INTO t2 VALUES (879,228214,37,'veranda','Gurkha','inmate','');
+INSERT INTO t2 VALUES (880,228301,37,'severely','meanwhile','mineral','');
+INSERT INTO t2 VALUES (881,228305,37,'Cassites','Melinda','impending','A');
+INSERT INTO t2 VALUES (882,228306,37,'forthcoming','Butterfield','meditation','A');
+INSERT INTO t2 VALUES (883,228307,37,'guides','Aldrich','ideas','');
+INSERT INTO t2 VALUES (884,228308,37,'vanish','previewing','miniaturizes','W');
+INSERT INTO t2 VALUES (885,228309,37,'lied','glut','lewdly','');
+INSERT INTO t2 VALUES (886,228310,37,'sawtooth','unaffected','title','');
+INSERT INTO t2 VALUES (887,228311,37,'fated','inmate','youthfulness','');
+INSERT INTO t2 VALUES (888,228312,37,'gradually','mineral','creak','FAS');
+INSERT INTO t2 VALUES (889,228313,37,'widens','impending','Chippewa','');
+INSERT INTO t2 VALUES (890,228314,37,'preclude','meditation','clamored','');
+INSERT INTO t2 VALUES (891,228401,65,'Jobrel','ideas','freezes','');
+INSERT INTO t2 VALUES (892,228402,65,'hooker','miniaturizes','forgivably','FAS');
+INSERT INTO t2 VALUES (893,228403,65,'rainstorm','lewdly','reduce','FAS');
+INSERT INTO t2 VALUES (894,228404,65,'disconnects','title','McGovern','W');
+INSERT INTO t2 VALUES (895,228405,65,'cruelty','youthfulness','Nazis','W');
+INSERT INTO t2 VALUES (896,228406,65,'exponentials','creak','epistle','W');
+INSERT INTO t2 VALUES (897,228407,65,'affective','Chippewa','socializes','W');
+INSERT INTO t2 VALUES (898,228408,65,'arteries','clamored','conceptions','');
+INSERT INTO t2 VALUES (899,228409,65,'Crosby','freezes','Kevin','');
+INSERT INTO t2 VALUES (900,228410,65,'acquaint','forgivably','uncovering','');
+INSERT INTO t2 VALUES (901,230301,37,'evenhandedly','reduce','chews','FAS');
+INSERT INTO t2 VALUES (902,230302,37,'percentage','McGovern','appendixes','FAS');
+INSERT INTO t2 VALUES (903,230303,37,'disobedience','Nazis','raining','');
+INSERT INTO t2 VALUES (904,018062,37,'humility','epistle','infest','');
+INSERT INTO t2 VALUES (905,230501,37,'gleaning','socializes','compartment','');
+INSERT INTO t2 VALUES (906,230502,37,'petted','conceptions','minting','');
+INSERT INTO t2 VALUES (907,230503,37,'bloater','Kevin','ducks','');
+INSERT INTO t2 VALUES (908,230504,37,'minion','uncovering','roped','A');
+INSERT INTO t2 VALUES (909,230505,37,'marginal','chews','waltz','');
+INSERT INTO t2 VALUES (910,230506,37,'apiary','appendixes','Lillian','');
+INSERT INTO t2 VALUES (911,230507,37,'measures','raining','repressions','A');
+INSERT INTO t2 VALUES (912,230508,37,'precaution','infest','chillingly','');
+INSERT INTO t2 VALUES (913,230509,37,'repelled','compartment','noncritical','');
+INSERT INTO t2 VALUES (914,230901,37,'primary','minting','lithograph','');
+INSERT INTO t2 VALUES (915,230902,37,'coverings','ducks','spongers','');
+INSERT INTO t2 VALUES (916,230903,37,'Artemia','roped','parenthood','');
+INSERT INTO t2 VALUES (917,230904,37,'navigate','waltz','posed','');
+INSERT INTO t2 VALUES (918,230905,37,'spatial','Lillian','instruments','');
+INSERT INTO t2 VALUES (919,230906,37,'Gurkha','repressions','filial','');
+INSERT INTO t2 VALUES (920,230907,37,'meanwhile','chillingly','fixedly','');
+INSERT INTO t2 VALUES (921,230908,37,'Melinda','noncritical','relives','');
+INSERT INTO t2 VALUES (922,230909,37,'Butterfield','lithograph','Pandora','');
+INSERT INTO t2 VALUES (923,230910,37,'Aldrich','spongers','watering','A');
+INSERT INTO t2 VALUES (924,230911,37,'previewing','parenthood','ungrateful','');
+INSERT INTO t2 VALUES (925,230912,37,'glut','posed','secures','');
+INSERT INTO t2 VALUES (926,230913,37,'unaffected','instruments','chastisers','');
+INSERT INTO t2 VALUES (927,230914,37,'inmate','filial','icon','');
+INSERT INTO t2 VALUES (928,231304,37,'mineral','fixedly','reuniting','A');
+INSERT INTO t2 VALUES (929,231305,37,'impending','relives','imagining','A');
+INSERT INTO t2 VALUES (930,231306,37,'meditation','Pandora','abiding','A');
+INSERT INTO t2 VALUES (931,231307,37,'ideas','watering','omnisciently','');
+INSERT INTO t2 VALUES (932,231308,37,'miniaturizes','ungrateful','Britannic','');
+INSERT INTO t2 VALUES (933,231309,37,'lewdly','secures','scholastics','A');
+INSERT INTO t2 VALUES (934,231310,37,'title','chastisers','mechanics','A');
+INSERT INTO t2 VALUES (935,231311,37,'youthfulness','icon','humidly','A');
+INSERT INTO t2 VALUES (936,231312,37,'creak','reuniting','masterpiece','');
+INSERT INTO t2 VALUES (937,231313,37,'Chippewa','imagining','however','');
+INSERT INTO t2 VALUES (938,231314,37,'clamored','abiding','Mendelian','');
+INSERT INTO t2 VALUES (939,231315,37,'freezes','omnisciently','jarred','');
+INSERT INTO t2 VALUES (940,232102,37,'forgivably','Britannic','scolds','');
+INSERT INTO t2 VALUES (941,232103,37,'reduce','scholastics','infatuate','');
+INSERT INTO t2 VALUES (942,232104,37,'McGovern','mechanics','willed','A');
+INSERT INTO t2 VALUES (943,232105,37,'Nazis','humidly','joyfully','');
+INSERT INTO t2 VALUES (944,232106,37,'epistle','masterpiece','Microsoft','');
+INSERT INTO t2 VALUES (945,232107,37,'socializes','however','fibrosities','');
+INSERT INTO t2 VALUES (946,232108,37,'conceptions','Mendelian','Baltimorean','');
+INSERT INTO t2 VALUES (947,232601,37,'Kevin','jarred','equestrian','');
+INSERT INTO t2 VALUES (948,232602,37,'uncovering','scolds','Goodrich','');
+INSERT INTO t2 VALUES (949,232603,37,'chews','infatuate','apish','A');
+INSERT INTO t2 VALUES (950,232605,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5950,1232605,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5951,1232606,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5952,1232607,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5953,1232608,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (5954,1232609,37,'appendixes','willed','Adlerian','');
+INSERT INTO t2 VALUES (951,232606,37,'raining','joyfully','Tropez','');
+INSERT INTO t2 VALUES (952,232607,37,'infest','Microsoft','nouns','');
+INSERT INTO t2 VALUES (953,232608,37,'compartment','fibrosities','distracting','');
+INSERT INTO t2 VALUES (954,232609,37,'minting','Baltimorean','mutton','');
+INSERT INTO t2 VALUES (955,236104,37,'ducks','equestrian','bridgeable','A');
+INSERT INTO t2 VALUES (956,236105,37,'roped','Goodrich','stickers','A');
+INSERT INTO t2 VALUES (957,236106,37,'waltz','apish','transcontinental','A');
+INSERT INTO t2 VALUES (958,236107,37,'Lillian','Adlerian','amateurish','');
+INSERT INTO t2 VALUES (959,236108,37,'repressions','Tropez','Gandhian','');
+INSERT INTO t2 VALUES (960,236109,37,'chillingly','nouns','stratified','');
+INSERT INTO t2 VALUES (961,236110,37,'noncritical','distracting','chamberlains','');
+INSERT INTO t2 VALUES (962,236111,37,'lithograph','mutton','creditably','');
+INSERT INTO t2 VALUES (963,236112,37,'spongers','bridgeable','philosophic','');
+INSERT INTO t2 VALUES (964,236113,37,'parenthood','stickers','ores','');
+INSERT INTO t2 VALUES (965,238005,37,'posed','transcontinental','Carleton','');
+INSERT INTO t2 VALUES (966,238006,37,'instruments','amateurish','tape','A');
+INSERT INTO t2 VALUES (967,238007,37,'filial','Gandhian','afloat','A');
+INSERT INTO t2 VALUES (968,238008,37,'fixedly','stratified','goodness','A');
+INSERT INTO t2 VALUES (969,238009,37,'relives','chamberlains','welcoming','');
+INSERT INTO t2 VALUES (970,238010,37,'Pandora','creditably','Pinsky','FAS');
+INSERT INTO t2 VALUES (971,238011,37,'watering','philosophic','halting','');
+INSERT INTO t2 VALUES (972,238012,37,'ungrateful','ores','bibliography','');
+INSERT INTO t2 VALUES (973,238013,37,'secures','Carleton','decoding','');
+INSERT INTO t2 VALUES (974,240401,41,'chastisers','tape','variance','A');
+INSERT INTO t2 VALUES (975,240402,41,'icon','afloat','allowed','A');
+INSERT INTO t2 VALUES (976,240901,41,'reuniting','goodness','dire','A');
+INSERT INTO t2 VALUES (977,240902,41,'imagining','welcoming','dub','A');
+INSERT INTO t2 VALUES (978,241801,41,'abiding','Pinsky','poisoning','');
+INSERT INTO t2 VALUES (979,242101,41,'omnisciently','halting','Iraqis','A');
+INSERT INTO t2 VALUES (980,242102,41,'Britannic','bibliography','heaving','');
+INSERT INTO t2 VALUES (981,242201,41,'scholastics','decoding','population','A');
+INSERT INTO t2 VALUES (982,242202,41,'mechanics','variance','bomb','A');
+INSERT INTO t2 VALUES (983,242501,41,'humidly','allowed','Majorca','A');
+INSERT INTO t2 VALUES (984,242502,41,'masterpiece','dire','Gershwins','');
+INSERT INTO t2 VALUES (985,246201,41,'however','dub','explorers','');
+INSERT INTO t2 VALUES (986,246202,41,'Mendelian','poisoning','libretto','A');
+INSERT INTO t2 VALUES (987,246203,41,'jarred','Iraqis','occurred','');
+INSERT INTO t2 VALUES (988,246204,41,'scolds','heaving','Lagos','');
+INSERT INTO t2 VALUES (989,246205,41,'infatuate','population','rats','');
+INSERT INTO t2 VALUES (990,246301,41,'willed','bomb','bankruptcies','A');
+INSERT INTO t2 VALUES (991,246302,41,'joyfully','Majorca','crying','');
+INSERT INTO t2 VALUES (992,248001,41,'Microsoft','Gershwins','unexpected','');
+INSERT INTO t2 VALUES (993,248002,41,'fibrosities','explorers','accessed','A');
+INSERT INTO t2 VALUES (994,248003,41,'Baltimorean','libretto','colorful','A');
+INSERT INTO t2 VALUES (995,248004,41,'equestrian','occurred','versatility','A');
+INSERT INTO t2 VALUES (996,248005,41,'Goodrich','Lagos','cosy','');
+INSERT INTO t2 VALUES (997,248006,41,'apish','rats','Darius','A');
+INSERT INTO t2 VALUES (998,248007,41,'Adlerian','bankruptcies','mastering','A');
+INSERT INTO t2 VALUES (999,248008,41,'Tropez','crying','Asiaticizations','A');
+INSERT INTO t2 VALUES (1000,248009,41,'nouns','unexpected','offerers','A');
+INSERT INTO t2 VALUES (1001,248010,41,'distracting','accessed','uncles','A');
+INSERT INTO t2 VALUES (1002,248011,41,'mutton','colorful','sleepwalk','');
+INSERT INTO t2 VALUES (1003,248012,41,'bridgeable','versatility','Ernestine','');
+INSERT INTO t2 VALUES (1004,248013,41,'stickers','cosy','checksumming','');
+INSERT INTO t2 VALUES (1005,248014,41,'transcontinental','Darius','stopped','');
+INSERT INTO t2 VALUES (1006,248015,41,'amateurish','mastering','sicker','');
+INSERT INTO t2 VALUES (1007,248016,41,'Gandhian','Asiaticizations','Italianization','');
+INSERT INTO t2 VALUES (1008,248017,41,'stratified','offerers','alphabetic','');
+INSERT INTO t2 VALUES (1009,248018,41,'chamberlains','uncles','pharmaceutic','');
+INSERT INTO t2 VALUES (1010,248019,41,'creditably','sleepwalk','creator','');
+INSERT INTO t2 VALUES (1011,248020,41,'philosophic','Ernestine','chess','');
+INSERT INTO t2 VALUES (1012,248021,41,'ores','checksumming','charcoal','');
+INSERT INTO t2 VALUES (1013,248101,41,'Carleton','stopped','Epiphany','A');
+INSERT INTO t2 VALUES (1014,248102,41,'tape','sicker','bulldozes','A');
+INSERT INTO t2 VALUES (1015,248201,41,'afloat','Italianization','Pygmalion','A');
+INSERT INTO t2 VALUES (1016,248202,41,'goodness','alphabetic','caressing','A');
+INSERT INTO t2 VALUES (1017,248203,41,'welcoming','pharmaceutic','Palestine','A');
+INSERT INTO t2 VALUES (1018,248204,41,'Pinsky','creator','regimented','A');
+INSERT INTO t2 VALUES (1019,248205,41,'halting','chess','scars','A');
+INSERT INTO t2 VALUES (1020,248206,41,'bibliography','charcoal','realest','A');
+INSERT INTO t2 VALUES (1021,248207,41,'decoding','Epiphany','diffusing','A');
+INSERT INTO t2 VALUES (1022,248208,41,'variance','bulldozes','clubroom','A');
+INSERT INTO t2 VALUES (1023,248209,41,'allowed','Pygmalion','Blythe','A');
+INSERT INTO t2 VALUES (1024,248210,41,'dire','caressing','ahead','');
+INSERT INTO t2 VALUES (1025,248211,50,'dub','Palestine','reviver','');
+INSERT INTO t2 VALUES (1026,250501,34,'poisoning','regimented','retransmitting','A');
+INSERT INTO t2 VALUES (1027,250502,34,'Iraqis','scars','landslide','');
+INSERT INTO t2 VALUES (1028,250503,34,'heaving','realest','Eiffel','');
+INSERT INTO t2 VALUES (1029,250504,34,'population','diffusing','absentee','');
+INSERT INTO t2 VALUES (1030,250505,34,'bomb','clubroom','aye','');
+INSERT INTO t2 VALUES (1031,250601,34,'Majorca','Blythe','forked','A');
+INSERT INTO t2 VALUES (1032,250602,34,'Gershwins','ahead','Peruvianizes','');
+INSERT INTO t2 VALUES (1033,250603,34,'explorers','reviver','clerked','');
+INSERT INTO t2 VALUES (1034,250604,34,'libretto','retransmitting','tutor','');
+INSERT INTO t2 VALUES (1035,250605,34,'occurred','landslide','boulevard','');
+INSERT INTO t2 VALUES (1036,251001,34,'Lagos','Eiffel','shuttered','');
+INSERT INTO t2 VALUES (1037,251002,34,'rats','absentee','quotes','A');
+INSERT INTO t2 VALUES (1038,251003,34,'bankruptcies','aye','Caltech','');
+INSERT INTO t2 VALUES (1039,251004,34,'crying','forked','Mossberg','');
+INSERT INTO t2 VALUES (1040,251005,34,'unexpected','Peruvianizes','kept','');
+INSERT INTO t2 VALUES (1041,251301,34,'accessed','clerked','roundly','');
+INSERT INTO t2 VALUES (1042,251302,34,'colorful','tutor','features','A');
+INSERT INTO t2 VALUES (1043,251303,34,'versatility','boulevard','imaginable','A');
+INSERT INTO t2 VALUES (1044,251304,34,'cosy','shuttered','controller','');
+INSERT INTO t2 VALUES (1045,251305,34,'Darius','quotes','racial','');
+INSERT INTO t2 VALUES (1046,251401,34,'mastering','Caltech','uprisings','A');
+INSERT INTO t2 VALUES (1047,251402,34,'Asiaticizations','Mossberg','narrowed','A');
+INSERT INTO t2 VALUES (1048,251403,34,'offerers','kept','cannot','A');
+INSERT INTO t2 VALUES (1049,251404,34,'uncles','roundly','vest','');
+INSERT INTO t2 VALUES (1050,251405,34,'sleepwalk','features','famine','');
+INSERT INTO t2 VALUES (1051,251406,34,'Ernestine','imaginable','sugars','');
+INSERT INTO t2 VALUES (1052,251801,34,'checksumming','controller','exterminated','A');
+INSERT INTO t2 VALUES (1053,251802,34,'stopped','racial','belays','');
+INSERT INTO t2 VALUES (1054,252101,34,'sicker','uprisings','Hodges','A');
+INSERT INTO t2 VALUES (1055,252102,34,'Italianization','narrowed','translatable','');
+INSERT INTO t2 VALUES (1056,252301,34,'alphabetic','cannot','duality','A');
+INSERT INTO t2 VALUES (1057,252302,34,'pharmaceutic','vest','recording','A');
+INSERT INTO t2 VALUES (1058,252303,34,'creator','famine','rouses','A');
+INSERT INTO t2 VALUES (1059,252304,34,'chess','sugars','poison','');
+INSERT INTO t2 VALUES (1060,252305,34,'charcoal','exterminated','attitude','');
+INSERT INTO t2 VALUES (1061,252306,34,'Epiphany','belays','dusted','');
+INSERT INTO t2 VALUES (1062,252307,34,'bulldozes','Hodges','encompasses','');
+INSERT INTO t2 VALUES (1063,252308,34,'Pygmalion','translatable','presentation','');
+INSERT INTO t2 VALUES (1064,252309,34,'caressing','duality','Kantian','');
+INSERT INTO t2 VALUES (1065,256001,34,'Palestine','recording','imprecision','A');
+INSERT INTO t2 VALUES (1066,256002,34,'regimented','rouses','saving','');
+INSERT INTO t2 VALUES (1067,256003,34,'scars','poison','maternal','');
+INSERT INTO t2 VALUES (1068,256004,34,'realest','attitude','hewed','');
+INSERT INTO t2 VALUES (1069,256005,34,'diffusing','dusted','kerosene','');
+INSERT INTO t2 VALUES (1070,258001,34,'clubroom','encompasses','Cubans','');
+INSERT INTO t2 VALUES (1071,258002,34,'Blythe','presentation','photographers','');
+INSERT INTO t2 VALUES (1072,258003,34,'ahead','Kantian','nymph','A');
+INSERT INTO t2 VALUES (1073,258004,34,'reviver','imprecision','bedlam','A');
+INSERT INTO t2 VALUES (1074,258005,34,'retransmitting','saving','north','A');
+INSERT INTO t2 VALUES (1075,258006,34,'landslide','maternal','Schoenberg','A');
+INSERT INTO t2 VALUES (1076,258007,34,'Eiffel','hewed','botany','A');
+INSERT INTO t2 VALUES (1077,258008,34,'absentee','kerosene','curs','');
+INSERT INTO t2 VALUES (1078,258009,34,'aye','Cubans','solidification','');
+INSERT INTO t2 VALUES (1079,258010,34,'forked','photographers','inheritresses','');
+INSERT INTO t2 VALUES (1080,258011,34,'Peruvianizes','nymph','stiller','');
+INSERT INTO t2 VALUES (1081,258101,68,'clerked','bedlam','t1','A');
+INSERT INTO t2 VALUES (1082,258102,68,'tutor','north','suite','A');
+INSERT INTO t2 VALUES (1083,258103,34,'boulevard','Schoenberg','ransomer','');
+INSERT INTO t2 VALUES (1084,258104,68,'shuttered','botany','Willy','');
+INSERT INTO t2 VALUES (1085,258105,68,'quotes','curs','Rena','A');
+INSERT INTO t2 VALUES (1086,258106,68,'Caltech','solidification','Seattle','A');
+INSERT INTO t2 VALUES (1087,258107,68,'Mossberg','inheritresses','relaxes','A');
+INSERT INTO t2 VALUES (1088,258108,68,'kept','stiller','exclaim','');
+INSERT INTO t2 VALUES (1089,258109,68,'roundly','t1','implicated','A');
+INSERT INTO t2 VALUES (1090,258110,68,'features','suite','distinguish','');
+INSERT INTO t2 VALUES (1091,258111,68,'imaginable','ransomer','assayed','');
+INSERT INTO t2 VALUES (1092,258112,68,'controller','Willy','homeowner','');
+INSERT INTO t2 VALUES (1093,258113,68,'racial','Rena','and','');
+INSERT INTO t2 VALUES (1094,258201,34,'uprisings','Seattle','stealth','');
+INSERT INTO t2 VALUES (1095,258202,34,'narrowed','relaxes','coinciding','A');
+INSERT INTO t2 VALUES (1096,258203,34,'cannot','exclaim','founder','A');
+INSERT INTO t2 VALUES (1097,258204,34,'vest','implicated','environing','');
+INSERT INTO t2 VALUES (1098,258205,34,'famine','distinguish','jewelry','');
+INSERT INTO t2 VALUES (1099,258301,34,'sugars','assayed','lemons','A');
+INSERT INTO t2 VALUES (1100,258401,34,'exterminated','homeowner','brokenness','A');
+INSERT INTO t2 VALUES (1101,258402,34,'belays','and','bedpost','A');
+INSERT INTO t2 VALUES (1102,258403,34,'Hodges','stealth','assurers','A');
+INSERT INTO t2 VALUES (1103,258404,34,'translatable','coinciding','annoyers','');
+INSERT INTO t2 VALUES (1104,258405,34,'duality','founder','affixed','');
+INSERT INTO t2 VALUES (1105,258406,34,'recording','environing','warbling','');
+INSERT INTO t2 VALUES (1106,258407,34,'rouses','jewelry','seriously','');
+INSERT INTO t2 VALUES (1107,228123,37,'poison','lemons','boasted','');
+INSERT INTO t2 VALUES (1108,250606,34,'attitude','brokenness','Chantilly','');
+INSERT INTO t2 VALUES (1109,208405,37,'dusted','bedpost','Iranizes','');
+INSERT INTO t2 VALUES (1110,212101,37,'encompasses','assurers','violinist','');
+INSERT INTO t2 VALUES (1111,218206,37,'presentation','annoyers','extramarital','');
+INSERT INTO t2 VALUES (1112,150401,37,'Kantian','affixed','spates','');
+INSERT INTO t2 VALUES (1113,248212,41,'imprecision','warbling','cloakroom','');
+INSERT INTO t2 VALUES (1114,128026,00,'saving','seriously','gazer','');
+INSERT INTO t2 VALUES (1115,128024,00,'maternal','boasted','hand','');
+INSERT INTO t2 VALUES (1116,128027,00,'hewed','Chantilly','tucked','');
+INSERT INTO t2 VALUES (1117,128025,00,'kerosene','Iranizes','gems','');
+INSERT INTO t2 VALUES (1118,128109,00,'Cubans','violinist','clinker','');
+INSERT INTO t2 VALUES (1119,128705,00,'photographers','extramarital','refiner','');
+INSERT INTO t2 VALUES (1120,126303,00,'nymph','spates','callus','');
+INSERT INTO t2 VALUES (1121,128308,00,'bedlam','cloakroom','leopards','');
+INSERT INTO t2 VALUES (1122,128204,00,'north','gazer','comfortingly','');
+INSERT INTO t2 VALUES (1123,128205,00,'Schoenberg','hand','generically','');
+INSERT INTO t2 VALUES (1124,128206,00,'botany','tucked','getters','');
+INSERT INTO t2 VALUES (1125,128207,00,'curs','gems','sexually','');
+INSERT INTO t2 VALUES (1126,118205,00,'solidification','clinker','spear','');
+INSERT INTO t2 VALUES (1127,116801,00,'inheritresses','refiner','serums','');
+INSERT INTO t2 VALUES (1128,116803,00,'stiller','callus','Italianization','');
+INSERT INTO t2 VALUES (1129,116804,00,'t1','leopards','attendants','');
+INSERT INTO t2 VALUES (1130,116802,00,'suite','comfortingly','spies','');
+INSERT INTO t2 VALUES (1131,128605,00,'ransomer','generically','Anthony','');
+INSERT INTO t2 VALUES (1132,118308,00,'Willy','getters','planar','');
+INSERT INTO t2 VALUES (1133,113702,00,'Rena','sexually','cupped','');
+INSERT INTO t2 VALUES (1134,113703,00,'Seattle','spear','cleanser','');
+INSERT INTO t2 VALUES (1135,112103,00,'relaxes','serums','commuters','');
+INSERT INTO t2 VALUES (1136,118009,00,'exclaim','Italianization','honeysuckle','');
+INSERT INTO t2 VALUES (5136,1118009,00,'exclaim','Italianization','honeysuckle','');
+INSERT INTO t2 VALUES (1137,138011,00,'implicated','attendants','orphanage','');
+INSERT INTO t2 VALUES (1138,138010,00,'distinguish','spies','skies','');
+INSERT INTO t2 VALUES (1139,138012,00,'assayed','Anthony','crushers','');
+INSERT INTO t2 VALUES (1140,068304,00,'homeowner','planar','Puritan','');
+INSERT INTO t2 VALUES (1141,078009,00,'and','cupped','squeezer','');
+INSERT INTO t2 VALUES (1142,108013,00,'stealth','cleanser','bruises','');
+INSERT INTO t2 VALUES (1143,084004,00,'coinciding','commuters','bonfire','');
+INSERT INTO t2 VALUES (1144,083402,00,'founder','honeysuckle','Colombo','');
+INSERT INTO t2 VALUES (1145,084003,00,'environing','orphanage','nondecreasing','');
+INSERT INTO t2 VALUES (1146,088504,00,'jewelry','skies','innocents','');
+INSERT INTO t2 VALUES (1147,088005,00,'lemons','crushers','masked','');
+INSERT INTO t2 VALUES (1148,088007,00,'brokenness','Puritan','file','');
+INSERT INTO t2 VALUES (1149,088006,00,'bedpost','squeezer','brush','');
+INSERT INTO t2 VALUES (1150,148025,00,'assurers','bruises','mutilate','');
+INSERT INTO t2 VALUES (1151,148024,00,'annoyers','bonfire','mommy','');
+INSERT INTO t2 VALUES (1152,138305,00,'affixed','Colombo','bulkheads','');
+INSERT INTO t2 VALUES (1153,138306,00,'warbling','nondecreasing','undeclared','');
+INSERT INTO t2 VALUES (1154,152701,00,'seriously','innocents','displacements','');
+INSERT INTO t2 VALUES (1155,148505,00,'boasted','masked','nieces','');
+INSERT INTO t2 VALUES (1156,158003,00,'Chantilly','file','coeducation','');
+INSERT INTO t2 VALUES (1157,156201,00,'Iranizes','brush','brassy','');
+INSERT INTO t2 VALUES (1158,156202,00,'violinist','mutilate','authenticator','');
+INSERT INTO t2 VALUES (1159,158307,00,'extramarital','mommy','Washoe','');
+INSERT INTO t2 VALUES (1160,158402,00,'spates','bulkheads','penny','');
+INSERT INTO t2 VALUES (1161,158401,00,'cloakroom','undeclared','Flagler','');
+INSERT INTO t2 VALUES (1162,068013,00,'gazer','displacements','stoned','');
+INSERT INTO t2 VALUES (1163,068012,00,'hand','nieces','cranes','');
+INSERT INTO t2 VALUES (1164,068203,00,'tucked','coeducation','masterful','');
+INSERT INTO t2 VALUES (1165,088205,00,'gems','brassy','biracial','');
+INSERT INTO t2 VALUES (1166,068704,00,'clinker','authenticator','steamships','');
+INSERT INTO t2 VALUES (1167,068604,00,'refiner','Washoe','windmills','');
+INSERT INTO t2 VALUES (1168,158502,00,'callus','penny','exploit','');
+INSERT INTO t2 VALUES (1169,123103,00,'leopards','Flagler','riverfront','');
+INSERT INTO t2 VALUES (1170,148026,00,'comfortingly','stoned','sisterly','');
+INSERT INTO t2 VALUES (1171,123302,00,'generically','cranes','sharpshoot','');
+INSERT INTO t2 VALUES (1172,076503,00,'getters','masterful','mittens','');
+INSERT INTO t2 VALUES (1173,126304,00,'sexually','biracial','interdependency','');
+INSERT INTO t2 VALUES (1174,068306,00,'spear','steamships','policy','');
+INSERT INTO t2 VALUES (1175,143504,00,'serums','windmills','unleashing','');
+INSERT INTO t2 VALUES (1176,160201,00,'Italianization','exploit','pretenders','');
+INSERT INTO t2 VALUES (1177,148028,00,'attendants','riverfront','overstatements','');
+INSERT INTO t2 VALUES (1178,148027,00,'spies','sisterly','birthed','');
+INSERT INTO t2 VALUES (1179,143505,00,'Anthony','sharpshoot','opportunism','');
+INSERT INTO t2 VALUES (1180,108014,00,'planar','mittens','showroom','');
+INSERT INTO t2 VALUES (1181,076104,00,'cupped','interdependency','compromisingly','');
+INSERT INTO t2 VALUES (1182,078106,00,'cleanser','policy','Medicare','');
+INSERT INTO t2 VALUES (1183,126102,00,'commuters','unleashing','corresponds','');
+INSERT INTO t2 VALUES (1184,128029,00,'honeysuckle','pretenders','hardware','');
+INSERT INTO t2 VALUES (1185,128028,00,'orphanage','overstatements','implant','');
+INSERT INTO t2 VALUES (1186,018410,00,'skies','birthed','Alicia','');
+INSERT INTO t2 VALUES (1187,128110,00,'crushers','opportunism','requesting','');
+INSERT INTO t2 VALUES (1188,148506,00,'Puritan','showroom','produced','');
+INSERT INTO t2 VALUES (1189,123303,00,'squeezer','compromisingly','criticizes','');
+INSERT INTO t2 VALUES (1190,123304,00,'bruises','Medicare','backer','');
+INSERT INTO t2 VALUES (1191,068504,00,'bonfire','corresponds','positively','');
+INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
+INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
+--enable_query_log
+
+#
+# Search with a key
+#
+
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+select fld3 from t2 where fld3 like "%cultivation" ;
+
+#
+# Search with a key using sorting and limit the same time
+#
+
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+
+select fld3 from t2 order by fld3 desc limit 10;
+select fld3 from t2 order by fld3 desc limit 5;
+select fld3 from t2 order by fld3 desc limit 5,5;
+
+#
+# Search with a key having a constant with each unique key.
+# The table is read directly with read-next on fld3
+#
+
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+
+#
+# Test using INDEX and IGNORE INDEX
+#
+
+explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+
+explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
+explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
+
+explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
+explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
+
+#
+# NOTE NOTE NOTE
+# The next should give an error
+#
+
+-- error 1072
+explain select fld3 from t2 ignore index (fld3,not_used);
+-- error 1072
+explain select fld3 from t2 use index (not_used);
+
+#
+# Test sorting with a used key (there is no need for sorting)
+#
+
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+
+#
+# Search with a key having a constant with many occurrences
+# The table is read directly with read-next having fld3 to get the
+# occurrences
+#
+
+select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
+
+#
+# Search with bunched 'or's.
+# If one can limit the key to a certain interval only the possible
+# alternatives will be gone through
+#
+
+select fld1 from t2 where fld1=250501 or fld1="250502";
+explain select fld1 from t2 where fld1=250501 or fld1="250502";
+select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+
+#
+# Search with a key with LIKE constant
+# If the like starts with a certain letter key will be used.
+#
+
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+select fld1,fld3 from t2 where fld1 like "25050%";
+select fld1,fld3 from t2 where fld1 like "25050_";
+
+#
+# Search using distinct. An automatic grouping will be done over all the fields,
+# if only distinct is used. In any other case a temporary table will always
+# be created. If only the field used for sorting is from the main register,
+# it will be sorted first before the distinct table is created.
+#
+
+select distinct companynr from t2;
+select distinct companynr from t2 order by companynr;
+select distinct companynr from t2 order by companynr desc;
+select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
+
+select distinct fld3 from t2 where companynr = 34 order by fld3;
+select distinct fld3 from t2 limit 10;
+select distinct fld3 from t2 having fld3 like "A%" limit 10;
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
+
+# make a big table.
+
+create table t3 (
+ period int not null,
+ name char(32) not null,
+ companynr int not null,
+ price double(11,0),
+ price2 double(11,0),
+ key (period),
+ key (name)
+);
+
+--disable_query_log
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1001,"Iranizes",37,5987435,234724);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1002,"violinist",37,28357832,8723648);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1003,"extramarital",37,39654943,235872);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1004,"spates",78,726498,72987523);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1005,"cloakroom",78,98439034,823742);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1006,"gazer",101,834598,27348324);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1007,"hand",154,983543950,29837423);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1008,"tucked",311,234298,3275892);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1009,"gems",447,2374834,9872392);
+INSERT INTO t3 (period,name,companynr,price,price2) VALUES (1010,"clinker",512,786542,76234234);
+--enable_query_log
+
+create temporary table tmp engine = myisam select * from t3;
+
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+#insert into tmp select * from t3;
+#insert into t3 select * from tmp;
+
+alter table t3 add t2nr int not null auto_increment primary key first;
+
+drop table tmp;
+
+# big table done
+
+SET SQL_BIG_TABLES=1;
+select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
+SET SQL_BIG_TABLES=0;
+select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
+select distinct fld5 from t2 limit 10;
+
+#
+# Force use of remove_dupp
+#
+
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+SET SQL_BIG_TABLES=1; # Force use of MyISAM
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+SET SQL_BIG_TABLES=0;
+select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
+
+#
+# A big order by that should trigger a merge in filesort
+#
+
+select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
+
+#
+# Search with distinct and order by with many table.
+#
+
+select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
+
+#
+# Here the last fld3 is optimized away from the order by
+#
+
+explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
+
+#
+# Some test with ORDER BY and limit
+#
+
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+
+#
+# Search with a constant table.
+#
+
+select period from t1;
+select period from t1 where period=1900;
+select fld3,period from t1,t2 where fld1 = 011401 order by period;
+
+#
+# Search with a constant table and several keyparts. (Rows are read only once
+# in the beginning of the search)
+#
+
+select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
+
+explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
+
+#
+# Search with a constant table and several rows from another table
+#
+
+select fld3,period from t2,t1 where companynr*10 = 37*10;
+
+#
+# Search with a table reference and without a key.
+# t3 will be the main table.
+#
+
+select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
+
+#
+# Search with an interval on a table with full key on reference table.
+# Here t2 will be the main table and only records matching the
+# t2nr will be checked.
+#
+
+select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
+
+#
+# We need another table for join stuff..
+#
+
+create table t4 (
+ companynr tinyint(2) unsigned zerofill NOT NULL default '00',
+ companyname char(30) NOT NULL default '',
+ PRIMARY KEY (companynr),
+ UNIQUE KEY companyname(companyname)
+) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+
+--disable_query_log
+INSERT INTO t4 (companynr, companyname) VALUES (29,'company 1');
+INSERT INTO t4 (companynr, companyname) VALUES (34,'company 2');
+INSERT INTO t4 (companynr, companyname) VALUES (36,'company 3');
+INSERT INTO t4 (companynr, companyname) VALUES (37,'company 4');
+INSERT INTO t4 (companynr, companyname) VALUES (40,'company 5');
+INSERT INTO t4 (companynr, companyname) VALUES (41,'company 6');
+INSERT INTO t4 (companynr, companyname) VALUES (53,'company 7');
+INSERT INTO t4 (companynr, companyname) VALUES (58,'company 8');
+INSERT INTO t4 (companynr, companyname) VALUES (65,'company 9');
+INSERT INTO t4 (companynr, companyname) VALUES (68,'company 10');
+INSERT INTO t4 (companynr, companyname) VALUES (50,'company 11');
+INSERT INTO t4 (companynr, companyname) VALUES (00,'Unknown');
+--enable_query_log
+
+#
+# Test of stright join to force a full join.
+#
+
+select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+
+select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+
+#
+# Full join (same alias)
+#
+
+select * from t1,t1 t12;
+select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
+
+#
+# Test of left join.
+#
+insert into t2 (fld1, companynr) values (999999,99);
+
+select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
+explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
+
+select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+select count(*) from t2 left join t4 using (companynr) where companynr is not null;
+explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
+delete from t2 where fld1=999999;
+
+#
+# Test left join optimization
+
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
+
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
+# Following can't be optimized
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
+
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
+explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
+
+#
+# Joins with forms.
+#
+
+select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+
+#
+# Search using 'or' with the same referens group.
+# An interval search will be done first with the first table and after that
+# the other table is referenced with a key with a 'test if key in use' for
+# each record
+#
+
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
+
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+
+#
+# Test of many parenthesis levels
+#
+
+select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
+select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
+
+select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
+
+select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
+
+select fld1 from t2 where fld1 between 250502 and 250504;
+
+select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
+
+#
+# Group on one table.
+# optimizer: sort table by group and send rows.
+#
+
+select count(*) from t1;
+select companynr,count(*),sum(fld1) from t2 group by companynr;
+select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
+select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
+select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
+select distinct mod(companynr,10) from t4 group by companynr;
+select distinct 1 from t4 group by companynr;
+select count(distinct fld1) from t2;
+select companynr,count(distinct fld1) from t2 group by companynr;
+select companynr,count(*) from t2 group by companynr;
+select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
+select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
+select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
+select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
+
+#
+# group with where on a key field
+#
+
+select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
+select name,count(*) from t3 where name='cloakroom' group by name;
+select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
+select count(*) from t3 where name='cloakroom' and price2=823742;
+select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
+select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
+select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+
+#
+# Group with extra not group fields.
+#
+
+select companynr|0,companyname from t4 group by 1;
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
+select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+
+#
+# Calculation with group functions
+#
+
+select sum(Period)/count(*) from t1;
+select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
+select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
+
+#
+# Group with order on not first table
+# optimizer: sort table by group and write group records to tmp table.
+# sort tmp_table and send rows.
+#
+
+select companynr,count(*) from t2 group by companynr order by 2 desc;
+select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
+select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
+
+#
+# group by with many tables
+# optimizer: create tmp table with group-by uniq index.
+# write with update to tmp table.
+# sort tmp table according to order (or group if no order)
+# send rows
+#
+
+select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
+select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
+
+#
+# group with many tables and long group on many tables. group on formula
+# optimizer: create tmp table with neaded fields
+# sort tmp table by group and calculate sums to new table
+# if different order by than group, sort tmp table
+# send rows
+#
+
+select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
+
+#
+# WHERE const folding
+# optimize: If there is a "field = const" part in the where, change all
+# instances of field in the and level to const.
+# All instances of const = const are checked once and removed.
+#
+
+#
+# Where -> t3.t2nr = 98005 and t2.fld1 = 98005
+#
+
+select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
+
+select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
+
+explain select fld3 from t2 where 1>2 or 2>3;
+explain select fld3 from t2 where fld1=fld1;
+
+#
+# HAVING
+#
+
+select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
+select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
+select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
+select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
+
+#
+# MIN(), MAX() and COUNT() optimizing
+#
+
+select count(*) from t2;
+select count(*) from t2 where fld1 < 098024;
+# PS does correct pre-zero here. MySQL can't do it as it returns a number.
+--disable_ps_protocol
+select min(fld1) from t2 where fld1>= 098024;
+--enable_ps_protocol
+select max(fld1) from t2 where fld1>= 098024;
+select count(*) from t3 where price2=76234234;
+select count(*) from t3 where companynr=512 and price2=76234234;
+explain select min(fld1),max(fld1),count(*) from t2;
+# PS does correct pre-zero here. MySQL can't do it as it returns a number.
+--disable_ps_protocol
+select min(fld1),max(fld1),count(*) from t2;
+--enable_ps_protocol
+select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
+select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
+select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
+select max(t2nr) from t3 where price=983543950;
+
+#
+# Test of alias
+#
+
+select t1.period from t3 = t1 limit 1;
+select t1.period from t1 as t1 limit 1;
+select t1.period as "Nuvarande period" from t1 as t1 limit 1;
+select period as ok_period from t1 limit 1;
+select period as ok_period from t1 group by ok_period limit 1;
+select 1+1 as summa from t1 group by summa limit 1;
+select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
+
+#
+# Some simple show commands
+#
+
+show tables;
+show tables from test like "s%";
+show tables from test like "t?";
+# We mask out the Privileges column because it differs with embedded server
+--replace_column 8 #
+show full columns from t2;
+--replace_column 8 #
+show full columns from t2 from test like 'f%';
+--replace_column 8 #
+show full columns from t2 from test like 's%';
+show keys from t2;
+
+drop table t4, t3, t2, t1;
+
+
+CREATE TABLE t1 (
+ cont_nr int(11) NOT NULL auto_increment,
+ ver_nr int(11) NOT NULL default '0',
+ aufnr int(11) NOT NULL default '0',
+ username varchar(50) NOT NULL default '',
+ hdl_nr int(11) NOT NULL default '0',
+ eintrag date NOT NULL default '0000-00-00',
+ st_klasse varchar(40) NOT NULL default '',
+ st_wert varchar(40) NOT NULL default '',
+ st_zusatz varchar(40) NOT NULL default '',
+ st_bemerkung varchar(255) NOT NULL default '',
+ kunden_art varchar(40) NOT NULL default '',
+ mcbs_knr int(11) default NULL,
+ mcbs_aufnr int(11) NOT NULL default '0',
+ schufa_status char(1) default '?',
+ bemerkung text,
+ wirknetz text,
+ wf_igz int(11) NOT NULL default '0',
+ tarifcode varchar(80) default NULL,
+ recycle char(1) default NULL,
+ sim varchar(30) default NULL,
+ mcbs_tpl varchar(30) default NULL,
+ emp_nr int(11) NOT NULL default '0',
+ laufzeit int(11) default NULL,
+ hdl_name varchar(30) default NULL,
+ prov_hdl_nr int(11) NOT NULL default '0',
+ auto_wirknetz varchar(50) default NULL,
+ auto_billing varchar(50) default NULL,
+ touch timestamp NOT NULL,
+ kategorie varchar(50) default NULL,
+ kundentyp varchar(20) NOT NULL default '',
+ sammel_rech_msisdn varchar(30) NOT NULL default '',
+ p_nr varchar(9) NOT NULL default '',
+ suffix char(3) NOT NULL default '',
+ PRIMARY KEY (cont_nr),
+ KEY idx_aufnr(aufnr),
+ KEY idx_hdl_nr(hdl_nr),
+ KEY idx_st_klasse(st_klasse),
+ KEY ver_nr(ver_nr),
+ KEY eintrag_idx(eintrag),
+ KEY emp_nr_idx(emp_nr),
+ KEY wf_igz(wf_igz),
+ KEY touch(touch),
+ KEY hdl_tag(eintrag,hdl_nr),
+ KEY prov_hdl_nr(prov_hdl_nr),
+ KEY mcbs_aufnr(mcbs_aufnr),
+ KEY kundentyp(kundentyp),
+ KEY p_nr(p_nr,suffix)
+) ENGINE=MyISAM;
+
+INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
+INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+
+--disable_ps_protocol
+SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
+--enable_ps_protocol
+drop table t1;
diff --git a/mysql-test/include/gis_generic.inc b/mysql-test/include/gis_generic.inc
new file mode 100644
index 00000000000..e5e7283e0e6
--- /dev/null
+++ b/mysql-test/include/gis_generic.inc
@@ -0,0 +1,180 @@
+--source include/have_geometry.inc
+
+#
+# Spatial objects
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+--enable_warnings
+
+CREATE TABLE gis_point (fid INTEGER, g POINT);
+CREATE TABLE gis_line (fid INTEGER, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER, g GEOMETRY);
+
+SHOW CREATE TABLE gis_point;
+SHOW FIELDS FROM gis_point;
+SHOW FIELDS FROM gis_line;
+SHOW FIELDS FROM gis_polygon;
+SHOW FIELDS FROM gis_multi_point;
+SHOW FIELDS FROM gis_multi_line;
+SHOW FIELDS FROM gis_multi_polygon;
+SHOW FIELDS FROM gis_geometrycollection;
+SHOW FIELDS FROM gis_geometry;
+
+
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+
+
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+explain extended select X(g),Y(g) FROM gis_point;
+
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+
+#
+# Check that ALTER TABLE doesn't loose geometry type
+#
+CREATE TABLE t1 (
+ gp point,
+ ln linestring,
+ pg polygon,
+ mp multipoint,
+ mln multilinestring,
+ mpg multipolygon,
+ gc geometrycollection,
+ gm geometry
+);
+
+SHOW FIELDS FROM t1;
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+DROP TABLE t1;
+
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+-- error 1416
+insert into t1 values ('Garbage');
+-- error 1416
+insert IGNORE into t1 values ('Garbage');
+
+drop table t1;
+
+create table t1 (fl geometry);
+--error 1416
+insert into t1 values (1);
+--error 1416
+insert into t1 values (1.11);
+--error 1416
+insert into t1 values ("qwerty");
+--error 1416
+insert into t1 values (pointfromtext('point(1,1)'));
+
+drop table t1;
+
+# End of 5.0 tests
diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc
index f7fb942e83e..262f66076a8 100644
--- a/mysql-test/include/have_archive.inc
+++ b/mysql-test/include/have_archive.inc
@@ -1,4 +1,4 @@
--- require r/have_archive.require
-disable_query_log;
+--require r/have_archive.require
+--disable_query_log
show variables like "have_archive";
-enable_query_log;
+--enable_query_log
diff --git a/mysql-test/include/have_geometry.inc b/mysql-test/include/have_geometry.inc
index 169c3a41ee7..f0ec22af172 100644
--- a/mysql-test/include/have_geometry.inc
+++ b/mysql-test/include/have_geometry.inc
@@ -1,4 +1,4 @@
--- require r/have_geometry.require
-disable_query_log;
+--require r/have_geometry.require
+--disable_query_log
show variables like "have_geometry";
-enable_query_log;
+--enable_query_log
diff --git a/mysql-test/include/have_openssl_1.inc b/mysql-test/include/have_openssl_1.inc
deleted file mode 100644
index 887309c7e23..00000000000
--- a/mysql-test/include/have_openssl_1.inc
+++ /dev/null
@@ -1,4 +0,0 @@
--- require r/have_openssl_1.require
-disable_query_log;
-SHOW STATUS LIKE 'Ssl_cipher';
-enable_query_log;
diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql
index b366a429ab2..fd7b035e038 100644
--- a/mysql-test/lib/init_db.sql
+++ b/mysql-test/lib/init_db.sql
@@ -62,7 +62,7 @@ comment='Host privileges; Merged with database privileges';
CREATE TABLE user (
Host char(60) binary DEFAULT '' NOT NULL,
User char(16) binary DEFAULT '' NOT NULL,
- Password binary(41) DEFAULT '' NOT NULL,
+ Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL,
Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index ca984d37ecf..fb622f2bbb3 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -68,7 +68,7 @@ sub collect_test_cases ($) {
#
# Otherwise, try to guess the target component.
- if ( defined $component_id )
+ if ( $component_id )
{
if ( ! -f "$testdir/$elem")
{
@@ -80,11 +80,11 @@ sub collect_test_cases ($) {
my $mysqld_test_exists = -f "$testdir/$tname.test";
my $im_test_exists = -f "$testdir/$tname.imtest";
- if ( $mysqld_test_exists && $im_test_exists )
+ if ( $mysqld_test_exists and $im_test_exists )
{
mtr_error("Ambiguos test case name ($tname)");
}
- elsif ( ! $mysqld_test_exists && !$im_test_exists )
+ elsif ( ! $mysqld_test_exists and ! $im_test_exists )
{
mtr_error("Test case $tname is not found");
}
@@ -405,7 +405,7 @@ sub collect_one_test_case($$$$$$$) {
"Instance Manager tests are not run with --ps-protocol. " .
"Test case '$tname' is skipped.");
}
- elsif ( !$::exe_im )
+ elsif ( $::opt_skip_im )
{
$tinfo->{'skip'}= 1;
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index eb60df4a5cb..b3a243444c1 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -360,6 +360,7 @@ sub mtr_kill_leftovers () {
# First, kill all masters and slaves that would conflict with
# this run. Make sure to remove the PID file, if any.
+ # FIXME kill IM manager first, else it will restart the servers, how?!
my @args;
@@ -367,6 +368,16 @@ sub mtr_kill_leftovers () {
{
push(@args,{
pid => 0, # We don't know the PID
+ pidfile => $::instance_manager->{'instances'}->[$idx]->{'path_pid'},
+ sockfile => $::instance_manager->{'instances'}->[$idx]->{'path_sock'},
+ port => $::instance_manager->{'instances'}->[$idx]->{'port'},
+ });
+ }
+
+ for ( my $idx; $idx < 2; $idx++ )
+ {
+ push(@args,{
+ pid => 0, # We don't know the PID
pidfile => $::master->[$idx]->{'path_mypid'},
sockfile => $::master->[$idx]->{'path_mysock'},
port => $::master->[$idx]->{'path_myport'},
diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c
index 88e68dfc27e..e5d1be42f95 100644
--- a/mysql-test/my_manage.c
+++ b/mysql-test/my_manage.c
@@ -230,7 +230,7 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)),
char *user, char *password, int port,char *tmp_dir)
{
arg_list_t al;
- int err= 0, i;
+ int err= 0;
char trash[FN_REFLEN];
/* mysqladmin file */
@@ -244,16 +244,11 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)),
add_arg(&al, "--user=%s", user);
add_arg(&al, "--password=%s", password);
add_arg(&al, "--silent");
+ add_arg(&al, "--host=localhost");
-/* #ifdef NOT_USED */
#ifndef __NETWARE__
- add_arg(&al, "-O");
- add_arg(&al, "connect_timeout=10");
+ add_arg(&al, "--connect_timeout=10");
add_arg(&al, "-w");
-#endif
-
- add_arg(&al, "--host=localhost");
-#ifndef __NETWARE__
add_arg(&al, "--protocol=tcp");
#endif
add_arg(&al, "ping");
@@ -263,9 +258,14 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)),
-- we will try the ping multiple times
*/
#ifndef __WIN__
- for (i= 0; (i < TRY_MAX)
- && (err= spawn(mysqladmin_file, &al, TRUE, NULL,
- trash, NULL, NULL)); i++) sleep(1);
+ {
+ int i;
+ for (i= 0;
+ (i < TRY_MAX) && (err= spawn(mysqladmin_file, &al, TRUE, NULL,
+ trash, NULL, NULL));
+ i++)
+ sleep(1);
+ }
#else
err= spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL);
#endif
diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl
new file mode 100755
index 00000000000..899dd06a746
--- /dev/null
+++ b/mysql-test/mysql-stress-test.pl
@@ -0,0 +1,1148 @@
+#!/usr/bin/perl
+# ======================================================================
+# MySQL server stress test system
+# ======================================================================
+#
+##########################################################################
+#
+# SCENARIOS AND REQUIREMENTS
+#
+# The system should perform stress testing of MySQL server with
+# following requirements and basic scenarios:
+#
+# Basic requirements:
+#
+# Design of stress script should allow one:
+#
+# - to use for stress testing mysqltest binary as test engine
+# - to use for stress testing both regular test suite and any
+# additional test suites (e.g. mysql-test-extra-5.0)
+# - to specify files with lists of tests both for initialization of
+# stress db and for further testing itself
+# - to define number of threads that will be concurrently used in testing
+# - to define limitations for test run. e.g. number of tests or loops
+# for execution or duration of testing, delay between test executions, etc.
+# - to get readable log file which can be used for identification of
+# errors arose during testing
+#
+# Basic scenarios:
+#
+# * It should be possible to run stress script in standalone mode
+# which will allow to create various scenarios of stress workloads:
+#
+# simple ones:
+#
+# box #1:
+# - one instance of script with list of tests #1
+#
+# and more advanced ones:
+#
+# box #1:
+# - one instance of script with list of tests #1
+# - another instance of script with list of tests #2
+# box #2:
+# - one instance of script with list of tests #3
+# - another instance of script with list of tests #4
+# that will recreate whole database to back it to clean
+# state
+#
+# One kind of such complex scenarios maybe continued testing
+# when we want to run stress tests from many boxes with various
+# lists of tests that will last very long time. And in such case
+# we need some wrapper for MySQL server that will restart it in
+# case of crashes.
+#
+# * It should be possible to run stress script in ad-hoc mode from
+# shell or perl versions of mysql-test-run. This allows developers
+# to reproduce and debug errors that was found in continued stress
+# testing
+#
+########################################################################
+
+use Config;
+
+if (!defined($Config{useithreads}))
+{
+ die <<EOF;
+It is unable to run threaded version of stress test on this system
+due to disabled ithreads. Please check that installed perl binary
+was built with support of ithreads.
+EOF
+}
+
+use threads;
+use threads::shared;
+
+use IO::Socket;
+use Sys::Hostname;
+use File::Copy;
+use File::Spec;
+use File::Find;
+use File::Basename;
+use File::Path;
+use Cwd;
+
+use Data::Dumper;
+use Getopt::Long;
+
+my $stress_suite_version="1.0";
+
+$|=1;
+
+$opt_server_host="";
+$opt_server_logs_dir="";
+$opt_help="";
+$opt_server_port="";
+$opt_server_socket="";
+$opt_server_user="";
+$opt_server_password="";
+$opt_server_database="";
+$opt_cleanup="";
+$opt_verbose="";
+$opt_log_error_details="";
+
+
+$opt_suite="main";
+$opt_stress_suite_basedir="";
+$opt_stress_basedir="";
+$opt_stress_datadir="";
+$opt_test_suffix="";
+
+$opt_stress_mode="random";
+
+$opt_loop_count=0;
+$opt_test_count=0;
+$opt_test_duration=0;
+$opt_abort_on_error=0;
+$opt_sleep_time = 0;
+$opt_threads=1;
+$pid_file="mysql_stress_test.pid";
+$opt_mysqltest= ($^O =~ /mswin32/i) ? "mysqltest.exe" : "mysqltest";
+$opt_check_tests_file="";
+@mysqltest_args=("--silent", "-v", "--skip-safemalloc");
+
+# Client ip address
+$client_ip=inet_ntoa((gethostbyname(hostname()))[4]);
+$client_ip=~ s/\.//g;
+
+%tests_files=(client => {mtime => 0, data => []},
+ initdb => {mtime => 0, data => []});
+
+# Error codes and sub-strings with corresponding severity
+#
+# S1 - Critical errors - cause immediately abort of testing. These errors
+# could be caused by server crash or impossibility
+# of test execution
+#
+# S2 - Serious errors - these errors are bugs for sure as it knowns that
+# they shouldn't appear during stress testing
+#
+# S3 - Non-seriuos errros - these errors could be caused by fact that
+# we execute simultaneously statements that
+# affect tests executed by other threads
+
+%error_strings = ( 'Failed in mysql_real_connect()' => S1,
+ 'not found (Errcode: 2)' => S1 );
+
+%error_codes = ( 1012 => S2, 1015 => S2, 1021 => S2,
+ 1027 => S2, 1037 => S2, 1038 => S2,
+ 1039 => S2, 1040 => S2, 1046 => S2,
+ 1180 => S2, 1181 => S2, 1203 => S2,
+ 1205 => S2, 1206 => S2, 1207 => S2,
+ 1223 => S2, 2013 => S1);
+
+share(%test_counters);
+%test_counters=( loop_count => 0, test_count=>0);
+
+share($exiting);
+$exiting=0;
+
+share($test_counters_lock);
+$test_counters_lock=0;
+share($log_file_lock);
+$log_file_lock=0;
+
+$SIG{INT}= \&sig_INT_handler;
+$SIG{TERM}= \&sig_TERM_handler;
+
+
+GetOptions("server-host=s", "server-logs-dir=s", "server-port=s",
+ "server-socket=s", "server-user=s", "server-password=s",
+ "server-database=s",
+ "stress-suite-basedir=s", "suite=s", "stress-init-file:s",
+ "stress-tests-file:s", "stress-basedir=s", "stress-mode=s",
+ "stress-datadir=s",
+ "threads=s", "sleep-time=s", "loop-count=i", "test-count=i",
+ "test-duration=i", "test-suffix=s", "check-tests-file",
+ "verbose", "log-error-details", "cleanup", "mysqltest=s",
+ "abort-on-error", "help") || usage();
+
+usage() if ($opt_help);
+
+#$opt_abort_on_error=1;
+
+$test_dirname=get_timestamp();
+$test_dirname.="-$opt_test_suffix" if ($opt_test_suffix ne '');
+
+print <<EOF;
+#############################################################
+ CONFIGURATION STAGE
+#############################################################
+EOF
+
+if ($opt_stress_basedir eq '' || $opt_stress_suite_basedir eq '' ||
+ $opt_server_logs_dir eq '')
+{
+ die <<EOF;
+
+Options --stress-basedir, --stress-suite-basedir and --server-logs-dir are
+required. Please use these options to specify proper basedir for
+client, test suite and location of server logs.
+
+stress-basedir: '$opt_stress_basedir'
+stress-suite-basedir: '$opt_stress_suite_basedir'
+server-logs-dir: '$opt_server_logs_dir'
+
+EOF
+}
+
+#Workaround for case when we got relative but not absolute path
+$opt_stress_basedir=File::Spec->rel2abs($opt_stress_basedir);
+$opt_stress_suite_basedir=File::Spec->rel2abs($opt_stress_suite_basedir);
+$opt_server_logs_dir=File::Spec->rel2abs($opt_server_logs_dir);
+
+if ($opt_stress_datadir ne '')
+{
+ $opt_stress_datadir=File::Spec->rel2abs($opt_stress_datadir);
+}
+
+if (! -d "$opt_stress_basedir")
+{
+ die <<EOF;
+
+Directory '$opt_stress_basedir' does not exist.
+Use --stress-basedir option to specify proper basedir for client
+
+EOF
+}
+
+if (!-d $opt_stress_suite_basedir)
+{
+ die <<EOF;
+
+Directory '$opt_stress_suite_basedir' does not exist.
+Use --stress-suite-basedir option to specify proper basedir for test suite
+
+EOF
+}
+
+$test_dataset_dir=$opt_stress_suite_basedir;
+if ($opt_stress_datadir ne '')
+{
+ if (-d $opt_stress_datadir)
+ {
+ $test_dataset_dir=$opt_stress_datadir;
+
+ }
+ else
+ {
+ die <<EOF;
+Directory '$opt_stress_datadir' not exists. Please specify proper one
+with --stress-datadir option.
+EOF
+ }
+}
+
+if ($^O =~ /mswin32/i)
+{
+ $test_dataset_dir=~ s/\\/\\\\/g;
+}
+else
+{
+ $test_dataset_dir.="/";
+}
+
+
+
+if (!-d $opt_server_logs_dir)
+{
+ die <<EOF;
+
+Directory server-logs-dir '$opt_server_logs_dir' does not exist.
+Use --server-logs-dir option to specify proper directory for storing
+logs
+
+EOF
+}
+else
+{
+ #Create sub-directory for test session logs
+ mkpath(File::Spec->catdir($opt_server_logs_dir, $test_dirname), 0, 0755);
+ #Define filename of global session log file
+ $stress_log_file=File::Spec->catfile($opt_server_logs_dir, $test_dirname,
+ "mysql-stress-test.log");
+}
+
+if ($opt_suite ne '' && $opt_suite ne 'main' && $opt_suite ne 'default')
+{
+ $test_suite_dir=File::Spec->catdir($opt_stress_suite_basedir, "suite", $opt_suite);
+}
+else
+{
+ $test_suite_dir= $opt_stress_suite_basedir;
+}
+
+if (!-d $test_suite_dir)
+{
+ die <<EOF
+
+Directory '$test_suite_dir' does not exist.
+Use --suite options to specify proper dir for test suite
+
+EOF
+}
+
+$test_suite_t_path=File::Spec->catdir($test_suite_dir,'t');
+$test_suite_r_path=File::Spec->catdir($test_suite_dir,'r');
+
+foreach my $suite_dir ($test_suite_t_path, $test_suite_r_path)
+{
+ if (!-d $suite_dir)
+ {
+ die <<EOF;
+
+Directory '$suite_dir' does not exist.
+Please ensure that you specified proper source location for
+test/result files with --stress-suite-basedir option and name
+of test suite with --suite option
+
+EOF
+ }
+}
+
+$test_t_path=File::Spec->catdir($opt_stress_basedir,'t');
+$test_r_path=File::Spec->catdir($opt_stress_basedir,'r');
+
+foreach $test_dir ($test_t_path, $test_r_path)
+{
+ if (-d $test_dir)
+ {
+ if ($opt_cleanup)
+ {
+ #Delete existing 't', 'r', 'r/*' subfolders in $stress_basedir
+ rmtree("$test_dir", 0, 0);
+ print "Cleanup $test_dir\n";
+ }
+ else
+ {
+ die <<EOF;
+Directory '$test_dir' already exist.
+Please ensure that you specified proper location of working dir
+for current test run with --stress-basedir option or in case of staled
+directories use --cleanup option to remove ones
+EOF
+ }
+ }
+ #Create empty 't', 'r' subfolders that will be filled later
+ mkpath("$test_dir", 0, 0777);
+}
+
+if (!defined($opt_stress_tests_file) && !defined($opt_stress_init_file))
+{
+ die <<EOF;
+You should run stress script either with --stress-tests-file or with
+--stress-init-file otions. See help for details.
+EOF
+}
+
+if (defined($opt_stress_tests_file))
+{
+ if ($opt_stress_tests_file eq '')
+ {
+ #Default location of file with set of tests for current test run
+ $tests_files{client}->{filename}= File::Spec->catfile($opt_stress_suite_basedir,
+ "testslist_client.txt");
+ }
+ else
+ {
+ $tests_files{client}->{filename}= $opt_stress_tests_file;
+ }
+
+ if (!-f $tests_files{client}->{filename})
+ {
+ die <<EOF;
+
+File '$tests_files{client}->{filename}' with list of tests not exists.
+Please ensure that this file exists, readable or specify another one with
+--stress-tests-file option.
+
+EOF
+ }
+}
+
+if (defined($opt_stress_init_file))
+{
+ if ($opt_stress_init_file eq '')
+ {
+ #Default location of file with set of tests for current test run
+ $tests_files{initdb}->{filename}= File::Spec->catfile($opt_stress_suite_basedir,
+ "testslist_initdb.txt");
+ }
+ else
+ {
+ $tests_files{initdb}->{filename}= $opt_stress_init_file;
+ }
+
+ if (!-f $tests_files{initdb}->{filename})
+ {
+ die <<EOF;
+
+File '$tests_files{initdb}->{filename}' with list of tests for initialization of database
+for stress test not exists.
+Please ensure that this file exists, readable or specify another one with
+--stress-init-file option.
+
+EOF
+ }
+}
+
+if ($opt_stress_mode !~ /^(random|seq)$/)
+{
+ die <<EOF
+Was specified wrong --stress-mode. Correct values 'random' and 'seq'.
+EOF
+}
+
+if (open(TEST, "$opt_mysqltest -V |"))
+{
+ $mysqltest_version=join("",<TEST>);
+ close(TEST);
+ print "FOUND MYSQLTEST BINARY: ", $mysqltest_version,"\n";
+}
+else
+{
+ die <<EOF;
+ERROR: mysqltest binary $opt_mysqltest not found $!.
+You must either specify file location explicitly using --mysqltest
+option, or make sure path to mysqltest binary is listed
+in your PATH environment variable.
+EOF
+}
+
+#
+#Adding mysql server specific command line options for mysqltest binary
+#
+$opt_server_host= $opt_server_host ? $opt_server_host : "localhost";
+$opt_server_port= $opt_server_port ? $opt_server_port : "3306";
+$opt_server_user= $opt_server_user ? $opt_server_user : "root";
+$opt_server_socket= $opt_server_socket ? $opt_server_socket : "/tmp/mysql.sock";
+$opt_server_database= $opt_server_database ? $opt_server_database : "test";
+
+unshift @mysqltest_args, "--host=$opt_server_host";
+unshift @mysqltest_args, "--port=$opt_server_port";
+unshift @mysqltest_args, "--user=$opt_server_user";
+unshift @mysqltest_args, "--password=$opt_server_password";
+unshift @mysqltest_args, "--socket=$opt_server_socket";
+unshift @mysqltest_args, "--database=$opt_server_database";
+
+#Export variables that could be used in tests
+$ENV{MYSQL_TEST_DIR}=$test_dataset_dir;
+$ENV{MASTER_MYPORT}=$opt_server_port;
+$ENV{MASTER_MYSOCK}=$opt_server_socket;
+
+print <<EOF;
+TEST-SUITE-BASEDIR: $opt_stress_suite_basedir
+SUITE: $opt_suite
+TEST-BASE-DIR: $opt_stress_basedir
+TEST-DATADIR: $test_dataset_dir
+SERVER-LOGS-DIR: $opt_server_logs_dir
+
+THREADS: $opt_threads
+TEST-MODE: $opt_stress_mode
+
+EOF
+
+#-------------------------------------------------------------------------------
+#At this stage we've already checked all needed pathes/files
+#and ready to start the test
+#-------------------------------------------------------------------------------
+
+if (defined($opt_stress_tests_file) || defined($opt_stress_init_file))
+{
+ print <<EOF;
+#############################################################
+ PREPARATION STAGE
+#############################################################
+EOF
+
+ #Copy Test files from network share to 't' folder
+ print "\nCopying Test files from $test_suite_t_path to $test_t_path folder...";
+ find({wanted=>\&copy_test_files, bydepth=>1}, "$test_suite_t_path");
+ print "Done\n";
+
+ #$test_r_path/r0 dir reserved for initdb
+ $count_start= defined($opt_stress_init_file) ? 0 : 1;
+
+ our $r_folder='';
+ print "\nCreating 'r' folder and copying Protocol files to each 'r#' sub-folder...";
+ for($count=$count_start; $count <= $opt_threads; $count++)
+ {
+ $r_folder = File::Spec->catdir($test_r_path, "r".$count);
+ mkpath("$r_folder", 0, 0777);
+
+ find(\&copy_result_files,"$test_suite_r_path");
+ }
+ print "Done\n\n";
+}
+
+if (defined($opt_stress_init_file))
+{
+ print <<EOF;
+#############################################################
+ INITIALIZATION STAGE
+#############################################################
+EOF
+
+ #Set limits for stress db initialization
+ %limits=(loop_count => 1, test_count => undef);
+
+ #Read list of tests from $opt_stress_init_file
+ read_tests_names($tests_files{initdb});
+ test_loop($client_ip, 0, 'seq', $tests_files{initdb});
+ #print Dumper($tests_files{initdb}),"\n";
+ print <<EOF;
+
+Done initialization of stress database by tests from
+$tests_files{initdb}->{filename} file.
+
+EOF
+}
+
+if (defined($opt_stress_tests_file))
+{
+ print <<EOF;
+#############################################################
+ STRESS TEST RUNNING STAGE
+#############################################################
+EOF
+
+ $exiting=0;
+ #Read list of tests from $opt_stress_tests_file
+ read_tests_names($tests_files{client});
+
+ #Reset current counter and set limits
+ %test_counters=( loop_count => 0, test_count=>0);
+ %limits=(loop_count => $opt_loop_count, test_count => $opt_test_count);
+
+ if (($opt_loop_count && $opt_threads > $opt_loop_count) ||
+ ($opt_test_count && $opt_threads > $opt_test_count))
+ {
+ warn <<EOF;
+
+WARNING: Possible inaccuracies in number of executed loops or
+ tests because number of threads bigger than number of
+ loops or tests:
+
+ Threads will be started: $opt_threads
+ Loops will be executed: $opt_loop_count
+ Tests will be executed: $opt_test_count
+
+EOF
+ }
+
+ #Create threads (number depending on the variable )
+ for ($id=1; $id<=$opt_threads && !$exiting; $id++)
+ {
+ $thrd[$id] = threads->create("test_loop", $client_ip, $id,
+ $opt_stress_mode, $tests_files{client});
+
+ print "main: Thread ID $id TID ",$thrd[$id]->tid," started\n";
+ select(undef, undef, undef, 0.5);
+ }
+
+ if ($opt_test_duration)
+ {
+ sleep($opt_test_duration);
+ kill INT, $$; #Interrupt child threads
+ }
+
+ #Let other threads to process INT signal
+ sleep(1);
+
+ for ($id=1; $id<=$opt_threads;$id++)
+ {
+ if (defined($thrd[$id]))
+ {
+ $thrd[$id]->join();
+ }
+ }
+ print "EXIT\n";
+}
+
+sub test_init
+{
+ my ($env)=@_;
+
+ $env->{session_id}=$env->{ip}."_".$env->{thread_id};
+ $env->{r_folder}='r'.$env->{thread_id};
+ $env->{screen_logs}=File::Spec->catdir($opt_server_logs_dir, $test_dirname,
+ "screen_logs", $env->{session_id});
+ $env->{reject_logs}=File::Spec->catdir($opt_server_logs_dir, $test_dirname,
+ "reject_logs", $env->{session_id});
+
+ mkpath($env->{screen_logs}, 0, 0755) unless (-d $env->{screen_logs});
+ mkpath($env->{reject_logs}, 0, 0755) unless (-d $env->{reject_logs});
+
+ $env->{session_log}= File::Spec->catfile($env->{screen_logs}, $env->{session_id}.".log");
+}
+
+sub test_execute
+{
+ my $env= shift;
+ my $test_name= shift;
+
+ my $g_start= "";
+ my $g_end= "";
+ my $mysqltest_cmd= "";
+ my @mysqltest_test_args=();
+ my @stderr=();
+
+ #Get time stamp
+ $g_start = get_timestamp();
+ $env->{errors}={};
+ @{$env->{test_status}}=();
+
+ my $test_file= $test_name.".test";
+ my $result_file= $test_name.".result";
+ my $reject_file = $test_name.'.reject';
+ my $output_file = $env->{session_id}.'_'.$test_name.'_'.$g_start."_".$env->{test_count}.'.txt';
+
+ my $test_filename = File::Spec->catfile($test_t_path, $test_file);
+ my $result_filename = File::Spec->catdir($test_r_path, $env->{r_folder}, $result_file);
+ my $reject_filename = File::Spec->catdir($test_r_path, $env->{r_folder}, $reject_file);
+ my $output_filename = File::Spec->catfile($env->{screen_logs}, $output_file);
+
+
+ push @mysqltest_test_args, "--basedir=$opt_stress_suite_basedir/",
+ "--tmpdir=$opt_stress_basedir",
+ "-x $test_filename",
+ "-R $result_filename",
+ "2>$output_filename";
+
+ $cmd= "$opt_mysqltest --no-defaults ".join(" ", @mysqltest_args)." ".
+ join(" ", @mysqltest_test_args);
+
+ system($cmd);
+
+ $exit_value = $? >> 8;
+ $signal_num = $? & 127;
+ $dumped_core = $? & 128;
+
+ my $tid= threads->self->tid;
+
+ if (-s $output_filename > 0)
+ {
+ #Read stderr for further analysis
+ open (STDERR_LOG, $output_filename) or
+ warn "Can't open file $output_filename";
+ @stderr=<STDERR_LOG>;
+ close(STDERR_LOG);
+
+ if ($opt_verbose)
+ {
+ $session_debug_file="$opt_stress_basedir/error$tid.txt";
+
+ stress_log($session_debug_file,
+ "Something wrong happened during execution of this command line:");
+ stress_log($session_debug_file, "MYSQLTEST CMD - $cmd");
+ stress_log($session_debug_file, "STDERR:".join("",@stderr));
+
+ stress_log($session_debug_file, "EXIT STATUS:\n1. EXIT: $exit_value \n".
+ "2. SIGNAL: $signal_num\n".
+ "3. CORE: $dumped_core\n");
+ }
+ }
+
+ #If something wrong trying to analyse stderr
+ if ($exit_value || $signal_num)
+ {
+ if (@stderr)
+ {
+ foreach my $line (@stderr)
+ {
+ #FIXME: we should handle case when for one sub-string/code
+ # we have several different error messages
+ # Now for both codes/substrings we assume that
+ # first found message will represent error
+
+ #Check line for error codes
+ if (($err_msg, $err_code)= $line=~/failed: ((\d+):.+?$)/)
+ {
+ if (!exists($error_codes{$err_code}))
+ {
+ $severity="S3";
+ $err_code=0;
+ }
+ else
+ {
+ $severity=$error_codes{$err_code};
+ }
+
+ if (!exists($env->{errors}->{$severity}->{$err_code}))
+ {
+ $env->{errors}->{$severity}->{$err_code}=[0, $err_msg];
+ }
+ $env->{errors}->{$severity}->{$err_code}->[0]++;
+ $env->{errors}->{$severity}->{total}++;
+ }
+
+ #Check line for error patterns
+ foreach $err_string (keys %error_strings)
+ {
+ $pattern= quotemeta $err_string;
+ if ($line =~ /$pattern/i)
+ {
+ my $severity= $error_strings{$err_string};
+ if (!exists($env->{errors}->{$severity}->{$err_string}))
+ {
+ $env->{errors}->{$severity}->{$err_string}=[0, $line];
+ }
+ $env->{errors}->{$severity}->{$err_string}->[0]++;
+ $env->{errors}->{$severity}->{total}++;
+ }
+ }
+ }
+ }
+ else
+ {
+ $env->{errors}->{S3}->{'Unknown error'}=
+ [1,"Unknown error. Nothing was output to STDERR"];
+ $env->{errors}->{S3}->{total}=1;
+ }
+ }
+
+ #
+ #FIXME: Here we can perform further analysis of recognized
+ # error codes
+ #
+
+ foreach my $severity (sort {$a cmp $b} keys %{$env->{errors}})
+ {
+ my $total=$env->{errors}->{$severity}->{total};
+ if ($total)
+ {
+ push @{$env->{test_status}}, "Severity $severity: $total";
+ $env->{errors}->{total}=+$total;
+ }
+ }
+
+ #FIXME: Should we take into account $exit_value here?
+ # Now we assume that all stringified errors(i.e. errors without
+ # error codes) which are not exist in %error_string structure
+ # are OK
+ if (!$env->{errors}->{total})
+ {
+ push @{$env->{test_status}},"No Errors. Test Passed OK";
+ }
+
+ log_session_errors($env, $test_file);
+
+ if (!$exiting && ($signal_num == 2 || $signal_num == 15 ||
+ ($opt_abort_on_error && $env->{errors}->{S1} > 0)))
+ {
+ #mysqltest was interrupted with INT or TERM signals or test was
+ #ran with --abort-on-error option and we got errors with severity S1
+ #so we assume that we should cancel testing and exit
+ $exiting=1;
+ print STDERR<<EOF;
+WARNING:
+ mysqltest was interrupted with INT or TERM signals or test was
+ ran with --abort-on-error option and we got errors with severity S1
+ (test cann't connect to the server or server crashed) so we assume that
+ we should cancel testing and exit. Please check log file for this thread
+ in $stress_log_file or
+ inspect below output of the last test case executed with mysqltest to
+ find out cause of error.
+
+ Output of mysqltest:
+ @stderr
+
+EOF
+ }
+
+ if (-e $reject_filename)
+ {
+ move_to_logs($env->{reject_logs}, $reject_filename, $reject_file);
+ }
+
+ if (-e $output_filename)
+ {
+ move_to_logs($env->{screen_logs}, $output_filename, $output_file);
+ }
+
+}
+
+sub test_loop
+{
+ my %client_env=();
+ my $test_name="";
+
+ # KEY for session identification: IP-THREAD_ID
+ $client_env{ip} = shift;
+ $client_env{thread_id} = shift;
+
+ $client_env{mode} = shift;
+ $client_env{tests_file}=shift;
+
+ $client_env{test_seq_idx}=0;
+
+ #Initialize session variables
+ test_init(\%client_env);
+
+LOOP:
+
+ while(!$exiting)
+ {
+ if ($opt_check_tests_file)
+ {
+ #Check if tests_file was modified and reread it in this case
+ read_tests_names($client_env{tests_file}, 0);
+ }
+
+ {
+ lock($test_counters_lock);
+
+ if (($limits{loop_count} && $limits{loop_count} <= $test_counters{loop_count}*1) ||
+ ($limits{test_count} && $limits{test_count} <= $test_counters{test_count}*1) )
+ {
+ $exiting=1;
+ next LOOP;
+ }
+ }
+
+ #Get random file name
+ if (($test_name = get_test(\%client_env)) ne '')
+ {
+ {
+ lock($test_counters_lock);
+
+ #Save current counters values
+ $client_env{loop_count}=$test_counters{loop_count};
+ $client_env{test_count}=$test_counters{test_count};
+ }
+ #Run test and analyze results
+ test_execute(\%client_env, $test_name);
+
+ print "test_loop[".$limits{loop_count}.":".
+ $limits{test_count}." ".
+ $client_env{loop_count}.":".
+ $client_env{test_count}."]:".
+ " TID ".$client_env{thread_id}.
+ " test: '$test_name' ".
+ " Errors: ".join(" ",@{$client_env{test_status}}),"\n";
+ print "\n";
+ }
+
+ sleep($opt_sleep_time) if($opt_sleep_time);
+
+ }
+}
+
+sub move_to_logs ($$$)
+{
+ my $path_to_logs = shift;
+ my $src_file = shift;
+ my $random_filename = shift;
+
+ my $dst_file = File::Spec->catfile($path_to_logs, $random_filename);
+
+ move ($src_file, $dst_file) or warn<<EOF;
+ERROR: move_to_logs: File $src_file cannot be moved to $dst_file: $!
+EOF
+}
+
+sub copy_test_files ()
+{
+ if (/\.test$/)
+ {
+ $src_file = $File::Find::name;
+ #print "## $File::Find::topdir - $File::Find::dir - $src_file\n";
+
+ if ($File::Find::topdir eq $File::Find::dir && $src_file !~ /SCCS/)
+ {
+ $test_filename = basename($src_file);
+ $dst_file = File::Spec->catfile($test_t_path, $test_filename);
+
+ copy($src_file, $dst_file) or die "ERROR: copy_test_files: File cannot be copied. $!";
+ }
+ }
+}
+
+sub copy_result_files ()
+{
+ if (/\.result$/)
+ {
+ $src_file = $File::Find::name;
+
+ if ($File::Find::topdir eq $File::Find::dir && $src_file !~ /SCCS/)
+ {
+ $result_filename = basename($src_file) ;
+ $dst_file = File::Spec->catfile($r_folder, $result_filename);
+
+ copy($src_file, $dst_file) or die "ERROR: copy_result_files: File cannot be copied. $!";
+ }
+ }
+}
+
+sub get_timestamp
+{
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$ydat,$isdst) = localtime();
+
+ return sprintf("%04d%02d%02d%02d%02d%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec);
+}
+
+sub read_tests_names
+{
+ my $tests_file = shift;
+ my $force_load = shift;
+
+ if ($force_load || ( (stat($tests_file->{filename}))[9] != $tests_file->{mtime}) )
+ {
+ open (TEST, $tests_file->{filename}) || die ("Could not open file <".
+ $tests_file->{filename}."> $!");
+ @{$tests_file->{data}}= grep {!/^[#\r\n]|^$/} map { s/[\r\n]//g; $_ } <TEST>;
+
+ close (TEST);
+ $tests_file->{mtime}=(stat(_))[9];
+ }
+}
+
+sub get_random_test
+{
+ my $envt=shift;
+ my $tests= $envt->{tests_file}->{data};
+
+ my $random = int(rand(@{$tests}));
+ my $test = $tests->[$random];
+
+ return $test;
+}
+
+sub get_next_test
+{
+ my $envt=shift;
+ my $test;
+
+ if (@{$envt->{tests_file}->{data}})
+ {
+ $test=${$envt->{tests_file}->{data}}[$envt->{test_seq_idx}];
+ $envt->{test_seq_idx}++;
+ }
+
+ #If we reach bound of array, reset seq index and increment loop counter
+ if ($envt->{test_seq_idx} == scalar(@{$envt->{tests_file}->{data}}))
+ {
+ $envt->{test_seq_idx}=0;
+ {
+ lock($test_counters_lock);
+ $test_counters{loop_count}++;
+ }
+ }
+
+ return $test;
+}
+
+sub get_test
+{
+ my $envt=shift;
+
+ {
+ lock($test_counters_lock);
+ $test_counters{test_count}++;
+ }
+
+ if ($envt->{mode} eq 'seq')
+ {
+ return get_next_test($envt);
+ }
+ elsif ($envt->{mode} eq 'random')
+ {
+ return get_random_test($envt);
+ }
+}
+
+sub stress_log
+{
+ my ($log_file, $line)=@_;
+
+ {
+ open(SLOG,">>$log_file") or warn "Error during opening log file $log_file";
+ print SLOG $line,"\n";
+ close(SLOG);
+ }
+}
+
+sub log_session_errors
+{
+ my ($env, $test_name) = @_;
+ my $line='';
+
+ {
+ lock ($log_file_lock);
+
+ #header in the begining of log file
+ if (!-e $stress_log_file)
+ {
+ stress_log($stress_log_file,
+ "TestID TID Suite TestFileName Found Errors");
+ stress_log($stress_log_file,
+ "=======================================================");
+ }
+
+ $line=sprintf('%6d %3d %10s %20s %s', $env->{test_count}, threads->self->tid,
+ $opt_suite, $test_name,
+ join(",", @{$env->{test_status}}));
+
+ stress_log($stress_log_file, $line);
+ #stress_log_with_lock($stress_log_file, "\n");
+
+ if ($opt_log_error_details)
+ {
+ foreach $severity (sort {$a cmp $b} keys %{$env->{errors}})
+ {
+ stress_log($stress_log_file, "");
+ foreach $error (keys %{$env->{errors}->{$severity}})
+ {
+ if ($error ne 'total')
+ {
+ stress_log($stress_log_file, "$severity: Count:".
+ $env->{errors}->{$severity}->{$error}->[0].
+ " Error:". $env->{errors}->{$severity}->{$error}->[1]);
+ }
+ }
+ }
+ }
+ }
+}
+
+sub sig_INT_handler
+{
+ $SIG{INT}= \&sig_INT_handler;
+ $exiting=1;
+ print STDERR "$$: Got INT signal-------------------------------------------\n";
+
+}
+
+sub sig_TERM_handler
+{
+ $SIG{TERM}= \&sig_TERM_handler;
+ $exiting=1;
+ print STDERR "$$: Got TERM signal\n";
+}
+
+sub usage
+{
+ print <<EOF;
+
+The MySQL Stress suite Ver $stress_suite_version
+
+mysql-stress-test.pl --stress-basedir=<dir> --stress-suite-basedir=<dir> --server-logs-dir=<dir>
+
+--server-host
+--server-port
+--server-socket
+--server-user
+--server-password
+--server-logs-dir
+ Directory where all clients session logs will be stored. Usually
+ this is shared directory associated with server that used
+ in testing
+
+ Required option.
+
+--stress-suite-basedir=<dir>
+ Directory that has r/ t/ subfolders with test/result files
+ which will be used for testing. Also by default we are looking
+ in this directory for 'stress-tests.txt' file which contains
+ list of tests. It is possible to specify other location of this
+ file with --stress-tests-file option.
+
+ Required option.
+
+--stress-basedir=<dir>
+ Working directory for this test run. This directory will be used
+ as temporary location for results tracking during testing
+
+ Required option.
+
+--stress-datadir=<dir>
+ Location of data files used which will be used in testing.
+ By default we search for these files in <dir>/data where dir
+ is value of --stress-suite-basedir option.
+
+--stress-init-file[=/path/to/file with tests for initialization of stress db]
+ Using of this option allows to perform initialization of database
+ by execution of test files. List of tests will be taken either from
+ specified file or if it omited from default file 'stress-init.txt'
+ located in <--stress-suite-basedir/--suite> dir
+
+--stress-tests-file[=/path/to/file with tests]
+ Using of this option allows to run stress test itself. Tests for testing
+ will be taken either from specified file or if it omited from default
+ file 'stress-tests.txt' located in <--stress-suite-basedir/--suite> dir
+
+--stress-mode= [random|seq]
+ There are two possible modes which affect order of selecting tests
+ from the list:
+ - in random mode tests will be selected in random order
+ - in seq mode each thread will execute tests in the loop one by one as
+ they specified in the list file.
+
+--sleep-time=<time in seconds>
+ Delay between test execution. Could be usefull in continued testsing
+ when one of instance of stress script perform periodical cleanup or
+ recreating of some database objects
+
+--threads=#number of threads
+ Define number of threads
+
+--check-tests-file
+ Check file with list of tests. If file was modified it will force to
+ reread list of tests. Could be usefull in continued testing for
+ adding/removing tests without script interruption
+
+--mysqltest=/path/to/mysqltest binary
+
+--verbose
+
+--cleanup
+ Force to clean up working directory (specified with --stress-basedir)
+
+--log-error-details
+ Enable errors details in the global error log file. (Default: off)
+
+--test-count=<number of executed tests before we have to exit>
+--loop-count=<number of executed loops in sequential mode before we have to exit>
+--test-duration=<number of seconds that stress test should run>
+
+Example of tool usage:
+
+perl mysql-stress-test.pl \
+--stress-suite-basedir=/opt/qa/mysql-test-extra-5.0/mysql-test \
+--stress-basedir=/opt/qa/test \
+--server-logs-dir=/opt/qa/logs \
+--test-count=20 \
+--stress-tests-file=innodb-tests.txt \
+--stress-init-file=innodb-init.txt \
+--threads=5 \
+--suite=funcs_1 \
+--mysqltest=/opt/mysql/mysql-5.0/client/mysqltest \
+--server-user=root \
+--server-database=test \
+--cleanup \
+
+EOF
+exit(0);
+}
+
+
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 101c18ec80f..72b65d4287c 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -171,7 +171,9 @@ our $exe_mysqladmin;
our $exe_mysqlbinlog;
our $exe_mysql_client_test;
our $exe_mysqld;
+our $exe_mysqlcheck; # Called from test case
our $exe_mysqldump; # Called from test case
+our $exe_mysqlimport; # Called from test case
our $exe_mysqlshow; # Called from test case
our $exe_mysql_fix_system_tables;
our $exe_mysqltest;
@@ -186,6 +188,11 @@ our $opt_big_test= 0; # Send --big-test to mysqltest
our @opt_extra_mysqld_opt;
our $opt_compress;
+our $opt_ssl;
+our $opt_skip_ssl;
+our $opt_ssl_supported;
+our $opt_ps_protocol;
+
our $opt_current_test;
our $opt_ddd;
our $opt_debug;
@@ -233,15 +240,15 @@ our $opt_result_ext;
our $opt_skip;
our $opt_skip_rpl;
our $opt_skip_test;
+our $opt_skip_im;
our $opt_sleep;
-our $opt_ps_protocol;
our $opt_sleep_time_after_restart= 1;
our $opt_sleep_time_for_delete= 10;
our $opt_testcase_timeout;
our $opt_suite_timeout;
-my $default_testcase_timeout= 10; # 10 min max
+my $default_testcase_timeout= 15; # 15 min max
my $default_suite_timeout= 120; # 2 hours max
our $opt_socket;
@@ -276,7 +283,6 @@ our $opt_udiff;
our $opt_skip_ndbcluster;
our $opt_with_ndbcluster;
-our $opt_with_openssl;
our $exe_ndb_mgm;
our $path_ndb_tools_dir;
@@ -297,7 +303,8 @@ sub executable_setup ();
sub environment_setup ();
sub kill_running_server ();
sub kill_and_cleanup ();
-sub ndbcluster_support ();
+sub check_ssl_support ();
+sub check_ndbcluster_support ();
sub ndbcluster_install ();
sub ndbcluster_start ();
sub ndbcluster_stop ();
@@ -332,11 +339,9 @@ sub main () {
initial_setup();
command_line_setup();
executable_setup();
-
- if (! $opt_skip_ndbcluster and ! $opt_with_ndbcluster)
- {
- $opt_with_ndbcluster= ndbcluster_support();
- }
+
+ check_ndbcluster_support();
+ check_ssl_support();
environment_setup();
signal_setup();
@@ -471,6 +476,16 @@ sub command_line_setup () {
my $im_mysqld1_port= 9312;
my $im_mysqld2_port= 9314;
+ if ( $ENV{'MTR_BUILD_THREAD'} )
+ {
+ $opt_master_myport= $ENV{'MTR_BUILD_THREAD'} * 40 + 8120;
+ $opt_slave_myport= $opt_master_myport + 16;
+ $opt_ndbcluster_port= $opt_master_myport + 24;
+ $im_port= $opt_master_myport + 10;
+ $im_mysqld1_port= $opt_master_myport + 12;
+ $im_mysqld2_port= $opt_master_myport + 14;
+ }
+
# Read the command line
# Note: Keep list, and the order, in sync with usage at end of this file
@@ -479,6 +494,9 @@ sub command_line_setup () {
# Control what engine/variation to run
'embedded-server' => \$opt_embedded_server,
'ps-protocol' => \$opt_ps_protocol,
+ 'ssl|with-openssl' => \$opt_ssl,
+ 'skip-ssl' => \$opt_skip_ssl,
+ 'compress' => \$opt_compress,
'bench' => \$opt_bench,
'small-bench' => \$opt_small_bench,
'no-manager' => \$opt_no_manager, # Currently not used
@@ -490,6 +508,7 @@ sub command_line_setup () {
'do-test=s' => \$opt_do_test,
'suite=s' => \$opt_suite,
'skip-rpl' => \$opt_skip_rpl,
+ 'skip-im' => \$opt_skip_im,
'skip-test=s' => \$opt_skip_test,
# Specify ports
@@ -530,7 +549,6 @@ sub command_line_setup () {
# Misc
'big-test' => \$opt_big_test,
- 'compress' => \$opt_compress,
'debug' => \$opt_debug,
'fast' => \$opt_fast,
'local' => \$opt_local,
@@ -555,7 +573,6 @@ sub command_line_setup () {
'testcase-timeout=i' => \$opt_testcase_timeout,
'suite-timeout=i' => \$opt_suite_timeout,
'warnings|log-warnings' => \$opt_warnings,
- 'with-openssl' => \$opt_with_openssl,
'help|h' => \$opt_usage,
) or usage("Can't read options");
@@ -840,8 +857,8 @@ sub command_line_setup () {
server_id => 1,
port => $im_mysqld1_port,
path_datadir => "$opt_vardir/im_mysqld_1.data",
- path_sock => "$opt_vardir/mysqld_1.sock",
- path_pid => "$opt_vardir/mysqld_1.pid",
+ path_sock => "$opt_tmpdir/mysqld_1.sock",
+ path_pid => "$opt_vardir/run/mysqld_1.pid",
};
$instance_manager->{'instances'}->[1]=
@@ -849,8 +866,8 @@ sub command_line_setup () {
server_id => 2,
port => $im_mysqld2_port,
path_datadir => "$opt_vardir/im_mysqld_2.data",
- path_sock => "$opt_vardir/mysqld_2.sock",
- path_pid => "$opt_vardir/mysqld_2.pid",
+ path_sock => "$opt_tmpdir/mysqld_2.sock",
+ path_pid => "$opt_vardir/run/mysqld_2.pid",
nonguarded => 1,
};
@@ -879,7 +896,9 @@ sub executable_setup () {
{
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
"$glob_basedir/bin");
- $exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt");
+ $exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt",
+ "$path_client_bindir/mysqld",
+ "$path_client_bindir/mysqld-debug",);
$path_language= mtr_path_exists("$glob_basedir/share/english/");
$path_charsetsdir= mtr_path_exists("$glob_basedir/share/charsets");
}
@@ -909,7 +928,9 @@ sub executable_setup () {
mtr_exe_exists("$glob_basedir/tests/mysql_client_test",
"/usr/bin/false");
}
+ $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
+ $exe_mysqlimport= mtr_exe_exists("$path_client_bindir/mysqlimport");
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
$exe_mysqladmin= mtr_exe_exists("$path_client_bindir/mysqladmin");
@@ -924,6 +945,7 @@ sub executable_setup () {
else
{
$path_client_bindir= mtr_path_exists("$glob_basedir/bin");
+ $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
@@ -939,9 +961,18 @@ sub executable_setup () {
"$glob_basedir/share/english/");
$path_charsetsdir= mtr_path_exists("$glob_basedir/share/mysql/charsets",
"$glob_basedir/share/charsets");
- $exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld",
- "$glob_basedir/bin/mysqld");
+ if ( $glob_win32 )
+ {
+ $exe_mysqld= mtr_exe_exists ("$glob_basedir/bin/mysqld-nt",
+ "$glob_basedir/bin/mysqld",
+ "$glob_basedir/bin/mysqld-debug",);
+ }
+ else
+ {
+ $exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld",
+ "$glob_basedir/bin/mysqld");
+ }
$exe_im= mtr_exe_exists("$glob_basedir/libexec/mysqlmanager",
"$glob_basedir/bin/mysqlmanager");
if ( $glob_use_embedded_server )
@@ -1035,6 +1066,15 @@ sub environment_setup () {
chomp($ENV{$key});
}
}
+
+ # We are nice and report a bit about our settings
+ print "Using MTR_BUILD_THREAD = ",$ENV{MTR_BUILD_THREAD} || 0,"\n";
+ print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n";
+ print "Using MASTER_MYPORT1 = $ENV{MASTER_MYPORT1}\n";
+ print "Using SLAVE_MYPORT = $ENV{SLAVE_MYPORT}\n";
+ print "Using NDBCLUSTER_PORT = $opt_ndbcluster_port\n";
+ print "Using IM_MYSQLD1_PORT = $ENV{'IM_MYSQLD1_PORT'}\n";
+ print "Using IM_MYSQLD2_PORT = $ENV{'IM_MYSQLD2_PORT'}\n";
}
@@ -1118,7 +1158,7 @@ sub kill_and_cleanup () {
foreach my $instance (@{$instance_manager->{'instances'}})
{
- push (@data_dir_lst, $instance->{'path_datadir'});
+ push(@data_dir_lst, $instance->{'path_datadir'});
}
foreach my $data_dir (@data_dir_lst)
@@ -1140,13 +1180,59 @@ sub kill_and_cleanup () {
}
+sub check_ssl_support () {
+
+ if ($opt_skip_ssl)
+ {
+ mtr_report("Skipping SSL");
+ $opt_ssl_supported= 0;
+ $opt_ssl= 0;
+ return;
+ }
+
+ # check ssl support by testing using a switch
+ # that is only available in that case
+ if ( mtr_run($exe_mysqld,
+ ["--no-defaults",
+ "--ssl",
+ "--help"],
+ "", "/dev/null", "/dev/null", "") != 0 )
+ {
+ if ( $opt_ssl)
+ {
+ mtr_error("Couldn't find support for SSL");
+ return;
+ }
+ mtr_report("Skipping SSL, mysqld not compiled with SSL");
+ $opt_ssl_supported= 0;
+ $opt_ssl= 0;
+ return;
+ }
+ mtr_report("Setting mysqld to support SSL connections");
+ $opt_ssl_supported= 1;
+}
+
+
##############################################################################
#
# Start the ndb cluster
#
##############################################################################
-sub ndbcluster_support () {
+sub check_ndbcluster_support () {
+
+ if ($opt_skip_ndbcluster)
+ {
+ mtr_report("Skipping ndbcluster");
+ $opt_with_ndbcluster= 0;
+ return;
+ }
+
+ if ($opt_with_ndbcluster)
+ {
+ mtr_report("Using ndbcluster");
+ return;
+ }
# check ndbcluster support by testing using a switch
# that is only available in that case
@@ -1156,11 +1242,13 @@ sub ndbcluster_support () {
"--help"],
"", "/dev/null", "/dev/null", "") != 0 )
{
- mtr_report("No ndbcluster support");
- return 0;
+ mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
+ $opt_with_ndbcluster= 0;
+ return;
}
- mtr_report("Has ndbcluster support");
- return 1;
+ mtr_report("Using ndbcluster, mysqld supports it");
+ $opt_with_ndbcluster= 1;
+ return;
}
# FIXME why is there a different start below?!
@@ -1364,7 +1452,7 @@ sub mysql_install_db () {
install_db('slave', $slave->[1]->{'path_myddir'});
install_db('slave', $slave->[2]->{'path_myddir'});
- if ( defined $exe_im)
+ if ( ! $opt_skip_im )
{
im_prepare_env($instance_manager);
}
@@ -1513,12 +1601,7 @@ skip-ndbcluster
EOF
;
- if ( exists $instance->{nonguarded} and
- defined $instance->{nonguarded} )
- {
- print OUT "nonguarded\n";
- }
-
+ print OUT "nonguarded\n" if $instance->{'nonguarded'};
print OUT "\n";
}
@@ -1678,7 +1761,7 @@ sub run_testcase ($) {
$master->[0]->{'running_master_is_special'}= 1;
}
}
- elsif ( $tinfo->{'component_id'} eq 'im')
+ elsif ( ! $opt_skip_im and $tinfo->{'component_id'} eq 'im' )
{
# We have to create defaults file every time, in order to ensure that it
# will be the same for each test. The problem is that test can change the
@@ -1776,7 +1859,8 @@ sub run_testcase ($) {
# Stop Instance Manager if we are processing an IM-test case.
# ----------------------------------------------------------------------
- if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' )
+ if ( ! $glob_use_running_server and $tinfo->{'component_id'} eq 'im' and
+ $instance_manager->{'pid'} )
{
im_stop($instance_manager);
}
@@ -2049,7 +2133,7 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix);
mtr_add_arg($args, "%s--log-bin-trust-routine-creators", $prefix);
- if ( $opt_with_openssl )
+ if ( $opt_ssl_supported )
{
mtr_add_arg($args, "%s--ssl-ca=%s/std_data/cacert.pem", $prefix,
$glob_mysql_test_dir);
@@ -2195,7 +2279,7 @@ sub stop_masters_slaves () {
print "Ending Tests\n";
- if (defined $instance_manager->{'pid'})
+ if ( $instance_manager->{'pid'} )
{
print "Shutting-down Instance Manager\n";
im_stop($instance_manager);
@@ -2269,14 +2353,10 @@ sub im_start($$) {
my $instance_manager = shift;
my $opts = shift;
- if ( ! defined $exe_im)
- {
- return;
- }
-
my $args;
mtr_init_args(\$args);
- mtr_add_arg($args, "--defaults-file=" . $instance_manager->{'defaults_file'});
+ mtr_add_arg($args, "--defaults-file=%s",
+ $instance_manager->{'defaults_file'});
foreach my $opt (@{$opts})
{
@@ -2294,7 +2374,7 @@ sub im_start($$) {
{ append_log_file => 1 } # append log files
);
- if ( ! defined $instance_manager->{'pid'} )
+ if ( ! $instance_manager->{'pid'} )
{
mtr_report('Could not start Instance Manager');
return;
@@ -2304,10 +2384,14 @@ sub im_start($$) {
# several processes and the parent process, created by mtr_spawn(), exits just
# after start. So, we have to obtain Instance Manager PID from the PID file.
- sleep_until_file_created(
- $instance_manager->{'path_pid'},
- $instance_manager->{'start_timeout'},
- -1); # real PID is still unknown
+ if ( ! sleep_until_file_created(
+ $instance_manager->{'path_pid'},
+ $instance_manager->{'start_timeout'},
+ -1)) # real PID is still unknown
+ {
+ mtr_report("Instance Manager PID file is missing");
+ return;
+ }
$instance_manager->{'pid'} =
mtr_get_pid_from_file($instance_manager->{'path_pid'});
@@ -2316,16 +2400,12 @@ sub im_start($$) {
sub im_stop($) {
my $instance_manager = shift;
- if (! defined $instance_manager->{'pid'})
- {
- return;
- }
-
# Re-read pid from the file, since during tests Instance Manager could have
# been restarted, so its pid could have been changed.
$instance_manager->{'pid'} =
- mtr_get_pid_from_file($instance_manager->{'path_pid'});
+ mtr_get_pid_from_file($instance_manager->{'path_pid'})
+ if -f $instance_manager->{'path_pid'};
# Inspired from mtr_stop_mysqld_servers().
@@ -2340,12 +2420,12 @@ sub im_stop($) {
if ( -r $instances->[0]->{'path_pid'} )
{
- push @pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'});
+ push(@pids, mtr_get_pid_from_file($instances->[0]->{'path_pid'}));
}
if ( -r $instances->[1]->{'path_pid'} )
{
- push @pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'});
+ push(@pids, mtr_get_pid_from_file($instances->[1]->{'path_pid'}));
}
# Kill processes.
@@ -2360,6 +2440,15 @@ sub im_stop($) {
sub run_mysqltest ($) {
my $tinfo= shift;
+ my $cmdline_mysqlcheck= "$exe_mysqlcheck --no-defaults -uroot " .
+ "--port=$master->[0]->{'path_myport'} " .
+ "--socket=$master->[0]->{'path_mysock'} --password=";
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlcheck .=
+ " --debug=d:t:A,$opt_vardir/log/mysqldump.trace";
+ }
+
my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " .
"--port=$master->[0]->{'path_myport'} " .
"--socket=$master->[0]->{'path_mysock'} --password=";
@@ -2368,6 +2457,14 @@ sub run_mysqltest ($) {
$cmdline_mysqldump .=
" --debug=d:t:A,$opt_vardir/log/mysqldump.trace";
}
+ my $cmdline_mysqlimport= "$exe_mysqlimport -uroot " .
+ "--port=$master->[0]->{'path_myport'} " .
+ "--socket=$master->[0]->{'path_mysock'} --password=";
+ if ( $opt_debug )
+ {
+ $cmdline_mysqlimport .=
+ " --debug=d:t:A,$opt_vardir/log/mysqlimport.trace";
+ }
my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " .
"--port=$master->[0]->{'path_myport'} " .
@@ -2419,7 +2516,9 @@ sub run_mysqltest ($) {
# $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}";
$ENV{'MYSQL'}= $cmdline_mysql;
+ $ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
$ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
+ $ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
$ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
$ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
@@ -2504,14 +2603,26 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir);
}
- if ( $opt_with_openssl )
+ if ( $opt_ssl_supported )
{
mtr_add_arg($args, "--ssl-ca=%s/std_data/cacert.pem",
- $glob_mysql_test_dir);
+ $glob_mysql_test_dir);
mtr_add_arg($args, "--ssl-cert=%s/std_data/client-cert.pem",
- $glob_mysql_test_dir);
+ $glob_mysql_test_dir);
mtr_add_arg($args, "--ssl-key=%s/std_data/client-key.pem",
- $glob_mysql_test_dir);
+ $glob_mysql_test_dir);
+ }
+
+ # Turn on SSL for all test cases
+ if ( $opt_ssl )
+ {
+ mtr_add_arg($args, "--ssl",
+ $glob_mysql_test_dir);
+ }
+ elsif ( $opt_ssl_supported )
+ {
+ mtr_add_arg($args, "--skip-ssl",
+ $glob_mysql_test_dir);
}
# ----------------------------------------------------------------------
@@ -2590,6 +2701,9 @@ Options to control what engine/variation to run
embedded-server Use the embedded server, i.e. no mysqld daemons
ps-protocol Use the binary protocol between client and server
+ compress Use the compressed protocol between client and server
+ ssl Use ssl protocol between client and server
+ skip-ssl Dont start sterver with support for ssl connections
bench Run the benchmark suite FIXME
small-bench FIXME
@@ -2597,10 +2711,12 @@ Options to control what test suites or cases to run
force Continue to run the suite after failure
with-ndbcluster Use cluster, and enable test cases that requres it
+ skip-ndb[cluster] Skip the ndb test cases, don't start cluster
do-test=PREFIX Run test cases which name are prefixed with PREFIX
start-from=PREFIX Run test cases starting from test prefixed with PREFIX
suite=NAME Run the test suite named NAME. The default is "main"
skip-rpl Skip the replication test cases.
+ skip-im Don't start IM, and skip the IM test cases
skip-test=PREFIX Skip test cases which name are prefixed with PREFIX
Options that specify ports
@@ -2620,7 +2736,7 @@ Options that pass on options
Options to run test on running server
extern Use running server for tests FIXME DANGEROUS
- ndbconnectstring=STR Use running cluster, and connect using STR
+ ndbconnectstring=STR Use running cluster, and connect using STR
user=USER User for connect to server
Options for debugging the product
@@ -2648,7 +2764,6 @@ Misc options
verbose Verbose output from this script
script-debug Debug this script itself
- compress Use the compressed protocol between client and server
timer Show test case execution time
start-and-exit Only initiate and start the "mysqld" servers, use the startup
settings for the specified test case if any
@@ -2661,6 +2776,9 @@ Misc options
testcase-timeout=MINUTES Max test case run time (default 5)
suite-timeout=MINUTES Max test suite run time (default 120)
+Deprecated options
+ with-openssl Deprecated option for ssl
+
Options not yet described, or that I want to look into more
@@ -2677,7 +2795,6 @@ Options not yet described, or that I want to look into more
wait-timeout=SECONDS
warnings
log-warnings
- with-openssl
HERE
mtr_exit(1);
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index b6f4caa0552..037040bf0de 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -216,12 +216,32 @@ NDBCLUSTER_PORT=9350
MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd
MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
MYSQL_MANAGER_USER=root
+
+#
+# To make it easier for different devs to work on the same host,
+# an environment variable can be used to control all ports. A small
+# number is to be used, 0 - 16 or similar.
+#
+if [ -n "$MTR_BUILD_THREAD" ] ; then
+ MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 5 + 10000`
+ MYSQL_MANAGER_PORT=`expr $MASTER_MYPORT + 2`
+ SLAVE_MYPORT=`expr $MASTER_MYPORT + 3`
+ NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 4`
+
+ echo "Using MTR_BUILD_THREAD = $MTR_BUILD_THREAD"
+ echo "Using MASTER_MYPORT = $MASTER_MYPORT"
+ echo "Using MYSQL_MANAGER_PORT = $MYSQL_MANAGER_PORT"
+ echo "Using SLAVE_MYPORT = $SLAVE_MYPORT"
+ echo "Using NDBCLUSTER_PORT = $NDBCLUSTER_PORT"
+fi
+
NO_SLAVE=0
USER_TEST=
FAILED_CASES=
EXTRA_MASTER_OPT=""
EXTRA_MYSQL_TEST_OPT=""
+EXTRA_MYSQLCHECK_OPT=""
EXTRA_MYSQLDUMP_OPT=""
EXTRA_MYSQLSHOW_OPT=""
EXTRA_MYSQLBINLOG_OPT=""
@@ -255,6 +275,17 @@ NDB_MGM_EXTRA_OPTS=
NDB_MGMD_EXTRA_OPTS=
NDBD_EXTRA_OPTS=
+DO_STRESS=""
+STRESS_SUITE="main"
+STRESS_MODE="random"
+STRESS_THREADS=5
+STRESS_TEST_COUNT=20
+STRESS_LOOP_COUNT=""
+STRESS_TEST_DURATION=""
+STRESS_INIT_FILE=""
+STRESS_TEST_FILE=""
+STRESS_TEST=""
+
while test $# -gt 0; do
case "$1" in
--embedded-server)
@@ -343,6 +374,35 @@ while test $# -gt 0; do
DO_BENCH=1
NO_SLAVE=1
;;
+ --stress)
+ DO_STRESS=1
+ NO_SLAVE=1
+ SKIP_SLAVE=1
+ ;;
+ --stress-suite=*)
+ STRESS_SUITE=`$ECHO "$1" | $SED -e "s;--stress-suite=;;"`
+ ;;
+ --stress-threads=*)
+ STRESS_THREADS=`$ECHO "$1" | $SED -e "s;--stress-threads=;;"`
+ ;;
+ --stress-test-file=*)
+ STRESS_TEST_FILE=`$ECHO "$1" | $SED -e "s;--stress-test-file=;;"`
+ ;;
+ --stress-init-file=*)
+ STRESS_INIT_FILE=`$ECHO "$1" | $SED -e "s;--stress-init-file=;;"`
+ ;;
+ --stress-mode=*)
+ STRESS_MODE=`$ECHO "$1" | $SED -e "s;--stress-mode=;;"`
+ ;;
+ --stress-loop-count=*)
+ STRESS_LOOP_COUNT=`$ECHO "$1" | $SED -e "s;--stress-loop-count=;;"`
+ ;;
+ --stress-test-count=*)
+ STRESS_TEST_COUNT=`$ECHO "$1" | $SED -e "s;--stress-test-count=;;"`
+ ;;
+ --stress-test-duration=*)
+ STRESS_TEST_DURATION=`$ECHO "$1" | $SED -e "s;--stress-test-duration=;;"`
+ ;;
--big*) # Actually --big-test
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
--compress)
@@ -455,6 +515,8 @@ while test $# -gt 0; do
--debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace"
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \
--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace"
+ EXTRA_MYSQLCHECK_OPT="$EXTRA_MYSQLCHECK_OPT \
+ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlcheck.trace"
EXTRA_MYSQLDUMP_OPT="$EXTRA_MYSQLDUMP_OPT \
--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace"
EXTRA_MYSQLSHOW_OPT="$EXTRA_MYSQLSHOW_OPT \
@@ -557,11 +619,21 @@ if [ x$SOURCE_DIST = x1 ] ; then
fi
MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test"
fi
+ if [ -f "$BASEDIR/client/.libs/mysqlcheck" ] ; then
+ MYSQL_CHECK="$BASEDIR/client/.libs/mysqlcheck"
+ else
+ MYSQL_CHECK="$BASEDIR/client/mysqlcheck"
+ fi
if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
else
MYSQL_DUMP="$BASEDIR/client/mysqldump"
fi
+ if [ -f "$BASEDIR/client/.libs/mysqlimport" ] ; then
+ MYSQL_IMPORT="$BASEDIR/client/.libs/mysqlimport"
+ else
+ MYSQL_IMPORT="$BASEDIR/client/mysqlimport"
+ fi
if [ -f "$BASEDIR/client/.libs/mysqlshow" ] ; then
MYSQL_SHOW="$BASEDIR/client/.libs/mysqlshow"
else
@@ -635,8 +707,10 @@ else
TESTS_BINDIR="$BASEDIR/bin"
fi
MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
+ MYSQL_CHECK="$CLIENT_BINDIR/mysqlcheck"
MYSQL_DUMP="$CLIENT_BINDIR/mysqldump"
MYSQL_SHOW="$CLIENT_BINDIR/mysqlshow"
+ MYSQL_IMPORT="$CLIENT_BINDIR/mysqlimport"
MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$CLIENT_BINDIR/mysql_waitpid"
@@ -691,7 +765,7 @@ fi
# If we should run all tests cases, we will use a local server for that
-if [ -z "$1" ]
+if [ -z "$1" -a -z "$DO_STRESS" ]
then
USE_RUNNING_SERVER=0
fi
@@ -720,12 +794,14 @@ fi
# Save path and name of mysqldump
MYSQL_DUMP_DIR="$MYSQL_DUMP"
export MYSQL_DUMP_DIR
+MYSQL_CHECK="$MYSQL_CHECK --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT"
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
+MYSQL_IMPORT="$MYSQL_IMPORT -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
MYSQL="$MYSQL --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
-export MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
+export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES MYSQL_IMPORT
export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR MYSQL_MY_PRINT_DEFAULTS
export NDB_TOOLS_DIR
export NDB_MGM
@@ -757,7 +833,7 @@ if [ -n "$DO_CLIENT_GDB" -o -n "$DO_GDB" ] ; then
XTERM=`which xterm`
fi
-export MYSQL MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK
+export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK
#++
# Function Definitions
@@ -1179,7 +1255,7 @@ start_master()
then
CURR_MASTER_MYSQLD_TRACE="$EXTRA_MASTER_MYSQLD_TRACE$1"
fi
- if [ -z "$DO_BENCH" ]
+ if [ -z "$DO_BENCH" -a -z "$DO_STRESS" ]
then
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \
--server-id=$id \
@@ -1616,7 +1692,7 @@ run_testcase ()
stop_master 1
report_current_test $tname
start_master
- if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then
+ if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
start_master 1
fi
TZ=$MY_TZ; export TZ
@@ -1632,7 +1708,7 @@ run_testcase ()
stop_master 1
report_current_test $tname
start_master
- if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then
+ if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
start_master 1
fi
else
@@ -1753,6 +1829,125 @@ run_testcase ()
fi
}
+run_stress_test()
+{
+
+ STRESS_BASEDIR="$MYSQL_TEST_DIR/var/stress"
+
+ #Clean-up old stress test basedir
+ if [ -d $STRESS_BASEDIR ] ; then
+ $RM -rf $STRESS_BASEDIR
+ fi
+ #Create stress test basedir
+ mkdir $STRESS_BASEDIR
+
+ if [ "$STRESS_SUITE" != "main" -a "$STRESS_SUITE" != "default" ] ; then
+ STRESS_SUITE_DIR="$MYSQL_TEST_DIR/suite/$STRESS_SUITE"
+ else
+ STRESS_SUITE_DIR="$MYSQL_TEST_DIR"
+ fi
+
+ if [ -d "$STRESS_SUITE_DIR" ] ; then
+ STRESS_SUITE_T_DIR="$STRESS_SUITE_DIR/t"
+ STRESS_SUITE_R_DIR="$STRESS_SUITE_DIR/r"
+ #FIXME: check that dirs above are exist
+ else
+ echo "Directory $STRESS_SUITE_DIR with test suite doesn't exists. Abort stress testing"
+ exit 1
+ fi
+
+ if [ -n "$STRESS_TEST" ] ; then
+ STRESS_TEST_FILE="$STRESS_BASEDIR/stress_tests.txt"
+ echo $STRESS_TEST > $STRESS_TEST_FILE
+ elif [ -n "$STRESS_TEST_FILE" ] ; then
+ STRESS_TEST_FILE="$STRESS_SUITE_DIR/$STRESS_TEST_FILE"
+ if [ ! -f "$STRESS_TEST_FILE" ] ; then
+ echo "Specified file $STRESS_TEST_FILE with list of tests does not exist"
+ echo "Please ensure that file exists and has proper permissions"
+ exit 1
+ fi
+ else
+ STRESS_TEST_FILE="$STRESS_SUITE_DIR/stress_tests.txt"
+ if [ ! -f "$STRESS_TEST_FILE" ] ; then
+ echo "Default file $STRESS_TEST_FILE with list of tests does not exist."
+ echo "Please use --stress-test-file option to specify custom one or you can"
+ echo "just specify name of test for testing as last argument in command line"
+ exit 1
+ fi
+ fi
+
+ if [ -n "$STRESS_INIT_FILE" ] ; then
+ STRESS_INIT_FILE="$STRESS_SUITE_DIR/$STRESS_INIT_FILE"
+ if [ ! -f "$STRESS_INIT_FILE" ] ; then
+ echo "Specified file $STRESS_INIT_FILE with list of tests doesn't exist."
+ echo "Please ensure that file exists and has proper permissions"
+ exit 1
+ fi
+ else
+ STRESS_INIT_FILE="$STRESS_SUITE_DIR/stress_init.txt"
+ #Check for default init file
+ if [ ! -f "$STRESS_INIT_FILE" ] ; then
+ STRESS_INIT_FILE=""
+ fi
+ fi
+
+ if [ "$STRESS_MODE" != "random" -a "$STRESS_MODE" != "seq" ] ; then
+ echo "You specified wrong mode '$STRESS_MODE' for stress test."
+ echo "Correct values are 'random' or 'seq'"
+ exit 1
+ fi
+
+ STRESS_TEST_ARGS="--server-socket=$MASTER_MYSOCK \
+ --server-user=$DBUSER \
+ --server-database=$DB \
+ --stress-suite-basedir=$MYSQL_TEST_DIR \
+ --suite=$STRESS_SUITE \
+ --stress-tests-file=$STRESS_TEST_FILE \
+ --stress-basedir=$STRESS_BASEDIR \
+ --server-logs-dir=$STRESS_BASEDIR \
+ --stress-mode=$STRESS_MODE \
+ --mysqltest=$BASEDIR/client/mysqltest \
+ --threads=$STRESS_THREADS \
+ --verbose \
+ --cleanup \
+ --log-error-details \
+ --abort-on-error"
+
+ if [ -n "$STRESS_INIT_FILE" ] ; then
+ STRESS_TEST_ARGS="$STRESS_TEST_ARGS --stress-init-file=$STRESS_INIT_FILE"
+ fi
+
+ if [ -n "$STRESS_LOOP_COUNT" ] ; then
+ STRESS_TEST_ARGS="$STRESS_TEST_ARGS --loop-count=$STRESS_LOOP_COUNT"
+ fi
+
+ if [ -n "$STRESS_TEST_COUNT" ] ; then
+ STRESS_TEST_ARGS="$STRESS_TEST_ARGS --test-count=$STRESS_TEST_COUNT"
+ fi
+
+ if [ -n "$STRESS_TEST_DURATION" ] ; then
+ STRESS_TEST_ARGS="$STRESS_TEST_ARGS --test-duration=$STRESS_TEST_DURATION"
+ fi
+
+ echo "Stress test related variables:"
+ echo "TESTS - $1"
+ echo "STRESS - $DO_STRESS"
+ echo "STRESS_SUITE - $STRESS_SUITE"
+ echo "STRESS_TEST_FILE - $STRESS_TEST_FILE"
+ echo "STRESS_INIT_FILE - $STRESS_INIT_FILE"
+ echo "STRESS_THREADS - $STRESS_THREADS"
+ echo "STRESS_MODE - $STRESS_MODE"
+ echo "STRESS_TEST_COUNT - $STRESS_TEST_COUNT"
+ echo "STRESS_LOOP_COUNT - $STRESS_LOOP_COUNT"
+ echo "STRESS_TEST_DURATION - $STRESS_TEST_DURATION"
+
+ #echo "$STRESS_TEST_ARGS";
+ #Run stress test
+ $MYSQL_TEST_DIR/mysql-stress-test.pl $STRESS_TEST_ARGS
+
+
+}
+
######################################################################
# Main script starts here
######################################################################
@@ -1867,6 +2062,32 @@ then
exit
fi
+#
+# Stress testing
+#
+if [ "$DO_STRESS" = 1 ]
+then
+
+ if [ -n "$1" ] ; then
+ STRESS_TEST="$1";
+ fi
+
+ if [ $USE_RUNNING_SERVER -eq 0 ] ; then
+ start_master
+ fi
+
+ run_stress_test
+
+ if [ $USE_RUNNING_SERVER -eq 0 ] ; then
+ mysql_stop
+ stop_manager
+ fi
+
+ exit
+
+fi
+
+
$ECHO
if [ x$USE_TIMER = x1 ] ; then
$ECHO "TEST RESULT TIME (ms)"
diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c
index b23b7ceb6a1..33a69eba872 100644
--- a/mysql-test/mysql_test_run_new.c
+++ b/mysql-test/mysql_test_run_new.c
@@ -1741,7 +1741,6 @@ int main(int argc, char **argv)
int* handle;
char test[FN_LEN];
char mask[FN_REFLEN];
- char *p;
int position;
/* single test */
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 5841b10551d..e3e9dab78bd 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -436,7 +436,7 @@ alter table t1 change a a char(10) character set cp1251;
select a,hex(a) from t1;
a hex(a)
ÔÅÓÔ F2E5F1F2
-alter table t1 change a a binary(10);
+alter table t1 change a a binary(4);
select a,hex(a) from t1;
a hex(a)
òåñò F2E5F1F2
@@ -541,16 +541,16 @@ create table t1 ( a timestamp );
alter table t1 add unique ( a(1) );
ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
drop table t1;
-create database mysqltest1;
+create database mysqltest;
create table t1 (c1 int);
-alter table t1 rename mysqltest1.t1;
+alter table t1 rename mysqltest.t1;
drop table t1;
ERROR 42S02: Unknown table 't1'
-alter table mysqltest1.t1 rename t1;
+alter table mysqltest.t1 rename t1;
drop table t1;
create table t1 (c1 int);
-use mysqltest1;
-drop database mysqltest1;
+use mysqltest;
+drop database mysqltest;
alter table test.t1 rename t1;
ERROR 3D000: No database selected
alter table test.t1 rename test.t1;
diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result
index df524b491f1..f4e547dbc66 100644
--- a/mysql-test/r/analyse.result
+++ b/mysql-test/r/analyse.result
@@ -107,7 +107,7 @@ insert into t1 values(1.1);
insert into t1 values(2.2);
select * from t1 procedure analyse();
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
-test.t1.df 1.1 2.2 8 8 0 0 1.650000000 0.302500000 ENUM('1.1','2.2') NOT NULL
+test.t1.df 1.1 2.2 13 13 0 0 1.65000 0.55000 ENUM('1.1','2.2') NOT NULL
drop table t1;
create table t1 (d double);
insert into t1 values (100000);
@@ -115,3 +115,29 @@ select * from t1 procedure analyse (1,1);
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
test.t1.d 100000 100000 6 6 0 0 100000 0 MEDIUMINT(6) UNSIGNED NOT NULL
drop table t1;
+create table t1 (product varchar(32), country_id int not null, year int,
+profit int);
+insert into t1 values ( 'Computer', 2,2000, 1200),
+( 'TV', 1, 1999, 150),
+( 'Calculator', 1, 1999,50),
+( 'Computer', 1, 1999,1500),
+( 'Computer', 1, 2000,1500),
+( 'TV', 1, 2000, 150),
+( 'TV', 2, 2000, 100),
+( 'TV', 2, 2000, 100),
+( 'Calculator', 1, 2000,75),
+( 'Calculator', 2, 2000,75),
+( 'TV', 1, 1999, 100),
+( 'Computer', 1, 1999,1200),
+( 'Computer', 2, 2000,1500),
+( 'Calculator', 2, 2000,75),
+( 'Phone', 3, 2003,10)
+;
+create table t2 (country_id int primary key, country char(20) not null);
+insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland');
+select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse();
+Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
+test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NOT NULL
+sum(profit) 10 6900 11 11 0 0 1946.2500 2867.6719 ENUM('10','275','600','6900') NOT NULL
+avg(profit) 10.0000 1380.0000 16 16 0 0 394.68750000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL
+drop table t1,t2;
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result
index 075f0f716d2..88bb3126fb6 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -192,8 +192,6 @@ select count(*) from t3;
count(*)
1199
rename table t3 to t4;
-Warnings:
-Error 7 Error on rename of './test/t3.ARN' to './test/t4.ARN' (Errcode: 2)
select * from t4 where fld3='bonfire';
auto fld1 companynr fld3 fld4 fld5 fld6
1191 068504 00 bonfire corresponds positively
@@ -9902,5 +9900,2450 @@ auto fld1 companynr fld3 fld4 fld5 fld6
2 011401 37 breaking dreaded Steinberg W
3 011402 37 Romans scholastics jarring
4 011403 37 intercepted audiology tinily
+CHECK TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+SELECT * FROM t2;
+auto fld1 companynr fld3 fld4 fld5 fld6
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg W
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+5 011501 37 bewilderingly wallet balled
+6 011701 37 astound parters persist W
+7 011702 37 admonishing eschew attainments
+8 011703 37 sumac quitter fanatic
+9 012001 37 flanking neat measures FAS
+10 012003 37 combed Steinberg rightfulness
+11 012004 37 subjective jarring capably
+12 012005 37 scatterbrain tinily impulsive
+13 012301 37 Eulerian balled starlet
+14 012302 36 dubbed persist terminators
+15 012303 37 Kane attainments untying
+16 012304 37 overlay fanatic announces FAS
+17 012305 37 perturb measures featherweight FAS
+18 012306 37 goblins rightfulness pessimist FAS
+19 012501 37 annihilates capably daughter
+20 012602 37 Wotan impulsive decliner FAS
+21 012603 37 snatching starlet lawgiver
+22 012604 37 concludes terminators stated
+23 012605 37 laterally untying readable
+24 012606 37 yelped announces attrition
+25 012701 37 grazing featherweight cascade FAS
+26 012702 37 Baird pessimist motors FAS
+27 012703 37 celery daughter interrogate
+28 012704 37 misunderstander decliner pests W
+29 013601 37 handgun lawgiver stairway
+30 013602 37 foldout stated dopers FAS
+31 013603 37 mystic readable testicle W
+32 013604 37 succumbed attrition Parsifal W
+33 013605 37 Nabisco cascade leavings
+34 013606 37 fingerings motors postulation W
+35 013607 37 aging interrogate squeaking
+36 013608 37 afield pests contrasted
+37 013609 37 ammonium stairway leftover
+38 013610 37 boat dopers whiteners
+39 013801 37 intelligibility testicle erases W
+40 013802 37 Augustine Parsifal Punjab W
+41 013803 37 teethe leavings Merritt
+42 013804 37 dreaded postulation Quixotism
+43 013901 37 scholastics squeaking sweetish FAS
+44 016001 37 audiology contrasted dogging FAS
+45 016201 37 wallet leftover scornfully FAS
+46 016202 37 parters whiteners bellow
+47 016301 37 eschew erases bills
+48 016302 37 quitter Punjab cupboard FAS
+49 016303 37 neat Merritt sureties FAS
+50 016304 37 Steinberg Quixotism puddings
+51 018001 37 jarring sweetish tapestry
+52 018002 37 tinily dogging fetters
+53 018003 37 balled scornfully bivalves
+54 018004 37 persist bellow incurring
+55 018005 37 attainments bills Adolph
+56 018007 37 fanatic cupboard pithed
+57 018008 37 measures sureties emergency
+58 018009 37 rightfulness puddings Miles
+59 018010 37 capably tapestry trimmings
+60 018012 37 impulsive fetters tragedies W
+61 018013 37 starlet bivalves skulking W
+62 018014 37 terminators incurring flint
+63 018015 37 untying Adolph flopping W
+64 018016 37 announces pithed relaxing FAS
+65 018017 37 featherweight emergency offload FAS
+66 018018 37 pessimist Miles suites W
+67 018019 37 daughter trimmings lists FAS
+68 018020 37 decliner tragedies animized FAS
+69 018021 37 lawgiver skulking multilayer W
+70 018022 37 stated flint standardizes FAS
+71 018023 37 readable flopping Judas
+72 018024 37 attrition relaxing vacuuming W
+73 018025 37 cascade offload dentally W
+74 018026 37 motors suites humanness W
+75 018027 37 interrogate lists inch W
+76 018028 37 pests animized Weissmuller W
+77 018029 37 stairway multilayer irresponsibly W
+78 018030 37 dopers standardizes luckily FAS
+79 018032 37 testicle Judas culled W
+80 018033 37 Parsifal vacuuming medical FAS
+81 018034 37 leavings dentally bloodbath FAS
+82 018035 37 postulation humanness subschema W
+83 018036 37 squeaking inch animals W
+84 018037 37 contrasted Weissmuller Micronesia
+85 018038 37 leftover irresponsibly repetitions
+86 018039 37 whiteners luckily Antares
+87 018040 37 erases culled ventilate W
+88 018041 37 Punjab medical pityingly
+89 018042 37 Merritt bloodbath interdependent
+90 018043 37 Quixotism subschema Graves FAS
+91 018044 37 sweetish animals neonatal
+92 018045 37 dogging Micronesia scribbled FAS
+93 018046 37 scornfully repetitions chafe W
+94 018048 37 bellow Antares honoring
+95 018049 37 bills ventilate realtor
+96 018050 37 cupboard pityingly elite
+97 018051 37 sureties interdependent funereal
+98 018052 37 puddings Graves abrogating
+99 018053 50 tapestry neonatal sorters
+100 018054 37 fetters scribbled Conley
+101 018055 37 bivalves chafe lectured
+102 018056 37 incurring honoring Abraham
+103 018057 37 Adolph realtor Hawaii W
+104 018058 37 pithed elite cage
+105 018059 36 emergency funereal hushes
+106 018060 37 Miles abrogating Simla
+107 018061 37 trimmings sorters reporters
+108 018101 37 tragedies Conley Dutchman FAS
+109 018102 37 skulking lectured descendants FAS
+110 018103 37 flint Abraham groupings FAS
+111 018104 37 flopping Hawaii dissociate
+112 018201 37 relaxing cage coexist W
+113 018202 37 offload hushes Beebe
+114 018402 37 suites Simla Taoism
+115 018403 37 lists reporters Connally
+116 018404 37 animized Dutchman fetched FAS
+117 018405 37 multilayer descendants checkpoints FAS
+118 018406 37 standardizes groupings rusting
+119 018409 37 Judas dissociate galling
+120 018601 37 vacuuming coexist obliterates
+121 018602 37 dentally Beebe traitor
+122 018603 37 humanness Taoism resumes FAS
+123 018801 37 inch Connally analyzable FAS
+124 018802 37 Weissmuller fetched terminator FAS
+125 018803 37 irresponsibly checkpoints gritty FAS
+126 018804 37 luckily rusting firearm W
+127 018805 37 culled galling minima
+128 018806 37 medical obliterates Selfridge
+129 018807 37 bloodbath traitor disable
+130 018808 37 subschema resumes witchcraft W
+131 018809 37 animals analyzable betroth W
+132 018810 37 Micronesia terminator Manhattanize
+133 018811 37 repetitions gritty imprint
+134 018812 37 Antares firearm peeked
+135 019101 37 ventilate minima swelling
+136 019102 37 pityingly Selfridge interrelationships W
+137 019103 37 interdependent disable riser
+138 019201 37 Graves witchcraft Gandhian W
+139 030501 37 neonatal betroth peacock A
+140 030502 50 scribbled Manhattanize bee A
+141 030503 37 chafe imprint kanji
+142 030504 37 honoring peeked dental
+143 031901 37 realtor swelling scarf FAS
+144 036001 37 elite interrelationships chasm A
+145 036002 37 funereal riser insolence A
+146 036004 37 abrogating Gandhian syndicate
+147 036005 37 sorters peacock alike
+148 038001 37 Conley bee imperial A
+149 038002 37 lectured kanji convulsion A
+150 038003 37 Abraham dental railway A
+151 038004 37 Hawaii scarf validate A
+152 038005 37 cage chasm normalizes A
+153 038006 37 hushes insolence comprehensive
+154 038007 37 Simla syndicate chewing
+155 038008 37 reporters alike denizen
+156 038009 37 Dutchman imperial schemer
+157 038010 37 descendants convulsion chronicle
+158 038011 37 groupings railway Kline
+159 038012 37 dissociate validate Anatole
+160 038013 37 coexist normalizes partridges
+161 038014 37 Beebe comprehensive brunch
+162 038015 37 Taoism chewing recruited
+163 038016 37 Connally denizen dimensions W
+164 038017 37 fetched schemer Chicana W
+165 038018 37 checkpoints chronicle announced
+166 038101 37 rusting Kline praised FAS
+167 038102 37 galling Anatole employing
+168 038103 37 obliterates partridges linear
+169 038104 37 traitor brunch quagmire
+170 038201 37 resumes recruited western A
+171 038202 37 analyzable dimensions relishing
+172 038203 37 terminator Chicana serving A
+173 038204 37 gritty announced scheduling
+174 038205 37 firearm praised lore
+175 038206 37 minima employing eventful
+176 038208 37 Selfridge linear arteriole A
+177 042801 37 disable quagmire disentangle
+178 042802 37 witchcraft western cured A
+179 046101 37 betroth relishing Fenton W
+180 048001 37 Manhattanize serving avoidable A
+181 048002 37 imprint scheduling drains A
+182 048003 37 peeked lore detectably FAS
+183 048004 37 swelling eventful husky
+184 048005 37 interrelationships arteriole impelling
+185 048006 37 riser disentangle undoes
+186 048007 37 Gandhian cured evened
+187 048008 37 peacock Fenton squeezes
+188 048101 37 bee avoidable destroyer FAS
+189 048102 37 kanji drains rudeness
+190 048201 37 dental detectably beaner FAS
+191 048202 37 scarf husky boorish
+192 048203 37 chasm impelling Everhart
+193 048204 37 insolence undoes encompass A
+194 048205 37 syndicate evened mushrooms
+195 048301 37 alike squeezes Alison A
+196 048302 37 imperial destroyer externally FAS
+197 048303 37 convulsion rudeness pellagra
+198 048304 37 railway beaner cult
+199 048305 37 validate boorish creek A
+200 048401 37 normalizes Everhart Huffman
+201 048402 37 comprehensive encompass Majorca FAS
+202 048403 37 chewing mushrooms governing A
+203 048404 37 denizen Alison gadfly FAS
+204 048405 37 schemer externally reassigned FAS
+205 048406 37 chronicle pellagra intentness W
+206 048407 37 Kline cult craziness
+207 048408 37 Anatole creek psychic
+208 048409 37 partridges Huffman squabbled
+209 048410 37 brunch Majorca burlesque
+210 048411 37 recruited governing capped
+211 048412 37 dimensions gadfly extracted A
+212 048413 37 Chicana reassigned DiMaggio
+213 048601 37 announced intentness exclamation FAS
+214 048602 37 praised craziness subdirectory
+215 048603 37 employing psychic fangs
+216 048604 37 linear squabbled buyer A
+217 048801 37 quagmire burlesque pithing A
+218 050901 37 western capped transistorizing A
+219 051201 37 relishing extracted nonbiodegradable
+220 056002 37 serving DiMaggio dislocate
+221 056003 37 scheduling exclamation monochromatic FAS
+222 056004 37 lore subdirectory batting
+223 056102 37 eventful fangs postcondition A
+224 056203 37 arteriole buyer catalog FAS
+225 056204 37 disentangle pithing Remus
+226 058003 37 cured transistorizing devices A
+227 058004 37 Fenton nonbiodegradable bike A
+228 058005 37 avoidable dislocate qualify
+229 058006 37 drains monochromatic detained
+230 058007 37 detectably batting commended
+231 058101 37 husky postcondition civilize
+232 058102 37 impelling catalog Elmhurst
+233 058103 37 undoes Remus anesthetizing
+234 058105 37 evened devices deaf
+235 058111 37 squeezes bike Brigham
+236 058112 37 destroyer qualify title
+237 058113 37 rudeness detained coarse
+238 058114 37 beaner commended combinations
+239 058115 37 boorish civilize grayness
+240 058116 37 Everhart Elmhurst innumerable FAS
+241 058117 37 encompass anesthetizing Caroline A
+242 058118 37 mushrooms deaf fatty FAS
+243 058119 37 Alison Brigham eastbound
+244 058120 37 externally title inexperienced
+245 058121 37 pellagra coarse hoarder A
+246 058122 37 cult combinations scotch W
+247 058123 37 creek grayness passport A
+248 058124 37 Huffman innumerable strategic FAS
+249 058125 37 Majorca Caroline gated
+250 058126 37 governing fatty flog
+251 058127 37 gadfly eastbound Pipestone
+252 058128 37 reassigned inexperienced Dar
+253 058201 37 intentness hoarder Corcoran
+254 058202 37 craziness scotch flyers A
+255 058303 37 psychic passport competitions W
+256 058304 37 squabbled strategic suppliers FAS
+257 058602 37 burlesque gated skips
+258 058603 37 capped flog institutes
+259 058604 37 extracted Pipestone troop A
+260 058605 37 DiMaggio Dar connective W
+261 058606 37 exclamation Corcoran denies
+262 058607 37 subdirectory flyers polka
+263 060401 36 fangs competitions observations FAS
+264 061701 36 buyer suppliers askers
+265 066201 36 pithing skips homeless FAS
+266 066501 36 transistorizing institutes Anna
+267 068001 36 nonbiodegradable troop subdirectories W
+268 068002 36 dislocate connective decaying FAS
+269 068005 36 monochromatic denies outwitting W
+270 068006 36 batting polka Harpy W
+271 068007 36 postcondition observations crazed
+272 068008 36 catalog askers suffocate
+273 068009 36 Remus homeless provers FAS
+274 068010 36 devices Anna technically
+275 068011 36 bike subdirectories Franklinizations
+276 068202 36 qualify decaying considered
+277 068302 36 detained outwitting tinnily
+278 068303 36 commended Harpy uninterruptedly
+279 068401 36 civilize crazed whistled A
+280 068501 36 Elmhurst suffocate automate
+281 068502 36 anesthetizing provers gutting W
+282 068503 36 deaf technically surreptitious
+283 068602 36 Brigham Franklinizations Choctaw
+284 068603 36 title considered cooks
+285 068701 36 coarse tinnily millivolt FAS
+286 068702 36 combinations uninterruptedly counterpoise
+287 068703 36 grayness whistled Gothicism
+288 076001 36 innumerable automate feminine
+289 076002 36 Caroline gutting metaphysically W
+290 076101 36 fatty surreptitious sanding A
+291 076102 36 eastbound Choctaw contributorily
+292 076103 36 inexperienced cooks receivers FAS
+293 076302 36 hoarder millivolt adjourn
+294 076303 36 scotch counterpoise straggled A
+295 076304 36 passport Gothicism druggists
+296 076305 36 strategic feminine thanking FAS
+297 076306 36 gated metaphysically ostrich
+298 076307 36 flog sanding hopelessness FAS
+299 076402 36 Pipestone contributorily Eurydice
+300 076501 36 Dar receivers excitation W
+301 076502 36 Corcoran adjourn presumes FAS
+302 076701 36 flyers straggled imaginable FAS
+303 078001 36 competitions druggists concoct W
+304 078002 36 suppliers thanking peering W
+305 078003 36 skips ostrich Phelps FAS
+306 078004 36 institutes hopelessness ferociousness FAS
+307 078005 36 troop Eurydice sentences
+308 078006 36 connective excitation unlocks
+309 078007 36 denies presumes engrossing W
+310 078008 36 polka imaginable Ruth
+311 078101 36 observations concoct tying
+312 078103 36 askers peering exclaimers
+313 078104 36 homeless Phelps synergy
+314 078105 36 Anna ferociousness Huey W
+315 082101 36 subdirectories sentences merging
+316 083401 36 decaying unlocks judges A
+317 084001 36 outwitting engrossing Shylock W
+318 084002 36 Harpy Ruth Miltonism
+319 086001 36 crazed tying hen W
+320 086102 36 suffocate exclaimers honeybee FAS
+321 086201 36 provers synergy towers
+322 088001 36 technically Huey dilutes W
+323 088002 36 Franklinizations merging numerals FAS
+324 088003 36 considered judges democracy FAS
+325 088004 36 tinnily Shylock Ibero-
+326 088101 36 uninterruptedly Miltonism invalids
+327 088102 36 whistled hen behavior
+328 088103 36 automate honeybee accruing
+329 088104 36 gutting towers relics A
+330 088105 36 surreptitious dilutes rackets
+331 088106 36 Choctaw numerals Fischbein W
+332 088201 36 cooks democracy phony W
+333 088203 36 millivolt Ibero- cross FAS
+334 088204 36 counterpoise invalids cleanup
+335 088302 37 Gothicism behavior conspirator
+336 088303 37 feminine accruing label FAS
+337 088305 37 metaphysically relics university
+338 088402 37 sanding rackets cleansed FAS
+339 088501 36 contributorily Fischbein ballgown
+340 088502 36 receivers phony starlet
+341 088503 36 adjourn cross aqueous
+342 098001 58 straggled cleanup portrayal A
+343 098002 58 druggists conspirator despising W
+344 098003 58 thanking label distort W
+345 098004 58 ostrich university palmed
+346 098005 58 hopelessness cleansed faced
+347 098006 58 Eurydice ballgown silverware
+348 141903 29 excitation starlet assessor
+349 098008 58 presumes aqueous spiders
+350 098009 58 imaginable portrayal artificially
+351 098010 58 concoct despising reminiscence
+352 098011 58 peering distort Mexican
+353 098012 58 Phelps palmed obnoxious
+354 098013 58 ferociousness faced fragile
+355 098014 58 sentences silverware apprehensible
+356 098015 58 unlocks assessor births
+357 098016 58 engrossing spiders garages
+358 098017 58 Ruth artificially panty
+359 098018 58 tying reminiscence anteater
+360 098019 58 exclaimers Mexican displacement A
+361 098020 58 synergy obnoxious drovers A
+362 098021 58 Huey fragile patenting A
+363 098022 58 merging apprehensible far A
+364 098023 58 judges births shrieks
+365 098024 58 Shylock garages aligning W
+366 098025 37 Miltonism panty pragmatism
+367 106001 36 hen anteater fevers W
+368 108001 36 honeybee displacement reexamines A
+369 108002 36 towers drovers occupancies
+370 108003 36 dilutes patenting sweats FAS
+371 108004 36 numerals far modulators
+372 108005 36 democracy shrieks demand W
+373 108007 36 Ibero- aligning Madeira
+374 108008 36 invalids pragmatism Viennese W
+375 108009 36 behavior fevers chillier W
+376 108010 36 accruing reexamines wildcats FAS
+377 108011 36 relics occupancies gentle
+378 108012 36 rackets sweats Angles W
+379 108101 36 Fischbein modulators accuracies
+380 108102 36 phony demand toggle
+381 108103 36 cross Madeira Mendelssohn W
+382 108111 50 cleanup Viennese behaviorally
+383 108105 36 conspirator chillier Rochford
+384 108106 36 label wildcats mirror W
+385 108107 36 university gentle Modula
+386 108108 50 cleansed Angles clobbering
+387 108109 36 ballgown accuracies chronography
+388 108110 36 starlet toggle Eskimoizeds
+389 108201 36 aqueous Mendelssohn British W
+390 108202 36 portrayal behaviorally pitfalls
+391 108203 36 despising Rochford verify W
+392 108204 36 distort mirror scatter FAS
+393 108205 36 palmed Modula Aztecan
+394 108301 36 faced clobbering acuity W
+395 108302 36 silverware chronography sinking W
+396 112101 36 assessor Eskimoizeds beasts FAS
+397 112102 36 spiders British Witt W
+398 113701 36 artificially pitfalls physicists FAS
+399 116001 36 reminiscence verify folksong A
+400 116201 36 Mexican scatter strokes FAS
+401 116301 36 obnoxious Aztecan crowder
+402 116302 36 fragile acuity merry
+403 116601 36 apprehensible sinking cadenced
+404 116602 36 births beasts alimony A
+405 116603 36 garages Witt principled A
+406 116701 36 panty physicists golfing
+407 116702 36 anteater folksong undiscovered
+408 118001 36 displacement strokes irritates
+409 118002 36 drovers crowder patriots A
+410 118003 36 patenting merry rooms FAS
+411 118004 36 far cadenced towering W
+412 118005 36 shrieks alimony displease
+413 118006 36 aligning principled photosensitive
+414 118007 36 pragmatism golfing inking
+415 118008 36 fevers undiscovered gainers
+416 118101 36 reexamines irritates leaning A
+417 118102 36 occupancies patriots hydrant A
+418 118103 36 sweats rooms preserve
+419 118202 36 modulators towering blinded A
+420 118203 36 demand displease interactions A
+421 118204 36 Madeira photosensitive Barry
+422 118302 36 Viennese inking whiteness A
+423 118304 36 chillier gainers pastimes W
+424 118305 36 wildcats leaning Edenization
+425 118306 36 gentle hydrant Muscat
+426 118307 36 Angles preserve assassinated
+427 123101 36 accuracies blinded labeled
+428 123102 36 toggle interactions glacial A
+429 123301 36 Mendelssohn Barry implied W
+430 126001 36 behaviorally whiteness bibliographies W
+431 126002 36 Rochford pastimes Buchanan
+432 126003 36 mirror Edenization forgivably FAS
+433 126101 36 Modula Muscat innuendo A
+434 126301 36 clobbering assassinated den FAS
+435 126302 36 chronography labeled submarines W
+436 126402 36 Eskimoizeds glacial mouthful A
+437 126601 36 British implied expiring
+438 126602 36 pitfalls bibliographies unfulfilled FAS
+439 126702 36 verify Buchanan precession
+440 128001 36 scatter forgivably nullified
+441 128002 36 Aztecan innuendo affects
+442 128003 36 acuity den Cynthia
+443 128004 36 sinking submarines Chablis A
+444 128005 36 beasts mouthful betterments FAS
+445 128007 36 Witt expiring advertising
+446 128008 36 physicists unfulfilled rubies A
+447 128009 36 folksong precession southwest FAS
+448 128010 36 strokes nullified superstitious A
+449 128011 36 crowder affects tabernacle W
+450 128012 36 merry Cynthia silk A
+451 128013 36 cadenced Chablis handsomest A
+452 128014 36 alimony betterments Persian A
+453 128015 36 principled advertising analog W
+454 128016 36 golfing rubies complex W
+455 128017 36 undiscovered southwest Taoist
+456 128018 36 irritates superstitious suspend
+457 128019 36 patriots tabernacle relegated
+458 128020 36 rooms silk awesome W
+459 128021 36 towering handsomest Bruxelles
+460 128022 36 displease Persian imprecisely A
+461 128023 36 photosensitive analog televise
+462 128101 36 inking complex braking
+463 128102 36 gainers Taoist true FAS
+464 128103 36 leaning suspend disappointing FAS
+465 128104 36 hydrant relegated navally W
+466 128106 36 preserve awesome circus
+467 128107 36 blinded Bruxelles beetles
+468 128108 36 interactions imprecisely trumps
+469 128202 36 Barry televise fourscore W
+470 128203 36 whiteness braking Blackfoots
+471 128301 36 pastimes true Grady
+472 128302 36 Edenization disappointing quiets FAS
+473 128303 36 Muscat navally floundered FAS
+474 128304 36 assassinated circus profundity W
+475 128305 36 labeled beetles Garrisonian W
+476 128307 36 glacial trumps Strauss
+477 128401 36 implied fourscore cemented FAS
+478 128502 36 bibliographies Blackfoots contrition A
+479 128503 36 Buchanan Grady mutations
+480 128504 36 forgivably quiets exhibits W
+481 128505 36 innuendo floundered tits
+482 128601 36 den profundity mate A
+483 128603 36 submarines Garrisonian arches
+484 128604 36 mouthful Strauss Moll
+485 128702 36 expiring cemented ropers
+486 128703 36 unfulfilled contrition bombast
+487 128704 36 precession mutations difficultly A
+488 138001 36 nullified exhibits adsorption
+489 138002 36 affects tits definiteness FAS
+490 138003 36 Cynthia mate cultivation A
+491 138004 36 Chablis arches heals A
+492 138005 36 betterments Moll Heusen W
+493 138006 36 advertising ropers target FAS
+494 138007 36 rubies bombast cited A
+495 138008 36 southwest difficultly congresswoman W
+496 138009 36 superstitious adsorption Katherine
+497 138102 36 tabernacle definiteness titter A
+498 138103 36 silk cultivation aspire A
+499 138104 36 handsomest heals Mardis
+500 138105 36 Persian Heusen Nadia W
+501 138201 36 analog target estimating FAS
+502 138302 36 complex cited stuck A
+503 138303 36 Taoist congresswoman fifteenth A
+504 138304 36 suspend Katherine Colombo
+505 138401 29 relegated titter survey A
+506 140102 29 awesome aspire staffing
+507 140103 29 Bruxelles Mardis obtain
+508 140104 29 imprecisely Nadia loaded
+509 140105 29 televise estimating slaughtered
+510 140201 29 braking stuck lights A
+511 140701 29 true fifteenth circumference
+512 141501 29 disappointing Colombo dull A
+513 141502 29 navally survey weekly A
+514 141901 29 circus staffing wetness
+515 141902 29 beetles obtain visualized
+516 142101 29 trumps loaded Tannenbaum
+517 142102 29 fourscore slaughtered moribund
+518 142103 29 Blackfoots lights demultiplex
+519 142701 29 Grady circumference lockings
+520 143001 29 quiets dull thugs FAS
+521 143501 29 floundered weekly unnerves
+522 143502 29 profundity wetness abut
+523 148001 29 Garrisonian visualized Chippewa A
+524 148002 29 Strauss Tannenbaum stratifications A
+525 148003 29 cemented moribund signaled
+526 148004 29 contrition demultiplex Italianizes A
+527 148005 29 mutations lockings algorithmic A
+528 148006 29 exhibits thugs paranoid FAS
+529 148007 29 tits unnerves camping A
+530 148009 29 mate abut signifying A
+531 148010 29 arches Chippewa Patrice W
+532 148011 29 Moll stratifications search A
+533 148012 29 ropers signaled Angeles A
+534 148013 29 bombast Italianizes semblance
+535 148023 36 difficultly algorithmic taxed
+536 148015 29 adsorption paranoid Beatrice
+537 148016 29 definiteness camping retrace
+538 148017 29 cultivation signifying lockout
+539 148018 29 heals Patrice grammatic
+540 148019 29 Heusen search helmsman
+541 148020 29 target Angeles uniform W
+542 148021 29 cited semblance hamming
+543 148022 29 congresswoman taxed disobedience
+544 148101 29 Katherine Beatrice captivated A
+545 148102 29 titter retrace transferals A
+546 148201 29 aspire lockout cartographer A
+547 148401 29 Mardis grammatic aims FAS
+548 148402 29 Nadia helmsman Pakistani
+549 148501 29 estimating uniform burglarized FAS
+550 148502 29 stuck hamming saucepans A
+551 148503 29 fifteenth disobedience lacerating A
+552 148504 29 Colombo captivated corny
+553 148601 29 survey transferals megabytes FAS
+554 148602 29 staffing cartographer chancellor
+555 150701 29 obtain aims bulk A
+556 152101 29 loaded Pakistani commits A
+557 152102 29 slaughtered burglarized meson W
+558 155202 36 lights saucepans deputies
+559 155203 29 circumference lacerating northeaster A
+560 155204 29 dull corny dipole
+561 155205 29 weekly megabytes machining 0
+562 156001 29 wetness chancellor therefore
+563 156002 29 visualized bulk Telefunken
+564 156102 29 Tannenbaum commits salvaging
+565 156301 29 moribund meson Corinthianizes A
+566 156302 29 demultiplex deputies restlessly A
+567 156303 29 lockings northeaster bromides
+568 156304 29 thugs dipole generalized A
+569 156305 29 unnerves machining mishaps
+570 156306 29 abut therefore quelling
+571 156501 29 Chippewa Telefunken spiritual A
+572 158001 29 stratifications salvaging beguiles FAS
+573 158002 29 signaled Corinthianizes Trobriand FAS
+574 158101 29 Italianizes restlessly fleeing A
+575 158102 29 algorithmic bromides Armour A
+576 158103 29 paranoid generalized chin A
+577 158201 29 camping mishaps provers A
+578 158202 29 signifying quelling aeronautic A
+579 158203 29 Patrice spiritual voltage W
+580 158204 29 search beguiles sash
+581 158301 29 Angeles Trobriand anaerobic A
+582 158302 29 semblance fleeing simultaneous A
+583 158303 29 taxed Armour accumulating A
+584 158304 29 Beatrice chin Medusan A
+585 158305 29 retrace provers shouted A
+586 158306 29 lockout aeronautic freakish
+587 158501 29 grammatic voltage index FAS
+588 160301 29 helmsman sash commercially
+589 166101 50 uniform anaerobic mistiness A
+590 166102 50 hamming simultaneous endpoint
+591 168001 29 disobedience accumulating straight A
+592 168002 29 captivated Medusan flurried
+593 168003 29 transferals shouted denotative A
+594 168101 29 cartographer freakish coming FAS
+595 168102 29 aims index commencements FAS
+596 168103 29 Pakistani commercially gentleman
+597 168104 29 burglarized mistiness gifted
+598 168202 29 saucepans endpoint Shanghais
+599 168301 29 lacerating straight sportswriting A
+600 168502 29 corny flurried sloping A
+601 168503 29 megabytes denotative navies
+602 168601 29 chancellor coming leaflet A
+603 173001 40 bulk commencements shooter
+604 173701 40 commits gentleman Joplin FAS
+605 173702 40 meson gifted babies
+606 176001 40 deputies Shanghais subdivision FAS
+607 176101 40 northeaster sportswriting burstiness W
+608 176201 40 dipole sloping belted FAS
+609 176401 40 machining navies assails FAS
+610 176501 40 therefore leaflet admiring W
+611 176601 40 Telefunken shooter swaying 0
+612 176602 40 salvaging Joplin Goldstine FAS
+613 176603 40 Corinthianizes babies fitting
+614 178001 40 restlessly subdivision Norwalk W
+615 178002 40 bromides burstiness weakening W
+616 178003 40 generalized belted analogy FAS
+617 178004 40 mishaps assails deludes
+618 178005 40 quelling admiring cokes
+619 178006 40 spiritual swaying Clayton
+620 178007 40 beguiles Goldstine exhausts
+621 178008 40 Trobriand fitting causality
+622 178101 40 fleeing Norwalk sating FAS
+623 178102 40 Armour weakening icon
+624 178103 40 chin analogy throttles
+625 178201 40 provers deludes communicants FAS
+626 178202 40 aeronautic cokes dehydrate FAS
+627 178301 40 voltage Clayton priceless FAS
+628 178302 40 sash exhausts publicly
+629 178401 40 anaerobic causality incidentals FAS
+630 178402 40 simultaneous sating commonplace
+631 178403 40 accumulating icon mumbles
+632 178404 40 Medusan throttles furthermore W
+633 178501 40 shouted communicants cautioned W
+634 186002 37 freakish dehydrate parametrized A
+635 186102 37 index priceless registration A
+636 186201 40 commercially publicly sadly FAS
+637 186202 40 mistiness incidentals positioning
+638 186203 40 endpoint commonplace babysitting
+639 186302 37 straight mumbles eternal A
+640 188007 37 flurried furthermore hoarder
+641 188008 37 denotative cautioned congregates
+642 188009 37 coming parametrized rains
+643 188010 37 commencements registration workers W
+644 188011 37 gentleman sadly sags A
+645 188012 37 gifted positioning unplug W
+646 188013 37 Shanghais babysitting garage A
+647 188014 37 sportswriting eternal boulder A
+648 188015 37 sloping hoarder hollowly A
+649 188016 37 navies congregates specifics
+650 188017 37 leaflet rains Teresa
+651 188102 37 shooter workers Winsett
+652 188103 37 Joplin sags convenient A
+653 188202 37 babies unplug buckboards FAS
+654 188301 40 subdivision garage amenities
+655 188302 40 burstiness boulder resplendent FAS
+656 188303 40 belted hollowly priding FAS
+657 188401 37 assails specifics configurations
+658 188402 37 admiring Teresa untidiness A
+659 188503 37 swaying Winsett Brice W
+660 188504 37 Goldstine convenient sews FAS
+661 188505 37 fitting buckboards participated
+662 190701 37 Norwalk amenities Simon FAS
+663 190703 50 weakening resplendent certificates
+664 191701 37 analogy priding Fitzpatrick
+665 191702 37 deludes configurations Evanston A
+666 191703 37 cokes untidiness misted
+667 196001 37 Clayton Brice textures A
+668 196002 37 exhausts sews save
+669 196003 37 causality participated count
+670 196101 37 sating Simon rightful A
+671 196103 37 icon certificates chaperone
+672 196104 37 throttles Fitzpatrick Lizzy A
+673 196201 37 communicants Evanston clenched A
+674 196202 37 dehydrate misted effortlessly
+675 196203 37 priceless textures accessed
+676 198001 37 publicly save beaters A
+677 198003 37 incidentals count Hornblower FAS
+678 198004 37 commonplace rightful vests A
+679 198005 37 mumbles chaperone indulgences FAS
+680 198006 37 furthermore Lizzy infallibly A
+681 198007 37 cautioned clenched unwilling FAS
+682 198008 37 parametrized effortlessly excrete FAS
+683 198009 37 registration accessed spools A
+684 198010 37 sadly beaters crunches FAS
+685 198011 37 positioning Hornblower overestimating FAS
+686 198012 37 babysitting vests ineffective
+687 198013 37 eternal indulgences humiliation A
+688 198014 37 hoarder infallibly sophomore
+689 198015 37 congregates unwilling star
+690 198017 37 rains excrete rifles
+691 198018 37 workers spools dialysis
+692 198019 37 sags crunches arriving
+693 198020 37 unplug overestimating indulge
+694 198021 37 garage ineffective clockers
+695 198022 37 boulder humiliation languages
+696 198023 50 hollowly sophomore Antarctica A
+697 198024 37 specifics star percentage
+698 198101 37 Teresa rifles ceiling A
+699 198103 37 Winsett dialysis specification
+700 198105 37 convenient arriving regimented A
+701 198106 37 buckboards indulge ciphers
+702 198201 37 amenities clockers pictures A
+703 198204 37 resplendent languages serpents A
+704 198301 53 priding Antarctica allot A
+705 198302 53 configurations percentage realized A
+706 198303 53 untidiness ceiling mayoral A
+707 198304 53 Brice specification opaquely A
+708 198401 37 sews regimented hostess FAS
+709 198402 37 participated ciphers fiftieth
+710 198403 37 Simon pictures incorrectly
+711 202101 37 certificates serpents decomposition FAS
+712 202301 37 Fitzpatrick allot stranglings
+713 202302 37 Evanston realized mixture FAS
+714 202303 37 misted mayoral electroencephalography FAS
+715 202304 37 textures opaquely similarities FAS
+716 202305 37 save hostess charges W
+717 202601 37 count fiftieth freest FAS
+718 202602 37 rightful incorrectly Greenberg FAS
+719 202605 37 chaperone decomposition tinting
+720 202606 37 Lizzy stranglings expelled W
+721 202607 37 clenched mixture warm
+722 202901 37 effortlessly electroencephalography smoothed
+723 202902 37 accessed similarities deductions FAS
+724 202903 37 beaters charges Romano W
+725 202904 37 Hornblower freest bitterroot
+726 202907 37 vests Greenberg corset
+727 202908 37 indulgences tinting securing
+728 203101 37 infallibly expelled environing FAS
+729 203103 37 unwilling warm cute
+730 203104 37 excrete smoothed Crays
+731 203105 37 spools deductions heiress FAS
+732 203401 37 crunches Romano inform FAS
+733 203402 37 overestimating bitterroot avenge
+734 203404 37 ineffective corset universals
+735 203901 37 humiliation securing Kinsey W
+736 203902 37 sophomore environing ravines FAS
+737 203903 37 star cute bestseller
+738 203906 37 rifles Crays equilibrium
+739 203907 37 dialysis heiress extents 0
+740 203908 37 arriving inform relatively
+741 203909 37 indulge avenge pressure FAS
+742 206101 37 clockers universals critiques FAS
+743 206201 37 languages Kinsey befouled
+744 206202 37 Antarctica ravines rightfully FAS
+745 206203 37 percentage bestseller mechanizing FAS
+746 206206 37 ceiling equilibrium Latinizes
+747 206207 37 specification extents timesharing
+748 206208 37 regimented relatively Aden
+749 208001 37 ciphers pressure embassies
+750 208002 37 pictures critiques males FAS
+751 208003 37 serpents befouled shapelessly FAS
+752 208004 37 allot rightfully genres FAS
+753 208008 37 realized mechanizing mastering
+754 208009 37 mayoral Latinizes Newtonian
+755 208010 37 opaquely timesharing finishers FAS
+756 208011 37 hostess Aden abates
+757 208101 37 fiftieth embassies teem
+758 208102 37 incorrectly males kiting FAS
+759 208103 37 decomposition shapelessly stodgy FAS
+760 208104 37 stranglings genres scalps FAS
+761 208105 37 mixture mastering feed FAS
+762 208110 37 electroencephalography Newtonian guitars
+763 208111 37 similarities finishers airships
+764 208112 37 charges abates store
+765 208113 37 freest teem denounces
+766 208201 37 Greenberg kiting Pyle FAS
+767 208203 37 tinting stodgy Saxony
+768 208301 37 expelled scalps serializations FAS
+769 208302 37 warm feed Peruvian FAS
+770 208305 37 smoothed guitars taxonomically FAS
+771 208401 37 deductions airships kingdom A
+772 208402 37 Romano store stint A
+773 208403 37 bitterroot denounces Sault A
+774 208404 37 corset Pyle faithful
+775 208501 37 securing Saxony Ganymede FAS
+776 208502 37 environing serializations tidiness FAS
+777 208503 37 cute Peruvian gainful FAS
+778 208504 37 Crays taxonomically contrary FAS
+779 208505 37 heiress kingdom Tipperary FAS
+780 210101 37 inform stint tropics W
+781 210102 37 avenge Sault theorizers
+782 210103 37 universals faithful renew 0
+783 210104 37 Kinsey Ganymede already
+784 210105 37 ravines tidiness terminal
+785 210106 37 bestseller gainful Hegelian
+786 210107 37 equilibrium contrary hypothesizer
+787 210401 37 extents Tipperary warningly FAS
+788 213201 37 relatively tropics journalizing FAS
+789 213203 37 pressure theorizers nested
+790 213204 37 critiques renew Lars
+791 213205 37 befouled already saplings
+792 213206 37 rightfully terminal foothill
+793 213207 37 mechanizing Hegelian labeled
+794 216101 37 Latinizes hypothesizer imperiously FAS
+795 216103 37 timesharing warningly reporters FAS
+796 218001 37 Aden journalizing furnishings FAS
+797 218002 37 embassies nested precipitable FAS
+798 218003 37 males Lars discounts FAS
+799 218004 37 shapelessly saplings excises FAS
+800 143503 50 genres foothill Stalin
+801 218006 37 mastering labeled despot FAS
+802 218007 37 Newtonian imperiously ripeness FAS
+803 218008 37 finishers reporters Arabia
+804 218009 37 abates furnishings unruly
+805 218010 37 teem precipitable mournfulness
+806 218011 37 kiting discounts boom FAS
+807 218020 37 stodgy excises slaughter A
+808 218021 50 scalps Stalin Sabine
+809 218022 37 feed despot handy FAS
+810 218023 37 guitars ripeness rural
+811 218024 37 airships Arabia organizer
+812 218101 37 store unruly shipyard FAS
+813 218102 37 denounces mournfulness civics FAS
+814 218103 37 Pyle boom inaccuracy FAS
+815 218201 37 Saxony slaughter rules FAS
+816 218202 37 serializations Sabine juveniles FAS
+817 218203 37 Peruvian handy comprised W
+818 218204 37 taxonomically rural investigations
+819 218205 37 kingdom organizer stabilizes A
+820 218301 37 stint shipyard seminaries FAS
+821 218302 37 Sault civics Hunter A
+822 218401 37 faithful inaccuracy sporty FAS
+823 218402 37 Ganymede rules test FAS
+824 218403 37 tidiness juveniles weasels
+825 218404 37 gainful comprised CERN
+826 218407 37 contrary investigations tempering
+827 218408 37 Tipperary stabilizes afore FAS
+828 218409 37 tropics seminaries Galatean
+829 218410 37 theorizers Hunter techniques W
+830 226001 37 renew sporty error
+831 226002 37 already test veranda
+832 226003 37 terminal weasels severely
+833 226004 37 Hegelian CERN Cassites FAS
+834 226005 37 hypothesizer tempering forthcoming
+835 226006 37 warningly afore guides
+836 226007 37 journalizing Galatean vanish FAS
+837 226008 37 nested techniques lied A
+838 226203 37 Lars error sawtooth FAS
+839 226204 37 saplings veranda fated FAS
+840 226205 37 foothill severely gradually
+841 226206 37 labeled Cassites widens
+842 226207 37 imperiously forthcoming preclude
+843 226208 37 reporters guides Jobrel
+844 226209 37 furnishings vanish hooker
+845 226210 37 precipitable lied rainstorm
+846 226211 37 discounts sawtooth disconnects
+847 228001 37 excises fated cruelty
+848 228004 37 Stalin gradually exponentials A
+849 228005 37 despot widens affective A
+850 228006 37 ripeness preclude arteries
+851 228007 37 Arabia Jobrel Crosby FAS
+852 228008 37 unruly hooker acquaint
+853 228009 37 mournfulness rainstorm evenhandedly
+854 228101 37 boom disconnects percentage
+855 228108 37 slaughter cruelty disobedience
+856 228109 37 Sabine exponentials humility
+857 228110 37 handy affective gleaning A
+858 228111 37 rural arteries petted A
+859 228112 37 organizer Crosby bloater A
+860 228113 37 shipyard acquaint minion A
+861 228114 37 civics evenhandedly marginal A
+862 228115 37 inaccuracy percentage apiary A
+863 228116 37 rules disobedience measures
+864 228117 37 juveniles humility precaution
+865 228118 37 comprised gleaning repelled
+866 228119 37 investigations petted primary FAS
+867 228120 37 stabilizes bloater coverings
+868 228121 37 seminaries minion Artemia A
+869 228122 37 Hunter marginal navigate
+870 228201 37 sporty apiary spatial
+871 228206 37 test measures Gurkha
+872 228207 37 weasels precaution meanwhile A
+873 228208 37 CERN repelled Melinda A
+874 228209 37 tempering primary Butterfield
+875 228210 37 afore coverings Aldrich A
+876 228211 37 Galatean Artemia previewing A
+877 228212 37 techniques navigate glut A
+878 228213 37 error spatial unaffected
+879 228214 37 veranda Gurkha inmate
+880 228301 37 severely meanwhile mineral
+881 228305 37 Cassites Melinda impending A
+882 228306 37 forthcoming Butterfield meditation A
+883 228307 37 guides Aldrich ideas
+884 228308 37 vanish previewing miniaturizes W
+885 228309 37 lied glut lewdly
+886 228310 37 sawtooth unaffected title
+887 228311 37 fated inmate youthfulness
+888 228312 37 gradually mineral creak FAS
+889 228313 37 widens impending Chippewa
+890 228314 37 preclude meditation clamored
+891 228401 65 Jobrel ideas freezes
+892 228402 65 hooker miniaturizes forgivably FAS
+893 228403 65 rainstorm lewdly reduce FAS
+894 228404 65 disconnects title McGovern W
+895 228405 65 cruelty youthfulness Nazis W
+896 228406 65 exponentials creak epistle W
+897 228407 65 affective Chippewa socializes W
+898 228408 65 arteries clamored conceptions
+899 228409 65 Crosby freezes Kevin
+900 228410 65 acquaint forgivably uncovering
+901 230301 37 evenhandedly reduce chews FAS
+902 230302 37 percentage McGovern appendixes FAS
+903 230303 37 disobedience Nazis raining
+904 018062 37 humility epistle infest
+905 230501 37 gleaning socializes compartment
+906 230502 37 petted conceptions minting
+907 230503 37 bloater Kevin ducks
+908 230504 37 minion uncovering roped A
+909 230505 37 marginal chews waltz
+910 230506 37 apiary appendixes Lillian
+911 230507 37 measures raining repressions A
+912 230508 37 precaution infest chillingly
+913 230509 37 repelled compartment noncritical
+914 230901 37 primary minting lithograph
+915 230902 37 coverings ducks spongers
+916 230903 37 Artemia roped parenthood
+917 230904 37 navigate waltz posed
+918 230905 37 spatial Lillian instruments
+919 230906 37 Gurkha repressions filial
+920 230907 37 meanwhile chillingly fixedly
+921 230908 37 Melinda noncritical relives
+922 230909 37 Butterfield lithograph Pandora
+923 230910 37 Aldrich spongers watering A
+924 230911 37 previewing parenthood ungrateful
+925 230912 37 glut posed secures
+926 230913 37 unaffected instruments chastisers
+927 230914 37 inmate filial icon
+928 231304 37 mineral fixedly reuniting A
+929 231305 37 impending relives imagining A
+930 231306 37 meditation Pandora abiding A
+931 231307 37 ideas watering omnisciently
+932 231308 37 miniaturizes ungrateful Britannic
+933 231309 37 lewdly secures scholastics A
+934 231310 37 title chastisers mechanics A
+935 231311 37 youthfulness icon humidly A
+936 231312 37 creak reuniting masterpiece
+937 231313 37 Chippewa imagining however
+938 231314 37 clamored abiding Mendelian
+939 231315 37 freezes omnisciently jarred
+940 232102 37 forgivably Britannic scolds
+941 232103 37 reduce scholastics infatuate
+942 232104 37 McGovern mechanics willed A
+943 232105 37 Nazis humidly joyfully
+944 232106 37 epistle masterpiece Microsoft
+945 232107 37 socializes however fibrosities
+946 232108 37 conceptions Mendelian Baltimorean
+947 232601 37 Kevin jarred equestrian
+948 232602 37 uncovering scolds Goodrich
+949 232603 37 chews infatuate apish A
+950 232605 37 appendixes willed Adlerian
+5950 1232605 37 appendixes willed Adlerian
+5951 1232606 37 appendixes willed Adlerian
+5952 1232607 37 appendixes willed Adlerian
+5953 1232608 37 appendixes willed Adlerian
+5954 1232609 37 appendixes willed Adlerian
+951 232606 37 raining joyfully Tropez
+952 232607 37 infest Microsoft nouns
+953 232608 37 compartment fibrosities distracting
+954 232609 37 minting Baltimorean mutton
+955 236104 37 ducks equestrian bridgeable A
+956 236105 37 roped Goodrich stickers A
+957 236106 37 waltz apish transcontinental A
+958 236107 37 Lillian Adlerian amateurish
+959 236108 37 repressions Tropez Gandhian
+960 236109 37 chillingly nouns stratified
+961 236110 37 noncritical distracting chamberlains
+962 236111 37 lithograph mutton creditably
+963 236112 37 spongers bridgeable philosophic
+964 236113 37 parenthood stickers ores
+965 238005 37 posed transcontinental Carleton
+966 238006 37 instruments amateurish tape A
+967 238007 37 filial Gandhian afloat A
+968 238008 37 fixedly stratified goodness A
+969 238009 37 relives chamberlains welcoming
+970 238010 37 Pandora creditably Pinsky FAS
+971 238011 37 watering philosophic halting
+972 238012 37 ungrateful ores bibliography
+973 238013 37 secures Carleton decoding
+974 240401 41 chastisers tape variance A
+975 240402 41 icon afloat allowed A
+976 240901 41 reuniting goodness dire A
+977 240902 41 imagining welcoming dub A
+978 241801 41 abiding Pinsky poisoning
+979 242101 41 omnisciently halting Iraqis A
+980 242102 41 Britannic bibliography heaving
+981 242201 41 scholastics decoding population A
+982 242202 41 mechanics variance bomb A
+983 242501 41 humidly allowed Majorca A
+984 242502 41 masterpiece dire Gershwins
+985 246201 41 however dub explorers
+986 246202 41 Mendelian poisoning libretto A
+987 246203 41 jarred Iraqis occurred
+988 246204 41 scolds heaving Lagos
+989 246205 41 infatuate population rats
+990 246301 41 willed bomb bankruptcies A
+991 246302 41 joyfully Majorca crying
+992 248001 41 Microsoft Gershwins unexpected
+993 248002 41 fibrosities explorers accessed A
+994 248003 41 Baltimorean libretto colorful A
+995 248004 41 equestrian occurred versatility A
+996 248005 41 Goodrich Lagos cosy
+997 248006 41 apish rats Darius A
+998 248007 41 Adlerian bankruptcies mastering A
+999 248008 41 Tropez crying Asiaticizations A
+1000 248009 41 nouns unexpected offerers A
+1001 248010 41 distracting accessed uncles A
+1002 248011 41 mutton colorful sleepwalk
+1003 248012 41 bridgeable versatility Ernestine
+1004 248013 41 stickers cosy checksumming
+1005 248014 41 transcontinental Darius stopped
+1006 248015 41 amateurish mastering sicker
+1007 248016 41 Gandhian Asiaticizations Italianization
+1008 248017 41 stratified offerers alphabetic
+1009 248018 41 chamberlains uncles pharmaceutic
+1010 248019 41 creditably sleepwalk creator
+1011 248020 41 philosophic Ernestine chess
+1012 248021 41 ores checksumming charcoal
+1013 248101 41 Carleton stopped Epiphany A
+1014 248102 41 tape sicker bulldozes A
+1015 248201 41 afloat Italianization Pygmalion A
+1016 248202 41 goodness alphabetic caressing A
+1017 248203 41 welcoming pharmaceutic Palestine A
+1018 248204 41 Pinsky creator regimented A
+1019 248205 41 halting chess scars A
+1020 248206 41 bibliography charcoal realest A
+1021 248207 41 decoding Epiphany diffusing A
+1022 248208 41 variance bulldozes clubroom A
+1023 248209 41 allowed Pygmalion Blythe A
+1024 248210 41 dire caressing ahead
+1025 248211 50 dub Palestine reviver
+1026 250501 34 poisoning regimented retransmitting A
+1027 250502 34 Iraqis scars landslide
+1028 250503 34 heaving realest Eiffel
+1029 250504 34 population diffusing absentee
+1030 250505 34 bomb clubroom aye
+1031 250601 34 Majorca Blythe forked A
+1032 250602 34 Gershwins ahead Peruvianizes
+1033 250603 34 explorers reviver clerked
+1034 250604 34 libretto retransmitting tutor
+1035 250605 34 occurred landslide boulevard
+1036 251001 34 Lagos Eiffel shuttered
+1037 251002 34 rats absentee quotes A
+1038 251003 34 bankruptcies aye Caltech
+1039 251004 34 crying forked Mossberg
+1040 251005 34 unexpected Peruvianizes kept
+1041 251301 34 accessed clerked roundly
+1042 251302 34 colorful tutor features A
+1043 251303 34 versatility boulevard imaginable A
+1044 251304 34 cosy shuttered controller
+1045 251305 34 Darius quotes racial
+1046 251401 34 mastering Caltech uprisings A
+1047 251402 34 Asiaticizations Mossberg narrowed A
+1048 251403 34 offerers kept cannot A
+1049 251404 34 uncles roundly vest
+1050 251405 34 sleepwalk features famine
+1051 251406 34 Ernestine imaginable sugars
+1052 251801 34 checksumming controller exterminated A
+1053 251802 34 stopped racial belays
+1054 252101 34 sicker uprisings Hodges A
+1055 252102 34 Italianization narrowed translatable
+1056 252301 34 alphabetic cannot duality A
+1057 252302 34 pharmaceutic vest recording A
+1058 252303 34 creator famine rouses A
+1059 252304 34 chess sugars poison
+1060 252305 34 charcoal exterminated attitude
+1061 252306 34 Epiphany belays dusted
+1062 252307 34 bulldozes Hodges encompasses
+1063 252308 34 Pygmalion translatable presentation
+1064 252309 34 caressing duality Kantian
+1065 256001 34 Palestine recording imprecision A
+1066 256002 34 regimented rouses saving
+1067 256003 34 scars poison maternal
+1068 256004 34 realest attitude hewed
+1069 256005 34 diffusing dusted kerosene
+1070 258001 34 clubroom encompasses Cubans
+1071 258002 34 Blythe presentation photographers
+1072 258003 34 ahead Kantian nymph A
+1073 258004 34 reviver imprecision bedlam A
+1074 258005 34 retransmitting saving north A
+1075 258006 34 landslide maternal Schoenberg A
+1076 258007 34 Eiffel hewed botany A
+1077 258008 34 absentee kerosene curs
+1078 258009 34 aye Cubans solidification
+1079 258010 34 forked photographers inheritresses
+1080 258011 34 Peruvianizes nymph stiller
+1081 258101 68 clerked bedlam t1 A
+1082 258102 68 tutor north suite A
+1083 258103 34 boulevard Schoenberg ransomer
+1084 258104 68 shuttered botany Willy
+1085 258105 68 quotes curs Rena A
+1086 258106 68 Caltech solidification Seattle A
+1087 258107 68 Mossberg inheritresses relaxes A
+1088 258108 68 kept stiller exclaim
+1089 258109 68 roundly t1 implicated A
+1090 258110 68 features suite distinguish
+1091 258111 68 imaginable ransomer assayed
+1092 258112 68 controller Willy homeowner
+1093 258113 68 racial Rena and
+1094 258201 34 uprisings Seattle stealth
+1095 258202 34 narrowed relaxes coinciding A
+1096 258203 34 cannot exclaim founder A
+1097 258204 34 vest implicated environing
+1098 258205 34 famine distinguish jewelry
+1099 258301 34 sugars assayed lemons A
+1100 258401 34 exterminated homeowner brokenness A
+1101 258402 34 belays and bedpost A
+1102 258403 34 Hodges stealth assurers A
+1103 258404 34 translatable coinciding annoyers
+1104 258405 34 duality founder affixed
+1105 258406 34 recording environing warbling
+1106 258407 34 rouses jewelry seriously
+1107 228123 37 poison lemons boasted
+1108 250606 34 attitude brokenness Chantilly
+1109 208405 37 dusted bedpost Iranizes
+1110 212101 37 encompasses assurers violinist
+1111 218206 37 presentation annoyers extramarital
+1112 150401 37 Kantian affixed spates
+1113 248212 41 imprecision warbling cloakroom
+1114 128026 00 saving seriously gazer
+1115 128024 00 maternal boasted hand
+1116 128027 00 hewed Chantilly tucked
+1117 128025 00 kerosene Iranizes gems
+1118 128109 00 Cubans violinist clinker
+1119 128705 00 photographers extramarital refiner
+1120 126303 00 nymph spates callus
+1121 128308 00 bedlam cloakroom leopards
+1122 128204 00 north gazer comfortingly
+1123 128205 00 Schoenberg hand generically
+1124 128206 00 botany tucked getters
+1125 128207 00 curs gems sexually
+1126 118205 00 solidification clinker spear
+1127 116801 00 inheritresses refiner serums
+1128 116803 00 stiller callus Italianization
+1129 116804 00 t1 leopards attendants
+1130 116802 00 suite comfortingly spies
+1131 128605 00 ransomer generically Anthony
+1132 118308 00 Willy getters planar
+1133 113702 00 Rena sexually cupped
+1134 113703 00 Seattle spear cleanser
+1135 112103 00 relaxes serums commuters
+1136 118009 00 exclaim Italianization honeysuckle
+5136 1118009 00 exclaim Italianization honeysuckle
+1137 138011 00 implicated attendants orphanage
+1138 138010 00 distinguish spies skies
+1139 138012 00 assayed Anthony crushers
+1140 068304 00 homeowner planar Puritan
+1141 078009 00 and cupped squeezer
+1142 108013 00 stealth cleanser bruises
+1143 084004 00 coinciding commuters bonfire
+1144 083402 00 founder honeysuckle Colombo
+1145 084003 00 environing orphanage nondecreasing
+1146 088504 00 jewelry skies innocents
+1147 088005 00 lemons crushers masked
+1148 088007 00 brokenness Puritan file
+1149 088006 00 bedpost squeezer brush
+1150 148025 00 assurers bruises mutilate
+1151 148024 00 annoyers bonfire mommy
+1152 138305 00 affixed Colombo bulkheads
+1153 138306 00 warbling nondecreasing undeclared
+1154 152701 00 seriously innocents displacements
+1155 148505 00 boasted masked nieces
+1156 158003 00 Chantilly file coeducation
+1157 156201 00 Iranizes brush brassy
+1158 156202 00 violinist mutilate authenticator
+1159 158307 00 extramarital mommy Washoe
+1160 158402 00 spates bulkheads penny
+1161 158401 00 cloakroom undeclared Flagler
+1162 068013 00 gazer displacements stoned
+1163 068012 00 hand nieces cranes
+1164 068203 00 tucked coeducation masterful
+1165 088205 00 gems brassy biracial
+1166 068704 00 clinker authenticator steamships
+1167 068604 00 refiner Washoe windmills
+1168 158502 00 callus penny exploit
+1169 123103 00 leopards Flagler riverfront
+1170 148026 00 comfortingly stoned sisterly
+1171 123302 00 generically cranes sharpshoot
+1172 076503 00 getters masterful mittens
+1173 126304 00 sexually biracial interdependency
+1174 068306 00 spear steamships policy
+1175 143504 00 serums windmills unleashing
+1176 160201 00 Italianization exploit pretenders
+1177 148028 00 attendants riverfront overstatements
+1178 148027 00 spies sisterly birthed
+1179 143505 00 Anthony sharpshoot opportunism
+1180 108014 00 planar mittens showroom
+1181 076104 00 cupped interdependency compromisingly
+1182 078106 00 cleanser policy Medicare
+1183 126102 00 commuters unleashing corresponds
+1184 128029 00 honeysuckle pretenders hardware
+1185 128028 00 orphanage overstatements implant
+1186 018410 00 skies birthed Alicia
+1187 128110 00 crushers opportunism requesting
+1188 148506 00 Puritan showroom produced
+1189 123303 00 squeezer compromisingly criticizes
+1190 123304 00 bruises Medicare backer
+1191 068504 00 bonfire corresponds positively
+1192 068305 00 Colombo hardware colicky
+1193 000000 00 nondecreasing implant thrillingly
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg W
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+2 011401 37 breaking dreaded Steinberg W
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg W
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+2 011401 37 breaking dreaded Steinberg W
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
+ALTER TABLE t2 DROP COLUMN fld6;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `auto` int(11) default NULL,
+ `fld1` int(6) unsigned zerofill NOT NULL default '000000',
+ `companynr` tinyint(2) unsigned zerofill NOT NULL default '00',
+ `fld3` char(30) NOT NULL default '',
+ `fld4` char(35) NOT NULL default '',
+ `fld5` char(35) NOT NULL default ''
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+SELECT * from t2;
+auto fld1 companynr fld3 fld4 fld5
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+5 011501 37 bewilderingly wallet balled
+6 011701 37 astound parters persist
+7 011702 37 admonishing eschew attainments
+8 011703 37 sumac quitter fanatic
+9 012001 37 flanking neat measures
+10 012003 37 combed Steinberg rightfulness
+11 012004 37 subjective jarring capably
+12 012005 37 scatterbrain tinily impulsive
+13 012301 37 Eulerian balled starlet
+14 012302 36 dubbed persist terminators
+15 012303 37 Kane attainments untying
+16 012304 37 overlay fanatic announces
+17 012305 37 perturb measures featherweight
+18 012306 37 goblins rightfulness pessimist
+19 012501 37 annihilates capably daughter
+20 012602 37 Wotan impulsive decliner
+21 012603 37 snatching starlet lawgiver
+22 012604 37 concludes terminators stated
+23 012605 37 laterally untying readable
+24 012606 37 yelped announces attrition
+25 012701 37 grazing featherweight cascade
+26 012702 37 Baird pessimist motors
+27 012703 37 celery daughter interrogate
+28 012704 37 misunderstander decliner pests
+29 013601 37 handgun lawgiver stairway
+30 013602 37 foldout stated dopers
+31 013603 37 mystic readable testicle
+32 013604 37 succumbed attrition Parsifal
+33 013605 37 Nabisco cascade leavings
+34 013606 37 fingerings motors postulation
+35 013607 37 aging interrogate squeaking
+36 013608 37 afield pests contrasted
+37 013609 37 ammonium stairway leftover
+38 013610 37 boat dopers whiteners
+39 013801 37 intelligibility testicle erases
+40 013802 37 Augustine Parsifal Punjab
+41 013803 37 teethe leavings Merritt
+42 013804 37 dreaded postulation Quixotism
+43 013901 37 scholastics squeaking sweetish
+44 016001 37 audiology contrasted dogging
+45 016201 37 wallet leftover scornfully
+46 016202 37 parters whiteners bellow
+47 016301 37 eschew erases bills
+48 016302 37 quitter Punjab cupboard
+49 016303 37 neat Merritt sureties
+50 016304 37 Steinberg Quixotism puddings
+51 018001 37 jarring sweetish tapestry
+52 018002 37 tinily dogging fetters
+53 018003 37 balled scornfully bivalves
+54 018004 37 persist bellow incurring
+55 018005 37 attainments bills Adolph
+56 018007 37 fanatic cupboard pithed
+57 018008 37 measures sureties emergency
+58 018009 37 rightfulness puddings Miles
+59 018010 37 capably tapestry trimmings
+60 018012 37 impulsive fetters tragedies
+61 018013 37 starlet bivalves skulking
+62 018014 37 terminators incurring flint
+63 018015 37 untying Adolph flopping
+64 018016 37 announces pithed relaxing
+65 018017 37 featherweight emergency offload
+66 018018 37 pessimist Miles suites
+67 018019 37 daughter trimmings lists
+68 018020 37 decliner tragedies animized
+69 018021 37 lawgiver skulking multilayer
+70 018022 37 stated flint standardizes
+71 018023 37 readable flopping Judas
+72 018024 37 attrition relaxing vacuuming
+73 018025 37 cascade offload dentally
+74 018026 37 motors suites humanness
+75 018027 37 interrogate lists inch
+76 018028 37 pests animized Weissmuller
+77 018029 37 stairway multilayer irresponsibly
+78 018030 37 dopers standardizes luckily
+79 018032 37 testicle Judas culled
+80 018033 37 Parsifal vacuuming medical
+81 018034 37 leavings dentally bloodbath
+82 018035 37 postulation humanness subschema
+83 018036 37 squeaking inch animals
+84 018037 37 contrasted Weissmuller Micronesia
+85 018038 37 leftover irresponsibly repetitions
+86 018039 37 whiteners luckily Antares
+87 018040 37 erases culled ventilate
+88 018041 37 Punjab medical pityingly
+89 018042 37 Merritt bloodbath interdependent
+90 018043 37 Quixotism subschema Graves
+91 018044 37 sweetish animals neonatal
+92 018045 37 dogging Micronesia scribbled
+93 018046 37 scornfully repetitions chafe
+94 018048 37 bellow Antares honoring
+95 018049 37 bills ventilate realtor
+96 018050 37 cupboard pityingly elite
+97 018051 37 sureties interdependent funereal
+98 018052 37 puddings Graves abrogating
+99 018053 50 tapestry neonatal sorters
+100 018054 37 fetters scribbled Conley
+101 018055 37 bivalves chafe lectured
+102 018056 37 incurring honoring Abraham
+103 018057 37 Adolph realtor Hawaii
+104 018058 37 pithed elite cage
+105 018059 36 emergency funereal hushes
+106 018060 37 Miles abrogating Simla
+107 018061 37 trimmings sorters reporters
+108 018101 37 tragedies Conley Dutchman
+109 018102 37 skulking lectured descendants
+110 018103 37 flint Abraham groupings
+111 018104 37 flopping Hawaii dissociate
+112 018201 37 relaxing cage coexist
+113 018202 37 offload hushes Beebe
+114 018402 37 suites Simla Taoism
+115 018403 37 lists reporters Connally
+116 018404 37 animized Dutchman fetched
+117 018405 37 multilayer descendants checkpoints
+118 018406 37 standardizes groupings rusting
+119 018409 37 Judas dissociate galling
+120 018601 37 vacuuming coexist obliterates
+121 018602 37 dentally Beebe traitor
+122 018603 37 humanness Taoism resumes
+123 018801 37 inch Connally analyzable
+124 018802 37 Weissmuller fetched terminator
+125 018803 37 irresponsibly checkpoints gritty
+126 018804 37 luckily rusting firearm
+127 018805 37 culled galling minima
+128 018806 37 medical obliterates Selfridge
+129 018807 37 bloodbath traitor disable
+130 018808 37 subschema resumes witchcraft
+131 018809 37 animals analyzable betroth
+132 018810 37 Micronesia terminator Manhattanize
+133 018811 37 repetitions gritty imprint
+134 018812 37 Antares firearm peeked
+135 019101 37 ventilate minima swelling
+136 019102 37 pityingly Selfridge interrelationships
+137 019103 37 interdependent disable riser
+138 019201 37 Graves witchcraft Gandhian
+139 030501 37 neonatal betroth peacock
+140 030502 50 scribbled Manhattanize bee
+141 030503 37 chafe imprint kanji
+142 030504 37 honoring peeked dental
+143 031901 37 realtor swelling scarf
+144 036001 37 elite interrelationships chasm
+145 036002 37 funereal riser insolence
+146 036004 37 abrogating Gandhian syndicate
+147 036005 37 sorters peacock alike
+148 038001 37 Conley bee imperial
+149 038002 37 lectured kanji convulsion
+150 038003 37 Abraham dental railway
+151 038004 37 Hawaii scarf validate
+152 038005 37 cage chasm normalizes
+153 038006 37 hushes insolence comprehensive
+154 038007 37 Simla syndicate chewing
+155 038008 37 reporters alike denizen
+156 038009 37 Dutchman imperial schemer
+157 038010 37 descendants convulsion chronicle
+158 038011 37 groupings railway Kline
+159 038012 37 dissociate validate Anatole
+160 038013 37 coexist normalizes partridges
+161 038014 37 Beebe comprehensive brunch
+162 038015 37 Taoism chewing recruited
+163 038016 37 Connally denizen dimensions
+164 038017 37 fetched schemer Chicana
+165 038018 37 checkpoints chronicle announced
+166 038101 37 rusting Kline praised
+167 038102 37 galling Anatole employing
+168 038103 37 obliterates partridges linear
+169 038104 37 traitor brunch quagmire
+170 038201 37 resumes recruited western
+171 038202 37 analyzable dimensions relishing
+172 038203 37 terminator Chicana serving
+173 038204 37 gritty announced scheduling
+174 038205 37 firearm praised lore
+175 038206 37 minima employing eventful
+176 038208 37 Selfridge linear arteriole
+177 042801 37 disable quagmire disentangle
+178 042802 37 witchcraft western cured
+179 046101 37 betroth relishing Fenton
+180 048001 37 Manhattanize serving avoidable
+181 048002 37 imprint scheduling drains
+182 048003 37 peeked lore detectably
+183 048004 37 swelling eventful husky
+184 048005 37 interrelationships arteriole impelling
+185 048006 37 riser disentangle undoes
+186 048007 37 Gandhian cured evened
+187 048008 37 peacock Fenton squeezes
+188 048101 37 bee avoidable destroyer
+189 048102 37 kanji drains rudeness
+190 048201 37 dental detectably beaner
+191 048202 37 scarf husky boorish
+192 048203 37 chasm impelling Everhart
+193 048204 37 insolence undoes encompass
+194 048205 37 syndicate evened mushrooms
+195 048301 37 alike squeezes Alison
+196 048302 37 imperial destroyer externally
+197 048303 37 convulsion rudeness pellagra
+198 048304 37 railway beaner cult
+199 048305 37 validate boorish creek
+200 048401 37 normalizes Everhart Huffman
+201 048402 37 comprehensive encompass Majorca
+202 048403 37 chewing mushrooms governing
+203 048404 37 denizen Alison gadfly
+204 048405 37 schemer externally reassigned
+205 048406 37 chronicle pellagra intentness
+206 048407 37 Kline cult craziness
+207 048408 37 Anatole creek psychic
+208 048409 37 partridges Huffman squabbled
+209 048410 37 brunch Majorca burlesque
+210 048411 37 recruited governing capped
+211 048412 37 dimensions gadfly extracted
+212 048413 37 Chicana reassigned DiMaggio
+213 048601 37 announced intentness exclamation
+214 048602 37 praised craziness subdirectory
+215 048603 37 employing psychic fangs
+216 048604 37 linear squabbled buyer
+217 048801 37 quagmire burlesque pithing
+218 050901 37 western capped transistorizing
+219 051201 37 relishing extracted nonbiodegradable
+220 056002 37 serving DiMaggio dislocate
+221 056003 37 scheduling exclamation monochromatic
+222 056004 37 lore subdirectory batting
+223 056102 37 eventful fangs postcondition
+224 056203 37 arteriole buyer catalog
+225 056204 37 disentangle pithing Remus
+226 058003 37 cured transistorizing devices
+227 058004 37 Fenton nonbiodegradable bike
+228 058005 37 avoidable dislocate qualify
+229 058006 37 drains monochromatic detained
+230 058007 37 detectably batting commended
+231 058101 37 husky postcondition civilize
+232 058102 37 impelling catalog Elmhurst
+233 058103 37 undoes Remus anesthetizing
+234 058105 37 evened devices deaf
+235 058111 37 squeezes bike Brigham
+236 058112 37 destroyer qualify title
+237 058113 37 rudeness detained coarse
+238 058114 37 beaner commended combinations
+239 058115 37 boorish civilize grayness
+240 058116 37 Everhart Elmhurst innumerable
+241 058117 37 encompass anesthetizing Caroline
+242 058118 37 mushrooms deaf fatty
+243 058119 37 Alison Brigham eastbound
+244 058120 37 externally title inexperienced
+245 058121 37 pellagra coarse hoarder
+246 058122 37 cult combinations scotch
+247 058123 37 creek grayness passport
+248 058124 37 Huffman innumerable strategic
+249 058125 37 Majorca Caroline gated
+250 058126 37 governing fatty flog
+251 058127 37 gadfly eastbound Pipestone
+252 058128 37 reassigned inexperienced Dar
+253 058201 37 intentness hoarder Corcoran
+254 058202 37 craziness scotch flyers
+255 058303 37 psychic passport competitions
+256 058304 37 squabbled strategic suppliers
+257 058602 37 burlesque gated skips
+258 058603 37 capped flog institutes
+259 058604 37 extracted Pipestone troop
+260 058605 37 DiMaggio Dar connective
+261 058606 37 exclamation Corcoran denies
+262 058607 37 subdirectory flyers polka
+263 060401 36 fangs competitions observations
+264 061701 36 buyer suppliers askers
+265 066201 36 pithing skips homeless
+266 066501 36 transistorizing institutes Anna
+267 068001 36 nonbiodegradable troop subdirectories
+268 068002 36 dislocate connective decaying
+269 068005 36 monochromatic denies outwitting
+270 068006 36 batting polka Harpy
+271 068007 36 postcondition observations crazed
+272 068008 36 catalog askers suffocate
+273 068009 36 Remus homeless provers
+274 068010 36 devices Anna technically
+275 068011 36 bike subdirectories Franklinizations
+276 068202 36 qualify decaying considered
+277 068302 36 detained outwitting tinnily
+278 068303 36 commended Harpy uninterruptedly
+279 068401 36 civilize crazed whistled
+280 068501 36 Elmhurst suffocate automate
+281 068502 36 anesthetizing provers gutting
+282 068503 36 deaf technically surreptitious
+283 068602 36 Brigham Franklinizations Choctaw
+284 068603 36 title considered cooks
+285 068701 36 coarse tinnily millivolt
+286 068702 36 combinations uninterruptedly counterpoise
+287 068703 36 grayness whistled Gothicism
+288 076001 36 innumerable automate feminine
+289 076002 36 Caroline gutting metaphysically
+290 076101 36 fatty surreptitious sanding
+291 076102 36 eastbound Choctaw contributorily
+292 076103 36 inexperienced cooks receivers
+293 076302 36 hoarder millivolt adjourn
+294 076303 36 scotch counterpoise straggled
+295 076304 36 passport Gothicism druggists
+296 076305 36 strategic feminine thanking
+297 076306 36 gated metaphysically ostrich
+298 076307 36 flog sanding hopelessness
+299 076402 36 Pipestone contributorily Eurydice
+300 076501 36 Dar receivers excitation
+301 076502 36 Corcoran adjourn presumes
+302 076701 36 flyers straggled imaginable
+303 078001 36 competitions druggists concoct
+304 078002 36 suppliers thanking peering
+305 078003 36 skips ostrich Phelps
+306 078004 36 institutes hopelessness ferociousness
+307 078005 36 troop Eurydice sentences
+308 078006 36 connective excitation unlocks
+309 078007 36 denies presumes engrossing
+310 078008 36 polka imaginable Ruth
+311 078101 36 observations concoct tying
+312 078103 36 askers peering exclaimers
+313 078104 36 homeless Phelps synergy
+314 078105 36 Anna ferociousness Huey
+315 082101 36 subdirectories sentences merging
+316 083401 36 decaying unlocks judges
+317 084001 36 outwitting engrossing Shylock
+318 084002 36 Harpy Ruth Miltonism
+319 086001 36 crazed tying hen
+320 086102 36 suffocate exclaimers honeybee
+321 086201 36 provers synergy towers
+322 088001 36 technically Huey dilutes
+323 088002 36 Franklinizations merging numerals
+324 088003 36 considered judges democracy
+325 088004 36 tinnily Shylock Ibero-
+326 088101 36 uninterruptedly Miltonism invalids
+327 088102 36 whistled hen behavior
+328 088103 36 automate honeybee accruing
+329 088104 36 gutting towers relics
+330 088105 36 surreptitious dilutes rackets
+331 088106 36 Choctaw numerals Fischbein
+332 088201 36 cooks democracy phony
+333 088203 36 millivolt Ibero- cross
+334 088204 36 counterpoise invalids cleanup
+335 088302 37 Gothicism behavior conspirator
+336 088303 37 feminine accruing label
+337 088305 37 metaphysically relics university
+338 088402 37 sanding rackets cleansed
+339 088501 36 contributorily Fischbein ballgown
+340 088502 36 receivers phony starlet
+341 088503 36 adjourn cross aqueous
+342 098001 58 straggled cleanup portrayal
+343 098002 58 druggists conspirator despising
+344 098003 58 thanking label distort
+345 098004 58 ostrich university palmed
+346 098005 58 hopelessness cleansed faced
+347 098006 58 Eurydice ballgown silverware
+348 141903 29 excitation starlet assessor
+349 098008 58 presumes aqueous spiders
+350 098009 58 imaginable portrayal artificially
+351 098010 58 concoct despising reminiscence
+352 098011 58 peering distort Mexican
+353 098012 58 Phelps palmed obnoxious
+354 098013 58 ferociousness faced fragile
+355 098014 58 sentences silverware apprehensible
+356 098015 58 unlocks assessor births
+357 098016 58 engrossing spiders garages
+358 098017 58 Ruth artificially panty
+359 098018 58 tying reminiscence anteater
+360 098019 58 exclaimers Mexican displacement
+361 098020 58 synergy obnoxious drovers
+362 098021 58 Huey fragile patenting
+363 098022 58 merging apprehensible far
+364 098023 58 judges births shrieks
+365 098024 58 Shylock garages aligning
+366 098025 37 Miltonism panty pragmatism
+367 106001 36 hen anteater fevers
+368 108001 36 honeybee displacement reexamines
+369 108002 36 towers drovers occupancies
+370 108003 36 dilutes patenting sweats
+371 108004 36 numerals far modulators
+372 108005 36 democracy shrieks demand
+373 108007 36 Ibero- aligning Madeira
+374 108008 36 invalids pragmatism Viennese
+375 108009 36 behavior fevers chillier
+376 108010 36 accruing reexamines wildcats
+377 108011 36 relics occupancies gentle
+378 108012 36 rackets sweats Angles
+379 108101 36 Fischbein modulators accuracies
+380 108102 36 phony demand toggle
+381 108103 36 cross Madeira Mendelssohn
+382 108111 50 cleanup Viennese behaviorally
+383 108105 36 conspirator chillier Rochford
+384 108106 36 label wildcats mirror
+385 108107 36 university gentle Modula
+386 108108 50 cleansed Angles clobbering
+387 108109 36 ballgown accuracies chronography
+388 108110 36 starlet toggle Eskimoizeds
+389 108201 36 aqueous Mendelssohn British
+390 108202 36 portrayal behaviorally pitfalls
+391 108203 36 despising Rochford verify
+392 108204 36 distort mirror scatter
+393 108205 36 palmed Modula Aztecan
+394 108301 36 faced clobbering acuity
+395 108302 36 silverware chronography sinking
+396 112101 36 assessor Eskimoizeds beasts
+397 112102 36 spiders British Witt
+398 113701 36 artificially pitfalls physicists
+399 116001 36 reminiscence verify folksong
+400 116201 36 Mexican scatter strokes
+401 116301 36 obnoxious Aztecan crowder
+402 116302 36 fragile acuity merry
+403 116601 36 apprehensible sinking cadenced
+404 116602 36 births beasts alimony
+405 116603 36 garages Witt principled
+406 116701 36 panty physicists golfing
+407 116702 36 anteater folksong undiscovered
+408 118001 36 displacement strokes irritates
+409 118002 36 drovers crowder patriots
+410 118003 36 patenting merry rooms
+411 118004 36 far cadenced towering
+412 118005 36 shrieks alimony displease
+413 118006 36 aligning principled photosensitive
+414 118007 36 pragmatism golfing inking
+415 118008 36 fevers undiscovered gainers
+416 118101 36 reexamines irritates leaning
+417 118102 36 occupancies patriots hydrant
+418 118103 36 sweats rooms preserve
+419 118202 36 modulators towering blinded
+420 118203 36 demand displease interactions
+421 118204 36 Madeira photosensitive Barry
+422 118302 36 Viennese inking whiteness
+423 118304 36 chillier gainers pastimes
+424 118305 36 wildcats leaning Edenization
+425 118306 36 gentle hydrant Muscat
+426 118307 36 Angles preserve assassinated
+427 123101 36 accuracies blinded labeled
+428 123102 36 toggle interactions glacial
+429 123301 36 Mendelssohn Barry implied
+430 126001 36 behaviorally whiteness bibliographies
+431 126002 36 Rochford pastimes Buchanan
+432 126003 36 mirror Edenization forgivably
+433 126101 36 Modula Muscat innuendo
+434 126301 36 clobbering assassinated den
+435 126302 36 chronography labeled submarines
+436 126402 36 Eskimoizeds glacial mouthful
+437 126601 36 British implied expiring
+438 126602 36 pitfalls bibliographies unfulfilled
+439 126702 36 verify Buchanan precession
+440 128001 36 scatter forgivably nullified
+441 128002 36 Aztecan innuendo affects
+442 128003 36 acuity den Cynthia
+443 128004 36 sinking submarines Chablis
+444 128005 36 beasts mouthful betterments
+445 128007 36 Witt expiring advertising
+446 128008 36 physicists unfulfilled rubies
+447 128009 36 folksong precession southwest
+448 128010 36 strokes nullified superstitious
+449 128011 36 crowder affects tabernacle
+450 128012 36 merry Cynthia silk
+451 128013 36 cadenced Chablis handsomest
+452 128014 36 alimony betterments Persian
+453 128015 36 principled advertising analog
+454 128016 36 golfing rubies complex
+455 128017 36 undiscovered southwest Taoist
+456 128018 36 irritates superstitious suspend
+457 128019 36 patriots tabernacle relegated
+458 128020 36 rooms silk awesome
+459 128021 36 towering handsomest Bruxelles
+460 128022 36 displease Persian imprecisely
+461 128023 36 photosensitive analog televise
+462 128101 36 inking complex braking
+463 128102 36 gainers Taoist true
+464 128103 36 leaning suspend disappointing
+465 128104 36 hydrant relegated navally
+466 128106 36 preserve awesome circus
+467 128107 36 blinded Bruxelles beetles
+468 128108 36 interactions imprecisely trumps
+469 128202 36 Barry televise fourscore
+470 128203 36 whiteness braking Blackfoots
+471 128301 36 pastimes true Grady
+472 128302 36 Edenization disappointing quiets
+473 128303 36 Muscat navally floundered
+474 128304 36 assassinated circus profundity
+475 128305 36 labeled beetles Garrisonian
+476 128307 36 glacial trumps Strauss
+477 128401 36 implied fourscore cemented
+478 128502 36 bibliographies Blackfoots contrition
+479 128503 36 Buchanan Grady mutations
+480 128504 36 forgivably quiets exhibits
+481 128505 36 innuendo floundered tits
+482 128601 36 den profundity mate
+483 128603 36 submarines Garrisonian arches
+484 128604 36 mouthful Strauss Moll
+485 128702 36 expiring cemented ropers
+486 128703 36 unfulfilled contrition bombast
+487 128704 36 precession mutations difficultly
+488 138001 36 nullified exhibits adsorption
+489 138002 36 affects tits definiteness
+490 138003 36 Cynthia mate cultivation
+491 138004 36 Chablis arches heals
+492 138005 36 betterments Moll Heusen
+493 138006 36 advertising ropers target
+494 138007 36 rubies bombast cited
+495 138008 36 southwest difficultly congresswoman
+496 138009 36 superstitious adsorption Katherine
+497 138102 36 tabernacle definiteness titter
+498 138103 36 silk cultivation aspire
+499 138104 36 handsomest heals Mardis
+500 138105 36 Persian Heusen Nadia
+501 138201 36 analog target estimating
+502 138302 36 complex cited stuck
+503 138303 36 Taoist congresswoman fifteenth
+504 138304 36 suspend Katherine Colombo
+505 138401 29 relegated titter survey
+506 140102 29 awesome aspire staffing
+507 140103 29 Bruxelles Mardis obtain
+508 140104 29 imprecisely Nadia loaded
+509 140105 29 televise estimating slaughtered
+510 140201 29 braking stuck lights
+511 140701 29 true fifteenth circumference
+512 141501 29 disappointing Colombo dull
+513 141502 29 navally survey weekly
+514 141901 29 circus staffing wetness
+515 141902 29 beetles obtain visualized
+516 142101 29 trumps loaded Tannenbaum
+517 142102 29 fourscore slaughtered moribund
+518 142103 29 Blackfoots lights demultiplex
+519 142701 29 Grady circumference lockings
+520 143001 29 quiets dull thugs
+521 143501 29 floundered weekly unnerves
+522 143502 29 profundity wetness abut
+523 148001 29 Garrisonian visualized Chippewa
+524 148002 29 Strauss Tannenbaum stratifications
+525 148003 29 cemented moribund signaled
+526 148004 29 contrition demultiplex Italianizes
+527 148005 29 mutations lockings algorithmic
+528 148006 29 exhibits thugs paranoid
+529 148007 29 tits unnerves camping
+530 148009 29 mate abut signifying
+531 148010 29 arches Chippewa Patrice
+532 148011 29 Moll stratifications search
+533 148012 29 ropers signaled Angeles
+534 148013 29 bombast Italianizes semblance
+535 148023 36 difficultly algorithmic taxed
+536 148015 29 adsorption paranoid Beatrice
+537 148016 29 definiteness camping retrace
+538 148017 29 cultivation signifying lockout
+539 148018 29 heals Patrice grammatic
+540 148019 29 Heusen search helmsman
+541 148020 29 target Angeles uniform
+542 148021 29 cited semblance hamming
+543 148022 29 congresswoman taxed disobedience
+544 148101 29 Katherine Beatrice captivated
+545 148102 29 titter retrace transferals
+546 148201 29 aspire lockout cartographer
+547 148401 29 Mardis grammatic aims
+548 148402 29 Nadia helmsman Pakistani
+549 148501 29 estimating uniform burglarized
+550 148502 29 stuck hamming saucepans
+551 148503 29 fifteenth disobedience lacerating
+552 148504 29 Colombo captivated corny
+553 148601 29 survey transferals megabytes
+554 148602 29 staffing cartographer chancellor
+555 150701 29 obtain aims bulk
+556 152101 29 loaded Pakistani commits
+557 152102 29 slaughtered burglarized meson
+558 155202 36 lights saucepans deputies
+559 155203 29 circumference lacerating northeaster
+560 155204 29 dull corny dipole
+561 155205 29 weekly megabytes machining
+562 156001 29 wetness chancellor therefore
+563 156002 29 visualized bulk Telefunken
+564 156102 29 Tannenbaum commits salvaging
+565 156301 29 moribund meson Corinthianizes
+566 156302 29 demultiplex deputies restlessly
+567 156303 29 lockings northeaster bromides
+568 156304 29 thugs dipole generalized
+569 156305 29 unnerves machining mishaps
+570 156306 29 abut therefore quelling
+571 156501 29 Chippewa Telefunken spiritual
+572 158001 29 stratifications salvaging beguiles
+573 158002 29 signaled Corinthianizes Trobriand
+574 158101 29 Italianizes restlessly fleeing
+575 158102 29 algorithmic bromides Armour
+576 158103 29 paranoid generalized chin
+577 158201 29 camping mishaps provers
+578 158202 29 signifying quelling aeronautic
+579 158203 29 Patrice spiritual voltage
+580 158204 29 search beguiles sash
+581 158301 29 Angeles Trobriand anaerobic
+582 158302 29 semblance fleeing simultaneous
+583 158303 29 taxed Armour accumulating
+584 158304 29 Beatrice chin Medusan
+585 158305 29 retrace provers shouted
+586 158306 29 lockout aeronautic freakish
+587 158501 29 grammatic voltage index
+588 160301 29 helmsman sash commercially
+589 166101 50 uniform anaerobic mistiness
+590 166102 50 hamming simultaneous endpoint
+591 168001 29 disobedience accumulating straight
+592 168002 29 captivated Medusan flurried
+593 168003 29 transferals shouted denotative
+594 168101 29 cartographer freakish coming
+595 168102 29 aims index commencements
+596 168103 29 Pakistani commercially gentleman
+597 168104 29 burglarized mistiness gifted
+598 168202 29 saucepans endpoint Shanghais
+599 168301 29 lacerating straight sportswriting
+600 168502 29 corny flurried sloping
+601 168503 29 megabytes denotative navies
+602 168601 29 chancellor coming leaflet
+603 173001 40 bulk commencements shooter
+604 173701 40 commits gentleman Joplin
+605 173702 40 meson gifted babies
+606 176001 40 deputies Shanghais subdivision
+607 176101 40 northeaster sportswriting burstiness
+608 176201 40 dipole sloping belted
+609 176401 40 machining navies assails
+610 176501 40 therefore leaflet admiring
+611 176601 40 Telefunken shooter swaying
+612 176602 40 salvaging Joplin Goldstine
+613 176603 40 Corinthianizes babies fitting
+614 178001 40 restlessly subdivision Norwalk
+615 178002 40 bromides burstiness weakening
+616 178003 40 generalized belted analogy
+617 178004 40 mishaps assails deludes
+618 178005 40 quelling admiring cokes
+619 178006 40 spiritual swaying Clayton
+620 178007 40 beguiles Goldstine exhausts
+621 178008 40 Trobriand fitting causality
+622 178101 40 fleeing Norwalk sating
+623 178102 40 Armour weakening icon
+624 178103 40 chin analogy throttles
+625 178201 40 provers deludes communicants
+626 178202 40 aeronautic cokes dehydrate
+627 178301 40 voltage Clayton priceless
+628 178302 40 sash exhausts publicly
+629 178401 40 anaerobic causality incidentals
+630 178402 40 simultaneous sating commonplace
+631 178403 40 accumulating icon mumbles
+632 178404 40 Medusan throttles furthermore
+633 178501 40 shouted communicants cautioned
+634 186002 37 freakish dehydrate parametrized
+635 186102 37 index priceless registration
+636 186201 40 commercially publicly sadly
+637 186202 40 mistiness incidentals positioning
+638 186203 40 endpoint commonplace babysitting
+639 186302 37 straight mumbles eternal
+640 188007 37 flurried furthermore hoarder
+641 188008 37 denotative cautioned congregates
+642 188009 37 coming parametrized rains
+643 188010 37 commencements registration workers
+644 188011 37 gentleman sadly sags
+645 188012 37 gifted positioning unplug
+646 188013 37 Shanghais babysitting garage
+647 188014 37 sportswriting eternal boulder
+648 188015 37 sloping hoarder hollowly
+649 188016 37 navies congregates specifics
+650 188017 37 leaflet rains Teresa
+651 188102 37 shooter workers Winsett
+652 188103 37 Joplin sags convenient
+653 188202 37 babies unplug buckboards
+654 188301 40 subdivision garage amenities
+655 188302 40 burstiness boulder resplendent
+656 188303 40 belted hollowly priding
+657 188401 37 assails specifics configurations
+658 188402 37 admiring Teresa untidiness
+659 188503 37 swaying Winsett Brice
+660 188504 37 Goldstine convenient sews
+661 188505 37 fitting buckboards participated
+662 190701 37 Norwalk amenities Simon
+663 190703 50 weakening resplendent certificates
+664 191701 37 analogy priding Fitzpatrick
+665 191702 37 deludes configurations Evanston
+666 191703 37 cokes untidiness misted
+667 196001 37 Clayton Brice textures
+668 196002 37 exhausts sews save
+669 196003 37 causality participated count
+670 196101 37 sating Simon rightful
+671 196103 37 icon certificates chaperone
+672 196104 37 throttles Fitzpatrick Lizzy
+673 196201 37 communicants Evanston clenched
+674 196202 37 dehydrate misted effortlessly
+675 196203 37 priceless textures accessed
+676 198001 37 publicly save beaters
+677 198003 37 incidentals count Hornblower
+678 198004 37 commonplace rightful vests
+679 198005 37 mumbles chaperone indulgences
+680 198006 37 furthermore Lizzy infallibly
+681 198007 37 cautioned clenched unwilling
+682 198008 37 parametrized effortlessly excrete
+683 198009 37 registration accessed spools
+684 198010 37 sadly beaters crunches
+685 198011 37 positioning Hornblower overestimating
+686 198012 37 babysitting vests ineffective
+687 198013 37 eternal indulgences humiliation
+688 198014 37 hoarder infallibly sophomore
+689 198015 37 congregates unwilling star
+690 198017 37 rains excrete rifles
+691 198018 37 workers spools dialysis
+692 198019 37 sags crunches arriving
+693 198020 37 unplug overestimating indulge
+694 198021 37 garage ineffective clockers
+695 198022 37 boulder humiliation languages
+696 198023 50 hollowly sophomore Antarctica
+697 198024 37 specifics star percentage
+698 198101 37 Teresa rifles ceiling
+699 198103 37 Winsett dialysis specification
+700 198105 37 convenient arriving regimented
+701 198106 37 buckboards indulge ciphers
+702 198201 37 amenities clockers pictures
+703 198204 37 resplendent languages serpents
+704 198301 53 priding Antarctica allot
+705 198302 53 configurations percentage realized
+706 198303 53 untidiness ceiling mayoral
+707 198304 53 Brice specification opaquely
+708 198401 37 sews regimented hostess
+709 198402 37 participated ciphers fiftieth
+710 198403 37 Simon pictures incorrectly
+711 202101 37 certificates serpents decomposition
+712 202301 37 Fitzpatrick allot stranglings
+713 202302 37 Evanston realized mixture
+714 202303 37 misted mayoral electroencephalography
+715 202304 37 textures opaquely similarities
+716 202305 37 save hostess charges
+717 202601 37 count fiftieth freest
+718 202602 37 rightful incorrectly Greenberg
+719 202605 37 chaperone decomposition tinting
+720 202606 37 Lizzy stranglings expelled
+721 202607 37 clenched mixture warm
+722 202901 37 effortlessly electroencephalography smoothed
+723 202902 37 accessed similarities deductions
+724 202903 37 beaters charges Romano
+725 202904 37 Hornblower freest bitterroot
+726 202907 37 vests Greenberg corset
+727 202908 37 indulgences tinting securing
+728 203101 37 infallibly expelled environing
+729 203103 37 unwilling warm cute
+730 203104 37 excrete smoothed Crays
+731 203105 37 spools deductions heiress
+732 203401 37 crunches Romano inform
+733 203402 37 overestimating bitterroot avenge
+734 203404 37 ineffective corset universals
+735 203901 37 humiliation securing Kinsey
+736 203902 37 sophomore environing ravines
+737 203903 37 star cute bestseller
+738 203906 37 rifles Crays equilibrium
+739 203907 37 dialysis heiress extents
+740 203908 37 arriving inform relatively
+741 203909 37 indulge avenge pressure
+742 206101 37 clockers universals critiques
+743 206201 37 languages Kinsey befouled
+744 206202 37 Antarctica ravines rightfully
+745 206203 37 percentage bestseller mechanizing
+746 206206 37 ceiling equilibrium Latinizes
+747 206207 37 specification extents timesharing
+748 206208 37 regimented relatively Aden
+749 208001 37 ciphers pressure embassies
+750 208002 37 pictures critiques males
+751 208003 37 serpents befouled shapelessly
+752 208004 37 allot rightfully genres
+753 208008 37 realized mechanizing mastering
+754 208009 37 mayoral Latinizes Newtonian
+755 208010 37 opaquely timesharing finishers
+756 208011 37 hostess Aden abates
+757 208101 37 fiftieth embassies teem
+758 208102 37 incorrectly males kiting
+759 208103 37 decomposition shapelessly stodgy
+760 208104 37 stranglings genres scalps
+761 208105 37 mixture mastering feed
+762 208110 37 electroencephalography Newtonian guitars
+763 208111 37 similarities finishers airships
+764 208112 37 charges abates store
+765 208113 37 freest teem denounces
+766 208201 37 Greenberg kiting Pyle
+767 208203 37 tinting stodgy Saxony
+768 208301 37 expelled scalps serializations
+769 208302 37 warm feed Peruvian
+770 208305 37 smoothed guitars taxonomically
+771 208401 37 deductions airships kingdom
+772 208402 37 Romano store stint
+773 208403 37 bitterroot denounces Sault
+774 208404 37 corset Pyle faithful
+775 208501 37 securing Saxony Ganymede
+776 208502 37 environing serializations tidiness
+777 208503 37 cute Peruvian gainful
+778 208504 37 Crays taxonomically contrary
+779 208505 37 heiress kingdom Tipperary
+780 210101 37 inform stint tropics
+781 210102 37 avenge Sault theorizers
+782 210103 37 universals faithful renew
+783 210104 37 Kinsey Ganymede already
+784 210105 37 ravines tidiness terminal
+785 210106 37 bestseller gainful Hegelian
+786 210107 37 equilibrium contrary hypothesizer
+787 210401 37 extents Tipperary warningly
+788 213201 37 relatively tropics journalizing
+789 213203 37 pressure theorizers nested
+790 213204 37 critiques renew Lars
+791 213205 37 befouled already saplings
+792 213206 37 rightfully terminal foothill
+793 213207 37 mechanizing Hegelian labeled
+794 216101 37 Latinizes hypothesizer imperiously
+795 216103 37 timesharing warningly reporters
+796 218001 37 Aden journalizing furnishings
+797 218002 37 embassies nested precipitable
+798 218003 37 males Lars discounts
+799 218004 37 shapelessly saplings excises
+800 143503 50 genres foothill Stalin
+801 218006 37 mastering labeled despot
+802 218007 37 Newtonian imperiously ripeness
+803 218008 37 finishers reporters Arabia
+804 218009 37 abates furnishings unruly
+805 218010 37 teem precipitable mournfulness
+806 218011 37 kiting discounts boom
+807 218020 37 stodgy excises slaughter
+808 218021 50 scalps Stalin Sabine
+809 218022 37 feed despot handy
+810 218023 37 guitars ripeness rural
+811 218024 37 airships Arabia organizer
+812 218101 37 store unruly shipyard
+813 218102 37 denounces mournfulness civics
+814 218103 37 Pyle boom inaccuracy
+815 218201 37 Saxony slaughter rules
+816 218202 37 serializations Sabine juveniles
+817 218203 37 Peruvian handy comprised
+818 218204 37 taxonomically rural investigations
+819 218205 37 kingdom organizer stabilizes
+820 218301 37 stint shipyard seminaries
+821 218302 37 Sault civics Hunter
+822 218401 37 faithful inaccuracy sporty
+823 218402 37 Ganymede rules test
+824 218403 37 tidiness juveniles weasels
+825 218404 37 gainful comprised CERN
+826 218407 37 contrary investigations tempering
+827 218408 37 Tipperary stabilizes afore
+828 218409 37 tropics seminaries Galatean
+829 218410 37 theorizers Hunter techniques
+830 226001 37 renew sporty error
+831 226002 37 already test veranda
+832 226003 37 terminal weasels severely
+833 226004 37 Hegelian CERN Cassites
+834 226005 37 hypothesizer tempering forthcoming
+835 226006 37 warningly afore guides
+836 226007 37 journalizing Galatean vanish
+837 226008 37 nested techniques lied
+838 226203 37 Lars error sawtooth
+839 226204 37 saplings veranda fated
+840 226205 37 foothill severely gradually
+841 226206 37 labeled Cassites widens
+842 226207 37 imperiously forthcoming preclude
+843 226208 37 reporters guides Jobrel
+844 226209 37 furnishings vanish hooker
+845 226210 37 precipitable lied rainstorm
+846 226211 37 discounts sawtooth disconnects
+847 228001 37 excises fated cruelty
+848 228004 37 Stalin gradually exponentials
+849 228005 37 despot widens affective
+850 228006 37 ripeness preclude arteries
+851 228007 37 Arabia Jobrel Crosby
+852 228008 37 unruly hooker acquaint
+853 228009 37 mournfulness rainstorm evenhandedly
+854 228101 37 boom disconnects percentage
+855 228108 37 slaughter cruelty disobedience
+856 228109 37 Sabine exponentials humility
+857 228110 37 handy affective gleaning
+858 228111 37 rural arteries petted
+859 228112 37 organizer Crosby bloater
+860 228113 37 shipyard acquaint minion
+861 228114 37 civics evenhandedly marginal
+862 228115 37 inaccuracy percentage apiary
+863 228116 37 rules disobedience measures
+864 228117 37 juveniles humility precaution
+865 228118 37 comprised gleaning repelled
+866 228119 37 investigations petted primary
+867 228120 37 stabilizes bloater coverings
+868 228121 37 seminaries minion Artemia
+869 228122 37 Hunter marginal navigate
+870 228201 37 sporty apiary spatial
+871 228206 37 test measures Gurkha
+872 228207 37 weasels precaution meanwhile
+873 228208 37 CERN repelled Melinda
+874 228209 37 tempering primary Butterfield
+875 228210 37 afore coverings Aldrich
+876 228211 37 Galatean Artemia previewing
+877 228212 37 techniques navigate glut
+878 228213 37 error spatial unaffected
+879 228214 37 veranda Gurkha inmate
+880 228301 37 severely meanwhile mineral
+881 228305 37 Cassites Melinda impending
+882 228306 37 forthcoming Butterfield meditation
+883 228307 37 guides Aldrich ideas
+884 228308 37 vanish previewing miniaturizes
+885 228309 37 lied glut lewdly
+886 228310 37 sawtooth unaffected title
+887 228311 37 fated inmate youthfulness
+888 228312 37 gradually mineral creak
+889 228313 37 widens impending Chippewa
+890 228314 37 preclude meditation clamored
+891 228401 65 Jobrel ideas freezes
+892 228402 65 hooker miniaturizes forgivably
+893 228403 65 rainstorm lewdly reduce
+894 228404 65 disconnects title McGovern
+895 228405 65 cruelty youthfulness Nazis
+896 228406 65 exponentials creak epistle
+897 228407 65 affective Chippewa socializes
+898 228408 65 arteries clamored conceptions
+899 228409 65 Crosby freezes Kevin
+900 228410 65 acquaint forgivably uncovering
+901 230301 37 evenhandedly reduce chews
+902 230302 37 percentage McGovern appendixes
+903 230303 37 disobedience Nazis raining
+904 018062 37 humility epistle infest
+905 230501 37 gleaning socializes compartment
+906 230502 37 petted conceptions minting
+907 230503 37 bloater Kevin ducks
+908 230504 37 minion uncovering roped
+909 230505 37 marginal chews waltz
+910 230506 37 apiary appendixes Lillian
+911 230507 37 measures raining repressions
+912 230508 37 precaution infest chillingly
+913 230509 37 repelled compartment noncritical
+914 230901 37 primary minting lithograph
+915 230902 37 coverings ducks spongers
+916 230903 37 Artemia roped parenthood
+917 230904 37 navigate waltz posed
+918 230905 37 spatial Lillian instruments
+919 230906 37 Gurkha repressions filial
+920 230907 37 meanwhile chillingly fixedly
+921 230908 37 Melinda noncritical relives
+922 230909 37 Butterfield lithograph Pandora
+923 230910 37 Aldrich spongers watering
+924 230911 37 previewing parenthood ungrateful
+925 230912 37 glut posed secures
+926 230913 37 unaffected instruments chastisers
+927 230914 37 inmate filial icon
+928 231304 37 mineral fixedly reuniting
+929 231305 37 impending relives imagining
+930 231306 37 meditation Pandora abiding
+931 231307 37 ideas watering omnisciently
+932 231308 37 miniaturizes ungrateful Britannic
+933 231309 37 lewdly secures scholastics
+934 231310 37 title chastisers mechanics
+935 231311 37 youthfulness icon humidly
+936 231312 37 creak reuniting masterpiece
+937 231313 37 Chippewa imagining however
+938 231314 37 clamored abiding Mendelian
+939 231315 37 freezes omnisciently jarred
+940 232102 37 forgivably Britannic scolds
+941 232103 37 reduce scholastics infatuate
+942 232104 37 McGovern mechanics willed
+943 232105 37 Nazis humidly joyfully
+944 232106 37 epistle masterpiece Microsoft
+945 232107 37 socializes however fibrosities
+946 232108 37 conceptions Mendelian Baltimorean
+947 232601 37 Kevin jarred equestrian
+948 232602 37 uncovering scolds Goodrich
+949 232603 37 chews infatuate apish
+950 232605 37 appendixes willed Adlerian
+5950 1232605 37 appendixes willed Adlerian
+5951 1232606 37 appendixes willed Adlerian
+5952 1232607 37 appendixes willed Adlerian
+5953 1232608 37 appendixes willed Adlerian
+5954 1232609 37 appendixes willed Adlerian
+951 232606 37 raining joyfully Tropez
+952 232607 37 infest Microsoft nouns
+953 232608 37 compartment fibrosities distracting
+954 232609 37 minting Baltimorean mutton
+955 236104 37 ducks equestrian bridgeable
+956 236105 37 roped Goodrich stickers
+957 236106 37 waltz apish transcontinental
+958 236107 37 Lillian Adlerian amateurish
+959 236108 37 repressions Tropez Gandhian
+960 236109 37 chillingly nouns stratified
+961 236110 37 noncritical distracting chamberlains
+962 236111 37 lithograph mutton creditably
+963 236112 37 spongers bridgeable philosophic
+964 236113 37 parenthood stickers ores
+965 238005 37 posed transcontinental Carleton
+966 238006 37 instruments amateurish tape
+967 238007 37 filial Gandhian afloat
+968 238008 37 fixedly stratified goodness
+969 238009 37 relives chamberlains welcoming
+970 238010 37 Pandora creditably Pinsky
+971 238011 37 watering philosophic halting
+972 238012 37 ungrateful ores bibliography
+973 238013 37 secures Carleton decoding
+974 240401 41 chastisers tape variance
+975 240402 41 icon afloat allowed
+976 240901 41 reuniting goodness dire
+977 240902 41 imagining welcoming dub
+978 241801 41 abiding Pinsky poisoning
+979 242101 41 omnisciently halting Iraqis
+980 242102 41 Britannic bibliography heaving
+981 242201 41 scholastics decoding population
+982 242202 41 mechanics variance bomb
+983 242501 41 humidly allowed Majorca
+984 242502 41 masterpiece dire Gershwins
+985 246201 41 however dub explorers
+986 246202 41 Mendelian poisoning libretto
+987 246203 41 jarred Iraqis occurred
+988 246204 41 scolds heaving Lagos
+989 246205 41 infatuate population rats
+990 246301 41 willed bomb bankruptcies
+991 246302 41 joyfully Majorca crying
+992 248001 41 Microsoft Gershwins unexpected
+993 248002 41 fibrosities explorers accessed
+994 248003 41 Baltimorean libretto colorful
+995 248004 41 equestrian occurred versatility
+996 248005 41 Goodrich Lagos cosy
+997 248006 41 apish rats Darius
+998 248007 41 Adlerian bankruptcies mastering
+999 248008 41 Tropez crying Asiaticizations
+1000 248009 41 nouns unexpected offerers
+1001 248010 41 distracting accessed uncles
+1002 248011 41 mutton colorful sleepwalk
+1003 248012 41 bridgeable versatility Ernestine
+1004 248013 41 stickers cosy checksumming
+1005 248014 41 transcontinental Darius stopped
+1006 248015 41 amateurish mastering sicker
+1007 248016 41 Gandhian Asiaticizations Italianization
+1008 248017 41 stratified offerers alphabetic
+1009 248018 41 chamberlains uncles pharmaceutic
+1010 248019 41 creditably sleepwalk creator
+1011 248020 41 philosophic Ernestine chess
+1012 248021 41 ores checksumming charcoal
+1013 248101 41 Carleton stopped Epiphany
+1014 248102 41 tape sicker bulldozes
+1015 248201 41 afloat Italianization Pygmalion
+1016 248202 41 goodness alphabetic caressing
+1017 248203 41 welcoming pharmaceutic Palestine
+1018 248204 41 Pinsky creator regimented
+1019 248205 41 halting chess scars
+1020 248206 41 bibliography charcoal realest
+1021 248207 41 decoding Epiphany diffusing
+1022 248208 41 variance bulldozes clubroom
+1023 248209 41 allowed Pygmalion Blythe
+1024 248210 41 dire caressing ahead
+1025 248211 50 dub Palestine reviver
+1026 250501 34 poisoning regimented retransmitting
+1027 250502 34 Iraqis scars landslide
+1028 250503 34 heaving realest Eiffel
+1029 250504 34 population diffusing absentee
+1030 250505 34 bomb clubroom aye
+1031 250601 34 Majorca Blythe forked
+1032 250602 34 Gershwins ahead Peruvianizes
+1033 250603 34 explorers reviver clerked
+1034 250604 34 libretto retransmitting tutor
+1035 250605 34 occurred landslide boulevard
+1036 251001 34 Lagos Eiffel shuttered
+1037 251002 34 rats absentee quotes
+1038 251003 34 bankruptcies aye Caltech
+1039 251004 34 crying forked Mossberg
+1040 251005 34 unexpected Peruvianizes kept
+1041 251301 34 accessed clerked roundly
+1042 251302 34 colorful tutor features
+1043 251303 34 versatility boulevard imaginable
+1044 251304 34 cosy shuttered controller
+1045 251305 34 Darius quotes racial
+1046 251401 34 mastering Caltech uprisings
+1047 251402 34 Asiaticizations Mossberg narrowed
+1048 251403 34 offerers kept cannot
+1049 251404 34 uncles roundly vest
+1050 251405 34 sleepwalk features famine
+1051 251406 34 Ernestine imaginable sugars
+1052 251801 34 checksumming controller exterminated
+1053 251802 34 stopped racial belays
+1054 252101 34 sicker uprisings Hodges
+1055 252102 34 Italianization narrowed translatable
+1056 252301 34 alphabetic cannot duality
+1057 252302 34 pharmaceutic vest recording
+1058 252303 34 creator famine rouses
+1059 252304 34 chess sugars poison
+1060 252305 34 charcoal exterminated attitude
+1061 252306 34 Epiphany belays dusted
+1062 252307 34 bulldozes Hodges encompasses
+1063 252308 34 Pygmalion translatable presentation
+1064 252309 34 caressing duality Kantian
+1065 256001 34 Palestine recording imprecision
+1066 256002 34 regimented rouses saving
+1067 256003 34 scars poison maternal
+1068 256004 34 realest attitude hewed
+1069 256005 34 diffusing dusted kerosene
+1070 258001 34 clubroom encompasses Cubans
+1071 258002 34 Blythe presentation photographers
+1072 258003 34 ahead Kantian nymph
+1073 258004 34 reviver imprecision bedlam
+1074 258005 34 retransmitting saving north
+1075 258006 34 landslide maternal Schoenberg
+1076 258007 34 Eiffel hewed botany
+1077 258008 34 absentee kerosene curs
+1078 258009 34 aye Cubans solidification
+1079 258010 34 forked photographers inheritresses
+1080 258011 34 Peruvianizes nymph stiller
+1081 258101 68 clerked bedlam t1
+1082 258102 68 tutor north suite
+1083 258103 34 boulevard Schoenberg ransomer
+1084 258104 68 shuttered botany Willy
+1085 258105 68 quotes curs Rena
+1086 258106 68 Caltech solidification Seattle
+1087 258107 68 Mossberg inheritresses relaxes
+1088 258108 68 kept stiller exclaim
+1089 258109 68 roundly t1 implicated
+1090 258110 68 features suite distinguish
+1091 258111 68 imaginable ransomer assayed
+1092 258112 68 controller Willy homeowner
+1093 258113 68 racial Rena and
+1094 258201 34 uprisings Seattle stealth
+1095 258202 34 narrowed relaxes coinciding
+1096 258203 34 cannot exclaim founder
+1097 258204 34 vest implicated environing
+1098 258205 34 famine distinguish jewelry
+1099 258301 34 sugars assayed lemons
+1100 258401 34 exterminated homeowner brokenness
+1101 258402 34 belays and bedpost
+1102 258403 34 Hodges stealth assurers
+1103 258404 34 translatable coinciding annoyers
+1104 258405 34 duality founder affixed
+1105 258406 34 recording environing warbling
+1106 258407 34 rouses jewelry seriously
+1107 228123 37 poison lemons boasted
+1108 250606 34 attitude brokenness Chantilly
+1109 208405 37 dusted bedpost Iranizes
+1110 212101 37 encompasses assurers violinist
+1111 218206 37 presentation annoyers extramarital
+1112 150401 37 Kantian affixed spates
+1113 248212 41 imprecision warbling cloakroom
+1114 128026 00 saving seriously gazer
+1115 128024 00 maternal boasted hand
+1116 128027 00 hewed Chantilly tucked
+1117 128025 00 kerosene Iranizes gems
+1118 128109 00 Cubans violinist clinker
+1119 128705 00 photographers extramarital refiner
+1120 126303 00 nymph spates callus
+1121 128308 00 bedlam cloakroom leopards
+1122 128204 00 north gazer comfortingly
+1123 128205 00 Schoenberg hand generically
+1124 128206 00 botany tucked getters
+1125 128207 00 curs gems sexually
+1126 118205 00 solidification clinker spear
+1127 116801 00 inheritresses refiner serums
+1128 116803 00 stiller callus Italianization
+1129 116804 00 t1 leopards attendants
+1130 116802 00 suite comfortingly spies
+1131 128605 00 ransomer generically Anthony
+1132 118308 00 Willy getters planar
+1133 113702 00 Rena sexually cupped
+1134 113703 00 Seattle spear cleanser
+1135 112103 00 relaxes serums commuters
+1136 118009 00 exclaim Italianization honeysuckle
+5136 1118009 00 exclaim Italianization honeysuckle
+1137 138011 00 implicated attendants orphanage
+1138 138010 00 distinguish spies skies
+1139 138012 00 assayed Anthony crushers
+1140 068304 00 homeowner planar Puritan
+1141 078009 00 and cupped squeezer
+1142 108013 00 stealth cleanser bruises
+1143 084004 00 coinciding commuters bonfire
+1144 083402 00 founder honeysuckle Colombo
+1145 084003 00 environing orphanage nondecreasing
+1146 088504 00 jewelry skies innocents
+1147 088005 00 lemons crushers masked
+1148 088007 00 brokenness Puritan file
+1149 088006 00 bedpost squeezer brush
+1150 148025 00 assurers bruises mutilate
+1151 148024 00 annoyers bonfire mommy
+1152 138305 00 affixed Colombo bulkheads
+1153 138306 00 warbling nondecreasing undeclared
+1154 152701 00 seriously innocents displacements
+1155 148505 00 boasted masked nieces
+1156 158003 00 Chantilly file coeducation
+1157 156201 00 Iranizes brush brassy
+1158 156202 00 violinist mutilate authenticator
+1159 158307 00 extramarital mommy Washoe
+1160 158402 00 spates bulkheads penny
+1161 158401 00 cloakroom undeclared Flagler
+1162 068013 00 gazer displacements stoned
+1163 068012 00 hand nieces cranes
+1164 068203 00 tucked coeducation masterful
+1165 088205 00 gems brassy biracial
+1166 068704 00 clinker authenticator steamships
+1167 068604 00 refiner Washoe windmills
+1168 158502 00 callus penny exploit
+1169 123103 00 leopards Flagler riverfront
+1170 148026 00 comfortingly stoned sisterly
+1171 123302 00 generically cranes sharpshoot
+1172 076503 00 getters masterful mittens
+1173 126304 00 sexually biracial interdependency
+1174 068306 00 spear steamships policy
+1175 143504 00 serums windmills unleashing
+1176 160201 00 Italianization exploit pretenders
+1177 148028 00 attendants riverfront overstatements
+1178 148027 00 spies sisterly birthed
+1179 143505 00 Anthony sharpshoot opportunism
+1180 108014 00 planar mittens showroom
+1181 076104 00 cupped interdependency compromisingly
+1182 078106 00 cleanser policy Medicare
+1183 126102 00 commuters unleashing corresponds
+1184 128029 00 honeysuckle pretenders hardware
+1185 128028 00 orphanage overstatements implant
+1186 018410 00 skies birthed Alicia
+1187 128110 00 crushers opportunism requesting
+1188 148506 00 Puritan showroom produced
+1189 123303 00 squeezer compromisingly criticizes
+1190 123304 00 bruises Medicare backer
+1191 068504 00 bonfire corresponds positively
+1192 068305 00 Colombo hardware colicky
+1193 000000 00 nondecreasing implant thrillingly
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+2 011401 37 breaking dreaded Steinberg
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+1 000001 00 Omaha teethe neat
+2 011401 37 breaking dreaded Steinberg
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+2 011401 37 breaking dreaded Steinberg
+3 011402 37 Romans scholastics jarring
+4 011403 37 intercepted audiology tinily
+4 011403 37 intercepted audiology tinily
drop table t1, t2, t4;
diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result
new file mode 100644
index 00000000000..25a77bc9c75
--- /dev/null
+++ b/mysql-test/r/archive_gis.result
@@ -0,0 +1,458 @@
+SET storage_engine=archive;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER, g POINT);
+CREATE TABLE gis_line (fid INTEGER, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table Create Table
+gis_point CREATE TABLE `gis_point` (
+ `fid` int(11) default NULL,
+ `g` point default NULL
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g point YES NULL
+SHOW FIELDS FROM gis_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g linestring YES NULL
+SHOW FIELDS FROM gis_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g polygon YES NULL
+SHOW FIELDS FROM gis_multi_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipoint YES NULL
+SHOW FIELDS FROM gis_multi_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multilinestring YES NULL
+SHOW FIELDS FROM gis_multi_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipolygon YES NULL
+SHOW FIELDS FROM gis_geometrycollection;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometrycollection YES NULL
+SHOW FIELDS FROM gis_geometry;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometry YES NULL
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid AsText(g)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid AsText(g)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid AsText(g)
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid AsText(g)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid AsText(g)
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid AsText(g)
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid Dimension(g)
+101 0
+102 0
+103 0
+104 0
+105 1
+106 1
+107 1
+108 2
+109 2
+110 2
+111 0
+112 0
+113 0
+114 1
+115 1
+116 1
+117 2
+118 2
+119 2
+120 1
+121 1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid GeometryType(g)
+101 POINT
+102 POINT
+103 POINT
+104 POINT
+105 LINESTRING
+106 LINESTRING
+107 LINESTRING
+108 POLYGON
+109 POLYGON
+110 POLYGON
+111 MULTIPOINT
+112 MULTIPOINT
+113 MULTIPOINT
+114 MULTILINESTRING
+115 MULTILINESTRING
+116 MULTILINESTRING
+117 MULTIPOLYGON
+118 MULTIPOLYGON
+119 MULTIPOLYGON
+120 GEOMETRYCOLLECTION
+121 GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid IsEmpty(g)
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid AsText(Envelope(g))
+101 POLYGON((10 10,10 10,10 10,10 10,10 10))
+102 POLYGON((20 10,20 10,20 10,20 10,20 10))
+103 POLYGON((20 20,20 20,20 20,20 20,20 20))
+104 POLYGON((10 20,10 20,10 20,10 20,10 20))
+105 POLYGON((0 0,10 0,10 10,0 10,0 0))
+106 POLYGON((10 10,20 10,20 20,10 20,10 10))
+107 POLYGON((10 10,40 10,40 10,10 10,10 10))
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0))
+110 POLYGON((0 0,30 0,30 30,0 30,0 0))
+111 POLYGON((0 0,20 0,20 20,0 20,0 0))
+112 POLYGON((1 1,21 1,21 21,1 21,1 1))
+113 POLYGON((3 6,4 6,4 10,3 10,3 6))
+114 POLYGON((10 0,16 0,16 48,10 48,10 0))
+115 POLYGON((10 0,10 0,10 48,10 48,10 0))
+116 POLYGON((1 2,21 2,21 8,1 8,1 2))
+117 POLYGON((28 0,84 0,84 42,28 42,28 0))
+118 POLYGON((28 0,84 0,84 42,28 42,28 0))
+119 POLYGON((0 0,3 0,3 3,0 3,0 0))
+120 POLYGON((0 0,10 0,10 10,0 10,0 0))
+121 POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
+Warnings:
+Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid X(g)
+101 10
+102 20
+103 20
+104 10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid Y(g)
+101 10
+102 10
+103 20
+104 20
+explain extended select X(g),Y(g) FROM gis_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
+Warnings:
+Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(StartPoint(g))
+105 POINT(0 0)
+106 POINT(10 10)
+107 POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(EndPoint(g))
+105 POINT(10 0)
+106 POINT(10 10)
+107 POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid GLength(g)
+105 24.142135623731
+106 40
+107 30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid NumPoints(g)
+105 3
+106 5
+107 2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid AsText(PointN(g, 2))
+105 POINT(0 10)
+106 POINT(20 10)
+107 POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid IsClosed(g)
+105 0
+106 1
+107 0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid AsText(Centroid(g))
+108 POINT(15 15)
+109 POINT(25.416666666667 25.416666666667)
+110 POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid Area(g)
+108 100
+109 2400
+110 450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid AsText(ExteriorRing(g))
+108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110 LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid NumInteriorRings(g)
+108 0
+109 1
+110 0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid AsText(InteriorRingN(g, 1))
+108 NULL
+109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110 NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid IsClosed(g)
+114 0
+115 0
+116 0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid AsText(Centroid(g))
+117 POINT(55.588527753042 17.426536064114)
+118 POINT(55.588527753042 17.426536064114)
+119 POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid Area(g)
+117 1684.5
+118 1684.5
+119 4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid NumGeometries(g)
+111 4
+112 4
+113 2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid NumGeometries(g)
+114 2
+115 1
+116 2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid NumGeometries(g)
+117 2
+118 2
+119 1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid NumGeometries(g)
+120 2
+121 2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid AsText(GeometryN(g, 2))
+111 POINT(10 10)
+112 POINT(11 11)
+113 POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid AsText(GeometryN(g, 2))
+114 LINESTRING(16 0,16 23,16 48)
+115 NULL
+116 LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid AsText(GeometryN(g, 2))
+117 POLYGON((59 18,67 18,67 13,59 13,59 18))
+118 POLYGON((59 18,67 18,67 13,59 13,59 18))
+119 NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 2))
+120 LINESTRING(0 0,10 10)
+121 LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first second w c o e d t i r
+120 120 1 1 0 1 0 0 1 0
+120 121 0 0 0 0 0 0 1 0
+121 120 0 0 1 0 0 0 1 0
+121 121 1 1 0 1 0 0 1 0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2
+Warnings:
+Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+fid int(11) YES NULL
+DROP TABLE t1;
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+insert into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (fl geometry);
+insert into t1 values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (pointfromtext('point(1,1)'));
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index 2bba44d36e9..5cdf9612300 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -1584,8 +1584,6 @@ g 10
h 10
i 10
alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v);
-Warnings:
-Warning 1071 Specified key was too long; max key length is 255 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -1594,7 +1592,7 @@ t1 CREATE TABLE `t1` (
`t` text,
KEY `c` (`c`),
KEY `t` (`t`(10)),
- KEY `v` (`v`(255))
+ KEY `v` (`v`)
) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1
select count(*) from t1 where v='a';
count(*)
@@ -1616,19 +1614,19 @@ count(*)
9
explain select count(*) from t1 where v='a ';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 258 const # Using where
+1 SIMPLE t1 ref v v 303 const # Using where
explain select count(*) from t1 where v like 'a%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range v v 258 NULL # Using where
+1 SIMPLE t1 range v v 303 NULL # Using where
explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 258 const # Using where
+1 SIMPLE t1 ref v v 303 const # Using where
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 258 const # Using where
+1 SIMPLE t1 ref v v 303 const # Using where
explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 258 const # Using where
+1 SIMPLE t1 ref v v 303 const # Using where
select v,count(*) from t1 group by v limit 10;
v count(*)
a 1
@@ -1656,15 +1654,15 @@ i 10
select sql_big_result v,count(t) from t1 group by v limit 10;
v count(t)
a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
+a 10
+b 10
+c 10
+d 10
+e 10
+f 10
+g 10
+h 10
+i 10
alter table t1 drop key v, add key v (v(30));
show create table t1;
Table Create Table
@@ -1746,8 +1744,6 @@ g 10
h 10
i 10
alter table t1 modify v varchar(600), drop key v, add key v (v);
-Warnings:
-Warning 1071 Specified key was too long; max key length is 255 bytes
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -1756,7 +1752,7 @@ t1 CREATE TABLE `t1` (
`t` text,
KEY `c` (`c`),
KEY `t` (`t`(10)),
- KEY `v` (`v`(255))
+ KEY `v` (`v`)
) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1
select v,count(*) from t1 group by v limit 10;
v count(*)
@@ -1785,15 +1781,15 @@ i 10
select sql_big_result v,count(t) from t1 group by v limit 10;
v count(t)
a 1
-a 10
-b 10
-c 10
-d 10
-e 10
-f 10
-g 10
-h 10
-i 10
+a 10
+b 10
+c 10
+d 10
+e 10
+f 10
+g 10
+h 10
+i 10
drop table t1;
create table t1 (a char(10), unique (a));
insert into t1 values ('a ');
@@ -1874,7 +1870,7 @@ a b
drop table t1;
create table t1 (v varchar(65530), key(v));
Warnings:
-Warning 1071 Specified key was too long; max key length is 255 bytes
+Warning 1071 Specified key was too long; max key length is MAX_KEY_LENGTH bytes
drop table if exists t1;
create table t1 (v varchar(65536));
Warnings:
diff --git a/mysql-test/r/bdb_gis.result b/mysql-test/r/bdb_gis.result
new file mode 100644
index 00000000000..c0e1682e485
--- /dev/null
+++ b/mysql-test/r/bdb_gis.result
@@ -0,0 +1,458 @@
+SET storage_engine=bdb;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER, g POINT);
+CREATE TABLE gis_line (fid INTEGER, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table Create Table
+gis_point CREATE TABLE `gis_point` (
+ `fid` int(11) default NULL,
+ `g` point default NULL
+) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g point YES NULL
+SHOW FIELDS FROM gis_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g linestring YES NULL
+SHOW FIELDS FROM gis_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g polygon YES NULL
+SHOW FIELDS FROM gis_multi_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipoint YES NULL
+SHOW FIELDS FROM gis_multi_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multilinestring YES NULL
+SHOW FIELDS FROM gis_multi_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipolygon YES NULL
+SHOW FIELDS FROM gis_geometrycollection;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometrycollection YES NULL
+SHOW FIELDS FROM gis_geometry;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometry YES NULL
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid AsText(g)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid AsText(g)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid AsText(g)
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid AsText(g)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid AsText(g)
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid AsText(g)
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid Dimension(g)
+101 0
+102 0
+103 0
+104 0
+105 1
+106 1
+107 1
+108 2
+109 2
+110 2
+111 0
+112 0
+113 0
+114 1
+115 1
+116 1
+117 2
+118 2
+119 2
+120 1
+121 1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid GeometryType(g)
+101 POINT
+102 POINT
+103 POINT
+104 POINT
+105 LINESTRING
+106 LINESTRING
+107 LINESTRING
+108 POLYGON
+109 POLYGON
+110 POLYGON
+111 MULTIPOINT
+112 MULTIPOINT
+113 MULTIPOINT
+114 MULTILINESTRING
+115 MULTILINESTRING
+116 MULTILINESTRING
+117 MULTIPOLYGON
+118 MULTIPOLYGON
+119 MULTIPOLYGON
+120 GEOMETRYCOLLECTION
+121 GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid IsEmpty(g)
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid AsText(Envelope(g))
+101 POLYGON((10 10,10 10,10 10,10 10,10 10))
+102 POLYGON((20 10,20 10,20 10,20 10,20 10))
+103 POLYGON((20 20,20 20,20 20,20 20,20 20))
+104 POLYGON((10 20,10 20,10 20,10 20,10 20))
+105 POLYGON((0 0,10 0,10 10,0 10,0 0))
+106 POLYGON((10 10,20 10,20 20,10 20,10 10))
+107 POLYGON((10 10,40 10,40 10,10 10,10 10))
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0))
+110 POLYGON((0 0,30 0,30 30,0 30,0 0))
+111 POLYGON((0 0,20 0,20 20,0 20,0 0))
+112 POLYGON((1 1,21 1,21 21,1 21,1 1))
+113 POLYGON((3 6,4 6,4 10,3 10,3 6))
+114 POLYGON((10 0,16 0,16 48,10 48,10 0))
+115 POLYGON((10 0,10 0,10 48,10 48,10 0))
+116 POLYGON((1 2,21 2,21 8,1 8,1 2))
+117 POLYGON((28 0,84 0,84 42,28 42,28 0))
+118 POLYGON((28 0,84 0,84 42,28 42,28 0))
+119 POLYGON((0 0,3 0,3 3,0 3,0 0))
+120 POLYGON((0 0,10 0,10 10,0 10,0 0))
+121 POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
+Warnings:
+Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid X(g)
+101 10
+102 20
+103 20
+104 10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid Y(g)
+101 10
+102 10
+103 20
+104 20
+explain extended select X(g),Y(g) FROM gis_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
+Warnings:
+Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(StartPoint(g))
+105 POINT(0 0)
+106 POINT(10 10)
+107 POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(EndPoint(g))
+105 POINT(10 0)
+106 POINT(10 10)
+107 POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid GLength(g)
+105 24.142135623731
+106 40
+107 30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid NumPoints(g)
+105 3
+106 5
+107 2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid AsText(PointN(g, 2))
+105 POINT(0 10)
+106 POINT(20 10)
+107 POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid IsClosed(g)
+105 0
+106 1
+107 0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid AsText(Centroid(g))
+108 POINT(15 15)
+109 POINT(25.416666666667 25.416666666667)
+110 POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid Area(g)
+108 100
+109 2400
+110 450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid AsText(ExteriorRing(g))
+108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110 LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid NumInteriorRings(g)
+108 0
+109 1
+110 0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid AsText(InteriorRingN(g, 1))
+108 NULL
+109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110 NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid IsClosed(g)
+114 0
+115 0
+116 0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid AsText(Centroid(g))
+117 POINT(55.588527753042 17.426536064114)
+118 POINT(55.588527753042 17.426536064114)
+119 POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid Area(g)
+117 1684.5
+118 1684.5
+119 4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid NumGeometries(g)
+111 4
+112 4
+113 2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid NumGeometries(g)
+114 2
+115 1
+116 2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid NumGeometries(g)
+117 2
+118 2
+119 1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid NumGeometries(g)
+120 2
+121 2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid AsText(GeometryN(g, 2))
+111 POINT(10 10)
+112 POINT(11 11)
+113 POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid AsText(GeometryN(g, 2))
+114 LINESTRING(16 0,16 23,16 48)
+115 NULL
+116 LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid AsText(GeometryN(g, 2))
+117 POLYGON((59 18,67 18,67 13,59 13,59 18))
+118 POLYGON((59 18,67 18,67 13,59 13,59 18))
+119 NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 2))
+120 LINESTRING(0 0,10 10)
+121 LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first second w c o e d t i r
+120 120 1 1 0 1 0 0 1 0
+120 121 0 0 0 0 0 0 1 0
+121 120 0 0 1 0 0 0 1 0
+121 121 1 1 0 1 0 0 1 0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2
+Warnings:
+Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+fid int(11) YES NULL
+DROP TABLE t1;
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+insert into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (fl geometry);
+insert into t1 values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (pointfromtext('point(1,1)'));
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result
index 5b5f673b071..a8d6c3bf411 100644
--- a/mysql-test/r/binary.result
+++ b/mysql-test/r/binary.result
@@ -85,7 +85,7 @@ NULL
select b from t1 having binary b like '';
b
drop table t1;
-create table t1 (a char(15) binary, b binary(15));
+create table t1 (a char(3) binary, b binary(3));
insert into t1 values ('aaa','bbb'),('AAA','BBB');
select upper(a),upper(b) from t1;
upper(a) upper(b)
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index fa8e810cf2b..817be3a2e7c 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -231,7 +231,7 @@ t1 CREATE TABLE `t1` (
`c5` varchar(2) character set utf8 NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
-create table t1 (a binary(10), b char(10) character set koi8r);
+create table t1 (a binary(4), b char(4) character set koi8r);
insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ');
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
a b cast(a as char character set cp1251) cast(b as binary)
@@ -334,6 +334,9 @@ cast(repeat('1',20) as signed)
-7335632962598440505
Warnings:
Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement
+select cast(1.0e+300 as signed int);
+cast(1.0e+300 as signed int)
+9223372036854775807
select cast('1.2' as decimal(3,2));
cast('1.2' as decimal(3,2))
1.20
diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result
new file mode 100644
index 00000000000..efcafbbe736
--- /dev/null
+++ b/mysql-test/r/compress.result
@@ -0,0 +1,2159 @@
+SHOW STATUS LIKE 'Compression';
+Variable_name Value
+Compression ON
+drop table if exists t1,t2,t3,t4;
+CREATE TABLE t1 (
+Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+);
+INSERT INTO t1 VALUES (9410,9412);
+select period from t1;
+period
+9410
+select * from t1;
+Period Varor_period
+9410 9412
+select t1.* from t1;
+Period Varor_period
+9410 9412
+CREATE TABLE t2 (
+auto int not null auto_increment,
+fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+fld3 char(30) DEFAULT '' NOT NULL,
+fld4 char(35) DEFAULT '' NOT NULL,
+fld5 char(35) DEFAULT '' NOT NULL,
+fld6 char(4) DEFAULT '' NOT NULL,
+UNIQUE fld1 (fld1),
+KEY fld3 (fld3),
+PRIMARY KEY (auto)
+);
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+imaginable
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+cultivation
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3,not_used);
+ERROR 42000: Key column 'not_used' doesn't exist in table
+explain select fld3 from t2 use index (not_used);
+ERROR 42000: Key column 'not_used' doesn't exist in table
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+honeysuckle
+honoring
+explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+148504 Colombo
+068305 Colombo
+000000 nondecreasing
+select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
+fld1 fld3
+232605 appendixes
+1232605 appendixes
+1232606 appendixes
+1232607 appendixes
+1232608 appendixes
+1232609 appendixes
+select fld1 from t2 where fld1=250501 or fld1="250502";
+fld1
+250501
+250502
+explain select fld1 from t2 where fld1=250501 or fld1="250502";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index
+select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+fld1
+250501
+250502
+250505
+250601
+explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+fld1 fld3
+218401 faithful
+018007 fanatic
+228311 fated
+018017 featherweight
+218022 feed
+088303 feminine
+058004 Fenton
+038017 fetched
+018054 fetters
+208101 fiftieth
+238007 filial
+013606 fingerings
+218008 finishers
+038205 firearm
+188505 fitting
+202301 Fitzpatrick
+238008 fixedly
+012001 flanking
+018103 flint
+018104 flopping
+188007 flurried
+013602 foldout
+226205 foothill
+232102 forgivably
+228306 forthcoming
+186002 freakish
+208113 freest
+231315 freezes
+036002 funereal
+226209 furnishings
+198006 furthermore
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+fld3
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+fld3
+Chantilly
+select fld1,fld3 from t2 where fld1 like "25050%";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select fld1,fld3 from t2 where fld1 like "25050_";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select distinct companynr from t2;
+companynr
+00
+37
+36
+50
+58
+29
+40
+53
+65
+41
+34
+68
+select distinct companynr from t2 order by companynr;
+companynr
+00
+29
+34
+36
+37
+40
+41
+50
+53
+58
+65
+68
+select distinct companynr from t2 order by companynr desc;
+companynr
+68
+65
+58
+53
+50
+41
+40
+37
+36
+34
+29
+00
+select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
+fld3 period
+obliterates 9410
+offload 9410
+opaquely 9410
+organizer 9410
+overestimating 9410
+overlay 9410
+select distinct fld3 from t2 where companynr = 34 order by fld3;
+fld3
+absentee
+accessed
+ahead
+alphabetic
+Asiaticizations
+attitude
+aye
+bankruptcies
+belays
+Blythe
+bomb
+boulevard
+bulldozes
+cannot
+caressing
+charcoal
+checksumming
+chess
+clubroom
+colorful
+cosy
+creator
+crying
+Darius
+diffusing
+duality
+Eiffel
+Epiphany
+Ernestine
+explorers
+exterminated
+famine
+forked
+Gershwins
+heaving
+Hodges
+Iraqis
+Italianization
+Lagos
+landslide
+libretto
+Majorca
+mastering
+narrowed
+occurred
+offerers
+Palestine
+Peruvianizes
+pharmaceutic
+poisoning
+population
+Pygmalion
+rats
+realest
+recording
+regimented
+retransmitting
+reviver
+rouses
+scars
+sicker
+sleepwalk
+stopped
+sugars
+translatable
+uncles
+unexpected
+uprisings
+versatility
+vest
+select distinct fld3 from t2 limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct fld3 from t2 having fld3 like "A%" limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+Adl
+adm
+Ado
+ads
+adv
+aer
+aff
+afi
+afl
+afo
+agi
+ahe
+aim
+air
+Ald
+alg
+ali
+all
+alp
+alr
+ama
+ame
+amm
+ana
+and
+ane
+Ang
+ani
+Ann
+Ant
+api
+app
+aqu
+Ara
+arc
+Arm
+arr
+Art
+Asi
+ask
+asp
+ass
+ast
+att
+aud
+Aug
+aut
+ave
+avo
+awe
+aye
+Azt
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+create table t3 (
+period int not null,
+name char(32) not null,
+companynr int not null,
+price double(11,0),
+price2 double(11,0),
+key (period),
+key (name)
+);
+create temporary table tmp engine = myisam select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+alter table t3 add t2nr int not null auto_increment primary key first;
+drop table tmp;
+SET SQL_BIG_TABLES=1;
+select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
+namn
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+SET SQL_BIG_TABLES=0;
+select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
+concat(fld3," ",fld3)
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+select distinct fld5 from t2 limit 10;
+fld5
+neat
+Steinberg
+jarring
+tinily
+balled
+persist
+attainments
+fanatic
+measures
+rightfulness
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=1;
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=0;
+select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
+fld3 repeat("a",length(fld3)) count(*)
+circus aaaaaa 1
+cited aaaaa 1
+Colombo aaaaaaa 1
+congresswoman aaaaaaaaaaaaa 1
+contrition aaaaaaaaaa 1
+corny aaaaa 1
+cultivation aaaaaaaaaaa 1
+definiteness aaaaaaaaaaaa 1
+demultiplex aaaaaaaaaaa 1
+disappointing aaaaaaaaaaaaa 1
+select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
+companynr rtrim(space(512+companynr))
+37
+78
+101
+154
+311
+447
+512
+select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
+fld3
+explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index period period 4 NULL 41810
+1 SIMPLE t1 ref period period 4 test.t3.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+select period from t1;
+period
+9410
+select period from t1 where period=1900;
+period
+select fld3,period from t1,t2 where fld1 = 011401 order by period;
+fld3 period
+breaking 9410
+select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
+fld3 period
+breaking 1001
+explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const fld1 fld1 4 const 1
+1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1
+select fld3,period from t2,t1 where companynr*10 = 37*10;
+fld3 period
+breaking 9410
+Romans 9410
+intercepted 9410
+bewilderingly 9410
+astound 9410
+admonishing 9410
+sumac 9410
+flanking 9410
+combed 9410
+subjective 9410
+scatterbrain 9410
+Eulerian 9410
+Kane 9410
+overlay 9410
+perturb 9410
+goblins 9410
+annihilates 9410
+Wotan 9410
+snatching 9410
+concludes 9410
+laterally 9410
+yelped 9410
+grazing 9410
+Baird 9410
+celery 9410
+misunderstander 9410
+handgun 9410
+foldout 9410
+mystic 9410
+succumbed 9410
+Nabisco 9410
+fingerings 9410
+aging 9410
+afield 9410
+ammonium 9410
+boat 9410
+intelligibility 9410
+Augustine 9410
+teethe 9410
+dreaded 9410
+scholastics 9410
+audiology 9410
+wallet 9410
+parters 9410
+eschew 9410
+quitter 9410
+neat 9410
+Steinberg 9410
+jarring 9410
+tinily 9410
+balled 9410
+persist 9410
+attainments 9410
+fanatic 9410
+measures 9410
+rightfulness 9410
+capably 9410
+impulsive 9410
+starlet 9410
+terminators 9410
+untying 9410
+announces 9410
+featherweight 9410
+pessimist 9410
+daughter 9410
+decliner 9410
+lawgiver 9410
+stated 9410
+readable 9410
+attrition 9410
+cascade 9410
+motors 9410
+interrogate 9410
+pests 9410
+stairway 9410
+dopers 9410
+testicle 9410
+Parsifal 9410
+leavings 9410
+postulation 9410
+squeaking 9410
+contrasted 9410
+leftover 9410
+whiteners 9410
+erases 9410
+Punjab 9410
+Merritt 9410
+Quixotism 9410
+sweetish 9410
+dogging 9410
+scornfully 9410
+bellow 9410
+bills 9410
+cupboard 9410
+sureties 9410
+puddings 9410
+fetters 9410
+bivalves 9410
+incurring 9410
+Adolph 9410
+pithed 9410
+Miles 9410
+trimmings 9410
+tragedies 9410
+skulking 9410
+flint 9410
+flopping 9410
+relaxing 9410
+offload 9410
+suites 9410
+lists 9410
+animized 9410
+multilayer 9410
+standardizes 9410
+Judas 9410
+vacuuming 9410
+dentally 9410
+humanness 9410
+inch 9410
+Weissmuller 9410
+irresponsibly 9410
+luckily 9410
+culled 9410
+medical 9410
+bloodbath 9410
+subschema 9410
+animals 9410
+Micronesia 9410
+repetitions 9410
+Antares 9410
+ventilate 9410
+pityingly 9410
+interdependent 9410
+Graves 9410
+neonatal 9410
+chafe 9410
+honoring 9410
+realtor 9410
+elite 9410
+funereal 9410
+abrogating 9410
+sorters 9410
+Conley 9410
+lectured 9410
+Abraham 9410
+Hawaii 9410
+cage 9410
+hushes 9410
+Simla 9410
+reporters 9410
+Dutchman 9410
+descendants 9410
+groupings 9410
+dissociate 9410
+coexist 9410
+Beebe 9410
+Taoism 9410
+Connally 9410
+fetched 9410
+checkpoints 9410
+rusting 9410
+galling 9410
+obliterates 9410
+traitor 9410
+resumes 9410
+analyzable 9410
+terminator 9410
+gritty 9410
+firearm 9410
+minima 9410
+Selfridge 9410
+disable 9410
+witchcraft 9410
+betroth 9410
+Manhattanize 9410
+imprint 9410
+peeked 9410
+swelling 9410
+interrelationships 9410
+riser 9410
+Gandhian 9410
+peacock 9410
+bee 9410
+kanji 9410
+dental 9410
+scarf 9410
+chasm 9410
+insolence 9410
+syndicate 9410
+alike 9410
+imperial 9410
+convulsion 9410
+railway 9410
+validate 9410
+normalizes 9410
+comprehensive 9410
+chewing 9410
+denizen 9410
+schemer 9410
+chronicle 9410
+Kline 9410
+Anatole 9410
+partridges 9410
+brunch 9410
+recruited 9410
+dimensions 9410
+Chicana 9410
+announced 9410
+praised 9410
+employing 9410
+linear 9410
+quagmire 9410
+western 9410
+relishing 9410
+serving 9410
+scheduling 9410
+lore 9410
+eventful 9410
+arteriole 9410
+disentangle 9410
+cured 9410
+Fenton 9410
+avoidable 9410
+drains 9410
+detectably 9410
+husky 9410
+impelling 9410
+undoes 9410
+evened 9410
+squeezes 9410
+destroyer 9410
+rudeness 9410
+beaner 9410
+boorish 9410
+Everhart 9410
+encompass 9410
+mushrooms 9410
+Alison 9410
+externally 9410
+pellagra 9410
+cult 9410
+creek 9410
+Huffman 9410
+Majorca 9410
+governing 9410
+gadfly 9410
+reassigned 9410
+intentness 9410
+craziness 9410
+psychic 9410
+squabbled 9410
+burlesque 9410
+capped 9410
+extracted 9410
+DiMaggio 9410
+exclamation 9410
+subdirectory 9410
+Gothicism 9410
+feminine 9410
+metaphysically 9410
+sanding 9410
+Miltonism 9410
+freakish 9410
+index 9410
+straight 9410
+flurried 9410
+denotative 9410
+coming 9410
+commencements 9410
+gentleman 9410
+gifted 9410
+Shanghais 9410
+sportswriting 9410
+sloping 9410
+navies 9410
+leaflet 9410
+shooter 9410
+Joplin 9410
+babies 9410
+assails 9410
+admiring 9410
+swaying 9410
+Goldstine 9410
+fitting 9410
+Norwalk 9410
+analogy 9410
+deludes 9410
+cokes 9410
+Clayton 9410
+exhausts 9410
+causality 9410
+sating 9410
+icon 9410
+throttles 9410
+communicants 9410
+dehydrate 9410
+priceless 9410
+publicly 9410
+incidentals 9410
+commonplace 9410
+mumbles 9410
+furthermore 9410
+cautioned 9410
+parametrized 9410
+registration 9410
+sadly 9410
+positioning 9410
+babysitting 9410
+eternal 9410
+hoarder 9410
+congregates 9410
+rains 9410
+workers 9410
+sags 9410
+unplug 9410
+garage 9410
+boulder 9410
+specifics 9410
+Teresa 9410
+Winsett 9410
+convenient 9410
+buckboards 9410
+amenities 9410
+resplendent 9410
+sews 9410
+participated 9410
+Simon 9410
+certificates 9410
+Fitzpatrick 9410
+Evanston 9410
+misted 9410
+textures 9410
+save 9410
+count 9410
+rightful 9410
+chaperone 9410
+Lizzy 9410
+clenched 9410
+effortlessly 9410
+accessed 9410
+beaters 9410
+Hornblower 9410
+vests 9410
+indulgences 9410
+infallibly 9410
+unwilling 9410
+excrete 9410
+spools 9410
+crunches 9410
+overestimating 9410
+ineffective 9410
+humiliation 9410
+sophomore 9410
+star 9410
+rifles 9410
+dialysis 9410
+arriving 9410
+indulge 9410
+clockers 9410
+languages 9410
+Antarctica 9410
+percentage 9410
+ceiling 9410
+specification 9410
+regimented 9410
+ciphers 9410
+pictures 9410
+serpents 9410
+allot 9410
+realized 9410
+mayoral 9410
+opaquely 9410
+hostess 9410
+fiftieth 9410
+incorrectly 9410
+decomposition 9410
+stranglings 9410
+mixture 9410
+electroencephalography 9410
+similarities 9410
+charges 9410
+freest 9410
+Greenberg 9410
+tinting 9410
+expelled 9410
+warm 9410
+smoothed 9410
+deductions 9410
+Romano 9410
+bitterroot 9410
+corset 9410
+securing 9410
+environing 9410
+cute 9410
+Crays 9410
+heiress 9410
+inform 9410
+avenge 9410
+universals 9410
+Kinsey 9410
+ravines 9410
+bestseller 9410
+equilibrium 9410
+extents 9410
+relatively 9410
+pressure 9410
+critiques 9410
+befouled 9410
+rightfully 9410
+mechanizing 9410
+Latinizes 9410
+timesharing 9410
+Aden 9410
+embassies 9410
+males 9410
+shapelessly 9410
+mastering 9410
+Newtonian 9410
+finishers 9410
+abates 9410
+teem 9410
+kiting 9410
+stodgy 9410
+feed 9410
+guitars 9410
+airships 9410
+store 9410
+denounces 9410
+Pyle 9410
+Saxony 9410
+serializations 9410
+Peruvian 9410
+taxonomically 9410
+kingdom 9410
+stint 9410
+Sault 9410
+faithful 9410
+Ganymede 9410
+tidiness 9410
+gainful 9410
+contrary 9410
+Tipperary 9410
+tropics 9410
+theorizers 9410
+renew 9410
+already 9410
+terminal 9410
+Hegelian 9410
+hypothesizer 9410
+warningly 9410
+journalizing 9410
+nested 9410
+Lars 9410
+saplings 9410
+foothill 9410
+labeled 9410
+imperiously 9410
+reporters 9410
+furnishings 9410
+precipitable 9410
+discounts 9410
+excises 9410
+Stalin 9410
+despot 9410
+ripeness 9410
+Arabia 9410
+unruly 9410
+mournfulness 9410
+boom 9410
+slaughter 9410
+Sabine 9410
+handy 9410
+rural 9410
+organizer 9410
+shipyard 9410
+civics 9410
+inaccuracy 9410
+rules 9410
+juveniles 9410
+comprised 9410
+investigations 9410
+stabilizes 9410
+seminaries 9410
+Hunter 9410
+sporty 9410
+test 9410
+weasels 9410
+CERN 9410
+tempering 9410
+afore 9410
+Galatean 9410
+techniques 9410
+error 9410
+veranda 9410
+severely 9410
+Cassites 9410
+forthcoming 9410
+guides 9410
+vanish 9410
+lied 9410
+sawtooth 9410
+fated 9410
+gradually 9410
+widens 9410
+preclude 9410
+evenhandedly 9410
+percentage 9410
+disobedience 9410
+humility 9410
+gleaning 9410
+petted 9410
+bloater 9410
+minion 9410
+marginal 9410
+apiary 9410
+measures 9410
+precaution 9410
+repelled 9410
+primary 9410
+coverings 9410
+Artemia 9410
+navigate 9410
+spatial 9410
+Gurkha 9410
+meanwhile 9410
+Melinda 9410
+Butterfield 9410
+Aldrich 9410
+previewing 9410
+glut 9410
+unaffected 9410
+inmate 9410
+mineral 9410
+impending 9410
+meditation 9410
+ideas 9410
+miniaturizes 9410
+lewdly 9410
+title 9410
+youthfulness 9410
+creak 9410
+Chippewa 9410
+clamored 9410
+freezes 9410
+forgivably 9410
+reduce 9410
+McGovern 9410
+Nazis 9410
+epistle 9410
+socializes 9410
+conceptions 9410
+Kevin 9410
+uncovering 9410
+chews 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+raining 9410
+infest 9410
+compartment 9410
+minting 9410
+ducks 9410
+roped 9410
+waltz 9410
+Lillian 9410
+repressions 9410
+chillingly 9410
+noncritical 9410
+lithograph 9410
+spongers 9410
+parenthood 9410
+posed 9410
+instruments 9410
+filial 9410
+fixedly 9410
+relives 9410
+Pandora 9410
+watering 9410
+ungrateful 9410
+secures 9410
+poison 9410
+dusted 9410
+encompasses 9410
+presentation 9410
+Kantian 9410
+select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
+fld3 period price price2
+admonishing 1002 28357832 8723648
+analyzable 1002 28357832 8723648
+annihilates 1001 5987435 234724
+Antares 1002 28357832 8723648
+astound 1001 5987435 234724
+audiology 1001 5987435 234724
+Augustine 1002 28357832 8723648
+Baird 1002 28357832 8723648
+bewilderingly 1001 5987435 234724
+breaking 1001 5987435 234724
+Conley 1001 5987435 234724
+dentally 1002 28357832 8723648
+dissociate 1002 28357832 8723648
+elite 1001 5987435 234724
+eschew 1001 5987435 234724
+Eulerian 1001 5987435 234724
+flanking 1001 5987435 234724
+foldout 1002 28357832 8723648
+funereal 1002 28357832 8723648
+galling 1002 28357832 8723648
+Graves 1001 5987435 234724
+grazing 1001 5987435 234724
+groupings 1001 5987435 234724
+handgun 1001 5987435 234724
+humility 1002 28357832 8723648
+impulsive 1002 28357832 8723648
+inch 1001 5987435 234724
+intelligibility 1001 5987435 234724
+jarring 1001 5987435 234724
+lawgiver 1001 5987435 234724
+lectured 1002 28357832 8723648
+Merritt 1002 28357832 8723648
+neonatal 1001 5987435 234724
+offload 1002 28357832 8723648
+parters 1002 28357832 8723648
+pityingly 1002 28357832 8723648
+puddings 1002 28357832 8723648
+Punjab 1001 5987435 234724
+quitter 1002 28357832 8723648
+realtor 1001 5987435 234724
+relaxing 1001 5987435 234724
+repetitions 1001 5987435 234724
+resumes 1001 5987435 234724
+Romans 1002 28357832 8723648
+rusting 1001 5987435 234724
+scholastics 1001 5987435 234724
+skulking 1002 28357832 8723648
+stated 1002 28357832 8723648
+suites 1002 28357832 8723648
+sureties 1001 5987435 234724
+testicle 1002 28357832 8723648
+tinily 1002 28357832 8723648
+tragedies 1001 5987435 234724
+trimmings 1001 5987435 234724
+vacuuming 1001 5987435 234724
+ventilate 1001 5987435 234724
+wallet 1001 5987435 234724
+Weissmuller 1002 28357832 8723648
+Wotan 1002 28357832 8723648
+select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
+fld1 fld3 period price price2
+018201 relaxing 1001 5987435 234724
+018601 vacuuming 1001 5987435 234724
+018801 inch 1001 5987435 234724
+018811 repetitions 1001 5987435 234724
+create table t4 (
+companynr tinyint(2) unsigned zerofill NOT NULL default '00',
+companyname char(30) NOT NULL default '',
+PRIMARY KEY (companynr),
+UNIQUE KEY companyname(companyname)
+) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select * from t1,t1 t12;
+Period Varor_period Period Varor_period
+9410 9412 9410 9412
+select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
+fld1 fld1
+250501 250501
+250502 250501
+250503 250501
+250504 250501
+250505 250501
+250501 250502
+250502 250502
+250503 250502
+250504 250502
+250505 250502
+250501 250503
+250502 250503
+250503 250503
+250504 250503
+250505 250503
+250501 250504
+250502 250504
+250503 250504
+250504 250504
+250505 250504
+250501 250505
+250502 250505
+250503 250505
+250504 250505
+250505 250505
+insert into t2 (fld1, companynr) values (999999,99);
+select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+companynr companyname
+99 NULL
+select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
+count(*)
+1199
+explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists
+select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+companynr companyname
+select count(*) from t2 left join t4 using (companynr) where companynr is not null;
+count(*)
+1200
+explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+delete from t2 where fld1=999999;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+companynr companynr
+37 36
+41 40
+explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
+period
+9410
+select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
+period
+9410
+select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
+fld1
+250501
+250502
+250503
+250505
+select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
+fld1
+250502
+250503
+select fld1 from t2 where fld1 between 250502 and 250504;
+fld1
+250502
+250503
+250504
+select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
+fld3
+label
+labeled
+labeled
+landslide
+laterally
+leaflet
+lewdly
+Lillian
+luckily
+select count(*) from t1;
+count(*)
+1
+select companynr,count(*),sum(fld1) from t2 group by companynr;
+companynr count(*) sum(fld1)
+00 82 10355753
+29 95 14473298
+34 70 17788966
+36 215 22786296
+37 588 83602098
+40 37 6618386
+41 52 12816335
+50 11 1595438
+53 4 793210
+58 23 2254293
+65 10 2284055
+68 12 3097288
+select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
+companynr count(*)
+68 12
+65 10
+58 23
+53 4
+50 11
+select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+Warnings:
+Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1''))
+select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
+companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087
+29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026
+34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
+companynr count(price) sum(price) min(price) max(price) avg(price)
+37 12543 309394878010 5987435 39654943 24666736.6667
+78 8362 414611089292 726498 98439034 49582766.0000
+101 4181 3489454238 834598 834598 834598.0000
+154 4181 4112197254950 983543950 983543950 983543950.0000
+311 4181 979599938 234298 234298 234298.0000
+447 4181 9929180954 2374834 2374834 2374834.0000
+512 4181 3288532102 786542 786542 786542.0000
+select distinct mod(companynr,10) from t4 group by companynr;
+mod(companynr,10)
+0
+9
+4
+6
+7
+1
+3
+8
+5
+select distinct 1 from t4 group by companynr;
+1
+1
+select count(distinct fld1) from t2;
+count(distinct fld1)
+1199
+select companynr,count(distinct fld1) from t2 group by companynr;
+companynr count(distinct fld1)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(*) from t2 group by companynr;
+companynr count(*)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,1000)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,200)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
+companynr count(distinct floor(fld1/100))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
+companynr count(distinct concat(repeat(65,1000),floor(fld1/100)))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
+sum(fld1) fld3
+11402 Romans
+select name,count(*) from t3 where name='cloakroom' group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
+name count(*)
+cloakroom 4181
+select count(*) from t3 where name='cloakroom' and price2=823742;
+count(*)
+4181
+select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
+name count(*)
+extramarital 4181
+gazer 4181
+gems 4181
+Iranizes 4181
+spates 4181
+tucked 4181
+violinist 4181
+select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld3 count(*)
+spates 4181
+select companynr|0,companyname from t4 group by 1;
+companynr|0 companyname
+0 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
+companynr companyname count(*)
+29 company 1 95
+68 company 10 12
+50 company 11 11
+34 company 2 70
+36 company 3 215
+37 company 4 588
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+00 Unknown 82
+select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld1 count(*)
+158402 4181
+select sum(Period)/count(*) from t1;
+sum(Period)/count(*)
+9410.0000
+select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
+companynr count sum diff func
+37 12543 309394878010 0.0000 464091
+78 8362 414611089292 0.0000 652236
+101 4181 3489454238 0.0000 422281
+154 4181 4112197254950 0.0000 643874
+311 4181 979599938 0.0000 1300291
+447 4181 9929180954 0.0000 1868907
+512 4181 3288532102 0.0000 2140672
+select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
+companynr avg
+154 983543950.0000
+select companynr,count(*) from t2 group by companynr order by 2 desc;
+companynr count(*)
+37 588
+36 215
+29 95
+00 82
+34 70
+41 52
+40 37
+58 23
+68 12
+50 11
+65 10
+53 4
+select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
+companynr count(*)
+41 52
+58 23
+68 12
+50 11
+65 10
+53 4
+select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
+fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)
+teethe 000001 1 5987435 5987435 5987435 5987435.0000
+dreaded 011401 1 5987435 5987435 5987435 5987435.0000
+scholastics 011402 1 28357832 28357832 28357832 28357832.0000
+audiology 011403 1 39654943 39654943 39654943 39654943.0000
+wallet 011501 1 5987435 5987435 5987435 5987435.0000
+parters 011701 1 5987435 5987435 5987435 5987435.0000
+eschew 011702 1 28357832 28357832 28357832 28357832.0000
+quitter 011703 1 39654943 39654943 39654943 39654943.0000
+neat 012001 1 5987435 5987435 5987435 5987435.0000
+Steinberg 012003 1 39654943 39654943 39654943 39654943.0000
+balled 012301 1 5987435 5987435 5987435 5987435.0000
+persist 012302 1 28357832 28357832 28357832 28357832.0000
+attainments 012303 1 39654943 39654943 39654943 39654943.0000
+capably 012501 1 5987435 5987435 5987435 5987435.0000
+impulsive 012602 1 28357832 28357832 28357832 28357832.0000
+starlet 012603 1 39654943 39654943 39654943 39654943.0000
+featherweight 012701 1 5987435 5987435 5987435 5987435.0000
+pessimist 012702 1 28357832 28357832 28357832 28357832.0000
+daughter 012703 1 39654943 39654943 39654943 39654943.0000
+lawgiver 013601 1 5987435 5987435 5987435 5987435.0000
+stated 013602 1 28357832 28357832 28357832 28357832.0000
+readable 013603 1 39654943 39654943 39654943 39654943.0000
+testicle 013801 1 5987435 5987435 5987435 5987435.0000
+Parsifal 013802 1 28357832 28357832 28357832 28357832.0000
+leavings 013803 1 39654943 39654943 39654943 39654943.0000
+squeaking 013901 1 5987435 5987435 5987435 5987435.0000
+contrasted 016001 1 5987435 5987435 5987435 5987435.0000
+leftover 016201 1 5987435 5987435 5987435 5987435.0000
+whiteners 016202 1 28357832 28357832 28357832 28357832.0000
+erases 016301 1 5987435 5987435 5987435 5987435.0000
+Punjab 016302 1 28357832 28357832 28357832 28357832.0000
+Merritt 016303 1 39654943 39654943 39654943 39654943.0000
+sweetish 018001 1 5987435 5987435 5987435 5987435.0000
+dogging 018002 1 28357832 28357832 28357832 28357832.0000
+scornfully 018003 1 39654943 39654943 39654943 39654943.0000
+fetters 018012 1 28357832 28357832 28357832 28357832.0000
+bivalves 018013 1 39654943 39654943 39654943 39654943.0000
+skulking 018021 1 5987435 5987435 5987435 5987435.0000
+flint 018022 1 28357832 28357832 28357832 28357832.0000
+flopping 018023 1 39654943 39654943 39654943 39654943.0000
+Judas 018032 1 28357832 28357832 28357832 28357832.0000
+vacuuming 018033 1 39654943 39654943 39654943 39654943.0000
+medical 018041 1 5987435 5987435 5987435 5987435.0000
+bloodbath 018042 1 28357832 28357832 28357832 28357832.0000
+subschema 018043 1 39654943 39654943 39654943 39654943.0000
+interdependent 018051 1 5987435 5987435 5987435 5987435.0000
+Graves 018052 1 28357832 28357832 28357832 28357832.0000
+neonatal 018053 1 39654943 39654943 39654943 39654943.0000
+sorters 018061 1 5987435 5987435 5987435 5987435.0000
+epistle 018062 1 28357832 28357832 28357832 28357832.0000
+Conley 018101 1 5987435 5987435 5987435 5987435.0000
+lectured 018102 1 28357832 28357832 28357832 28357832.0000
+Abraham 018103 1 39654943 39654943 39654943 39654943.0000
+cage 018201 1 5987435 5987435 5987435 5987435.0000
+hushes 018202 1 28357832 28357832 28357832 28357832.0000
+Simla 018402 1 28357832 28357832 28357832 28357832.0000
+reporters 018403 1 39654943 39654943 39654943 39654943.0000
+coexist 018601 1 5987435 5987435 5987435 5987435.0000
+Beebe 018602 1 28357832 28357832 28357832 28357832.0000
+Taoism 018603 1 39654943 39654943 39654943 39654943.0000
+Connally 018801 1 5987435 5987435 5987435 5987435.0000
+fetched 018802 1 28357832 28357832 28357832 28357832.0000
+checkpoints 018803 1 39654943 39654943 39654943 39654943.0000
+gritty 018811 1 5987435 5987435 5987435 5987435.0000
+firearm 018812 1 28357832 28357832 28357832 28357832.0000
+minima 019101 1 5987435 5987435 5987435 5987435.0000
+Selfridge 019102 1 28357832 28357832 28357832 28357832.0000
+disable 019103 1 39654943 39654943 39654943 39654943.0000
+witchcraft 019201 1 5987435 5987435 5987435 5987435.0000
+betroth 030501 1 5987435 5987435 5987435 5987435.0000
+Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000
+imprint 030503 1 39654943 39654943 39654943 39654943.0000
+swelling 031901 1 5987435 5987435 5987435 5987435.0000
+interrelationships 036001 1 5987435 5987435 5987435 5987435.0000
+riser 036002 1 28357832 28357832 28357832 28357832.0000
+bee 038001 1 5987435 5987435 5987435 5987435.0000
+kanji 038002 1 28357832 28357832 28357832 28357832.0000
+dental 038003 1 39654943 39654943 39654943 39654943.0000
+railway 038011 1 5987435 5987435 5987435 5987435.0000
+validate 038012 1 28357832 28357832 28357832 28357832.0000
+normalizes 038013 1 39654943 39654943 39654943 39654943.0000
+Kline 038101 1 5987435 5987435 5987435 5987435.0000
+Anatole 038102 1 28357832 28357832 28357832 28357832.0000
+partridges 038103 1 39654943 39654943 39654943 39654943.0000
+recruited 038201 1 5987435 5987435 5987435 5987435.0000
+dimensions 038202 1 28357832 28357832 28357832 28357832.0000
+Chicana 038203 1 39654943 39654943 39654943 39654943.0000
+select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
+companynr fld3 sum(price)
+512 boat 786542
+512 capably 786542
+512 cupboard 786542
+512 decliner 786542
+512 descendants 786542
+512 dopers 786542
+512 erases 786542
+512 Micronesia 786542
+512 Miles 786542
+512 skies 786542
+select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
+companynr count(*) min(fld3) max(fld3) sum(price) avg(price)
+00 1 Omaha Omaha 5987435 5987435.0000
+36 1 dubbed dubbed 28357832 28357832.0000
+37 83 Abraham Wotan 1908978016 22999735.1325
+50 2 scribbled tapestry 68012775 34006387.5000
+select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
+t3.companynr+0 t2nr fld3 sum(price)
+37 1 Omaha 5987435
+37 11401 breaking 5987435
+37 11402 Romans 28357832
+37 11403 intercepted 39654943
+37 11501 bewilderingly 5987435
+37 11701 astound 5987435
+37 11702 admonishing 28357832
+37 11703 sumac 39654943
+37 12001 flanking 5987435
+37 12003 combed 39654943
+37 12301 Eulerian 5987435
+37 12302 dubbed 28357832
+37 12303 Kane 39654943
+37 12501 annihilates 5987435
+37 12602 Wotan 28357832
+37 12603 snatching 39654943
+37 12701 grazing 5987435
+37 12702 Baird 28357832
+37 12703 celery 39654943
+37 13601 handgun 5987435
+37 13602 foldout 28357832
+37 13603 mystic 39654943
+37 13801 intelligibility 5987435
+37 13802 Augustine 28357832
+37 13803 teethe 39654943
+37 13901 scholastics 5987435
+37 16001 audiology 5987435
+37 16201 wallet 5987435
+37 16202 parters 28357832
+37 16301 eschew 5987435
+37 16302 quitter 28357832
+37 16303 neat 39654943
+37 18001 jarring 5987435
+37 18002 tinily 28357832
+37 18003 balled 39654943
+37 18012 impulsive 28357832
+37 18013 starlet 39654943
+37 18021 lawgiver 5987435
+37 18022 stated 28357832
+37 18023 readable 39654943
+37 18032 testicle 28357832
+37 18033 Parsifal 39654943
+37 18041 Punjab 5987435
+37 18042 Merritt 28357832
+37 18043 Quixotism 39654943
+37 18051 sureties 5987435
+37 18052 puddings 28357832
+37 18053 tapestry 39654943
+37 18061 trimmings 5987435
+37 18062 humility 28357832
+37 18101 tragedies 5987435
+37 18102 skulking 28357832
+37 18103 flint 39654943
+37 18201 relaxing 5987435
+37 18202 offload 28357832
+37 18402 suites 28357832
+37 18403 lists 39654943
+37 18601 vacuuming 5987435
+37 18602 dentally 28357832
+37 18603 humanness 39654943
+37 18801 inch 5987435
+37 18802 Weissmuller 28357832
+37 18803 irresponsibly 39654943
+37 18811 repetitions 5987435
+37 18812 Antares 28357832
+37 19101 ventilate 5987435
+37 19102 pityingly 28357832
+37 19103 interdependent 39654943
+37 19201 Graves 5987435
+37 30501 neonatal 5987435
+37 30502 scribbled 28357832
+37 30503 chafe 39654943
+37 31901 realtor 5987435
+37 36001 elite 5987435
+37 36002 funereal 28357832
+37 38001 Conley 5987435
+37 38002 lectured 28357832
+37 38003 Abraham 39654943
+37 38011 groupings 5987435
+37 38012 dissociate 28357832
+37 38013 coexist 39654943
+37 38101 rusting 5987435
+37 38102 galling 28357832
+37 38103 obliterates 39654943
+37 38201 resumes 5987435
+37 38202 analyzable 28357832
+37 38203 terminator 39654943
+select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
+sum(price)
+234298
+select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
+fld1 sum(price)
+038008 234298
+explain select fld3 from t2 where 1>2 or 2>3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select fld3 from t2 where fld1=fld1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
+companynr count sum
+00 82 10355753
+29 95 14473298
+34 70 17788966
+37 588 83602098
+41 52 12816335
+select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
+companynr
+00
+29
+34
+37
+41
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
+companynr companyname count(*)
+68 company 10 12
+50 company 11 11
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+select count(*) from t2;
+count(*)
+1199
+select count(*) from t2 where fld1 < 098024;
+count(*)
+387
+select min(fld1) from t2 where fld1>= 098024;
+min(fld1)
+98024
+select max(fld1) from t2 where fld1>= 098024;
+max(fld1)
+1232609
+select count(*) from t3 where price2=76234234;
+count(*)
+4181
+select count(*) from t3 where companynr=512 and price2=76234234;
+count(*)
+4181
+explain select min(fld1),max(fld1),count(*) from t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(fld1),max(fld1),count(*) from t2;
+min(fld1) max(fld1) count(*)
+0 1232609 1199
+select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
+min(t2nr) max(t2nr)
+2115 2115
+select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
+count(*) min(t2nr) max(t2nr)
+4181 4 41804
+select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
+t2nr count(*)
+9 1
+19 1
+29 1
+39 1
+49 1
+59 1
+69 1
+79 1
+89 1
+99 1
+109 1
+119 1
+129 1
+139 1
+149 1
+159 1
+169 1
+179 1
+189 1
+199 1
+select max(t2nr) from t3 where price=983543950;
+max(t2nr)
+41807
+select t1.period from t3 = t1 limit 1;
+period
+1001
+select t1.period from t1 as t1 limit 1;
+period
+9410
+select t1.period as "Nuvarande period" from t1 as t1 limit 1;
+Nuvarande period
+9410
+select period as ok_period from t1 limit 1;
+ok_period
+9410
+select period as ok_period from t1 group by ok_period limit 1;
+ok_period
+9410
+select 1+1 as summa from t1 group by summa limit 1;
+summa
+2
+select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
+Nuvarande period
+9410
+show tables;
+Tables_in_test
+t1
+t2
+t3
+t4
+show tables from test like "s%";
+Tables_in_test (s%)
+show tables from test like "t?";
+Tables_in_test (t?)
+show full columns from t2;
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(11) NULL NO PRI NULL auto_increment #
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+companynr tinyint(2) unsigned zerofill NULL NO 00 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 'f%';
+Field Type Collation Null Key Default Extra Privileges Comment
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 's%';
+Field Type Collation Null Key Default Extra Privileges Comment
+show keys from t2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
+t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
+t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+drop table t4, t3, t2, t1;
+CREATE TABLE t1 (
+cont_nr int(11) NOT NULL auto_increment,
+ver_nr int(11) NOT NULL default '0',
+aufnr int(11) NOT NULL default '0',
+username varchar(50) NOT NULL default '',
+hdl_nr int(11) NOT NULL default '0',
+eintrag date NOT NULL default '0000-00-00',
+st_klasse varchar(40) NOT NULL default '',
+st_wert varchar(40) NOT NULL default '',
+st_zusatz varchar(40) NOT NULL default '',
+st_bemerkung varchar(255) NOT NULL default '',
+kunden_art varchar(40) NOT NULL default '',
+mcbs_knr int(11) default NULL,
+mcbs_aufnr int(11) NOT NULL default '0',
+schufa_status char(1) default '?',
+bemerkung text,
+wirknetz text,
+wf_igz int(11) NOT NULL default '0',
+tarifcode varchar(80) default NULL,
+recycle char(1) default NULL,
+sim varchar(30) default NULL,
+mcbs_tpl varchar(30) default NULL,
+emp_nr int(11) NOT NULL default '0',
+laufzeit int(11) default NULL,
+hdl_name varchar(30) default NULL,
+prov_hdl_nr int(11) NOT NULL default '0',
+auto_wirknetz varchar(50) default NULL,
+auto_billing varchar(50) default NULL,
+touch timestamp NOT NULL,
+kategorie varchar(50) default NULL,
+kundentyp varchar(20) NOT NULL default '',
+sammel_rech_msisdn varchar(30) NOT NULL default '',
+p_nr varchar(9) NOT NULL default '',
+suffix char(3) NOT NULL default '',
+PRIMARY KEY (cont_nr),
+KEY idx_aufnr(aufnr),
+KEY idx_hdl_nr(hdl_nr),
+KEY idx_st_klasse(st_klasse),
+KEY ver_nr(ver_nr),
+KEY eintrag_idx(eintrag),
+KEY emp_nr_idx(emp_nr),
+KEY wf_igz(wf_igz),
+KEY touch(touch),
+KEY hdl_tag(eintrag,hdl_nr),
+KEY prov_hdl_nr(prov_hdl_nr),
+KEY mcbs_aufnr(mcbs_aufnr),
+KEY kundentyp(kundentyp),
+KEY p_nr(p_nr,suffix)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
+INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
+Kundentyp kategorie
+Privat (Private Nutzung) Mobilfunk
+Warnings:
+Warning 1052 Column 'kundentyp' in group statement is ambiguous
+drop table t1;
+SHOW STATUS LIKE 'Compression';
+Variable_name Value
+Compression ON
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 2508d751b46..d5b1cf4dd63 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -20,6 +20,10 @@ time_zone_transition_type
user
show tables;
Tables_in_test
+connect(localhost,root,z,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
+connect(localhost,root,z,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
show tables;
@@ -43,6 +47,14 @@ time_zone_transition_type
user
show tables;
Tables_in_test
+connect(localhost,test,,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
+connect(localhost,test,,"",MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
+connect(localhost,test,zorro,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
+connect(localhost,test,zorro,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges;
set password="";
@@ -70,6 +82,14 @@ time_zone_transition_type
user
show tables;
Tables_in_test
+connect(localhost,test,,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
+connect(localhost,test,,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
+connect(localhost,test,zorro,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
+connect(localhost,test,zorro,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock);
+ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
delete from mysql.user where user=_binary"test";
flush privileges;
create table t1 (id integer not null auto_increment primary key);
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 3e7c9d6eb4a..1f8c6cb464d 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -641,3 +641,16 @@ create table if not exists t1 (a int);
Warnings:
Note 1050 Table 't1' already exists
drop table t1;
+create table t1 (
+a varchar(112) charset utf8 collate utf8_bin not null,
+primary key (a)
+) select 'test' as a ;
+Warnings:
+Warning 1364 Field 'a' doesn't have a default value
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(112) character set utf8 collate utf8_bin NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index a31289775fe..4c5832a57e9 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -170,3 +170,22 @@ SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE
HEX(a)
A741ADCCA66EB6DC20A7DAADCCABDCA66E
DROP TABLE t1;
+set names big5;
+create table t1 (a char character set big5);
+insert into t1 values (0xF9D6),(0xF9D7),(0xF9D8),(0xF9D9);
+insert into t1 values (0xF9DA),(0xF9DB),(0xF9DC);
+select hex(a) a, hex(@u:=convert(a using utf8)) b,
+hex(convert(@u using big5)) c from t1 order by a;
+a b c
+F9D6 E7A281 F9D6
+F9D7 E98AB9 F9D7
+F9D8 E8A38F F9D8
+F9D9 E5A2BB F9D9
+F9DA E68192 F9DA
+F9DB E7B2A7 F9DB
+F9DC E5ABBA F9DC
+alter table t1 convert to character set utf8;
+select hex(a) from t1 where a = _big5 0xF9DC;
+hex(a)
+E5ABBA
+drop table t1;
diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result
index 7b2ca7d7e0e..533bfb8cb53 100644
--- a/mysql-test/r/ctype_cp1250_ch.result
+++ b/mysql-test/r/ctype_cp1250_ch.result
@@ -19,3 +19,26 @@ SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
popisek
2005-01-1
drop table t1;
+set names cp1250;
+CREATE TABLE t1
+(
+id INT AUTO_INCREMENT PRIMARY KEY,
+str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '',
+UNIQUE KEY (str)
+);
+INSERT INTO t1 VALUES (NULL, 'a');
+INSERT INTO t1 VALUES (NULL, 'aa');
+INSERT INTO t1 VALUES (NULL, 'aaa');
+INSERT INTO t1 VALUES (NULL, 'aaaa');
+INSERT INTO t1 VALUES (NULL, 'aaaaa');
+INSERT INTO t1 VALUES (NULL, 'aaaaaa');
+INSERT INTO t1 VALUES (NULL, 'aaaaaaa');
+select * from t1 where str like 'aa%';
+id str
+2 aa
+3 aaa
+4 aaaa
+5 aaaaa
+6 aaaaaa
+7 aaaaaaa
+drop table t1;
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result
index c65055e726d..47797af3cbe 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -23,7 +23,7 @@ a
b
c
drop table t1;
-create table t1 (a char(15) binary, b binary(15)) character set cp1251;
+create table t1 (a char(3) binary, b binary(3)) character set cp1251;
insert into t1 values ('aaa','bbb'),('AAA','BBB');
select upper(a),upper(b) from t1;
upper(a) upper(b)
diff --git a/mysql-test/r/ctype_cp932.result b/mysql-test/r/ctype_cp932.result
index 08206a91b7b..1afceb86381 100755
--- a/mysql-test/r/ctype_cp932.result
+++ b/mysql-test/r/ctype_cp932.result
@@ -11349,3 +11349,20 @@ cp932_bin 6109
cp932_bin 61
cp932_bin 6120
drop table t1;
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert into t1 values ('ab');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+insert into t1 values ('abc');
+Warnings:
+Warning 1265 Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+a
diff --git a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog.result
new file mode 100644
index 00000000000..d04fce7738c
--- /dev/null
+++ b/mysql-test/r/ctype_cp932_binlog.result
@@ -0,0 +1,17 @@
+drop table if exists t1;
+set names cp932;
+set character_set_database = cp932;
+RESET MASTER;
+CREATE TABLE t1(f1 blob);
+PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
+SET @var1= x'8300';
+EXECUTE stmt1 USING @var1;
+SHOW BINLOG EVENTS FROM 98;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 98 Query 1 185 use `test`; CREATE TABLE t1(f1 blob)
+master-bin.000001 185 User var 1 224 @`var1`=_binary 0x8300 COLLATE binary
+master-bin.000001 224 Query 1 317 use `test`; INSERT INTO t1 VALUES(@'var1')
+SELECT HEX(f1) FROM t1;
+HEX(f1)
+8300
+DROP table t1;
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result
index 0fbdc8ac63c..cf4bf6e2fdd 100644
--- a/mysql-test/r/ctype_latin1.result
+++ b/mysql-test/r/ctype_latin1.result
@@ -296,6 +296,9 @@ FD C3BD FD 1
FE C3BE FE 1
FF C3BF FF 1
DROP TABLE t1;
+SELECT 1 as ƒ, 2 as Š, 3 as Œ, 4 as Ž, 5 as š, 6 as œ, 7 as ž, 8 as Ÿ;
+ƒ Š Œ Ž š œ ž Ÿ
+1 2 3 4 5 6 7 8
select 'a' regexp 'A' collate latin1_general_ci;
'a' regexp 'A' collate latin1_general_ci
1
diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result
index 87b83acfe0f..125a3fc4286 100644
--- a/mysql-test/r/ctype_many.result
+++ b/mysql-test/r/ctype_many.result
@@ -340,7 +340,7 @@ CYR CAPIT SOFT SIGN ø ø
CYR CAPIT E ü ü
CYR CAPIT YU à à
CYR CAPIT YA ñ ñ
-ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default '';
+ALTER TABLE t1 ADD bin_f CHAR(1) BYTE NOT NULL default '';
UPDATE t1 SET bin_f=koi8_ru_f;
SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1;
COUNT(DISTINCT bin_f) COUNT(DISTINCT koi8_ru_f) COUNT(DISTINCT utf8_f)
@@ -1331,146 +1331,146 @@ UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE
UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%';
UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8'';
UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2'';
-SELECT * FROM t1;
-comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f
-LAT SMALL A a a a a
-LAT SMALL B b b b b
-LAT SMALL C c c c c
-LAT SMALL D d d d d
-LAT SMALL E e e e e
-LAT SMALL F f f f f
-LAT SMALL G g g g g
-LAT SMALL H h h h h
-LAT SMALL I i i i i
-LAT SMALL J j j j j
-LAT SMALL K k k k k
-LAT SMALL L l l l l
-LAT SMALL M m m m m
-LAT SMALL N n n n n
-LAT SMALL O o o o o
-LAT SMALL P p p p p
-LAT SMALL Q q q q q
-LAT SMALL R r r r r
-LAT SMALL S s s s s
-LAT SMALL T t t t t
-LAT SMALL U u u u u
-LAT SMALL V v v v v
-LAT SMALL W w w w w
-LAT SMALL X x x x x
-LAT SMALL Y y y y y
-LAT SMALL Z z z z z
-LAT CAPIT A A A A A
-LAT CAPIT B B B B B
-LAT CAPIT C C C C C
-LAT CAPIT D D D D D
-LAT CAPIT E E E E E
-LAT CAPIT F F F F F
-LAT CAPIT G G G G G
-LAT CAPIT H H H H H
-LAT CAPIT I I I I I
-LAT CAPIT J J J J J
-LAT CAPIT K K K K K
-LAT CAPIT L L L L L
-LAT CAPIT M M M M M
-LAT CAPIT N N N N N
-LAT CAPIT O O O O O
-LAT CAPIT P P P P P
-LAT CAPIT Q Q Q Q Q
-LAT CAPIT R R R R R
-LAT CAPIT S S S S S
-LAT CAPIT T T T T T
-LAT CAPIT U U U U U
-LAT CAPIT V V V V V
-LAT CAPIT W W W W W
-LAT CAPIT X X X X X
-LAT CAPIT Y Y Y Y Y
-LAT CAPIT Z Z Z Z Z
-CYR SMALL A а а Á а
-CYR SMALL BE б б  б
-CYR SMALL VE в в × Ð²
-CYR SMALL GE г г Ç Ð³
-CYR SMALL DE д д Ä Ð´
-CYR SMALL IE е е Šе
-CYR SMALL IO Ñ‘ Ñ‘ £ Ñ‘
-CYR SMALL ZHE ж ж Ö Ð¶
-CYR SMALL ZE з з Ú Ð·
-CYR SMALL I и и É Ð¸
-CYR SMALL KA к к Ë Ðº
-CYR SMALL EL л л Ì Ð»
-CYR SMALL EM м м Í Ð¼
-CYR SMALL EN н н Πн
-CYR SMALL O о о Ï Ð¾
-CYR SMALL PE п п Рп
-CYR SMALL ER Ñ€ Ñ€ Ò Ñ€
-CYR SMALL ES Ñ Ñ Ó Ñ
-CYR SMALL TE Ñ‚ Ñ‚ Ô Ñ‚
-CYR SMALL U у у Õ Ñƒ
-CYR SMALL EF Ñ„ Ñ„ Æ Ñ„
-CYR SMALL HA Ñ… Ñ… È Ñ…
-CYR SMALL TSE ц ц à ц
-CYR SMALL CHE ч ч Þ Ñ‡
-CYR SMALL SHA ш ш Û Ñˆ
-CYR SMALL SCHA щ щ Ý Ñ‰
-CYR SMALL HARD SIGN ÑŠ ÑŠ ß ÑŠ
-CYR SMALL YERU Ñ‹ Ñ‹ Ù Ñ‹
-CYR SMALL SOFT SIGN ÑŒ ÑŒ Ø ÑŒ
-CYR SMALL E Ñ Ñ Ü Ñ
-CYR SMALL YU ÑŽ ÑŽ À ÑŽ
-CYR SMALL YA Ñ Ñ Ñ Ñ
-CYR CAPIT A Ð Ð á Ð
-CYR CAPIT BE Б Б â Б
-CYR CAPIT VE Ð’ Ð’ ÷ Ð’
-CYR CAPIT GE Г Г ç Г
-CYR CAPIT DE Д Д ä Д
-CYR CAPIT IE Е Е å Е
-CYR CAPIT IO Ð Ð ³ Ð
-CYR CAPIT ZHE Ж Ж ö Ж
-CYR CAPIT ZE З З ú З
-CYR CAPIT I И И é И
-CYR CAPIT KA К К ë К
-CYR CAPIT EL Л Л ì Л
-CYR CAPIT EM Ðœ Ðœ í Ðœ
-CYR CAPIT EN Ð Ð î Ð
-CYR CAPIT O О О ï О
-CYR CAPIT PE П П ð П
-CYR CAPIT ER Р Р ò Р
-CYR CAPIT ES С С ó С
-CYR CAPIT TE Т Т ô Т
-CYR CAPIT U У У õ У
-CYR CAPIT EF Ф Ф æ Ф
-CYR CAPIT HA Ð¥ Ð¥ è Ð¥
-CYR CAPIT TSE Ц Ц ã Ц
-CYR CAPIT CHE Ч Ч þ Ч
-CYR CAPIT SHA Ш Ш û Ш
-CYR CAPIT SCHA Щ Щ ý Щ
-CYR CAPIT HARD SIGN Ъ Ъ ÿ Ъ
-CYR CAPIT YERU Ы Ы ù Ы
-CYR CAPIT SOFT SIGN Ь Ь ø Ь
-CYR CAPIT E Э Э ü Э
-CYR CAPIT YU Ю Ю à Ю
-CYR CAPIT YA Я Я ñ Я
-GREEK CAPIT ALPHA Α Α Α
-GREEK CAPIT BETA Î’ Î’ Î’
-GREEK CAPIT GAMMA Γ Γ Γ
-GREEK CAPIT DELTA Δ Δ Δ
-GREEK CAPIT EPSILON Ε Ε Ε
-GREEK SMALL ALPHA α α α
-GREEK SMALL BETA β β β
-GREEK SMALL GAMMA γ γ γ
-GREEK SMALL DELTA δ δ δ
-GREEK SMALL EPSILON ε ε ε
-ARMENIAN CAPIT AYB Ô± Ô± Ô±
-ARMENIAN CAPIT BEN Ô² Ô² Ô²
-ARMENIAN CAPIT GIM Ô³ Ô³ Ô³
-ARMENIAN CAPIT DA Ô´ Ô´ Ô´
-ARMENIAN CAPIT ECH Ôµ Ôµ Ôµ
-ARMENIAN CAPIT ZA Ô¶ Ô¶ Ô¶
-ARMENIAN SMALL YAB Õ¡ Õ¡ Õ¡
-ARMENIAN SMALL BEN Õ¢ Õ¢ Õ¢
-ARMENIAN SMALL GIM Õ£ Õ£ Õ£
-ARMENIAN SMALL DA Õ¤ Õ¤ Õ¤
-ARMENIAN SMALL ECH Õ¥ Õ¥ Õ¥
-ARMENIAN SMALL ZA Õ¦ Õ¦ Õ¦
+SELECT comment, koi8_ru_f, utf8_f, hex(bin_f), ucs2_f, armscii8_f, greek_f FROM t1;
+comment koi8_ru_f utf8_f hex(bin_f) ucs2_f armscii8_f greek_f
+LAT SMALL A a a 61 a
+LAT SMALL B b b 62 b
+LAT SMALL C c c 63 c
+LAT SMALL D d d 64 d
+LAT SMALL E e e 65 e
+LAT SMALL F f f 66 f
+LAT SMALL G g g 67 g
+LAT SMALL H h h 68 h
+LAT SMALL I i i 69 i
+LAT SMALL J j j 6A j
+LAT SMALL K k k 6B k
+LAT SMALL L l l 6C l
+LAT SMALL M m m 6D m
+LAT SMALL N n n 6E n
+LAT SMALL O o o 6F o
+LAT SMALL P p p 70 p
+LAT SMALL Q q q 71 q
+LAT SMALL R r r 72 r
+LAT SMALL S s s 73 s
+LAT SMALL T t t 74 t
+LAT SMALL U u u 75 u
+LAT SMALL V v v 76 v
+LAT SMALL W w w 77 w
+LAT SMALL X x x 78 x
+LAT SMALL Y y y 79 y
+LAT SMALL Z z z 7A z
+LAT CAPIT A A A 41 A
+LAT CAPIT B B B 42 B
+LAT CAPIT C C C 43 C
+LAT CAPIT D D D 44 D
+LAT CAPIT E E E 45 E
+LAT CAPIT F F F 46 F
+LAT CAPIT G G G 47 G
+LAT CAPIT H H H 48 H
+LAT CAPIT I I I 49 I
+LAT CAPIT J J J 4A J
+LAT CAPIT K K K 4B K
+LAT CAPIT L L L 4C L
+LAT CAPIT M M M 4D M
+LAT CAPIT N N N 4E N
+LAT CAPIT O O O 4F O
+LAT CAPIT P P P 50 P
+LAT CAPIT Q Q Q 51 Q
+LAT CAPIT R R R 52 R
+LAT CAPIT S S S 53 S
+LAT CAPIT T T T 54 T
+LAT CAPIT U U U 55 U
+LAT CAPIT V V V 56 V
+LAT CAPIT W W W 57 W
+LAT CAPIT X X X 58 X
+LAT CAPIT Y Y Y 59 Y
+LAT CAPIT Z Z Z 5A Z
+CYR SMALL A а а C1 а
+CYR SMALL BE б б C2 б
+CYR SMALL VE в в D7 в
+CYR SMALL GE г г C7 г
+CYR SMALL DE д д C4 д
+CYR SMALL IE е е C5 е
+CYR SMALL IO Ñ‘ Ñ‘ A3 Ñ‘
+CYR SMALL ZHE ж ж D6 ж
+CYR SMALL ZE з з DA з
+CYR SMALL I и и C9 и
+CYR SMALL KA к к CB к
+CYR SMALL EL л л CC л
+CYR SMALL EM м м CD м
+CYR SMALL EN н н CE н
+CYR SMALL O о о CF о
+CYR SMALL PE п п D0 п
+CYR SMALL ER р р D2 р
+CYR SMALL ES Ñ Ñ D3 Ñ
+CYR SMALL TE Ñ‚ Ñ‚ D4 Ñ‚
+CYR SMALL U у у D5 у
+CYR SMALL EF Ñ„ Ñ„ C6 Ñ„
+CYR SMALL HA Ñ… Ñ… C8 Ñ…
+CYR SMALL TSE ц ц C3 ц
+CYR SMALL CHE ч ч DE ч
+CYR SMALL SHA ш ш DB ш
+CYR SMALL SCHA щ щ DD щ
+CYR SMALL HARD SIGN ÑŠ ÑŠ DF ÑŠ
+CYR SMALL YERU Ñ‹ Ñ‹ D9 Ñ‹
+CYR SMALL SOFT SIGN ь ь D8 ь
+CYR SMALL E Ñ Ñ DC Ñ
+CYR SMALL YU ÑŽ ÑŽ C0 ÑŽ
+CYR SMALL YA Ñ Ñ D1 Ñ
+CYR CAPIT A Ð Ð E1 Ð
+CYR CAPIT BE Б Б E2 Б
+CYR CAPIT VE Ð’ Ð’ F7 Ð’
+CYR CAPIT GE Г Г E7 Г
+CYR CAPIT DE Д Д E4 Д
+CYR CAPIT IE Е Е E5 Е
+CYR CAPIT IO Ð Ð B3 Ð
+CYR CAPIT ZHE Ж Ж F6 Ж
+CYR CAPIT ZE З З FA З
+CYR CAPIT I И И E9 И
+CYR CAPIT KA К К EB К
+CYR CAPIT EL Л Л EC Л
+CYR CAPIT EM М М ED М
+CYR CAPIT EN Ð Ð EE Ð
+CYR CAPIT O О О EF О
+CYR CAPIT PE П П F0 П
+CYR CAPIT ER Р Р F2 Р
+CYR CAPIT ES С С F3 С
+CYR CAPIT TE Т Т F4 Т
+CYR CAPIT U У У F5 У
+CYR CAPIT EF Ф Ф E6 Ф
+CYR CAPIT HA Х Х E8 Х
+CYR CAPIT TSE Ц Ц E3 Ц
+CYR CAPIT CHE Ч Ч FE Ч
+CYR CAPIT SHA Ш Ш FB Ш
+CYR CAPIT SCHA Щ Щ FD Щ
+CYR CAPIT HARD SIGN Ъ Ъ FF Ъ
+CYR CAPIT YERU Ы Ы F9 Ы
+CYR CAPIT SOFT SIGN Ь Ь F8 Ь
+CYR CAPIT E Э Э FC Э
+CYR CAPIT YU Ю Ю E0 Ю
+CYR CAPIT YA Я Я F1 Я
+GREEK CAPIT ALPHA Α 00 Α Α
+GREEK CAPIT BETA Î’ 00 Î’ Î’
+GREEK CAPIT GAMMA Γ 00 Γ Γ
+GREEK CAPIT DELTA Δ 00 Δ Δ
+GREEK CAPIT EPSILON Ε 00 Ε Ε
+GREEK SMALL ALPHA α 00 α α
+GREEK SMALL BETA β 00 β β
+GREEK SMALL GAMMA γ 00 γ γ
+GREEK SMALL DELTA δ 00 δ δ
+GREEK SMALL EPSILON ε 00 ε ε
+ARMENIAN CAPIT AYB Ô± 00 Ô± Ô±
+ARMENIAN CAPIT BEN Ô² 00 Ô² Ô²
+ARMENIAN CAPIT GIM Ô³ 00 Ô³ Ô³
+ARMENIAN CAPIT DA Ô´ 00 Ô´ Ô´
+ARMENIAN CAPIT ECH Ôµ 00 Ôµ Ôµ
+ARMENIAN CAPIT ZA Ô¶ 00 Ô¶ Ô¶
+ARMENIAN SMALL YAB Õ¡ 00 Õ¡ Õ¡
+ARMENIAN SMALL BEN Õ¢ 00 Õ¢ Õ¢
+ARMENIAN SMALL GIM Õ£ 00 Õ£ Õ£
+ARMENIAN SMALL DA Õ¤ 00 Õ¤ Õ¤
+ARMENIAN SMALL ECH Õ¥ 00 Õ¥ Õ¥
+ARMENIAN SMALL ZA Õ¦ 00 Õ¦ Õ¦
SET CHARACTER SET 'binary';
SELECT * FROM t1;
comment koi8_ru_f utf8_f bin_f ucs2_f armscii8_f greek_f
@@ -1590,28 +1590,28 @@ CYR CAPIT SOFT SIGN ø Ь ø ,
CYR CAPIT E ü Э ü -
CYR CAPIT YU à Ю à .
CYR CAPIT YA ñ Я ñ /
-GREEK CAPIT ALPHA Α ‘ Á
-GREEK CAPIT BETA Î’ ’ Â
-GREEK CAPIT GAMMA Γ “ Ã
-GREEK CAPIT DELTA Δ ” Ä
-GREEK CAPIT EPSILON Ε • Å
-GREEK SMALL ALPHA α ± á
-GREEK SMALL BETA β ² â
-GREEK SMALL GAMMA γ ³ ã
-GREEK SMALL DELTA δ ´ ä
-GREEK SMALL EPSILON ε µ å
-ARMENIAN CAPIT AYB Ô± 1 ²
-ARMENIAN CAPIT BEN Ô² 2 ´
-ARMENIAN CAPIT GIM Ô³ 3 ¶
-ARMENIAN CAPIT DA Ô´ 4 ¸
-ARMENIAN CAPIT ECH Ôµ 5 º
-ARMENIAN CAPIT ZA Ô¶ 6 ¼
-ARMENIAN SMALL YAB Õ¡ a ³
-ARMENIAN SMALL BEN Õ¢ b µ
-ARMENIAN SMALL GIM Õ£ c ·
-ARMENIAN SMALL DA Õ¤ d ¹
-ARMENIAN SMALL ECH Õ¥ e »
-ARMENIAN SMALL ZA Õ¦ f ½
+GREEK CAPIT ALPHA Α
+GREEK CAPIT BETA Î’
+GREEK CAPIT GAMMA Γ
+GREEK CAPIT DELTA Δ
+GREEK CAPIT EPSILON Ε
+GREEK SMALL ALPHA α
+GREEK SMALL BETA β
+GREEK SMALL GAMMA γ
+GREEK SMALL DELTA δ
+GREEK SMALL EPSILON ε
+ARMENIAN CAPIT AYB Ô±
+ARMENIAN CAPIT BEN Ô²
+ARMENIAN CAPIT GIM Ô³
+ARMENIAN CAPIT DA Ô´
+ARMENIAN CAPIT ECH Ôµ
+ARMENIAN CAPIT ZA Ô¶
+ARMENIAN SMALL YAB Õ¡
+ARMENIAN SMALL BEN Õ¢
+ARMENIAN SMALL GIM Õ£
+ARMENIAN SMALL DA Õ¤
+ARMENIAN SMALL ECH Õ¥
+ARMENIAN SMALL ZA Õ¦
SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f;
min(comment) count(*)
LAT CAPIT A 2
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 1695f1c67e8..874983daff2 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -1044,6 +1044,20 @@ hex(a)
5B
E880BD
drop table t1;
+set names 'latin1';
+create table t1 (a varchar(255)) default charset=utf8;
+select * from t1 where find_in_set('-1', a);
+a
+drop table t1;
+create table t1 (a int);
+insert into t1 values (48),(49),(50);
+set names utf8;
+select distinct char(a) from t1;
+char(a)
+0
+1
+2
+drop table t1;
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
SELECT id FROM t1;
@@ -1064,44 +1078,56 @@ xxx
yyy
DROP TABLE t1;
set names utf8;
-select hex(char(1));
-hex(char(1))
+select hex(char(1 using utf8));
+hex(char(1 using utf8))
01
-select char(0xd1,0x8f);
-char(0xd1,0x8f)
+select char(0xd1,0x8f using utf8);
+char(0xd1,0x8f using utf8)
Ñ
-select char(0xd18f);
-char(0xd18f)
+select char(0xd18f using utf8);
+char(0xd18f using utf8)
Ñ
-select char(53647);
-char(53647)
+select char(53647 using utf8);
+char(53647 using utf8)
Ñ
-select char(0xff,0x8f);
-char(0xff,0x8f)
+select char(0xff,0x8f using utf8);
+char(0xff,0x8f using utf8)
ÿ
Warnings:
Warning 1300 Invalid utf8 character string: 'FF8F'
set sql_mode=traditional;
-select char(0xff,0x8f);
-char(0xff,0x8f)
+select char(0xff,0x8f using utf8);
+char(0xff,0x8f using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
-select char(195);
-char(195)
+select char(195 using utf8);
+char(195 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C3'
-select char(196);
-char(196)
+select char(196 using utf8);
+char(196 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'C4'
-select char(2557);
-char(2557)
+select char(2557 using utf8);
+char(2557 using utf8)
NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FD'
+select hex(convert(char(2557 using latin1) using utf8));
+hex(convert(char(2557 using latin1) using utf8))
+09C3BD
+select hex(char(195));
+hex(char(195))
+C3
+select hex(char(196));
+hex(char(196))
+C4
+select hex(char(2557));
+hex(char(2557))
+09FD
set names utf8;
create table t1 (a char(1)) default character set utf8;
create table t2 (a char(1)) default character set utf8;
@@ -1114,3 +1140,20 @@ a
i
ã„
drop table t1,t2;
+set names utf8;
+create table t1 (a char(10), b varchar(10));
+insert into t1 values ('bar','kostja');
+insert into t1 values ('kostja','bar');
+prepare my_stmt from "select * from t1 where a=?";
+set @a:='bar';
+execute my_stmt using @a;
+a b
+bar kostja
+set @a:='kostja';
+execute my_stmt using @a;
+a b
+kostja bar
+set @a:=null;
+execute my_stmt using @a;
+a b
+drop table if exists t1;
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 74ab1e35534..f8189266e50 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -495,3 +495,11 @@ f1 f2
Warnings:
Warning 1292 Truncated incorrect date value: '2003-04-05 g'
Warning 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567'
+create table t1 (f1 datetime);
+insert into t1 (f1) values ("2005-01-01");
+insert into t1 (f1) values ("2005-02-01");
+select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
+d1 d2
+02 February
+01 January
+drop table t1;
diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result
index 26b8511661a..96481341bd6 100644
--- a/mysql-test/r/drop_temp_table.result
+++ b/mysql-test/r/drop_temp_table.result
@@ -1,3 +1,4 @@
+drop database if exists `drop-temp+table-test`;
reset master;
create database `drop-temp+table-test`;
use `drop-temp+table-test`;
diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result
index e0e0bba3271..7f53bd884ef 100644
--- a/mysql-test/r/federated.result
+++ b/mysql-test/r/federated.result
@@ -74,6 +74,12 @@ CREATE TABLE federated.t2 (
)
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+SHOW CREATE TABLE federated.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(20) NOT NULL,
+ `name` varchar(32) NOT NULL default ''
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
INSERT INTO federated.t2 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t2 (id, name) VALUES (2, 'fee');
SELECT * FROM federated.t2;
@@ -504,7 +510,7 @@ DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
`name` char(32) NOT NULL DEFAULT '',
-`bincol` binary(4) NOT NULL,
+`bincol` binary(1) NOT NULL,
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
`other` int NOT NULL DEFAULT 0,
PRIMARY KEY (id),
@@ -515,7 +521,7 @@ DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
`name` char(32) NOT NULL DEFAULT '',
-`bincol` binary(4) NOT NULL,
+`bincol` binary(1) NOT NULL,
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
`other` int NOT NULL DEFAULT 0,
PRIMARY KEY (id),
@@ -1484,6 +1490,33 @@ id name
DROP TABLE federated.alter_me;
DROP TABLE federated.normal_table;
DROP TABLE IF EXISTS federated.t1;
+CREATE TABLE federated.t1 (
+`bitty` bit(3)
+) DEFAULT CHARSET=latin1;
+DROP TABLE IF EXISTS federated.t1;
+CREATE TABLE federated.t1 (
+`bitty` bit(3)
+) ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+INSERT INTO federated.t1 VALUES (b'001');
+INSERT INTO federated.t1 VALUES (b'010');
+INSERT INTO federated.t1 VALUES (b'011');
+INSERT INTO federated.t1 VALUES (b'100');
+INSERT INTO federated.t1 VALUES (b'101');
+INSERT INTO federated.t1 VALUES (b'110');
+INSERT INTO federated.t1 VALUES (b'111');
+select * FROM federated.t1;
+bitty
+
+
+
+
+
+
+
+drop table federated.t1;
+drop table federated.t1;
+DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/r/func_crypt.result b/mysql-test/r/func_crypt.result
index 2ee3e770a2e..afdec0f4d06 100644
--- a/mysql-test/r/func_crypt.result
+++ b/mysql-test/r/func_crypt.result
@@ -92,3 +92,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select password(_latin1'idkfa ') AS `password('idkfa ')`,old_password(_latin1'idkfa') AS `old_password('idkfa')`
+select encrypt('1234','_.');
+encrypt('1234','_.')
+#
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 6461c393d51..90884dcc596 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` separator ',') AS `group_concat(distinct c order by c desc)` from `test`.`t1` group by `test`.`t1`.`grp`
+Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` DESC separator ',') AS `group_concat(distinct c order by c desc)` from `test`.`t1` group by `test`.`t1`.`grp`
select grp,group_concat(c order by c separator ",") from t1 group by grp;
grp group_concat(c order by c separator ",")
1 a
@@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort
Warnings:
-Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` separator ',') AS `group_concat(distinct c order by c separator ",")` from `test`.`t1` group by `test`.`t1`.`grp`
+Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` ASC separator ',') AS `group_concat(distinct c order by c separator ",")` from `test`.`t1` group by `test`.`t1`.`grp`
select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp;
grp group_concat(distinct c order by c desc separator ",")
1 a
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 8562937f1ac..60022ae0d8f 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -187,7 +187,7 @@ select 1 in ('1.1',2);
select 1 in ('1.1',2.0);
1 in ('1.1',2.0)
0
-create table t1 (a char(20) character set binary);
+create table t1 (a char(2) character set binary);
insert into t1 values ('aa'), ('bb');
select * from t1 where a in (NULL, 'aa');
a
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 5b6c29f87fb..fba274b9bb1 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -170,3 +170,36 @@ insert into t1 values (1);
select rand(i) from t1;
ERROR HY000: Incorrect arguments to RAND
drop table t1;
+create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
+insert into t1 values ('http://www.foo.com/', now());
+select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
+a
+http://www.foo.com/
+drop table t1;
+set sql_mode='traditional';
+select ln(-1);
+ln(-1)
+NULL
+Warnings:
+Error 1365 Division by 0
+select log10(-1);
+log10(-1)
+NULL
+Warnings:
+Error 1365 Division by 0
+select log2(-1);
+log2(-1)
+NULL
+Warnings:
+Error 1365 Division by 0
+select log(2,-1);
+log(2,-1)
+NULL
+Warnings:
+Error 1365 Division by 0
+select log(-2,1);
+log(-2,1)
+NULL
+Warnings:
+Error 1365 Division by 0
+set sql_mode='';
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index f209866d953..d984eee80fa 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -180,8 +180,8 @@ Field Type Null Key Default Extra
f1 date NO 0000-00-00
f2 datetime YES NULL
f3 time YES NULL
-f4 time NO 00:00:00
-f5 time NO 00:00:00
+f4 time YES NULL
+f5 time YES NULL
f6 time NO 00:00:00
f7 datetime YES NULL
f8 date YES NULL
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 3d7d693cdce..a305bf20bff 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -21,6 +21,9 @@ length(_latin1'\n\t\n\b\0\\_\\%\\')
select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h');
concat('monty',' was here ','again') length('hello') char(ascii('h')) ord('h')
monty was here again 5 h 104
+select hex(char(256));
+hex(char(256))
+0100
select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;
locate('he','hello') locate('he','hello',2) locate('lo','hello',2)
1 0 4
@@ -598,7 +601,7 @@ collation(hex(130)) coercibility(hex(130))
latin1_swedish_ci 4
select collation(char(130)), coercibility(hex(130));
collation(char(130)) coercibility(hex(130))
-latin1_swedish_ci 4
+binary 4
select collation(format(130,10)), coercibility(format(130,10));
collation(format(130,10)) coercibility(format(130,10))
latin1_swedish_ci 4
@@ -720,7 +723,7 @@ t1 CREATE TABLE `t1` (
`oct(130)` varchar(64) NOT NULL default '',
`conv(130,16,10)` varchar(64) NOT NULL default '',
`hex(130)` varchar(6) NOT NULL default '',
- `char(130)` varchar(1) NOT NULL default '',
+ `char(130)` varbinary(1) NOT NULL default '',
`format(130,10)` varchar(4) NOT NULL default '',
`left(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
`right(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
@@ -818,6 +821,9 @@ lpad(12345, 5, "#")
SELECT conv(71, 10, 36), conv('1Z', 36, 10);
conv(71, 10, 36) conv('1Z', 36, 10)
1Z 71
+SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
+conv(71, 10, 37) conv('1Z', 37, 10) conv(0,1,10) conv(0,0,10) conv(0,-1,10)
+NULL NULL NULL NULL NULL
create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb');
create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 9275a893309..64dafa132b4 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -760,3 +760,54 @@ call t_sysdate();
@a != @b
1
drop procedure t_sysdate;
+select timestampdiff(month,'2004-09-11','2004-09-11');
+timestampdiff(month,'2004-09-11','2004-09-11')
+0
+select timestampdiff(month,'2004-09-11','2005-09-11');
+timestampdiff(month,'2004-09-11','2005-09-11')
+12
+select timestampdiff(month,'2004-09-11','2006-09-11');
+timestampdiff(month,'2004-09-11','2006-09-11')
+24
+select timestampdiff(month,'2004-09-11','2007-09-11');
+timestampdiff(month,'2004-09-11','2007-09-11')
+36
+select timestampdiff(month,'2005-09-11','2004-09-11');
+timestampdiff(month,'2005-09-11','2004-09-11')
+-12
+select timestampdiff(month,'2005-09-11','2003-09-11');
+timestampdiff(month,'2005-09-11','2003-09-11')
+-24
+select timestampdiff(month,'2004-02-28','2005-02-28');
+timestampdiff(month,'2004-02-28','2005-02-28')
+12
+select timestampdiff(month,'2004-02-29','2005-02-28');
+timestampdiff(month,'2004-02-29','2005-02-28')
+11
+select timestampdiff(month,'2004-02-28','2005-02-28');
+timestampdiff(month,'2004-02-28','2005-02-28')
+12
+select timestampdiff(month,'2004-03-29','2005-03-28');
+timestampdiff(month,'2004-03-29','2005-03-28')
+11
+select timestampdiff(month,'2003-02-28','2004-02-29');
+timestampdiff(month,'2003-02-28','2004-02-29')
+12
+select timestampdiff(month,'2003-02-28','2005-02-28');
+timestampdiff(month,'2003-02-28','2005-02-28')
+24
+select timestampdiff(month,'1999-09-11','2001-10-10');
+timestampdiff(month,'1999-09-11','2001-10-10')
+24
+select timestampdiff(month,'1999-09-11','2001-9-11');
+timestampdiff(month,'1999-09-11','2001-9-11')
+24
+select timestampdiff(year,'1999-09-11','2001-9-11');
+timestampdiff(year,'1999-09-11','2001-9-11')
+2
+select timestampdiff(year,'2004-02-28','2005-02-28');
+timestampdiff(year,'2004-02-28','2005-02-28')
+1
+select timestampdiff(year,'2004-02-29','2005-02-28');
+timestampdiff(year,'2004-02-29','2005-02-28')
+0
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 78014137b50..049ba784dc9 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -665,6 +665,12 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (pointfromtext('point(1,1)'));
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
+select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
+(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))))
+POINT(10 10)
+select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
+(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))))
+POINT(10 10)
create table t1 (s1 geometry not null,s2 char(100));
create trigger t1_bu before update on t1 for each row set new.s1 = null;
insert into t1 values (null,null);
@@ -680,3 +686,11 @@ select astext(fn3());
astext(fn3())
POINT(1 1)
drop function fn3;
+create table t1(pt POINT);
+alter table t1 add primary key pti(pt);
+drop table t1;
+create table t1(pt GEOMETRY);
+alter table t1 add primary key pti(pt);
+ERROR 42000: BLOB/TEXT column 'pt' used in key specification without a key length
+alter table t1 add primary key pti(pt(20));
+drop table t1;
diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require
deleted file mode 100644
index b33a1d2854f..00000000000
--- a/mysql-test/r/have_openssl_1.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-Ssl_cipher DHE-RSA-AES256-SHA
diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result
index 810953e0578..f8eaf0ccb46 100644
--- a/mysql-test/r/im_life_cycle.result
+++ b/mysql-test/r/im_life_cycle.result
@@ -21,7 +21,7 @@ instance_name status version
mysqld2 online VERSION
SHOW VARIABLES LIKE 'port';
Variable_name Value
-port 9312
+port IM_MYSQLD1_PORT
STOP INSTANCE mysqld2;
SHOW INSTANCES;
instance_name status
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 0d53180b6d6..a5852dc31b4 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -648,21 +648,21 @@ select table_name from information_schema.views
where table_schema='test';
table_name
Warnings:
-Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s)
-Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s)
+Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select table_name from information_schema.views
where table_schema='test';
table_name
Warnings:
-Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s)
-Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s)
+Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select column_name from information_schema.columns
where table_schema='test';
column_name
f1
Warnings:
-Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s)
-Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s)
+Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Warning 1356 View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select index_name from information_schema.statistics where table_schema='test';
index_name
f1_key
@@ -1013,3 +1013,23 @@ grant all on information_schema.* to 'user1'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
grant select on information_schema.* to 'user1'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+use test;
+create table t1(id int);
+insert into t1(id) values (1);
+select 1 from (select 1 from test.t1) a;
+1
+1
+use information_schema;
+select 1 from (select 1 from test.t1) a;
+1
+1
+use test;
+drop table t1;
+create table t1(a blob, b text charset utf8, c text charset ucs2);
+select data_type, character_octet_length, character_maximum_length
+from information_schema.columns where table_name='t1';
+data_type character_octet_length character_maximum_length
+blob 65535 65535
+text 65535 65535
+text 65535 32767
+drop table t1;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index a66259ff5f4..dc4893c3bfa 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -2663,3 +2663,112 @@ rollback;
rollback;
drop table t1;
drop function f1;
+create table t1 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+create table t1 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+commit;
diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result
new file mode 100644
index 00000000000..826a17cb60d
--- /dev/null
+++ b/mysql-test/r/innodb_gis.result
@@ -0,0 +1,458 @@
+SET storage_engine=innodb;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER, g POINT);
+CREATE TABLE gis_line (fid INTEGER, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table Create Table
+gis_point CREATE TABLE `gis_point` (
+ `fid` int(11) default NULL,
+ `g` point default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g point YES NULL
+SHOW FIELDS FROM gis_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g linestring YES NULL
+SHOW FIELDS FROM gis_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g polygon YES NULL
+SHOW FIELDS FROM gis_multi_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipoint YES NULL
+SHOW FIELDS FROM gis_multi_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multilinestring YES NULL
+SHOW FIELDS FROM gis_multi_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipolygon YES NULL
+SHOW FIELDS FROM gis_geometrycollection;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometrycollection YES NULL
+SHOW FIELDS FROM gis_geometry;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometry YES NULL
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid AsText(g)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid AsText(g)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid AsText(g)
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid AsText(g)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid AsText(g)
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid AsText(g)
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid Dimension(g)
+101 0
+102 0
+103 0
+104 0
+105 1
+106 1
+107 1
+108 2
+109 2
+110 2
+111 0
+112 0
+113 0
+114 1
+115 1
+116 1
+117 2
+118 2
+119 2
+120 1
+121 1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid GeometryType(g)
+101 POINT
+102 POINT
+103 POINT
+104 POINT
+105 LINESTRING
+106 LINESTRING
+107 LINESTRING
+108 POLYGON
+109 POLYGON
+110 POLYGON
+111 MULTIPOINT
+112 MULTIPOINT
+113 MULTIPOINT
+114 MULTILINESTRING
+115 MULTILINESTRING
+116 MULTILINESTRING
+117 MULTIPOLYGON
+118 MULTIPOLYGON
+119 MULTIPOLYGON
+120 GEOMETRYCOLLECTION
+121 GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid IsEmpty(g)
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid AsText(Envelope(g))
+101 POLYGON((10 10,10 10,10 10,10 10,10 10))
+102 POLYGON((20 10,20 10,20 10,20 10,20 10))
+103 POLYGON((20 20,20 20,20 20,20 20,20 20))
+104 POLYGON((10 20,10 20,10 20,10 20,10 20))
+105 POLYGON((0 0,10 0,10 10,0 10,0 0))
+106 POLYGON((10 10,20 10,20 20,10 20,10 10))
+107 POLYGON((10 10,40 10,40 10,10 10,10 10))
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0))
+110 POLYGON((0 0,30 0,30 30,0 30,0 0))
+111 POLYGON((0 0,20 0,20 20,0 20,0 0))
+112 POLYGON((1 1,21 1,21 21,1 21,1 1))
+113 POLYGON((3 6,4 6,4 10,3 10,3 6))
+114 POLYGON((10 0,16 0,16 48,10 48,10 0))
+115 POLYGON((10 0,10 0,10 48,10 48,10 0))
+116 POLYGON((1 2,21 2,21 8,1 8,1 2))
+117 POLYGON((28 0,84 0,84 42,28 42,28 0))
+118 POLYGON((28 0,84 0,84 42,28 42,28 0))
+119 POLYGON((0 0,3 0,3 3,0 3,0 0))
+120 POLYGON((0 0,10 0,10 10,0 10,0 0))
+121 POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
+Warnings:
+Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid X(g)
+101 10
+102 20
+103 20
+104 10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid Y(g)
+101 10
+102 10
+103 20
+104 20
+explain extended select X(g),Y(g) FROM gis_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
+Warnings:
+Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(StartPoint(g))
+105 POINT(0 0)
+106 POINT(10 10)
+107 POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(EndPoint(g))
+105 POINT(10 0)
+106 POINT(10 10)
+107 POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid GLength(g)
+105 24.142135623731
+106 40
+107 30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid NumPoints(g)
+105 3
+106 5
+107 2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid AsText(PointN(g, 2))
+105 POINT(0 10)
+106 POINT(20 10)
+107 POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid IsClosed(g)
+105 0
+106 1
+107 0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid AsText(Centroid(g))
+108 POINT(15 15)
+109 POINT(25.416666666667 25.416666666667)
+110 POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid Area(g)
+108 100
+109 2400
+110 450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid AsText(ExteriorRing(g))
+108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110 LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid NumInteriorRings(g)
+108 0
+109 1
+110 0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid AsText(InteriorRingN(g, 1))
+108 NULL
+109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110 NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid IsClosed(g)
+114 0
+115 0
+116 0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid AsText(Centroid(g))
+117 POINT(55.588527753042 17.426536064114)
+118 POINT(55.588527753042 17.426536064114)
+119 POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid Area(g)
+117 1684.5
+118 1684.5
+119 4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid NumGeometries(g)
+111 4
+112 4
+113 2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid NumGeometries(g)
+114 2
+115 1
+116 2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid NumGeometries(g)
+117 2
+118 2
+119 1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid NumGeometries(g)
+120 2
+121 2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid AsText(GeometryN(g, 2))
+111 POINT(10 10)
+112 POINT(11 11)
+113 POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid AsText(GeometryN(g, 2))
+114 LINESTRING(16 0,16 23,16 48)
+115 NULL
+116 LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid AsText(GeometryN(g, 2))
+117 POLYGON((59 18,67 18,67 13,59 13,59 18))
+118 POLYGON((59 18,67 18,67 13,59 13,59 18))
+119 NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 2))
+120 LINESTRING(0 0,10 10)
+121 LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first second w c o e d t i r
+120 120 1 1 0 1 0 0 1 0
+120 121 0 0 0 0 0 0 1 0
+121 120 0 0 1 0 0 0 1 0
+121 121 1 1 0 1 0 0 1 0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2
+Warnings:
+Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+fid int(11) YES NULL
+DROP TABLE t1;
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+insert into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (fl geometry);
+insert into t1 values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (pointfromtext('point(1,1)'));
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 17f65d96abc..434dddb3049 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -668,3 +668,21 @@ ERROR 42S22: Unknown column 't2.a' in 'field list'
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
ERROR 42S22: Unknown column 't2.b' in 'field list'
drop table t1,t2,t3;
+create table t1(f1 varchar(5) key);
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+select * from t1;
+f1
+2000
+2001
+2002
+drop table t1;
+create table t1(x int, y int);
+create table t2(x int, z int);
+insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x);
+insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
+ERROR 42S22: Unknown column 'z' in 'field list'
+insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
+ERROR 42S22: Unknown column 't2.x' in 'field list'
+drop table t1,t2;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index f9d47e3533c..4e47ce6f82c 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -77,6 +77,14 @@ id
0
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1;
+create table t1 (a varchar(20), b varchar(20));
+load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
+select * from t1;
+a b
+field1 field2
+a"b cd"ef
+a"b c"d"e
+drop table t1;
create table t1 (a int default 100, b int, c varchar(60));
load data infile '../../std_data/rpl_loaddata.dat' into table t1 (a, @b) set b=@b+10, c=concat("b=",@b);
select * from t1;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index f484a937b27..b4265a99604 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -669,6 +669,38 @@ show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 10 NULL NULL YES BTREE
drop table t1;
+set myisam_stats_method=nulls_ignored;
+show variables like 'myisam_stats_method';
+Variable_name Value
+myisam_stats_method nulls_ignored
+create table t1 (
+a char(3), b char(4), c char(5), d char(6),
+key(a,b,c,d)
+);
+insert into t1 values ('bcd','def1', NULL, 'zz');
+insert into t1 values ('bcd','def2', NULL, 'zz');
+insert into t1 values ('bce','def1', 'yuu', NULL);
+insert into t1 values ('bce','def2', NULL, 'quux');
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a A 2 NULL NULL YES BTREE
+t1 1 a 2 b A 4 NULL NULL YES BTREE
+t1 1 a 3 c A 4 NULL NULL YES BTREE
+t1 1 a 4 d A 4 NULL NULL YES BTREE
+delete from t1;
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a A 0 NULL NULL YES BTREE
+t1 1 a 2 b A 0 NULL NULL YES BTREE
+t1 1 a 3 c A 0 NULL NULL YES BTREE
+t1 1 a 4 d A 0 NULL NULL YES BTREE
+set myisam_stats_method=DEFAULT;
set storage_engine=MyISAM;
drop table if exists t1,t2,t3;
--- Testing varchar ---
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index eeb6abd9f41..76faa12373a 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -1,6 +1,7 @@
drop table if exists t1;
create table t1(a int);
insert into t1 values(1);
+ERROR at line 9: DELIMITER must be followed by a 'delimiter' character or string
Test default delimiter ;
a
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
new file mode 100644
index 00000000000..8c98e18aa9b
--- /dev/null
+++ b/mysql-test/r/mysqlcheck.result
@@ -0,0 +1,34 @@
+mysql.columns_priv OK
+mysql.db OK
+mysql.func OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
+mysql.columns_priv OK
+mysql.db OK
+mysql.func OK
+mysql.help_category OK
+mysql.help_keyword OK
+mysql.help_relation OK
+mysql.help_topic OK
+mysql.host OK
+mysql.proc OK
+mysql.procs_priv OK
+mysql.tables_priv OK
+mysql.time_zone OK
+mysql.time_zone_leap_second OK
+mysql.time_zone_name OK
+mysql.time_zone_transition OK
+mysql.time_zone_transition_type OK
+mysql.user OK
diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result
index 699552bd514..39d607910aa 100644
--- a/mysql-test/r/mysqldump-max.result
+++ b/mysql-test/r/mysqldump-max.result
@@ -99,6 +99,8 @@ id name
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -167,6 +169,7 @@ CREATE TABLE `t6` (
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -181,6 +184,8 @@ INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first va
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -249,6 +254,7 @@ CREATE TABLE `t6` (
/*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t6` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 9bb669fd9b8..82a761252b5 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -64,6 +64,8 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -80,6 +82,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -89,6 +92,8 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -99,6 +104,7 @@ CREATE TABLE `t1` (
);
INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -157,6 +163,8 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -173,6 +181,7 @@ INSERT INTO `t1` VALUES ('абцде');
INSERT INTO `t1` VALUES (NULL);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -185,6 +194,8 @@ UNLOCK TABLES;
DROP TABLE t1;
CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1), (2);
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */;
@@ -200,12 +211,15 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES (1),(2);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
@@ -221,6 +235,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES (1),(2);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -239,6 +254,8 @@ create table t1(a int);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -253,6 +270,7 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -262,6 +280,8 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
@@ -276,6 +296,7 @@ CREATE TABLE "t1" (
LOCK TABLES "t1" WRITE;
UNLOCK TABLES;
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -288,6 +309,8 @@ set global sql_mode='ANSI_QUOTES';
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -302,6 +325,7 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -311,6 +335,8 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
@@ -325,6 +351,7 @@ CREATE TABLE "t1" (
LOCK TABLES "t1" WRITE;
UNLOCK TABLES;
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -340,6 +367,8 @@ insert into t1 values (1),(2),(3);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
@@ -347,6 +376,7 @@ CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
@@ -363,6 +393,8 @@ drop table t1;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -371,6 +403,7 @@ drop table t1;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `test`;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -386,6 +419,8 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -394,6 +429,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */;
USE `mysqldump_test_db`;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -411,6 +447,8 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -426,6 +464,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES ('ÄÖÜß');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -435,6 +474,8 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
@@ -450,12 +491,15 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES ('Ž™šá');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
@@ -471,12 +515,15 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES ('Ž™šá');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
@@ -492,6 +539,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES ('ÄÖÜß');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -508,6 +556,8 @@ INSERT INTO t2 VALUES (4),(5),(6);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -523,6 +573,7 @@ LOCK TABLES `t2` WRITE;
INSERT INTO `t2` VALUES (4),(5),(6);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -541,6 +592,8 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -556,6 +609,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -574,6 +628,8 @@ INSERT INTO t1 VALUES (4),(5),(6);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -589,6 +645,7 @@ LOCK TABLES `t1` WRITE;
INSERT IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -603,6 +660,8 @@ UNLOCK TABLES;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -616,6 +675,7 @@ CREATE TABLE `t1` (
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES (1),(2),(3),(4),(5),(6);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -963,6 +1023,8 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1307,6 +1369,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` (`F_c4ca4238a0b923820dcc509a6f75849b`, `F_c81e728d9d4c2f636f067f89cc14862c`, `F_eccbc87e4b5ce2fe28308fd9f2a7baf3`, `F_a87ff679a2f3e71d9181a67b7542122c`, `F_e4da3b7fbbce2345d7772b0674a318d5`, `F_1679091c5a880faf6fb5e6087eb1b2dc`, `F_8f14e45fceea167a5a36dedd4bea2543`, `F_c9f0f895fb98ab9159f51fd0297e236d`, `F_45c48cce2e2d7fbdea1afc51c7c6ad26`, `F_d3d9446802a44259755d38e6d163e820`, `F_6512bd43d9caa6e02c990b0a82652dca`, `F_c20ad4d76fe97759aa27a0c99bff6710`, `F_c51ce410c124a10e0db5e4b97fc2af39`, `F_aab3238922bcc25a6f606eb525ffdc56`, `F_9bf31c7ff062936a96d3c8bd1f8f2ff3`, `F_c74d97b01eae257e44aa9d5bade97baf`, `F_70efdf2ec9b086079795c442636b55fb`, `F_6f4922f45568161a8cdf4ad2299f6d23`, `F_1f0e3dad99908345f7439f8ffabdffc4`, `F_98f13708210194c475687be6106a3b84`, `F_3c59dc048e8850243be8079a5c74d079`, `F_b6d767d2f8ed5d21a44b0e5886680cb9`, `F_37693cfc748049e45d87b8c7d8b9aacd`, `F_1ff1de774005f8da13f42943881c655f`, `F_8e296a067a37563370ded05f5a3bf3ec`, `F_4e732ced3463d06de0ca9a15b6153677`, `F_02e74f10e0327ad868d138f2b4fdd6f0`, `F_33e75ff09dd601bbe69f351039152189`, `F_6ea9ab1baa0efb9e19094440c317e21b`, `F_34173cb38f07f89ddbebc2ac9128303f`, `F_c16a5320fa475530d9583c34fd356ef5`, `F_6364d3f0f495b6ab9dcf8d3b5c6e0b01`, `F_182be0c5cdcd5072bb1864cdee4d3d6e`, `F_e369853df766fa44e1ed0ff613f563bd`, `F_1c383cd30b7c298ab50293adfecb7b18`, `F_19ca14e7ea6328a42e0eb13d585e4c22`, `F_a5bfc9e07964f8dddeb95fc584cd965d`, `F_a5771bce93e200c36f7cd9dfd0e5deaa`, `F_d67d8ab4f4c10bf22aa353e27879133c`, `F_d645920e395fedad7bbbed0eca3fe2e0`, `F_3416a75f4cea9109507cacd8e2f2aefc`, `F_a1d0c6e83f027327d8461063f4ac58a6`, `F_17e62166fc8586dfa4d1bc0e1742c08b`, `F_f7177163c833dff4b38fc8d2872f1ec6`, `F_6c8349cc7260ae62e3b1396831a8398f`, `F_d9d4f495e875a2e075a1a4a6e1b9770f`, `F_67c6a1e7ce56d3d6fa748ab6d9af3fd7`, `F_642e92efb79421734881b53e1e1b18b6`, `F_f457c545a9ded88f18ecee47145a72c0`, `F_c0c7c76d30bd3dcaefc96f40275bdc0a`, `F_2838023a778dfaecdc212708f721b788`, `F_9a1158154dfa42caddbd0694a4e9bdc8`, `F_d82c8d1619ad8176d665453cfb2e55f0`, `F_a684eceee76fc522773286a895bc8436`, `F_b53b3a3d6ab90ce0268229151c9bde11`, `F_9f61408e3afb633e50cdf1b20de6f466`, `F_72b32a1f754ba1c09b3695e0cb6cde7f`, `F_66f041e16a60928b05a7e228a89c3799`, `F_093f65e080a295f8076b1c5722a46aa2`, `F_072b030ba126b2f4b2374f342be9ed44`, `F_7f39f8317fbdb1988ef4c628eba02591`, `F_44f683a84163b3523afe57c2e008bc8c`, `F_03afdbd66e7929b125f8597834fa83a4`, `F_ea5d2f1c4608232e07d3aa3d998e5135`, `F_fc490ca45c00b1249bbe3554a4fdf6fb`, `F_3295c76acbf4caaed33c36b1b5fc2cb1`, `F_735b90b4568125ed6c3f678819b6e058`, `F_a3f390d88e4c41f2747bfa2f1b5f87db`, `F_14bfa6bb14875e45bba028a21ed38046`, `F_7cbbc409ec990f19c78c75bd1e06f215`, `F_e2c420d928d4bf8ce0ff2ec19b371514`, `F_32bb90e8976aab5298d5da10fe66f21d`, `F_d2ddea18f00665ce8623e36bd4e3c7c5`, `F_ad61ab143223efbc24c7d2583be69251`, `F_d09bf41544a3365a46c9077ebb5e35c3`, `F_fbd7939d674997cdb4692d34de8633c4`, `F_28dd2c7955ce926456240b2ff0100bde`, `F_35f4a8d465e6e1edc05f3d8ab658c551`, `F_d1fe173d08e959397adf34b1d77e88d7`, `F_f033ab37c30201f73f142449d037028d`, `F_43ec517d68b6edd3015b3edc9a11367b`, `F_9778d5d219c5080b9a6a17bef029331c`, `F_fe9fc289c3ff0af142b6d3bead98a923`, `F_68d30a9594728bc39aa24be94b319d21`, `F_3ef815416f775098fe977004015c6193`, `F_93db85ed909c13838ff95ccfa94cebd9`, `F_c7e1249ffc03eb9ded908c236bd1996d`, `F_2a38a4a9316c49e5a833517c45d31070`, `F_7647966b7343c29048673252e490f736`, `F_8613985ec49eb8f757ae6439e879bb2a`, `F_54229abfcfa5649e7003b83dd4755294`, `F_92cc227532d17e56e07902b254dfad10`, `F_98dce83da57b0395e163467c9dae521b`, `F_f4b9ec30ad9f68f89b29639786cb62ef`, `F_812b4ba287f5ee0bc9d43bbf5bbe87fb`, `F_26657d5ff9020d2abefe558796b99584`, `F_e2ef524fbf3d9fe611d5a8e90fefdc9c`, `F_ed3d2c21991e3bef5e069713af9fa6ca`, `F_ac627ab1ccbdb62ec96e702f07f6425b`, `F_f899139df5e1059396431415e770c6dd`, `F_38b3eff8baf56627478ec76a704e9b52`, `F_ec8956637a99787bd197eacd77acce5e`, `F_6974ce5ac660610b44d9b9fed0ff9548`, `F_c9e1074f5b3f9fc8ea15d152add07294`, `F_65b9eea6e1cc6bb9f0cd2a47751a186f`, `F_f0935e4cd5920aa6c7c996a5ee53a70f`, `F_a97da629b098b75c294dffdc3e463904`, `F_a3c65c2974270fd093ee8a9bf8ae7d0b`, `F_2723d092b63885e0d7c260cc007e8b9d`, `F_5f93f983524def3dca464469d2cf9f3e`, `F_698d51a19d8a121ce581499d7b701668`, `F_7f6ffaa6bb0b408017b62254211691b5`, `F_73278a4a86960eeb576a8fd4c9ec6997`, `F_5fd0b37cd7dbbb00f97ba6ce92bf5add`, `F_2b44928ae11fb9384c4cf38708677c48`, `F_c45147dee729311ef5b5c3003946c48f`, `F_eb160de1de89d9058fcb0b968dbbbd68`, `F_5ef059938ba799aaa845e1c2e8a762bd`, `F_07e1cd7dca89a1678042477183b7ac3f`, `F_da4fb5c6e93e74d3df8527599fa62642`, `F_4c56ff4ce4aaf9573aa5dff913df997a`, `F_a0a080f42e6f13b3a2df133f073095dd`, `F_202cb962ac59075b964b07152d234b70`, `F_c8ffe9a587b126f152ed3d89a146b445`, `F_3def184ad8f4755ff269862ea77393dd`, `F_069059b7ef840f0c74a814ec9237b6ec`, `F_ec5decca5ed3d6b8079e2e7e7bacc9f2`, `F_76dc611d6ebaafc66cc0879c71b5db5c`, `F_d1f491a404d6854880943e5c3cd9ca25`, `F_9b8619251a19057cff70779273e95aa6`, `F_1afa34a7f984eeabdbb0a7d494132ee5`, `F_65ded5353c5ee48d0b7d48c591b8f430`, `F_9fc3d7152ba9336a670e36d0ed79bc43`, `F_02522a2b2726fb0a03bb19f2d8d9524d`, `F_7f1de29e6da19d22b51c68001e7e0e54`, `F_42a0e188f5033bc65bf8d78622277c4e`, `F_3988c7f88ebcb58c6ce932b957b6f332`, `F_013d407166ec4fa56eb1e1f8cbe183b9`, `F_e00da03b685a0dd18fb6a08af0923de0`, `F_1385974ed5904a438616ff7bdb3f7439`, `F_0f28b5d49b3020afeecd95b4009adf4c`, `F_a8baa56554f96369ab93e4f3bb068c22`, `F_903ce9225fca3e988c2af215d4e544d3`, `F_0a09c8844ba8f0936c20bd791130d6b6`, `F_2b24d495052a8ce66358eb576b8912c8`, `F_a5e00132373a7031000fd987a3c9f87b`, `F_8d5e957f297893487bd98fa830fa6413`, `F_47d1e990583c9c67424d369f3414728e`, `F_f2217062e9a397a1dca429e7d70bc6ca`, `F_7ef605fc8dba5425d6965fbd4c8fbe1f`, `F_a8f15eda80c50adb0e71943adc8015cf`, `F_37a749d808e46495a8da1e5352d03cae`, `F_b3e3e393c77e35a4a3f3cbd1e429b5dc`, `F_1d7f7abc18fcb43975065399b0d1e48e`, `F_2a79ea27c279e471f4d180b08d62b00a`, `F_1c9ac0159c94d8d0cbedc973445af2da`, `F_6c4b761a28b734fe93831e3fb400ce87`, `F_06409663226af2f3114485aa4e0a23b4`, `F_140f6969d5213fd0ece03148e62e461e`, `F_b73ce398c39f506af761d2277d853a92`, `F_bd4c9ab730f5513206b999ec0d90d1fb`, `F_82aa4b0af34c2313a562076992e50aa3`, `F_0777d5c17d4066b82ab86dff8a46af6f`, `F_fa7cdfad1a5aaf8370ebeda47a1ff1c3`, `F_9766527f2b5d3e95d4a733fcfb77bd7e`, `F_7e7757b1e12abcb736ab9a754ffb617a`, `F_5878a7ab84fb43402106c575658472fa`, `F_006f52e9102a8d3be2fe5614f42ba989`, `F_3636638817772e42b59d74cff571fbb3`, `F_149e9677a5989fd342ae44213df68868`, `F_a4a042cf4fd6bfb47701cbc8a1653ada`, `F_1ff8a7b5dc7a7d1f0ed65aaa29c04b1e`, `F_f7e6c85504ce6e82442c770f7c8606f0`, `F_bf8229696f7a3bb4700cfddef19fa23f`, `F_82161242827b703e6acf9c726942a1e4`, `F_38af86134b65d0f10fe33d30dd76442e`, `F_96da2f590cd7246bbde0051047b0d6f7`, `F_8f85517967795eeef66c225f7883bdcb`, `F_8f53295a73878494e9bc8dd6c3c7104f`, `F_045117b0e0a11a242b9765e79cbf113f`, `F_fc221309746013ac554571fbd180e1c8`, `F_4c5bde74a8f110656874902f07378009`, `F_cedebb6e872f539bef8c3f919874e9d7`, `F_6cdd60ea0045eb7a6ec44c54d29ed402`, `F_eecca5b6365d9607ee5a9d336962c534`, `F_9872ed9fc22fc182d371c3e9ed316094`, `F_31fefc0e570cb3860f2a6d4b38c6490d`, `F_9dcb88e0137649590b755372b040afad`, `F_a2557a7b2e94197ff767970b67041697`, `F_cfecdb276f634854f3ef915e2e980c31`, `F_0aa1883c6411f7873cb83dacb17b0afc`, `F_58a2fc6ed39fd083f55d4182bf88826d`, `F_bd686fd640be98efaae0091fa301e613`, `F_a597e50502f5ff68e3e25b9114205d4a`, `F_0336dcbab05b9d5ad24f4333c7658a0e`, `F_084b6fbb10729ed4da8c3d3f5a3ae7c9`, `F_85d8ce590ad8981ca2c8286f79f59954`, `F_0e65972dce68dad4d52d063967f0a705`, `F_84d9ee44e457ddef7f2c4f25dc8fa865`, `F_3644a684f98ea8fe223c713b77189a77`, `F_757b505cfd34c64c85ca5b5690ee5293`, `F_854d6fae5ee42911677c739ee1734486`, `F_e2c0be24560d78c5e599c2a9c9d0bbd2`, `F_274ad4786c3abca69fa097b85867d9a4`, `F_eae27d77ca20db309e056e3d2dcd7d69`, `F_7eabe3a1649ffa2b3ff8c02ebfd5659f`, `F_69adc1e107f7f7d035d7baf04342e1ca`, `F_091d584fced301b442654dd8c23b3fc9`, `F_b1d10e7bafa4421218a51b1e1f1b0ba2`, `F_6f3ef77ac0e3619e98159e9b6febf557`, `F_eb163727917cbba1eea208541a643e74`, `F_1534b76d325a8f591b52d302e7181331`, `F_979d472a84804b9f647bc185a877a8b5`, `F_ca46c1b9512a7a8315fa3c5a946e8265`, `F_3b8a614226a953a8cd9526fca6fe9ba5`, `F_45fbc6d3e05ebd93369ce542e8f2322d`, `F_63dc7ed1010d3c3b8269faf0ba7491d4`, `F_e96ed478dab8595a7dbda4cbcbee168f`, `F_c0e190d8267e36708f955d7ab048990d`, `F_ec8ce6abb3e952a85b8551ba726a1227`, `F_060ad92489947d410d897474079c1477`, `F_bcbe3365e6ac95ea2c0343a2395834dd`, `F_115f89503138416a242f40fb7d7f338e`, `F_13fe9d84310e77f13a6d184dbf1232f3`, `F_d1c38a09acc34845c6be3a127a5aacaf`, `F_9cfdf10e8fc047a44b08ed031e1f0ed1`, `F_705f2172834666788607efbfca35afb3`, `F_74db120f0a8e5646ef5a30154e9f6deb`, `F_57aeee35c98205091e18d1140e9f38cf`, `F_6da9003b743b65f4c0ccd295cc484e57`, `F_9b04d152845ec0a378394003c96da594`, `F_be83ab3ecd0db773eb2dc1b0a17836a1`, `F_e165421110ba03099a1c0393373c5b43`, `F_289dff07669d7a23de0ef88d2f7129e7`, `F_577ef1154f3240ad5b9b413aa7346a1e`, `F_01161aaa0b6d1345dd8fe4e481144d84`, `F_539fd53b59e3bb12d203f45a912eeaf2`, `F_ac1dd209cbcc5e5d1c6e28598e8cbbe8`, `F_555d6702c950ecb729a966504af0a635`, `F_335f5352088d7d9bf74191e006d8e24c`, `F_f340f1b1f65b6df5b5e3f94d95b11daf`, `F_e4a6222cdb5b34375400904f03d8e6a5`, `F_cb70ab375662576bd1ac5aaf16b3fca4`, `F_9188905e74c28e489b44e954ec0b9bca`, `F_0266e33d3f546cb5436a10798e657d97`, `F_38db3aed920cf82ab059bfccbd02be6a`, `F_3cec07e9ba5f5bb252d13f5f431e4bbb`, `F_621bf66ddb7c962aa0d22ac97d69b793`, `F_077e29b11be80ab57e1a2ecabb7da330`, `F_6c9882bbac1c7093bd25041881277658`, `F_19f3cd308f1455b3fa09a282e0d496f4`, `F_03c6b06952c750899bb03d998e631860`, `F_c24cd76e1ce41366a4bbe8a49b02a028`, `F_c52f1bd66cc19d05628bd8bf27af3ad6`, `F_fe131d7f5a6b38b23cc967316c13dae2`, `F_f718499c1c8cef6730f9fd03c8125cab`, `F_d96409bf894217686ba124d7356686c9`, `F_502e4a16930e414107ee22b6198c578f`, `F_cfa0860e83a4c3a763a7e62d825349f7`, `F_a4f23670e1833f3fdb077ca70bbd5d66`, `F_b1a59b315fc9a3002ce38bbe070ec3f5`, `F_36660e59856b4de58a219bcf4e27eba3`, `F_8c19f571e251e61cb8dd3612f26d5ecf`, `F_d6baf65e0b240ce177cf70da146c8dc8`, `F_e56954b4f6347e897f954495eab16a88`, `F_f7664060cc52bc6f3d620bcedc94a4b6`, `F_eda80a3d5b344bc40f3bc04f65b7a357`, `F_8f121ce07d74717e0b1f21d122e04521`, `F_06138bc5af6023646ede0e1f7c1eac75`, `F_39059724f73a9969845dfe4146c5660e`, `F_7f100b7b36092fb9b06dfb4fac360931`, `F_7a614fd06c325499f1680b9896beedeb`, `F_4734ba6f3de83d861c3176a6273cac6d`, `F_d947bf06a885db0d477d707121934ff8`, `F_63923f49e5241343aa7acb6a06a751e7`, `F_db8e1af0cb3aca1ae2d0018624204529`, `F_20f07591c6fcb220ffe637cda29bb3f6`, `F_07cdfd23373b17c6b337251c22b7ea57`, `F_d395771085aab05244a4fb8fd91bf4ee`, `F_92c8c96e4c37100777c7190b76d28233`, `F_e3796ae838835da0b6f6ea37bcf8bcb7`, `F_6a9aeddfc689c1d0e3b9ccc3ab651bc5`, `F_0f49c89d1e7298bb9930789c8ed59d48`, `F_46ba9f2a6976570b0353203ec4474217`, `F_0e01938fc48a2cfb5f2217fbfb00722d`, `F_16a5cdae362b8d27a1d8f8c7b78b4330`, `F_918317b57931b6b7a7d29490fe5ec9f9`, `F_48aedb8880cab8c45637abc7493ecddd`, `F_839ab46820b524afda05122893c2fe8e`, `F_f90f2aca5c640289d0a29417bcb63a37`, `F_9c838d2e45b2ad1094d42f4ef36764f6`, `F_1700002963a49da13542e0726b7bb758`, `F_53c3bce66e43be4f209556518c2fcb54`, `F_6883966fd8f918a4aa29be29d2c386fb`, `F_49182f81e6a13cf5eaa496d51fea6406`, `F_d296c101daa88a51f6ca8cfc1ac79b50`, `F_9fd81843ad7f202f26c1a174c7357585`, `F_26e359e83860db1d11b6acca57d8ea88`, `F_ef0d3930a7b6c95bd2b32ed45989c61f`, `F_94f6d7e04a4d452035300f18b984988c`, `F_34ed066df378efacc9b924ec161e7639`, `F_577bcc914f9e55d5e4e4f82f9f00e7d4`, `F_11b9842e0a271ff252c1903e7132cd68`, `F_37bc2f75bf1bcfe8450a1a41c200364c`, `F_496e05e1aea0a9c4655800e8a7b9ea28`, `F_b2eb7349035754953b57a32e2841bda5`, `F_8e98d81f8217304975ccb23337bb5761`, `F_a8c88a0055f636e4a163a5e3d16adab7`, `F_eddea82ad2755b24c4e168c5fc2ebd40`, `F_06eb61b839a0cefee4967c67ccb099dc`, `F_9dfcd5e558dfa04aaf37f137a1d9d3e5`, `F_950a4152c2b4aa3ad78bdd6b366cc179`, `F_158f3069a435b314a80bdcb024f8e422`, `F_758874998f5bd0c393da094e1967a72b`, `F_ad13a2a07ca4b7642959dc0c4c740ab6`, `F_3fe94a002317b5f9259f82690aeea4cd`, `F_5b8add2a5d98b1a652ea7fd72d942dac`, `F_432aca3a1e345e339f35a30c8f65edce`, `F_8d3bba7425e7c98c50f52ca1b52d3735`, `F_320722549d1751cf3f247855f937b982`, `F_caf1a3dfb505ffed0d024130f58c5cfa`, `F_5737c6ec2e0716f3d8a7a5c4e0de0d9a`, `F_bc6dc48b743dc5d013b1abaebd2faed2`, `F_f2fc990265c712c49d51a18a32b39f0c`, `F_89f0fd5c927d466d6ec9a21b9ac34ffa`, `F_a666587afda6e89aec274a3657558a27`, `F_b83aac23b9528732c23cc7352950e880`, `F_cd00692c3bfe59267d5ecfac5310286c`, `F_6faa8040da20ef399b63a72d0e4ab575`, `F_fe73f687e5bc5280214e0486b273a5f9`) VALUES (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1324,6 +1387,8 @@ INSERT INTO t1 VALUES (1),(2),(3);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1345,6 +1410,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES (1),(2),(3);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1372,6 +1438,8 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1390,12 +1458,14 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
- `a` varchar(30) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+ `a` varchar(30)
+) */;
/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1446,6 +1516,8 @@ INSERT INTO t2 VALUES (1), (2);
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1458,6 +1530,7 @@ DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1472,6 +1545,8 @@ CREATE TABLE `t2` (
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1484,6 +1559,7 @@ DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1601,6 +1677,16 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
</database>
</mysqldump>
drop table t1, t2;
+create table t1 (a text character set utf8, b text character set latin1);
+insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
+select * from t1;
+a b
+Osnabrück Köln
+test.t1: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
+select * from t1;
+a b
+Osnabrück Köln
+drop table t1;
create table t1(a int);
create view v1 as select * from t1;
@@ -1608,6 +1694,8 @@ create view v1 as select * from t1;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1624,12 +1712,14 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
- `a` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+ `a` int(11)
+) */;
/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1`*/;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1658,6 +1748,8 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1676,12 +1768,14 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
- `a` varchar(30) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+ `a` varchar(30)
+) */;
/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') WITH CASCADED CHECK OPTION*/;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1702,6 +1796,8 @@ INSERT INTO t1 VALUES ('\'');
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1717,6 +1813,7 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES ('\'');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1740,6 +1837,8 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1759,23 +1858,26 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `v1`;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 CREATE TABLE `v1` (
- `a` int(11) default NULL,
- `b` int(11) default NULL,
- `c` varchar(30) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+ `a` int(11),
+ `b` int(11),
+ `c` varchar(30)
+) */;
DROP TABLE IF EXISTS `v2`;
/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
/*!50001 CREATE TABLE `v2` (
- `a` int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+ `a` int(11)
+) */;
DROP TABLE IF EXISTS `v3`;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
+/*!50001 DROP TABLE IF EXISTS `v3`*/;
/*!50001 CREATE TABLE `v3` (
- `a` int(11) default NULL,
- `b` int(11) default NULL,
- `c` varchar(30) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
+ `a` int(11),
+ `b` int(11),
+ `c` varchar(30)
+) */;
/*!50001 DROP TABLE IF EXISTS `v1`*/;
/*!50001 DROP VIEW IF EXISTS `v1`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7))*/;
@@ -1785,6 +1887,7 @@ DROP TABLE IF EXISTS `v3`;
/*!50001 DROP TABLE IF EXISTS `v3`*/;
/*!50001 DROP VIEW IF EXISTS `v3`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1`*/;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -1847,6 +1950,8 @@ update t1 set a = 4 where a=3;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1869,31 +1974,32 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
-DELIMITER //;
-/*!50003 SET SESSION SQL_MODE="" */ //
+DELIMITER ;;
+/*!50003 SET SESSION SQL_MODE="" */;;
/*!50003 CREATE TRIGGER `trg1` BEFORE INSERT ON `t1` FOR EACH ROW
begin
if new.a > 10 then
set new.a := 10;
set new.a := 11;
end if;
-end */ //
+end */;;
-/*!50003 SET SESSION SQL_MODE="" */ //
+/*!50003 SET SESSION SQL_MODE="" */;;
/*!50003 CREATE TRIGGER `trg2` BEFORE UPDATE ON `t1` FOR EACH ROW begin
if old.a % 2 = 0 then set new.b := 12; end if;
-end */ //
+end */;;
-/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */ //
+/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;;
/*!50003 CREATE TRIGGER `trg3` AFTER UPDATE ON `t1` FOR EACH ROW
begin
if new.a = -1 then
set @fired:= "Yes";
end if;
-end */ //
+end */;;
-DELIMITER ;//
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;DROP TABLE IF EXISTS `t2`;
+DELIMITER ;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+DROP TABLE IF EXISTS `t2`;
CREATE TABLE `t2` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@@ -1905,17 +2011,19 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
-DELIMITER //;
-/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */ //
+DELIMITER ;;
+/*!50003 SET SESSION SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER" */;;
/*!50003 CREATE TRIGGER `trg4` BEFORE INSERT ON `t2` FOR EACH ROW
begin
if new.a > 10 then
set @fired:= "No";
end if;
-end */ //
+end */;;
-DELIMITER ;//
+DELIMITER ;
/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
@@ -1929,6 +2037,8 @@ DELIMITER ;//
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -1959,6 +2069,7 @@ CREATE TABLE `t2` (
LOCK TABLES `t2` WRITE;
UNLOCK TABLES;
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -2058,6 +2169,8 @@ set sql_mode='';
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
@@ -2077,38 +2190,39 @@ LOCK TABLES `t1` WRITE;
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5);
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
-DELIMITER //
-/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */ //
-/*!50003 SET SESSION SQL_MODE=""*/ //
+DELIMITER ;;
+/*!50003 DROP FUNCTION IF EXISTS `bug9056_func1` */;;
+/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11)
-RETURN a+b */ //
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
-/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */ //
-/*!50003 SET SESSION SQL_MODE=""*/ //
+RETURN a+b */;;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
+/*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */;;
+/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1)
begin
set f1= concat( 'hello', f1 );
return f1;
-end */ //
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
-/*!50003 DROP PROCEDURE IF EXISTS `a'b` */ //
-/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/ //
+end */;;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
+/*!50003 DROP PROCEDURE IF EXISTS `a'b` */;;
+/*!50003 SET SESSION SQL_MODE="REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI"*/;;
/*!50003 CREATE PROCEDURE "a'b"()
-select 1 */ //
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
-/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */ //
-/*!50003 SET SESSION SQL_MODE=""*/ //
+select 1 */;;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
+/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc1` */;;
+/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
-BEGIN SELECT a+b INTO c; end */ //
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
-/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */ //
-/*!50003 SET SESSION SQL_MODE=""*/ //
+BEGIN SELECT a+b INTO c; end */;;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
+/*!50003 DROP PROCEDURE IF EXISTS `bug9056_proc2` */;;
+/*!50003 SET SESSION SQL_MODE=""*/;;
/*!50003 CREATE PROCEDURE `bug9056_proc2`(OUT a INT)
BEGIN
select sum(id) from t1 into a;
-END */ //
-/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/ //
+END */;;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;;
DELIMITER ;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
@@ -2122,4 +2236,250 @@ DROP FUNCTION bug9056_func1;
DROP FUNCTION bug9056_func2;
DROP PROCEDURE bug9056_proc1;
DROP PROCEDURE bug9056_proc2;
+DROP PROCEDURE `a'b`;
+drop table t1;
+drop table if exists t1;
+create table t1 (`d` timestamp, unique (`d`));
+set time_zone='+00:00';
+insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00');
+select * from t1;
+d
+2003-10-25 22:00:00
+2003-10-25 23:00:00
+set time_zone='Europe/Moscow';
+select * from t1;
+d
+2003-10-26 02:00:00
+2003-10-26 02:00:00
+set global time_zone='Europe/Moscow';
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `d` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ UNIQUE KEY `d` (`d`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES ('2003-10-25 22:00:00'),('2003-10-25 23:00:00');
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `d` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ UNIQUE KEY `d` (`d`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES ('2003-10-26 02:00:00'),('2003-10-26 02:00:00');
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+drop table t1;
+set global time_zone=default;
+set time_zone=default;
+DROP TABLE IF EXISTS `t1 test`;
+CREATE TABLE `t1 test` (
+`a1` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+DROP TABLE IF EXISTS `t2 test`;
+CREATE TABLE `t2 test` (
+`a2` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
+INSERT INTO `t2 test` SET a2 = NEW.a1; END //
+INSERT INTO `t1 test` VALUES (1);
+INSERT INTO `t1 test` VALUES (2);
+INSERT INTO `t1 test` VALUES (3);
+SELECT * FROM `t2 test`;
+a2
+1
+2
+3
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+DROP TABLE IF EXISTS "t1 test";
+CREATE TABLE "t1 test" (
+ "a1" int(11) default NULL
+);
+
+
+/*!40000 ALTER TABLE "t1 test" DISABLE KEYS */;
+LOCK TABLES "t1 test" WRITE;
+INSERT INTO "t1 test" VALUES (1),(2),(3);
+UNLOCK TABLES;
+/*!40000 ALTER TABLE "t1 test" ENABLE KEYS */;
+
+/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;
+DELIMITER ;;
+/*!50003 SET SESSION SQL_MODE="" */;;
+/*!50003 CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
+INSERT INTO `t2 test` SET a2 = NEW.a1; END */;;
+
+DELIMITER ;
+/*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE */;
+DROP TABLE IF EXISTS "t2 test";
+CREATE TABLE "t2 test" (
+ "a2" int(11) default NULL
+);
+
+
+/*!40000 ALTER TABLE "t2 test" DISABLE KEYS */;
+LOCK TABLES "t2 test" WRITE;
+INSERT INTO "t2 test" VALUES (1),(2),(3);
+UNLOCK TABLES;
+/*!40000 ALTER TABLE "t2 test" ENABLE KEYS */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+DROP TRIGGER `test trig`;
+DROP TABLE `t1 test`;
+DROP TABLE `t2 test`;
+drop table if exists t1;
+create table t1 (a int, b varchar(32), c varchar(32));
+insert into t1 values (1, 'first value', 'xxxx');
+insert into t1 values (2, 'second value', 'tttt');
+insert into t1 values (3, 'third value', 'vvv vvv');
+create view v1 as select * from t1;
+create view v0 as select * from v1;
+create view v2 as select * from v0;
+select * from v2;
+a b c
+1 first value xxxx
+2 second value tttt
+3 third value vvv vvv
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL,
+ `b` varchar(32) default NULL,
+ `c` varchar(32) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES (1,'first value','xxxx'),(2,'second value','tttt'),(3,'third value','vvv vvv');
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+DROP TABLE IF EXISTS `v0`;
+/*!50001 DROP VIEW IF EXISTS `v0`*/;
+/*!50001 DROP TABLE IF EXISTS `v0`*/;
+/*!50001 CREATE TABLE `v0` (
+ `a` int(11),
+ `b` varchar(32),
+ `c` varchar(32)
+) */;
+DROP TABLE IF EXISTS `v1`;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 CREATE TABLE `v1` (
+ `a` int(11),
+ `b` varchar(32),
+ `c` varchar(32)
+) */;
+DROP TABLE IF EXISTS `v2`;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 CREATE TABLE `v2` (
+ `a` int(11),
+ `b` varchar(32),
+ `c` varchar(32)
+) */;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+/*!50001 DROP TABLE IF EXISTS `v0`*/;
+/*!50001 DROP VIEW IF EXISTS `v0`*/;
+/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v0` AS select `v1`.`a` AS `a`,`v1`.`b` AS `b`,`v1`.`c` AS `c` from `v1`*/;
+/*!50001 DROP TABLE IF EXISTS `v1`*/;
+/*!50001 DROP VIEW IF EXISTS `v1`*/;
+/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1`*/;
+/*!50001 DROP TABLE IF EXISTS `v2`*/;
+/*!50001 DROP VIEW IF EXISTS `v2`*/;
+/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v0`.`a` AS `a`,`v0`.`b` AS `b`,`v0`.`c` AS `c` from `v0`*/;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+drop view v2;
+drop view v0;
+drop view v1;
drop table t1;
diff --git a/mysql-test/r/mysqlshow.result b/mysql-test/r/mysqlshow.result
index a04a7081b34..355c20fdad3 100644
--- a/mysql-test/r/mysqlshow.result
+++ b/mysql-test/r/mysqlshow.result
@@ -1,3 +1,4 @@
+DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1),(2),(3);
CREATE TABLE t2 (a int, b int);
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index 0ad6db8c57e..54bdb1b45d8 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -344,6 +344,18 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1
mysqltest: At line 1: Invalid integer argument "10!"
mysqltest: At line 1: End of line junk detected: "!"
mysqltest: At line 1: Invalid integer argument "a"
+mysqltest: At line 1: Syntax error in connect - expected '(' found 'mysqltest: At line 1: Missing connection host
+mysqltest: At line 1: Missing connection host
+mysqltest: At line 1: Missing connection user
+mysqltest: At line 1: Missing connection user
+mysqltest: At line 1: Missing connection password
+mysqltest: At line 1: Missing connection db
+mysqltest: At line 1: Could not open connection 'con2': Unknown database 'illegal_db'
+mysqltest: At line 1: Illegal argument for port: 'illegal_port'
+mysqltest: At line 1: Illegal option to connect: SMTP
+mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c
+mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool
+mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already exists
Output from mysqltest-x.inc
Output from mysqltest-x.inc
Output from mysqltest-x.inc
diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result
index 0a46a3db05c..23022378d60 100644
--- a/mysql-test/r/ndb_basic.result
+++ b/mysql-test/r/ndb_basic.result
@@ -673,3 +673,7 @@ select * from atablewithareallylongandirritatingname;
a
2
drop table atablewithareallylongandirritatingname;
+CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
+select * from t1;
+b
+drop table t1;
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
index 449120c6c79..bdeff437f6f 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/r/ndb_condition_pushdown.result
@@ -3,7 +3,7 @@ CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10),
vstring varchar(10),
-bin binary(7),
+bin binary(2),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
diff --git a/mysql-test/r/ndb_config.result b/mysql-test/r/ndb_config.result
index 629d37f1e5e..ef5c924a398 100644
--- a/mysql-test/r/ndb_config.result
+++ b/mysql-test/r/ndb_config.result
@@ -5,3 +5,7 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql
1 2
ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7,
ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,,
+ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
+ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
+ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15,
+shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2
diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result
new file mode 100644
index 00000000000..43075306bd2
--- /dev/null
+++ b/mysql-test/r/ndb_gis.result
@@ -0,0 +1,916 @@
+SET storage_engine=ndbcluster;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER, g POINT);
+CREATE TABLE gis_line (fid INTEGER, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table Create Table
+gis_point CREATE TABLE `gis_point` (
+ `fid` int(11) default NULL,
+ `g` point default NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g point YES NULL
+SHOW FIELDS FROM gis_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g linestring YES NULL
+SHOW FIELDS FROM gis_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g polygon YES NULL
+SHOW FIELDS FROM gis_multi_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipoint YES NULL
+SHOW FIELDS FROM gis_multi_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multilinestring YES NULL
+SHOW FIELDS FROM gis_multi_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipolygon YES NULL
+SHOW FIELDS FROM gis_geometrycollection;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometrycollection YES NULL
+SHOW FIELDS FROM gis_geometry;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometry YES NULL
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid AsText(g)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid AsText(g)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid AsText(g)
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid AsText(g)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid AsText(g)
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid AsText(g)
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid Dimension(g)
+101 0
+102 0
+103 0
+104 0
+105 1
+106 1
+107 1
+108 2
+109 2
+110 2
+111 0
+112 0
+113 0
+114 1
+115 1
+116 1
+117 2
+118 2
+119 2
+120 1
+121 1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid GeometryType(g)
+101 POINT
+102 POINT
+103 POINT
+104 POINT
+105 LINESTRING
+106 LINESTRING
+107 LINESTRING
+108 POLYGON
+109 POLYGON
+110 POLYGON
+111 MULTIPOINT
+112 MULTIPOINT
+113 MULTIPOINT
+114 MULTILINESTRING
+115 MULTILINESTRING
+116 MULTILINESTRING
+117 MULTIPOLYGON
+118 MULTIPOLYGON
+119 MULTIPOLYGON
+120 GEOMETRYCOLLECTION
+121 GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid IsEmpty(g)
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid AsText(Envelope(g))
+101 POLYGON((10 10,10 10,10 10,10 10,10 10))
+102 POLYGON((20 10,20 10,20 10,20 10,20 10))
+103 POLYGON((20 20,20 20,20 20,20 20,20 20))
+104 POLYGON((10 20,10 20,10 20,10 20,10 20))
+105 POLYGON((0 0,10 0,10 10,0 10,0 0))
+106 POLYGON((10 10,20 10,20 20,10 20,10 10))
+107 POLYGON((10 10,40 10,40 10,10 10,10 10))
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0))
+110 POLYGON((0 0,30 0,30 30,0 30,0 0))
+111 POLYGON((0 0,20 0,20 20,0 20,0 0))
+112 POLYGON((1 1,21 1,21 21,1 21,1 1))
+113 POLYGON((3 6,4 6,4 10,3 10,3 6))
+114 POLYGON((10 0,16 0,16 48,10 48,10 0))
+115 POLYGON((10 0,10 0,10 48,10 48,10 0))
+116 POLYGON((1 2,21 2,21 8,1 8,1 2))
+117 POLYGON((28 0,84 0,84 42,28 42,28 0))
+118 POLYGON((28 0,84 0,84 42,28 42,28 0))
+119 POLYGON((0 0,3 0,3 3,0 3,0 0))
+120 POLYGON((0 0,10 0,10 10,0 10,0 0))
+121 POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
+Warnings:
+Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid X(g)
+101 10
+102 20
+103 20
+104 10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid Y(g)
+101 10
+102 10
+103 20
+104 20
+explain extended select X(g),Y(g) FROM gis_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
+Warnings:
+Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(StartPoint(g))
+105 POINT(0 0)
+106 POINT(10 10)
+107 POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(EndPoint(g))
+105 POINT(10 0)
+106 POINT(10 10)
+107 POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid GLength(g)
+105 24.142135623731
+106 40
+107 30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid NumPoints(g)
+105 3
+106 5
+107 2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid AsText(PointN(g, 2))
+105 POINT(0 10)
+106 POINT(20 10)
+107 POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid IsClosed(g)
+105 0
+106 1
+107 0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid AsText(Centroid(g))
+108 POINT(15 15)
+109 POINT(25.416666666667 25.416666666667)
+110 POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid Area(g)
+108 100
+109 2400
+110 450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid AsText(ExteriorRing(g))
+108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110 LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid NumInteriorRings(g)
+108 0
+109 1
+110 0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid AsText(InteriorRingN(g, 1))
+108 NULL
+109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110 NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid IsClosed(g)
+114 0
+115 0
+116 0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid AsText(Centroid(g))
+117 POINT(55.588527753042 17.426536064114)
+118 POINT(55.588527753042 17.426536064114)
+119 POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid Area(g)
+117 1684.5
+118 1684.5
+119 4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid NumGeometries(g)
+111 4
+112 4
+113 2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid NumGeometries(g)
+114 2
+115 1
+116 2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid NumGeometries(g)
+117 2
+118 2
+119 1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid NumGeometries(g)
+120 2
+121 2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid AsText(GeometryN(g, 2))
+111 POINT(10 10)
+112 POINT(11 11)
+113 POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid AsText(GeometryN(g, 2))
+114 LINESTRING(16 0,16 23,16 48)
+115 NULL
+116 LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid AsText(GeometryN(g, 2))
+117 POLYGON((59 18,67 18,67 13,59 13,59 18))
+118 POLYGON((59 18,67 18,67 13,59 13,59 18))
+119 NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 2))
+120 LINESTRING(0 0,10 10)
+121 LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first second w c o e d t i r
+120 120 1 1 0 1 0 0 1 0
+120 121 0 0 0 0 0 0 1 0
+121 120 0 0 1 0 0 0 1 0
+121 121 1 1 0 1 0 0 1 0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2
+Warnings:
+Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+fid int(11) YES NULL
+DROP TABLE t1;
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+insert into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (fl geometry);
+insert into t1 values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (pointfromtext('point(1,1)'));
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+set engine_condition_pushdown = on;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER, g POINT);
+CREATE TABLE gis_line (fid INTEGER, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER, g GEOMETRY);
+SHOW CREATE TABLE gis_point;
+Table Create Table
+gis_point CREATE TABLE `gis_point` (
+ `fid` int(11) default NULL,
+ `g` point default NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+SHOW FIELDS FROM gis_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g point YES NULL
+SHOW FIELDS FROM gis_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g linestring YES NULL
+SHOW FIELDS FROM gis_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g polygon YES NULL
+SHOW FIELDS FROM gis_multi_point;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipoint YES NULL
+SHOW FIELDS FROM gis_multi_line;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multilinestring YES NULL
+SHOW FIELDS FROM gis_multi_polygon;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g multipolygon YES NULL
+SHOW FIELDS FROM gis_geometrycollection;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometrycollection YES NULL
+SHOW FIELDS FROM gis_geometry;
+Field Type Null Key Default Extra
+fid int(11) YES NULL
+g geometry YES NULL
+INSERT INTO gis_point VALUES
+(101, PointFromText('POINT(10 10)')),
+(102, PointFromText('POINT(20 10)')),
+(103, PointFromText('POINT(20 20)')),
+(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
+INSERT INTO gis_line VALUES
+(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
+(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
+(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
+INSERT INTO gis_polygon VALUES
+(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
+(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
+(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
+INSERT INTO gis_multi_point VALUES
+(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
+(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
+(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
+INSERT INTO gis_multi_line VALUES
+(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
+(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
+(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
+INSERT INTO gis_multi_polygon VALUES
+(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
+(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
+INSERT INTO gis_geometrycollection VALUES
+(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
+(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+SELECT fid, AsText(g) FROM gis_line ORDER by fid;
+fid AsText(g)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+SELECT fid, AsText(g) FROM gis_polygon ORDER by fid;
+fid AsText(g)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+SELECT fid, AsText(g) FROM gis_multi_point ORDER by fid;
+fid AsText(g)
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+SELECT fid, AsText(g) FROM gis_multi_line ORDER by fid;
+fid AsText(g)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+SELECT fid, AsText(g) FROM gis_multi_polygon ORDER by fid;
+fid AsText(g)
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+SELECT fid, AsText(g) FROM gis_geometrycollection ORDER by fid;
+fid AsText(g)
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, AsText(g) FROM gis_geometry ORDER by fid;
+fid AsText(g)
+101 POINT(10 10)
+102 POINT(20 10)
+103 POINT(20 20)
+104 POINT(10 20)
+105 LINESTRING(0 0,0 10,10 0)
+106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+107 LINESTRING(10 10,40 10)
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
+110 POLYGON((0 0,30 0,30 30,0 0))
+111 MULTIPOINT(0 0,10 10,10 20,20 20)
+112 MULTIPOINT(1 1,11 11,11 21,21 21)
+113 MULTIPOINT(3 6,4 10)
+114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
+115 MULTILINESTRING((10 48,10 21,10 0))
+116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
+117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
+119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
+120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
+121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
+SELECT fid, Dimension(g) FROM gis_geometry ORDER by fid;
+fid Dimension(g)
+101 0
+102 0
+103 0
+104 0
+105 1
+106 1
+107 1
+108 2
+109 2
+110 2
+111 0
+112 0
+113 0
+114 1
+115 1
+116 1
+117 2
+118 2
+119 2
+120 1
+121 1
+SELECT fid, GeometryType(g) FROM gis_geometry ORDER by fid;
+fid GeometryType(g)
+101 POINT
+102 POINT
+103 POINT
+104 POINT
+105 LINESTRING
+106 LINESTRING
+107 LINESTRING
+108 POLYGON
+109 POLYGON
+110 POLYGON
+111 MULTIPOINT
+112 MULTIPOINT
+113 MULTIPOINT
+114 MULTILINESTRING
+115 MULTILINESTRING
+116 MULTILINESTRING
+117 MULTIPOLYGON
+118 MULTIPOLYGON
+119 MULTIPOLYGON
+120 GEOMETRYCOLLECTION
+121 GEOMETRYCOLLECTION
+SELECT fid, IsEmpty(g) FROM gis_geometry ORDER by fid;
+fid IsEmpty(g)
+101 0
+102 0
+103 0
+104 0
+105 0
+106 0
+107 0
+108 0
+109 0
+110 0
+111 0
+112 0
+113 0
+114 0
+115 0
+116 0
+117 0
+118 0
+119 0
+120 0
+121 0
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry ORDER by fid;
+fid AsText(Envelope(g))
+101 POLYGON((10 10,10 10,10 10,10 10,10 10))
+102 POLYGON((20 10,20 10,20 10,20 10,20 10))
+103 POLYGON((20 20,20 20,20 20,20 20,20 20))
+104 POLYGON((10 20,10 20,10 20,10 20,10 20))
+105 POLYGON((0 0,10 0,10 10,0 10,0 0))
+106 POLYGON((10 10,20 10,20 20,10 20,10 10))
+107 POLYGON((10 10,40 10,40 10,10 10,10 10))
+108 POLYGON((10 10,20 10,20 20,10 20,10 10))
+109 POLYGON((0 0,50 0,50 50,0 50,0 0))
+110 POLYGON((0 0,30 0,30 30,0 30,0 0))
+111 POLYGON((0 0,20 0,20 20,0 20,0 0))
+112 POLYGON((1 1,21 1,21 21,1 21,1 1))
+113 POLYGON((3 6,4 6,4 10,3 10,3 6))
+114 POLYGON((10 0,16 0,16 48,10 48,10 0))
+115 POLYGON((10 0,10 0,10 48,10 48,10 0))
+116 POLYGON((1 2,21 2,21 8,1 8,1 2))
+117 POLYGON((28 0,84 0,84 42,28 42,28 0))
+118 POLYGON((28 0,84 0,84 42,28 42,28 0))
+119 POLYGON((0 0,3 0,3 3,0 3,0 0))
+120 POLYGON((0 0,10 0,10 10,0 10,0 0))
+121 POLYGON((3 6,44 6,44 9,3 9,3 6))
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
+Warnings:
+Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry`
+SELECT fid, X(g) FROM gis_point ORDER by fid;
+fid X(g)
+101 10
+102 20
+103 20
+104 10
+SELECT fid, Y(g) FROM gis_point ORDER by fid;
+fid Y(g)
+101 10
+102 10
+103 20
+104 20
+explain extended select X(g),Y(g) FROM gis_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
+Warnings:
+Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point`
+SELECT fid, AsText(StartPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(StartPoint(g))
+105 POINT(0 0)
+106 POINT(10 10)
+107 POINT(10 10)
+SELECT fid, AsText(EndPoint(g)) FROM gis_line ORDER by fid;
+fid AsText(EndPoint(g))
+105 POINT(10 0)
+106 POINT(10 10)
+107 POINT(40 10)
+SELECT fid, GLength(g) FROM gis_line ORDER by fid;
+fid GLength(g)
+105 24.142135623731
+106 40
+107 30
+SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
+fid NumPoints(g)
+105 3
+106 5
+107 2
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line ORDER by fid;
+fid AsText(PointN(g, 2))
+105 POINT(0 10)
+106 POINT(20 10)
+107 POINT(40 10)
+SELECT fid, IsClosed(g) FROM gis_line ORDER by fid;
+fid IsClosed(g)
+105 0
+106 1
+107 0
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line`
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
+fid AsText(Centroid(g))
+108 POINT(15 15)
+109 POINT(25.416666666667 25.416666666667)
+110 POINT(20 10)
+SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
+fid Area(g)
+108 100
+109 2400
+110 450
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon ORDER by fid;
+fid AsText(ExteriorRing(g))
+108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
+110 LINESTRING(0 0,30 0,30 30,0 0)
+SELECT fid, NumInteriorRings(g) FROM gis_polygon ORDER by fid;
+fid NumInteriorRings(g)
+108 0
+109 1
+110 0
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon ORDER by fid;
+fid AsText(InteriorRingN(g, 1))
+108 NULL
+109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
+110 NULL
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon`
+SELECT fid, IsClosed(g) FROM gis_multi_line ORDER by fid;
+fid IsClosed(g)
+114 0
+115 0
+116 0
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
+fid AsText(Centroid(g))
+117 POINT(55.588527753042 17.426536064114)
+118 POINT(55.588527753042 17.426536064114)
+119 POINT(2 2)
+SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
+fid Area(g)
+117 1684.5
+118 1684.5
+119 4.5
+SELECT fid, NumGeometries(g) from gis_multi_point ORDER by fid;
+fid NumGeometries(g)
+111 4
+112 4
+113 2
+SELECT fid, NumGeometries(g) from gis_multi_line ORDER by fid;
+fid NumGeometries(g)
+114 2
+115 1
+116 2
+SELECT fid, NumGeometries(g) from gis_multi_polygon ORDER by fid;
+fid NumGeometries(g)
+117 2
+118 2
+119 1
+SELECT fid, NumGeometries(g) from gis_geometrycollection ORDER by fid;
+fid NumGeometries(g)
+120 2
+121 2
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point`
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point ORDER by fid;
+fid AsText(GeometryN(g, 2))
+111 POINT(10 10)
+112 POINT(11 11)
+113 POINT(4 10)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line ORDER by fid;
+fid AsText(GeometryN(g, 2))
+114 LINESTRING(16 0,16 23,16 48)
+115 NULL
+116 LINESTRING(2 5,5 8,21 7)
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon ORDER by fid;
+fid AsText(GeometryN(g, 2))
+117 POLYGON((59 18,67 18,67 13,59 13,59 18))
+118 POLYGON((59 18,67 18,67 13,59 13,59 18))
+119 NULL
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 2))
+120 LINESTRING(0 0,10 10)
+121 LINESTRING(3 6,7 9)
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection ORDER by fid;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
+Warnings:
+Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point`
+SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+first second w c o e d t i r
+120 120 1 1 0 1 0 0 1 0
+120 121 0 0 0 0 0 0 1 0
+121 120 0 0 1 0 0 0 1 0
+121 121 1 1 0 1 0 0 1 0
+explain extended SELECT g1.fid as first, g2.fid as second,
+Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
+Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
+Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
+1 SIMPLE g2 ALL NULL NULL NULL NULL 2
+Warnings:
+Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid`
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+gp point,
+ln linestring,
+pg polygon,
+mp multipoint,
+mln multilinestring,
+mpg multipolygon,
+gc geometrycollection,
+gm geometry
+);
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+ALTER TABLE t1 ADD fid INT;
+SHOW FIELDS FROM t1;
+Field Type Null Key Default Extra
+gp point YES NULL
+ln linestring YES NULL
+pg polygon YES NULL
+mp multipoint YES NULL
+mln multilinestring YES NULL
+mpg multipolygon YES NULL
+gc geometrycollection YES NULL
+gm geometry YES NULL
+fid int(11) YES NULL
+DROP TABLE t1;
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+insert into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert IGNORE into t1 values ('Garbage');
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
+create table t1 (fl geometry);
+insert into t1 values (1);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (1.11);
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values ("qwerty");
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+insert into t1 values (pointfromtext('point(1,1)'));
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+drop table t1;
diff --git a/mysql-test/r/ndb_types.result b/mysql-test/r/ndb_types.result
index 37ce7732f65..6938277f01d 100644
--- a/mysql-test/r/ndb_types.result
+++ b/mysql-test/r/ndb_types.result
@@ -3,7 +3,7 @@ CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10) default "hello",
vstring varchar(10) default "hello",
-bin binary(7),
+bin binary(2),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 035c84431f8..77f2d5495a9 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -6,21 +6,33 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA
grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com";
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com";
flush privileges;
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
select * from t1;
f1
5
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user1'@'localhost' for table 't1'
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
select * from t1;
f1
5
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user2'@'localhost' for table 't1'
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
select * from t1;
f1
5
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user3'@'localhost' for table 't1'
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
select * from t1;
f1
5
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index f2c3e617144..97d14b2be3a 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1271,3 +1271,19 @@ drop procedure f3;
drop procedure f4;
drop table t1;
set GLOBAL query_cache_size=0;
+SET GLOBAL query_cache_size=102400;
+create table t1(a int);
+insert into t1 values(0), (1), (4), (5);
+select * from t1 where a > 3;
+a
+4
+5
+select * from t1 where a > 3;
+a
+4
+5
+show status like 'last_query_cost';
+Variable_name Value
+Last_query_cost 0.000000
+drop table t1;
+SET GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 69c150fc0b7..f6b7409ea6a 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -809,4 +809,11 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t2 where a = 'a' or a='a ';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref a a 13 const # Using where
+update t1 set a='b' where a<>'a';
+explain select * from t1 where a not between 'b' and 'b';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 13 NULL # Using where
+select a, hex(filler) from t1 where a not between 'b' and 'b';
+a hex(filler)
+a 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
drop table t1,t2,t3;
diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/r/rpl_ddl.result
index 9f90001ab67..2a97da63c64 100644
--- a/mysql-test/r/rpl_ddl.result
+++ b/mysql-test/r/rpl_ddl.result
@@ -1254,6 +1254,440 @@ flush logs;
SHOW PROCEDURE STATUS LIKE 'p1';
-------- switch to slave -------
SHOW PROCEDURE STATUS LIKE 'p1';
+
+######## CREATE OR REPLACE VIEW v1 as select * from t1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 18 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+18
+
+-------- switch to master -------
+CREATE OR REPLACE VIEW v1 as select * from t1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+-------- switch to slave -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+######## ALTER VIEW v1 AS select f1 from t1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 19 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+19
+
+-------- switch to master -------
+ALTER VIEW v1 AS select f1 from t1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+-------- switch to slave -------
+SHOW CREATE VIEW v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
+
+######## DROP VIEW IF EXISTS v1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 20 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+20
+
+-------- switch to master -------
+DROP VIEW IF EXISTS v1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW CREATE VIEW v1;
+ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
+
+-------- switch to slave -------
+SHOW CREATE VIEW v1;
+ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
+
+######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 21 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+21
+
+-------- switch to master -------
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode
+trg1 INSERT t1 SET @a:=1 BEFORE NULL
+
+-------- switch to slave -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode
+trg1 INSERT t1 SET @a:=1 BEFORE NULL
+
+######## DROP TRIGGER trg1 ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 22 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+22
+
+-------- switch to master -------
+DROP TRIGGER trg1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode
+
+-------- switch to slave -------
+SHOW TRIGGERS;
+Trigger Event Table Statement Timing Created sql_mode
+
+######## CREATE USER user1@localhost ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 23 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+23
+
+-------- switch to master -------
+CREATE USER user1@localhost;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SELECT user FROM mysql.user WHERE user = 'user1';
+user
+user1
+
+-------- switch to slave -------
+SELECT user FROM mysql.user WHERE user = 'user1';
+user
+user1
+
+######## RENAME USER user1@localhost TO rename1@localhost ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 24 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+24
+
+-------- switch to master -------
+RENAME USER user1@localhost TO rename1@localhost;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
+rename1
+
+-------- switch to slave -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
+rename1
+
+######## DROP USER rename1@localhost ########
+
+-------- switch to master -------
+INSERT INTO t1 SET f1= 25 + 1;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+25
+
+-------- switch to master -------
+DROP USER rename1@localhost;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+-------- switch to master -------
+ROLLBACK;
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+TEST-INFO: MASTER: The INSERT is committed (Succeeded)
+
+-------- switch to slave --------
+SELECT MAX(f1) FROM t1;
+MAX(f1)
+26
+
+TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
+
+-------- switch to master -------
+flush logs;
+
+-------- switch to slave --------
+flush logs;
+
+-------- switch to master -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
+
+-------- switch to slave -------
+SELECT user FROM mysql.user WHERE user = 'rename1';
+user
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
diff --git a/mysql-test/r/rpl_dual_pos_advance.result b/mysql-test/r/rpl_dual_pos_advance.result
new file mode 100644
index 00000000000..257baa81b74
--- /dev/null
+++ b/mysql-test/r/rpl_dual_pos_advance.result
@@ -0,0 +1,22 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+reset master;
+change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
+start slave;
+create table t1 (n int);
+create table t4 (n int);
+create table t5 (n int);
+create table t6 (n int);
+show tables;
+Tables_in_test
+t1
+t4
+t5
+t6
+stop slave;
+reset slave;
+drop table t1,t4,t5,t6;
diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result
index 99356ebf970..5bb262764fa 100644
--- a/mysql-test/r/rpl_multi_update2.result
+++ b/mysql-test/r/rpl_multi_update2.result
@@ -4,6 +4,7 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
+drop table if exists t1,t2;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
@@ -40,3 +41,15 @@ SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
+drop table t1,t2;
+reset master;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (0);
+UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
+select * from t1;
+a
+3
+select * from t1;
+a
+3
+drop table t1;
diff --git a/mysql-test/r/rpl_multi_update3.result b/mysql-test/r/rpl_multi_update3.result
index 1b757b1400c..b81af7c6e39 100644
--- a/mysql-test/r/rpl_multi_update3.result
+++ b/mysql-test/r/rpl_multi_update3.result
@@ -122,3 +122,75 @@ SELECT * FROM t1;
i j x y z
1 2 23 24 71
DROP TABLE t1, t2, t3;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+DROP TABLE IF EXISTS t2;
+Warnings:
+Note 1051 Unknown table 't2'
+CREATE TABLE t1 (
+idp int(11) NOT NULL default '0',
+idpro int(11) default NULL,
+price decimal(19,4) default NULL,
+PRIMARY KEY (idp)
+);
+CREATE TABLE t2 (
+idpro int(11) NOT NULL default '0',
+price decimal(19,4) default NULL,
+nbprice int(11) default NULL,
+PRIMARY KEY (idpro)
+);
+INSERT INTO t1 VALUES
+(1,1,'3.0000'),
+(2,2,'1.0000'),
+(3,1,'1.0000'),
+(4,1,'4.0000'),
+(5,3,'2.0000'),
+(6,2,'4.0000');
+INSERT INTO t2 VALUES
+(1,'0.0000',0),
+(2,'0.0000',0),
+(3,'0.0000',0);
+update
+t2
+join
+( select idpro, min(price) as min_price, count(*) as nbr_price
+from t1
+where idpro>0 and price>0
+group by idpro
+) as table_price
+on t2.idpro = table_price.idpro
+set t2.price = table_price.min_price,
+t2.nbprice = table_price.nbr_price;
+select "-- MASTER AFTER JOIN --" as "";
+
+-- MASTER AFTER JOIN --
+select * from t1;
+idp idpro price
+1 1 3.0000
+2 2 1.0000
+3 1 1.0000
+4 1 4.0000
+5 3 2.0000
+6 2 4.0000
+select * from t2;
+idpro price nbprice
+1 1.0000 3
+2 1.0000 2
+3 2.0000 1
+select "-- SLAVE AFTER JOIN --" as "";
+
+-- SLAVE AFTER JOIN --
+select * from t1;
+idp idpro price
+1 1 3.0000
+2 2 1.0000
+3 1 1.0000
+4 1 4.0000
+5 3 2.0000
+6 2 4.0000
+select * from t2;
+idpro price nbprice
+1 1.0000 3
+2 1.0000 2
+3 2.0000 1
diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result
index b1f564a0791..5f1c3afd14d 100644
--- a/mysql-test/r/rpl_sp.result
+++ b/mysql-test/r/rpl_sp.result
@@ -264,6 +264,14 @@ master-bin.000002 # Query 1 # use `mysqltest1`; insert into t1 values (1)
select * from t1;
a
1
+create procedure foo()
+not deterministic
+reads sql data
+select * from t1;
+call foo();
+a
+1
+drop procedure foo;
drop function fn1;
drop database mysqltest1;
drop user "zedjzlcsjhd"@127.0.0.1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 3e4f29d7a01..318cf8e7b65 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2,t3,t4;
+drop table if exists t1,t2,t3,t4,t11;
drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa;
drop view if exists v1;
CREATE TABLE t1 (
@@ -2620,6 +2620,16 @@ select found_rows();
found_rows()
1
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT);
+(SELECT a, b AS c FROM t1) ORDER BY c+1;
+a c
+(SELECT a, b AS c FROM t1) ORDER BY b+1;
+a c
+SELECT a, b AS c FROM t1 ORDER BY c+1;
+a c
+SELECT a, b AS c FROM t1 ORDER BY b+1;
+a c
+drop table t1;
create table t1(f1 int, f2 int);
create table t2(f3 int);
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1));
@@ -2628,6 +2638,75 @@ select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1));
f1
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL));
f1
+insert into t1 values(1,1),(2,null);
+insert into t2 values(2);
+select * from t1,t2 where f1=f3 and (f1,f2) = (2,null);
+f1 f2 f3
+select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null);
+f1 f2 f3
+2 NULL 2
+drop table t1,t2;
+create table t1 (f1 int not null auto_increment primary key, f2 varchar(10));
+create table t11 like t1;
+insert into t1 values(1,""),(2,"");
+show table status like 't1%';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 MyISAM 10 Dynamic 2 20 X X X X X X X X latin1_swedish_ci NULL
+t11 MyISAM 10 Dynamic 0 0 X X X X X X X X latin1_swedish_ci NULL
+select 123 as a from t1 where f1 is null;
+a
+drop table t1,t11;
+CREATE TABLE t1 (a INT, b INT);
+(SELECT a, b AS c FROM t1) ORDER BY c+1;
+a c
+(SELECT a, b AS c FROM t1) ORDER BY b+1;
+a c
+SELECT a, b AS c FROM t1 ORDER BY c+1;
+a c
+SELECT a, b AS c FROM t1 ORDER BY b+1;
+a c
+drop table t1;
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) );
+INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4);
+CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT );
+INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3);
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+a b c d
+1 2 1 1
+1 2 2 1
+1 2 3 1
+1 10 2
+1 11 2
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c;
+a b c d
+1 10 4
+1 2 1 1
+1 2 2 1
+1 2 3 1
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c;
+a b c d
+1 2 1 1
+1 2 2 1
+1 2 3 1
+1 10 2
+1 11 2
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1
+WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+a b c d
+1 2 1 1
+1 2 2 1
+1 2 3 1
+DROP TABLE IF EXISTS t1, t2;
+create table t1 (f1 int primary key, f2 int);
+create table t2 (f3 int, f4 int, primary key(f3,f4));
+insert into t1 values (1,1);
+insert into t2 values (1,1),(1,2);
+select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
+count(f2) >0
+1
drop table t1,t2;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
@@ -2894,6 +2973,63 @@ NULL
SELECT IFNULL(NULL, NULL);
IFNULL(NULL, NULL)
NULL
+SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE='';
+SHOW LOCAL VARIABLES LIKE 'SQL_MODE';
+Variable_name Value
+sql_mode
+CREATE TABLE BUG_12595(a varchar(100));
+INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%';
+a
+hakan%
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
+a
+hakan%
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
+ERROR HY000: Incorrect arguments to ESCAPE
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE '';
+a
+hakan%
+hakank
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '';
+a
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c;
+a
+ha%an
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%';
+a
+ha%an
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\';
+a
+ha%an
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|';
+a
+ha%an
+SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
+SHOW LOCAL VARIABLES LIKE 'SQL_MODE';
+Variable_name Value
+sql_mode NO_BACKSLASH_ESCAPES
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%';
+a
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
+a
+hakan%
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
+ERROR HY000: Incorrect arguments to ESCAPE
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\';
+ERROR HY000: Incorrect arguments to ESCAPE
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE '';
+ERROR HY000: Incorrect arguments to ESCAPE
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c;
+a
+ha%an
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|';
+a
+ha%an
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n';
+ERROR HY000: Incorrect arguments to ESCAPE
+SET @@SQL_MODE=@OLD_SQL_MODE12595;
+DROP TABLE BUG_12595;
create table t1 (a char(1));
create table t2 (a char(1));
insert into t1 values ('a'),('b'),('c');
@@ -3038,26 +3174,70 @@ id
102
drop table t1, t2;
drop view v1, v2, v3;
-create table a (
-id int(11) not null default '0'
-) engine=myisam default charset=latin1;
-insert into a values (123),(191),(192);
-create table b (
-id char(16) character set utf8 not null default ''
-) engine=myisam default charset=latin1;
-insert into b values ('58013'),('58014'),('58015'),('58016');
-create table c (
-a_id int(11) not null default '0',
-b_id char(16) character set utf8 default null
-) engine=myisam default charset=latin1;
-insert into c values
-(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
+create table t1 (id int(11) not null default '0');
+insert into t1 values (123),(191),(192);
+create table t2 (id char(16) character set utf8 not null);
+insert into t2 values ('58013'),('58014'),('58015'),('58016');
+create table t3 (a_id int(11) not null, b_id char(16) character set utf8);
+insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
select count(*)
-from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id;
+from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id;
count(*)
6
select count(*)
-from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id;
+from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id;
count(*)
6
-drop table a, b, c;
+drop table t1,t2,t3;
+create table t1 (a int);
+create table t2 (b int);
+create table t3 (c int);
+select * from t1 join t2 join t3 on (t1.a=t3.c);
+a b c
+select * from t1 join t2 left join t3 on (t1.a=t3.c);
+a b c
+select * from t1 join t2 right join t3 on (t1.a=t3.c);
+a b c
+select * from t1 join t2 straight_join t3 on (t1.a=t3.c);
+a b c
+drop table t1, t2 ,t3;
+create table t1(f1 int, f2 date);
+insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
+(4,'2005-10-01'),(5,'2005-12-30');
+select * from t1 where f2 >= 0;
+f1 f2
+1 2005-01-01
+2 2005-09-01
+3 2005-09-30
+4 2005-10-01
+5 2005-12-30
+select * from t1 where f2 >= '0000-00-00';
+f1 f2
+1 2005-01-01
+2 2005-09-01
+3 2005-09-30
+4 2005-10-01
+5 2005-12-30
+select * from t1 where f2 >= '2005-09-31';
+f1 f2
+4 2005-10-01
+5 2005-12-30
+select * from t1 where f2 >= '2005-09-3a';
+f1 f2
+4 2005-10-01
+5 2005-12-30
+Warnings:
+Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
+select * from t1 where f2 <= '2005-09-31';
+f1 f2
+1 2005-01-01
+2 2005-09-01
+3 2005-09-30
+select * from t1 where f2 <= '2005-09-3a';
+f1 f2
+1 2005-01-01
+2 2005-09-01
+3 2005-09-30
+Warnings:
+Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1
+drop table t1;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index c143c7f0f29..fdb0db602ff 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -512,6 +512,13 @@ t1 CREATE TABLE `t1` (
KEY `c2` USING BTREE (`c2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
+flush tables;
+SHOW TABLE STATUS like 't1';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
+show create table t1;
+ERROR HY000: Incorrect information in file: './test/t1.frm'
+drop table t1;
CREATE TABLE txt1(a int);
CREATE TABLE tyt2(a int);
CREATE TABLE urkunde(a int);
diff --git a/mysql-test/r/skip_grants.result b/mysql-test/r/skip_grants.result
index c1c31eb91c9..4d723f8e12a 100644
--- a/mysql-test/r/skip_grants.result
+++ b/mysql-test/r/skip_grants.result
@@ -8,3 +8,7 @@ ERROR HY000: View definer is not fully qualified
drop table t1;
create procedure f1() select 1;
drop procedure f1;
+create table t1 (a int);
+create definer='user'@'host' sql security definer view v1 as select * from t1;
+drop view v1;
+drop table t1;
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 05b6a2788ea..50ff7ea264a 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -444,9 +444,9 @@ set b = a;
end if;
end|
call bug2653_1(1, @b)|
-ERROR 42S22: Unknown column 'aa' in 'order clause'
+ERROR 42S22: Unknown column 'aa' in 'field list'
call bug2653_2(2, @b)|
-ERROR 42S22: Unknown column 'aa' in 'order clause'
+ERROR 42S22: Unknown column 'aa' in 'field list'
drop procedure bug2653_1|
drop procedure bug2653_2|
create procedure bug4344() drop procedure bug4344|
@@ -834,3 +834,85 @@ ERROR HY000: Not allowed to set autocommit from a stored function or trigger
create trigger bug12712
before insert on t1 for each row set session autocommit = 0;
ERROR HY000: Not allowed to set autocommit from a stored function or trigger
+drop procedure if exists bug13510_1|
+drop procedure if exists bug13510_2|
+drop procedure if exists bug13510_3|
+drop procedure if exists bug13510_4|
+create procedure bug13510_1()
+begin
+declare password varchar(10);
+set password = 'foo1';
+select password;
+end|
+ERROR 42000: Variable 'password' must be quoted with `...`, or renamed
+create procedure bug13510_2()
+begin
+declare names varchar(10);
+set names = 'foo2';
+select names;
+end|
+ERROR 42000: Variable 'names' must be quoted with `...`, or renamed
+create procedure bug13510_3()
+begin
+declare password varchar(10);
+set `password` = 'foo3';
+select password;
+end|
+create procedure bug13510_4()
+begin
+declare names varchar(10);
+set `names` = 'foo4';
+select names;
+end|
+call bug13510_3()|
+password
+foo3
+call bug13510_4()|
+names
+foo4
+drop procedure bug13510_3|
+drop procedure bug13510_4|
+create database mysqltest1;
+use mysqltest1;
+drop database mysqltest1;
+create function f1() returns int return 1;
+ERROR 3D000: No database selected
+create procedure p1(out param1 int)
+begin
+select count(*) into param1 from t3;
+end|
+ERROR 3D000: No database selected
+use test;
+DROP PROCEDURE IF EXISTS bug13037_p1;
+DROP PROCEDURE IF EXISTS bug13037_p2;
+DROP PROCEDURE IF EXISTS bug13037_p3;
+CREATE PROCEDURE bug13037_p1()
+BEGIN
+IF bug13037_foo THEN
+SELECT 1;
+END IF;
+END|
+CREATE PROCEDURE bug13037_p2()
+BEGIN
+SET @bug13037_foo = bug13037_bar;
+END|
+CREATE PROCEDURE bug13037_p3()
+BEGIN
+SELECT bug13037_foo;
+END|
+
+CALL bug13037_p1();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+CALL bug13037_p2();
+ERROR 42S22: Unknown column 'bug13037_bar' in 'field list'
+CALL bug13037_p3();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+CALL bug13037_p1();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+CALL bug13037_p2();
+ERROR 42S22: Unknown column 'bug13037_bar' in 'field list'
+CALL bug13037_p3();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+DROP PROCEDURE bug13037_p1;
+DROP PROCEDURE bug13037_p2;
+DROP PROCEDURE bug13037_p3;
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index eb2e2ce334e..614e670f25d 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -251,3 +251,15 @@ drop procedure mysqltest_1.p1;
drop database mysqltest_1;
revoke usage on *.* from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
+drop function if exists bug12812|
+create function bug12812() returns char(2)
+begin
+return 'ok';
+end;
+create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
+SELECT test.bug12812()|
+ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
+CREATE VIEW v1 AS SELECT test.bug12812()|
+ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
+DROP USER user_bug12812@localhost|
+drop function bug12812|
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 1b8cde6d3db..d50e6dd3751 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -1032,7 +1032,7 @@ a f8()
3 1
drop function f1|
select * from v1|
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
create function f1() returns int
return (select sum(data) from t1) + (select sum(data) from v1)|
drop function f1|
@@ -1916,7 +1916,7 @@ select bug3788()|
bug3788()
2005-03-04
drop function bug3788|
-create function bug3788() returns binary(5) return 5|
+create function bug3788() returns binary(1) return 5|
select bug3788()|
bug3788()
5
@@ -3206,18 +3206,6 @@ set f1= concat( 'hello', f1 );
return f1;
end|
drop function bug9048|
-drop function if exists bug12812|
-create function bug12812() returns char(2)
-begin
-return 'ok';
-end;
-create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
-SELECT test.bug12812()|
-ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
-CREATE VIEW v1 AS SELECT test.bug12812()|
-ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
-DROP USER user_bug12812@localhost|
-drop function bug12812|
drop procedure if exists bug12849_1|
create procedure bug12849_1(inout x char) select x into x|
set @var='a'|
@@ -3312,17 +3300,11 @@ call bug12379_1()|
bug12379()
42
42
-Warnings:
-Error 1062 Duplicate entry 'X' for key 1
-Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select 2|
2
2
call bug12379_2()|
bug12379()
-Warnings:
-Error 1062 Duplicate entry 'X' for key 1
-Warning 1417 A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes
select 3|
3
3
@@ -3435,4 +3417,204 @@ Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(6,3) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table if exists t3|
+drop procedure if exists bug7049_1|
+drop procedure if exists bug7049_2|
+drop procedure if exists bug7049_3|
+drop procedure if exists bug7049_4|
+drop procedure if exists bug7049_5|
+drop procedure if exists bug7049_6|
+drop function if exists bug7049_1|
+drop function if exists bug7049_2|
+create table t3 ( x int unique )|
+create procedure bug7049_1()
+begin
+insert into t3 values (42);
+insert into t3 values (42);
+end|
+create procedure bug7049_2()
+begin
+declare exit handler for sqlexception
+select 'Caught it' as 'Result';
+call bug7049_1();
+select 'Missed it' as 'Result';
+end|
+create procedure bug7049_3()
+call bug7049_1()|
+create procedure bug7049_4()
+begin
+declare exit handler for sqlexception
+select 'Caught it' as 'Result';
+call bug7049_3();
+select 'Missed it' as 'Result';
+end|
+create procedure bug7049_5()
+begin
+declare x decimal(2,1);
+set x = 'zap';
+end|
+create procedure bug7049_6()
+begin
+declare exit handler for sqlwarning
+select 'Caught it' as 'Result';
+call bug7049_5();
+select 'Missed it' as 'Result';
+end|
+create function bug7049_1()
+returns int
+begin
+insert into t3 values (42);
+insert into t3 values (42);
+return 42;
+end|
+create function bug7049_2()
+returns int
+begin
+declare x int default 0;
+declare continue handler for sqlexception
+set x = 1;
+set x = bug7049_1();
+return x;
+end|
+call bug7049_2()|
+Result
+Caught it
+select * from t3|
+x
+42
+delete from t3|
+call bug7049_4()|
+Result
+Caught it
+select * from t3|
+x
+42
+call bug7049_6()|
+Result
+Caught it
+select bug7049_2()|
+bug7049_2()
+1
+drop table t3|
+drop procedure bug7049_1|
+drop procedure bug7049_2|
+drop procedure bug7049_3|
+drop procedure bug7049_4|
+drop procedure bug7049_5|
+drop procedure bug7049_6|
+drop function bug7049_1|
+drop function bug7049_2|
+drop function if exists bug13941|
+drop procedure if exists bug13941|
+create function bug13941(p_input_str text)
+returns text
+begin
+declare p_output_str text;
+set p_output_str = p_input_str;
+set p_output_str = replace(p_output_str, 'xyzzy', 'plugh');
+set p_output_str = replace(p_output_str, 'test', 'prova');
+set p_output_str = replace(p_output_str, 'this', 'questo');
+set p_output_str = replace(p_output_str, ' a ', 'una ');
+set p_output_str = replace(p_output_str, 'is', '');
+return p_output_str;
+end|
+create procedure bug13941(out sout varchar(128))
+begin
+set sout = 'Local';
+set sout = ifnull(sout, 'DEF');
+end|
+select bug13941('this is a test')|
+bug13941('this is a test')
+questo una prova
+call bug13941(@a)|
+select @a|
+@a
+Local
+drop function bug13941|
+drop procedure bug13941|
+DROP PROCEDURE IF EXISTS bug13095;
+DROP TABLE IF EXISTS bug13095_t1;
+DROP VIEW IF EXISTS bug13095_v1;
+CREATE PROCEDURE bug13095(tbl_name varchar(32))
+BEGIN
+SET @str =
+CONCAT("CREATE TABLE ", tbl_name, "(stuff char(15))");
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+SET @str =
+CONCAT("INSERT INTO ", tbl_name, " VALUES('row1'),('row2'),('row3')" );
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+SET @str =
+CONCAT("CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM ", tbl_name);
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+SELECT * FROM bug13095_v1;
+SET @str =
+"DROP VIEW bug13095_v1";
+SELECT @str;
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+END|
+CALL bug13095('bug13095_t1');
+@str
+CREATE TABLE bug13095_t1(stuff char(15))
+@str
+INSERT INTO bug13095_t1 VALUES('row1'),('row2'),('row3')
+@str
+CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM bug13095_t1
+c1
+row1
+row2
+row3
+@str
+DROP VIEW bug13095_v1
+DROP PROCEDURE IF EXISTS bug13095;
+DROP VIEW IF EXISTS bug13095_v1;
+DROP TABLE IF EXISTS bug13095_t1;
+drop procedure if exists bug14210|
+set @@session.max_heap_table_size=16384|
+select @@session.max_heap_table_size|
+@@session.max_heap_table_size
+16384
+create table t3 (a char(255)) engine=InnoDB|
+create procedure bug14210_fill_table()
+begin
+declare table_size, max_table_size int default 0;
+select @@session.max_heap_table_size into max_table_size;
+delete from t3;
+insert into t3 (a) values (repeat('a', 255));
+repeat
+insert into t3 select a from t3;
+select count(*)*255 from t3 into table_size;
+until table_size > max_table_size*2 end repeat;
+end|
+call bug14210_fill_table()|
+drop procedure bug14210_fill_table|
+create table t4 like t3|
+create procedure bug14210()
+begin
+declare a char(255);
+declare done int default 0;
+declare c cursor for select * from t3;
+declare continue handler for sqlstate '02000' set done = 1;
+open c;
+repeat
+fetch c into a;
+if not done then
+insert into t4 values (upper(a));
+end if;
+until done end repeat;
+close c;
+end|
+call bug14210()|
+select count(*) from t4|
+count(*)
+256
+drop table t3, t4|
+drop procedure bug14210|
+set @@session.max_heap_table_size=default|
drop table t1,t2;
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index 83099623e23..7d9d7fb333c 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -1,4 +1,5 @@
-drop table if exists t1;
+drop table if exists t1,t2,v1,v2;
+drop view if exists t1,t2,v1,v2;
CREATE TABLE `t1` (
a int not null auto_increment,
`pseudo` varchar(35) character set latin2 NOT NULL default '',
diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result
new file mode 100644
index 00000000000..bb7297d6807
--- /dev/null
+++ b/mysql-test/r/ssl.result
@@ -0,0 +1,2159 @@
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+drop table if exists t1,t2,t3,t4;
+CREATE TABLE t1 (
+Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+);
+INSERT INTO t1 VALUES (9410,9412);
+select period from t1;
+period
+9410
+select * from t1;
+Period Varor_period
+9410 9412
+select t1.* from t1;
+Period Varor_period
+9410 9412
+CREATE TABLE t2 (
+auto int not null auto_increment,
+fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+fld3 char(30) DEFAULT '' NOT NULL,
+fld4 char(35) DEFAULT '' NOT NULL,
+fld5 char(35) DEFAULT '' NOT NULL,
+fld6 char(4) DEFAULT '' NOT NULL,
+UNIQUE fld1 (fld1),
+KEY fld3 (fld3),
+PRIMARY KEY (auto)
+);
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+imaginable
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+cultivation
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3,not_used);
+ERROR 42000: Key column 'not_used' doesn't exist in table
+explain select fld3 from t2 use index (not_used);
+ERROR 42000: Key column 'not_used' doesn't exist in table
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+honeysuckle
+honoring
+explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+148504 Colombo
+068305 Colombo
+000000 nondecreasing
+select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
+fld1 fld3
+232605 appendixes
+1232605 appendixes
+1232606 appendixes
+1232607 appendixes
+1232608 appendixes
+1232609 appendixes
+select fld1 from t2 where fld1=250501 or fld1="250502";
+fld1
+250501
+250502
+explain select fld1 from t2 where fld1=250501 or fld1="250502";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index
+select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+fld1
+250501
+250502
+250505
+250601
+explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+fld1 fld3
+218401 faithful
+018007 fanatic
+228311 fated
+018017 featherweight
+218022 feed
+088303 feminine
+058004 Fenton
+038017 fetched
+018054 fetters
+208101 fiftieth
+238007 filial
+013606 fingerings
+218008 finishers
+038205 firearm
+188505 fitting
+202301 Fitzpatrick
+238008 fixedly
+012001 flanking
+018103 flint
+018104 flopping
+188007 flurried
+013602 foldout
+226205 foothill
+232102 forgivably
+228306 forthcoming
+186002 freakish
+208113 freest
+231315 freezes
+036002 funereal
+226209 furnishings
+198006 furthermore
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+fld3
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+fld3
+Chantilly
+select fld1,fld3 from t2 where fld1 like "25050%";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select fld1,fld3 from t2 where fld1 like "25050_";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select distinct companynr from t2;
+companynr
+00
+37
+36
+50
+58
+29
+40
+53
+65
+41
+34
+68
+select distinct companynr from t2 order by companynr;
+companynr
+00
+29
+34
+36
+37
+40
+41
+50
+53
+58
+65
+68
+select distinct companynr from t2 order by companynr desc;
+companynr
+68
+65
+58
+53
+50
+41
+40
+37
+36
+34
+29
+00
+select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
+fld3 period
+obliterates 9410
+offload 9410
+opaquely 9410
+organizer 9410
+overestimating 9410
+overlay 9410
+select distinct fld3 from t2 where companynr = 34 order by fld3;
+fld3
+absentee
+accessed
+ahead
+alphabetic
+Asiaticizations
+attitude
+aye
+bankruptcies
+belays
+Blythe
+bomb
+boulevard
+bulldozes
+cannot
+caressing
+charcoal
+checksumming
+chess
+clubroom
+colorful
+cosy
+creator
+crying
+Darius
+diffusing
+duality
+Eiffel
+Epiphany
+Ernestine
+explorers
+exterminated
+famine
+forked
+Gershwins
+heaving
+Hodges
+Iraqis
+Italianization
+Lagos
+landslide
+libretto
+Majorca
+mastering
+narrowed
+occurred
+offerers
+Palestine
+Peruvianizes
+pharmaceutic
+poisoning
+population
+Pygmalion
+rats
+realest
+recording
+regimented
+retransmitting
+reviver
+rouses
+scars
+sicker
+sleepwalk
+stopped
+sugars
+translatable
+uncles
+unexpected
+uprisings
+versatility
+vest
+select distinct fld3 from t2 limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct fld3 from t2 having fld3 like "A%" limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+Adl
+adm
+Ado
+ads
+adv
+aer
+aff
+afi
+afl
+afo
+agi
+ahe
+aim
+air
+Ald
+alg
+ali
+all
+alp
+alr
+ama
+ame
+amm
+ana
+and
+ane
+Ang
+ani
+Ann
+Ant
+api
+app
+aqu
+Ara
+arc
+Arm
+arr
+Art
+Asi
+ask
+asp
+ass
+ast
+att
+aud
+Aug
+aut
+ave
+avo
+awe
+aye
+Azt
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+create table t3 (
+period int not null,
+name char(32) not null,
+companynr int not null,
+price double(11,0),
+price2 double(11,0),
+key (period),
+key (name)
+);
+create temporary table tmp engine = myisam select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+alter table t3 add t2nr int not null auto_increment primary key first;
+drop table tmp;
+SET SQL_BIG_TABLES=1;
+select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
+namn
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+SET SQL_BIG_TABLES=0;
+select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
+concat(fld3," ",fld3)
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+select distinct fld5 from t2 limit 10;
+fld5
+neat
+Steinberg
+jarring
+tinily
+balled
+persist
+attainments
+fanatic
+measures
+rightfulness
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=1;
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=0;
+select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
+fld3 repeat("a",length(fld3)) count(*)
+circus aaaaaa 1
+cited aaaaa 1
+Colombo aaaaaaa 1
+congresswoman aaaaaaaaaaaaa 1
+contrition aaaaaaaaaa 1
+corny aaaaa 1
+cultivation aaaaaaaaaaa 1
+definiteness aaaaaaaaaaaa 1
+demultiplex aaaaaaaaaaa 1
+disappointing aaaaaaaaaaaaa 1
+select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
+companynr rtrim(space(512+companynr))
+37
+78
+101
+154
+311
+447
+512
+select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
+fld3
+explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index period period 4 NULL 41810
+1 SIMPLE t1 ref period period 4 test.t3.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+select period from t1;
+period
+9410
+select period from t1 where period=1900;
+period
+select fld3,period from t1,t2 where fld1 = 011401 order by period;
+fld3 period
+breaking 9410
+select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
+fld3 period
+breaking 1001
+explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const fld1 fld1 4 const 1
+1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1
+select fld3,period from t2,t1 where companynr*10 = 37*10;
+fld3 period
+breaking 9410
+Romans 9410
+intercepted 9410
+bewilderingly 9410
+astound 9410
+admonishing 9410
+sumac 9410
+flanking 9410
+combed 9410
+subjective 9410
+scatterbrain 9410
+Eulerian 9410
+Kane 9410
+overlay 9410
+perturb 9410
+goblins 9410
+annihilates 9410
+Wotan 9410
+snatching 9410
+concludes 9410
+laterally 9410
+yelped 9410
+grazing 9410
+Baird 9410
+celery 9410
+misunderstander 9410
+handgun 9410
+foldout 9410
+mystic 9410
+succumbed 9410
+Nabisco 9410
+fingerings 9410
+aging 9410
+afield 9410
+ammonium 9410
+boat 9410
+intelligibility 9410
+Augustine 9410
+teethe 9410
+dreaded 9410
+scholastics 9410
+audiology 9410
+wallet 9410
+parters 9410
+eschew 9410
+quitter 9410
+neat 9410
+Steinberg 9410
+jarring 9410
+tinily 9410
+balled 9410
+persist 9410
+attainments 9410
+fanatic 9410
+measures 9410
+rightfulness 9410
+capably 9410
+impulsive 9410
+starlet 9410
+terminators 9410
+untying 9410
+announces 9410
+featherweight 9410
+pessimist 9410
+daughter 9410
+decliner 9410
+lawgiver 9410
+stated 9410
+readable 9410
+attrition 9410
+cascade 9410
+motors 9410
+interrogate 9410
+pests 9410
+stairway 9410
+dopers 9410
+testicle 9410
+Parsifal 9410
+leavings 9410
+postulation 9410
+squeaking 9410
+contrasted 9410
+leftover 9410
+whiteners 9410
+erases 9410
+Punjab 9410
+Merritt 9410
+Quixotism 9410
+sweetish 9410
+dogging 9410
+scornfully 9410
+bellow 9410
+bills 9410
+cupboard 9410
+sureties 9410
+puddings 9410
+fetters 9410
+bivalves 9410
+incurring 9410
+Adolph 9410
+pithed 9410
+Miles 9410
+trimmings 9410
+tragedies 9410
+skulking 9410
+flint 9410
+flopping 9410
+relaxing 9410
+offload 9410
+suites 9410
+lists 9410
+animized 9410
+multilayer 9410
+standardizes 9410
+Judas 9410
+vacuuming 9410
+dentally 9410
+humanness 9410
+inch 9410
+Weissmuller 9410
+irresponsibly 9410
+luckily 9410
+culled 9410
+medical 9410
+bloodbath 9410
+subschema 9410
+animals 9410
+Micronesia 9410
+repetitions 9410
+Antares 9410
+ventilate 9410
+pityingly 9410
+interdependent 9410
+Graves 9410
+neonatal 9410
+chafe 9410
+honoring 9410
+realtor 9410
+elite 9410
+funereal 9410
+abrogating 9410
+sorters 9410
+Conley 9410
+lectured 9410
+Abraham 9410
+Hawaii 9410
+cage 9410
+hushes 9410
+Simla 9410
+reporters 9410
+Dutchman 9410
+descendants 9410
+groupings 9410
+dissociate 9410
+coexist 9410
+Beebe 9410
+Taoism 9410
+Connally 9410
+fetched 9410
+checkpoints 9410
+rusting 9410
+galling 9410
+obliterates 9410
+traitor 9410
+resumes 9410
+analyzable 9410
+terminator 9410
+gritty 9410
+firearm 9410
+minima 9410
+Selfridge 9410
+disable 9410
+witchcraft 9410
+betroth 9410
+Manhattanize 9410
+imprint 9410
+peeked 9410
+swelling 9410
+interrelationships 9410
+riser 9410
+Gandhian 9410
+peacock 9410
+bee 9410
+kanji 9410
+dental 9410
+scarf 9410
+chasm 9410
+insolence 9410
+syndicate 9410
+alike 9410
+imperial 9410
+convulsion 9410
+railway 9410
+validate 9410
+normalizes 9410
+comprehensive 9410
+chewing 9410
+denizen 9410
+schemer 9410
+chronicle 9410
+Kline 9410
+Anatole 9410
+partridges 9410
+brunch 9410
+recruited 9410
+dimensions 9410
+Chicana 9410
+announced 9410
+praised 9410
+employing 9410
+linear 9410
+quagmire 9410
+western 9410
+relishing 9410
+serving 9410
+scheduling 9410
+lore 9410
+eventful 9410
+arteriole 9410
+disentangle 9410
+cured 9410
+Fenton 9410
+avoidable 9410
+drains 9410
+detectably 9410
+husky 9410
+impelling 9410
+undoes 9410
+evened 9410
+squeezes 9410
+destroyer 9410
+rudeness 9410
+beaner 9410
+boorish 9410
+Everhart 9410
+encompass 9410
+mushrooms 9410
+Alison 9410
+externally 9410
+pellagra 9410
+cult 9410
+creek 9410
+Huffman 9410
+Majorca 9410
+governing 9410
+gadfly 9410
+reassigned 9410
+intentness 9410
+craziness 9410
+psychic 9410
+squabbled 9410
+burlesque 9410
+capped 9410
+extracted 9410
+DiMaggio 9410
+exclamation 9410
+subdirectory 9410
+Gothicism 9410
+feminine 9410
+metaphysically 9410
+sanding 9410
+Miltonism 9410
+freakish 9410
+index 9410
+straight 9410
+flurried 9410
+denotative 9410
+coming 9410
+commencements 9410
+gentleman 9410
+gifted 9410
+Shanghais 9410
+sportswriting 9410
+sloping 9410
+navies 9410
+leaflet 9410
+shooter 9410
+Joplin 9410
+babies 9410
+assails 9410
+admiring 9410
+swaying 9410
+Goldstine 9410
+fitting 9410
+Norwalk 9410
+analogy 9410
+deludes 9410
+cokes 9410
+Clayton 9410
+exhausts 9410
+causality 9410
+sating 9410
+icon 9410
+throttles 9410
+communicants 9410
+dehydrate 9410
+priceless 9410
+publicly 9410
+incidentals 9410
+commonplace 9410
+mumbles 9410
+furthermore 9410
+cautioned 9410
+parametrized 9410
+registration 9410
+sadly 9410
+positioning 9410
+babysitting 9410
+eternal 9410
+hoarder 9410
+congregates 9410
+rains 9410
+workers 9410
+sags 9410
+unplug 9410
+garage 9410
+boulder 9410
+specifics 9410
+Teresa 9410
+Winsett 9410
+convenient 9410
+buckboards 9410
+amenities 9410
+resplendent 9410
+sews 9410
+participated 9410
+Simon 9410
+certificates 9410
+Fitzpatrick 9410
+Evanston 9410
+misted 9410
+textures 9410
+save 9410
+count 9410
+rightful 9410
+chaperone 9410
+Lizzy 9410
+clenched 9410
+effortlessly 9410
+accessed 9410
+beaters 9410
+Hornblower 9410
+vests 9410
+indulgences 9410
+infallibly 9410
+unwilling 9410
+excrete 9410
+spools 9410
+crunches 9410
+overestimating 9410
+ineffective 9410
+humiliation 9410
+sophomore 9410
+star 9410
+rifles 9410
+dialysis 9410
+arriving 9410
+indulge 9410
+clockers 9410
+languages 9410
+Antarctica 9410
+percentage 9410
+ceiling 9410
+specification 9410
+regimented 9410
+ciphers 9410
+pictures 9410
+serpents 9410
+allot 9410
+realized 9410
+mayoral 9410
+opaquely 9410
+hostess 9410
+fiftieth 9410
+incorrectly 9410
+decomposition 9410
+stranglings 9410
+mixture 9410
+electroencephalography 9410
+similarities 9410
+charges 9410
+freest 9410
+Greenberg 9410
+tinting 9410
+expelled 9410
+warm 9410
+smoothed 9410
+deductions 9410
+Romano 9410
+bitterroot 9410
+corset 9410
+securing 9410
+environing 9410
+cute 9410
+Crays 9410
+heiress 9410
+inform 9410
+avenge 9410
+universals 9410
+Kinsey 9410
+ravines 9410
+bestseller 9410
+equilibrium 9410
+extents 9410
+relatively 9410
+pressure 9410
+critiques 9410
+befouled 9410
+rightfully 9410
+mechanizing 9410
+Latinizes 9410
+timesharing 9410
+Aden 9410
+embassies 9410
+males 9410
+shapelessly 9410
+mastering 9410
+Newtonian 9410
+finishers 9410
+abates 9410
+teem 9410
+kiting 9410
+stodgy 9410
+feed 9410
+guitars 9410
+airships 9410
+store 9410
+denounces 9410
+Pyle 9410
+Saxony 9410
+serializations 9410
+Peruvian 9410
+taxonomically 9410
+kingdom 9410
+stint 9410
+Sault 9410
+faithful 9410
+Ganymede 9410
+tidiness 9410
+gainful 9410
+contrary 9410
+Tipperary 9410
+tropics 9410
+theorizers 9410
+renew 9410
+already 9410
+terminal 9410
+Hegelian 9410
+hypothesizer 9410
+warningly 9410
+journalizing 9410
+nested 9410
+Lars 9410
+saplings 9410
+foothill 9410
+labeled 9410
+imperiously 9410
+reporters 9410
+furnishings 9410
+precipitable 9410
+discounts 9410
+excises 9410
+Stalin 9410
+despot 9410
+ripeness 9410
+Arabia 9410
+unruly 9410
+mournfulness 9410
+boom 9410
+slaughter 9410
+Sabine 9410
+handy 9410
+rural 9410
+organizer 9410
+shipyard 9410
+civics 9410
+inaccuracy 9410
+rules 9410
+juveniles 9410
+comprised 9410
+investigations 9410
+stabilizes 9410
+seminaries 9410
+Hunter 9410
+sporty 9410
+test 9410
+weasels 9410
+CERN 9410
+tempering 9410
+afore 9410
+Galatean 9410
+techniques 9410
+error 9410
+veranda 9410
+severely 9410
+Cassites 9410
+forthcoming 9410
+guides 9410
+vanish 9410
+lied 9410
+sawtooth 9410
+fated 9410
+gradually 9410
+widens 9410
+preclude 9410
+evenhandedly 9410
+percentage 9410
+disobedience 9410
+humility 9410
+gleaning 9410
+petted 9410
+bloater 9410
+minion 9410
+marginal 9410
+apiary 9410
+measures 9410
+precaution 9410
+repelled 9410
+primary 9410
+coverings 9410
+Artemia 9410
+navigate 9410
+spatial 9410
+Gurkha 9410
+meanwhile 9410
+Melinda 9410
+Butterfield 9410
+Aldrich 9410
+previewing 9410
+glut 9410
+unaffected 9410
+inmate 9410
+mineral 9410
+impending 9410
+meditation 9410
+ideas 9410
+miniaturizes 9410
+lewdly 9410
+title 9410
+youthfulness 9410
+creak 9410
+Chippewa 9410
+clamored 9410
+freezes 9410
+forgivably 9410
+reduce 9410
+McGovern 9410
+Nazis 9410
+epistle 9410
+socializes 9410
+conceptions 9410
+Kevin 9410
+uncovering 9410
+chews 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+raining 9410
+infest 9410
+compartment 9410
+minting 9410
+ducks 9410
+roped 9410
+waltz 9410
+Lillian 9410
+repressions 9410
+chillingly 9410
+noncritical 9410
+lithograph 9410
+spongers 9410
+parenthood 9410
+posed 9410
+instruments 9410
+filial 9410
+fixedly 9410
+relives 9410
+Pandora 9410
+watering 9410
+ungrateful 9410
+secures 9410
+poison 9410
+dusted 9410
+encompasses 9410
+presentation 9410
+Kantian 9410
+select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
+fld3 period price price2
+admonishing 1002 28357832 8723648
+analyzable 1002 28357832 8723648
+annihilates 1001 5987435 234724
+Antares 1002 28357832 8723648
+astound 1001 5987435 234724
+audiology 1001 5987435 234724
+Augustine 1002 28357832 8723648
+Baird 1002 28357832 8723648
+bewilderingly 1001 5987435 234724
+breaking 1001 5987435 234724
+Conley 1001 5987435 234724
+dentally 1002 28357832 8723648
+dissociate 1002 28357832 8723648
+elite 1001 5987435 234724
+eschew 1001 5987435 234724
+Eulerian 1001 5987435 234724
+flanking 1001 5987435 234724
+foldout 1002 28357832 8723648
+funereal 1002 28357832 8723648
+galling 1002 28357832 8723648
+Graves 1001 5987435 234724
+grazing 1001 5987435 234724
+groupings 1001 5987435 234724
+handgun 1001 5987435 234724
+humility 1002 28357832 8723648
+impulsive 1002 28357832 8723648
+inch 1001 5987435 234724
+intelligibility 1001 5987435 234724
+jarring 1001 5987435 234724
+lawgiver 1001 5987435 234724
+lectured 1002 28357832 8723648
+Merritt 1002 28357832 8723648
+neonatal 1001 5987435 234724
+offload 1002 28357832 8723648
+parters 1002 28357832 8723648
+pityingly 1002 28357832 8723648
+puddings 1002 28357832 8723648
+Punjab 1001 5987435 234724
+quitter 1002 28357832 8723648
+realtor 1001 5987435 234724
+relaxing 1001 5987435 234724
+repetitions 1001 5987435 234724
+resumes 1001 5987435 234724
+Romans 1002 28357832 8723648
+rusting 1001 5987435 234724
+scholastics 1001 5987435 234724
+skulking 1002 28357832 8723648
+stated 1002 28357832 8723648
+suites 1002 28357832 8723648
+sureties 1001 5987435 234724
+testicle 1002 28357832 8723648
+tinily 1002 28357832 8723648
+tragedies 1001 5987435 234724
+trimmings 1001 5987435 234724
+vacuuming 1001 5987435 234724
+ventilate 1001 5987435 234724
+wallet 1001 5987435 234724
+Weissmuller 1002 28357832 8723648
+Wotan 1002 28357832 8723648
+select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
+fld1 fld3 period price price2
+018201 relaxing 1001 5987435 234724
+018601 vacuuming 1001 5987435 234724
+018801 inch 1001 5987435 234724
+018811 repetitions 1001 5987435 234724
+create table t4 (
+companynr tinyint(2) unsigned zerofill NOT NULL default '00',
+companyname char(30) NOT NULL default '',
+PRIMARY KEY (companynr),
+UNIQUE KEY companyname(companyname)
+) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select * from t1,t1 t12;
+Period Varor_period Period Varor_period
+9410 9412 9410 9412
+select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
+fld1 fld1
+250501 250501
+250502 250501
+250503 250501
+250504 250501
+250505 250501
+250501 250502
+250502 250502
+250503 250502
+250504 250502
+250505 250502
+250501 250503
+250502 250503
+250503 250503
+250504 250503
+250505 250503
+250501 250504
+250502 250504
+250503 250504
+250504 250504
+250505 250504
+250501 250505
+250502 250505
+250503 250505
+250504 250505
+250505 250505
+insert into t2 (fld1, companynr) values (999999,99);
+select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+companynr companyname
+99 NULL
+select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
+count(*)
+1199
+explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists
+select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+companynr companyname
+select count(*) from t2 left join t4 using (companynr) where companynr is not null;
+count(*)
+1200
+explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+delete from t2 where fld1=999999;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+companynr companynr
+37 36
+41 40
+explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
+period
+9410
+select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
+period
+9410
+select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
+fld1
+250501
+250502
+250503
+250505
+select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
+fld1
+250502
+250503
+select fld1 from t2 where fld1 between 250502 and 250504;
+fld1
+250502
+250503
+250504
+select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
+fld3
+label
+labeled
+labeled
+landslide
+laterally
+leaflet
+lewdly
+Lillian
+luckily
+select count(*) from t1;
+count(*)
+1
+select companynr,count(*),sum(fld1) from t2 group by companynr;
+companynr count(*) sum(fld1)
+00 82 10355753
+29 95 14473298
+34 70 17788966
+36 215 22786296
+37 588 83602098
+40 37 6618386
+41 52 12816335
+50 11 1595438
+53 4 793210
+58 23 2254293
+65 10 2284055
+68 12 3097288
+select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
+companynr count(*)
+68 12
+65 10
+58 23
+53 4
+50 11
+select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+Warnings:
+Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1''))
+select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
+companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087
+29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026
+34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
+companynr count(price) sum(price) min(price) max(price) avg(price)
+37 12543 309394878010 5987435 39654943 24666736.6667
+78 8362 414611089292 726498 98439034 49582766.0000
+101 4181 3489454238 834598 834598 834598.0000
+154 4181 4112197254950 983543950 983543950 983543950.0000
+311 4181 979599938 234298 234298 234298.0000
+447 4181 9929180954 2374834 2374834 2374834.0000
+512 4181 3288532102 786542 786542 786542.0000
+select distinct mod(companynr,10) from t4 group by companynr;
+mod(companynr,10)
+0
+9
+4
+6
+7
+1
+3
+8
+5
+select distinct 1 from t4 group by companynr;
+1
+1
+select count(distinct fld1) from t2;
+count(distinct fld1)
+1199
+select companynr,count(distinct fld1) from t2 group by companynr;
+companynr count(distinct fld1)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(*) from t2 group by companynr;
+companynr count(*)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,1000)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,200)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
+companynr count(distinct floor(fld1/100))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
+companynr count(distinct concat(repeat(65,1000),floor(fld1/100)))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
+sum(fld1) fld3
+11402 Romans
+select name,count(*) from t3 where name='cloakroom' group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
+name count(*)
+cloakroom 4181
+select count(*) from t3 where name='cloakroom' and price2=823742;
+count(*)
+4181
+select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
+name count(*)
+extramarital 4181
+gazer 4181
+gems 4181
+Iranizes 4181
+spates 4181
+tucked 4181
+violinist 4181
+select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld3 count(*)
+spates 4181
+select companynr|0,companyname from t4 group by 1;
+companynr|0 companyname
+0 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
+companynr companyname count(*)
+29 company 1 95
+68 company 10 12
+50 company 11 11
+34 company 2 70
+36 company 3 215
+37 company 4 588
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+00 Unknown 82
+select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld1 count(*)
+158402 4181
+select sum(Period)/count(*) from t1;
+sum(Period)/count(*)
+9410.0000
+select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
+companynr count sum diff func
+37 12543 309394878010 0.0000 464091
+78 8362 414611089292 0.0000 652236
+101 4181 3489454238 0.0000 422281
+154 4181 4112197254950 0.0000 643874
+311 4181 979599938 0.0000 1300291
+447 4181 9929180954 0.0000 1868907
+512 4181 3288532102 0.0000 2140672
+select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
+companynr avg
+154 983543950.0000
+select companynr,count(*) from t2 group by companynr order by 2 desc;
+companynr count(*)
+37 588
+36 215
+29 95
+00 82
+34 70
+41 52
+40 37
+58 23
+68 12
+50 11
+65 10
+53 4
+select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
+companynr count(*)
+41 52
+58 23
+68 12
+50 11
+65 10
+53 4
+select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
+fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)
+teethe 000001 1 5987435 5987435 5987435 5987435.0000
+dreaded 011401 1 5987435 5987435 5987435 5987435.0000
+scholastics 011402 1 28357832 28357832 28357832 28357832.0000
+audiology 011403 1 39654943 39654943 39654943 39654943.0000
+wallet 011501 1 5987435 5987435 5987435 5987435.0000
+parters 011701 1 5987435 5987435 5987435 5987435.0000
+eschew 011702 1 28357832 28357832 28357832 28357832.0000
+quitter 011703 1 39654943 39654943 39654943 39654943.0000
+neat 012001 1 5987435 5987435 5987435 5987435.0000
+Steinberg 012003 1 39654943 39654943 39654943 39654943.0000
+balled 012301 1 5987435 5987435 5987435 5987435.0000
+persist 012302 1 28357832 28357832 28357832 28357832.0000
+attainments 012303 1 39654943 39654943 39654943 39654943.0000
+capably 012501 1 5987435 5987435 5987435 5987435.0000
+impulsive 012602 1 28357832 28357832 28357832 28357832.0000
+starlet 012603 1 39654943 39654943 39654943 39654943.0000
+featherweight 012701 1 5987435 5987435 5987435 5987435.0000
+pessimist 012702 1 28357832 28357832 28357832 28357832.0000
+daughter 012703 1 39654943 39654943 39654943 39654943.0000
+lawgiver 013601 1 5987435 5987435 5987435 5987435.0000
+stated 013602 1 28357832 28357832 28357832 28357832.0000
+readable 013603 1 39654943 39654943 39654943 39654943.0000
+testicle 013801 1 5987435 5987435 5987435 5987435.0000
+Parsifal 013802 1 28357832 28357832 28357832 28357832.0000
+leavings 013803 1 39654943 39654943 39654943 39654943.0000
+squeaking 013901 1 5987435 5987435 5987435 5987435.0000
+contrasted 016001 1 5987435 5987435 5987435 5987435.0000
+leftover 016201 1 5987435 5987435 5987435 5987435.0000
+whiteners 016202 1 28357832 28357832 28357832 28357832.0000
+erases 016301 1 5987435 5987435 5987435 5987435.0000
+Punjab 016302 1 28357832 28357832 28357832 28357832.0000
+Merritt 016303 1 39654943 39654943 39654943 39654943.0000
+sweetish 018001 1 5987435 5987435 5987435 5987435.0000
+dogging 018002 1 28357832 28357832 28357832 28357832.0000
+scornfully 018003 1 39654943 39654943 39654943 39654943.0000
+fetters 018012 1 28357832 28357832 28357832 28357832.0000
+bivalves 018013 1 39654943 39654943 39654943 39654943.0000
+skulking 018021 1 5987435 5987435 5987435 5987435.0000
+flint 018022 1 28357832 28357832 28357832 28357832.0000
+flopping 018023 1 39654943 39654943 39654943 39654943.0000
+Judas 018032 1 28357832 28357832 28357832 28357832.0000
+vacuuming 018033 1 39654943 39654943 39654943 39654943.0000
+medical 018041 1 5987435 5987435 5987435 5987435.0000
+bloodbath 018042 1 28357832 28357832 28357832 28357832.0000
+subschema 018043 1 39654943 39654943 39654943 39654943.0000
+interdependent 018051 1 5987435 5987435 5987435 5987435.0000
+Graves 018052 1 28357832 28357832 28357832 28357832.0000
+neonatal 018053 1 39654943 39654943 39654943 39654943.0000
+sorters 018061 1 5987435 5987435 5987435 5987435.0000
+epistle 018062 1 28357832 28357832 28357832 28357832.0000
+Conley 018101 1 5987435 5987435 5987435 5987435.0000
+lectured 018102 1 28357832 28357832 28357832 28357832.0000
+Abraham 018103 1 39654943 39654943 39654943 39654943.0000
+cage 018201 1 5987435 5987435 5987435 5987435.0000
+hushes 018202 1 28357832 28357832 28357832 28357832.0000
+Simla 018402 1 28357832 28357832 28357832 28357832.0000
+reporters 018403 1 39654943 39654943 39654943 39654943.0000
+coexist 018601 1 5987435 5987435 5987435 5987435.0000
+Beebe 018602 1 28357832 28357832 28357832 28357832.0000
+Taoism 018603 1 39654943 39654943 39654943 39654943.0000
+Connally 018801 1 5987435 5987435 5987435 5987435.0000
+fetched 018802 1 28357832 28357832 28357832 28357832.0000
+checkpoints 018803 1 39654943 39654943 39654943 39654943.0000
+gritty 018811 1 5987435 5987435 5987435 5987435.0000
+firearm 018812 1 28357832 28357832 28357832 28357832.0000
+minima 019101 1 5987435 5987435 5987435 5987435.0000
+Selfridge 019102 1 28357832 28357832 28357832 28357832.0000
+disable 019103 1 39654943 39654943 39654943 39654943.0000
+witchcraft 019201 1 5987435 5987435 5987435 5987435.0000
+betroth 030501 1 5987435 5987435 5987435 5987435.0000
+Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000
+imprint 030503 1 39654943 39654943 39654943 39654943.0000
+swelling 031901 1 5987435 5987435 5987435 5987435.0000
+interrelationships 036001 1 5987435 5987435 5987435 5987435.0000
+riser 036002 1 28357832 28357832 28357832 28357832.0000
+bee 038001 1 5987435 5987435 5987435 5987435.0000
+kanji 038002 1 28357832 28357832 28357832 28357832.0000
+dental 038003 1 39654943 39654943 39654943 39654943.0000
+railway 038011 1 5987435 5987435 5987435 5987435.0000
+validate 038012 1 28357832 28357832 28357832 28357832.0000
+normalizes 038013 1 39654943 39654943 39654943 39654943.0000
+Kline 038101 1 5987435 5987435 5987435 5987435.0000
+Anatole 038102 1 28357832 28357832 28357832 28357832.0000
+partridges 038103 1 39654943 39654943 39654943 39654943.0000
+recruited 038201 1 5987435 5987435 5987435 5987435.0000
+dimensions 038202 1 28357832 28357832 28357832 28357832.0000
+Chicana 038203 1 39654943 39654943 39654943 39654943.0000
+select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
+companynr fld3 sum(price)
+512 boat 786542
+512 capably 786542
+512 cupboard 786542
+512 decliner 786542
+512 descendants 786542
+512 dopers 786542
+512 erases 786542
+512 Micronesia 786542
+512 Miles 786542
+512 skies 786542
+select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
+companynr count(*) min(fld3) max(fld3) sum(price) avg(price)
+00 1 Omaha Omaha 5987435 5987435.0000
+36 1 dubbed dubbed 28357832 28357832.0000
+37 83 Abraham Wotan 1908978016 22999735.1325
+50 2 scribbled tapestry 68012775 34006387.5000
+select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
+t3.companynr+0 t2nr fld3 sum(price)
+37 1 Omaha 5987435
+37 11401 breaking 5987435
+37 11402 Romans 28357832
+37 11403 intercepted 39654943
+37 11501 bewilderingly 5987435
+37 11701 astound 5987435
+37 11702 admonishing 28357832
+37 11703 sumac 39654943
+37 12001 flanking 5987435
+37 12003 combed 39654943
+37 12301 Eulerian 5987435
+37 12302 dubbed 28357832
+37 12303 Kane 39654943
+37 12501 annihilates 5987435
+37 12602 Wotan 28357832
+37 12603 snatching 39654943
+37 12701 grazing 5987435
+37 12702 Baird 28357832
+37 12703 celery 39654943
+37 13601 handgun 5987435
+37 13602 foldout 28357832
+37 13603 mystic 39654943
+37 13801 intelligibility 5987435
+37 13802 Augustine 28357832
+37 13803 teethe 39654943
+37 13901 scholastics 5987435
+37 16001 audiology 5987435
+37 16201 wallet 5987435
+37 16202 parters 28357832
+37 16301 eschew 5987435
+37 16302 quitter 28357832
+37 16303 neat 39654943
+37 18001 jarring 5987435
+37 18002 tinily 28357832
+37 18003 balled 39654943
+37 18012 impulsive 28357832
+37 18013 starlet 39654943
+37 18021 lawgiver 5987435
+37 18022 stated 28357832
+37 18023 readable 39654943
+37 18032 testicle 28357832
+37 18033 Parsifal 39654943
+37 18041 Punjab 5987435
+37 18042 Merritt 28357832
+37 18043 Quixotism 39654943
+37 18051 sureties 5987435
+37 18052 puddings 28357832
+37 18053 tapestry 39654943
+37 18061 trimmings 5987435
+37 18062 humility 28357832
+37 18101 tragedies 5987435
+37 18102 skulking 28357832
+37 18103 flint 39654943
+37 18201 relaxing 5987435
+37 18202 offload 28357832
+37 18402 suites 28357832
+37 18403 lists 39654943
+37 18601 vacuuming 5987435
+37 18602 dentally 28357832
+37 18603 humanness 39654943
+37 18801 inch 5987435
+37 18802 Weissmuller 28357832
+37 18803 irresponsibly 39654943
+37 18811 repetitions 5987435
+37 18812 Antares 28357832
+37 19101 ventilate 5987435
+37 19102 pityingly 28357832
+37 19103 interdependent 39654943
+37 19201 Graves 5987435
+37 30501 neonatal 5987435
+37 30502 scribbled 28357832
+37 30503 chafe 39654943
+37 31901 realtor 5987435
+37 36001 elite 5987435
+37 36002 funereal 28357832
+37 38001 Conley 5987435
+37 38002 lectured 28357832
+37 38003 Abraham 39654943
+37 38011 groupings 5987435
+37 38012 dissociate 28357832
+37 38013 coexist 39654943
+37 38101 rusting 5987435
+37 38102 galling 28357832
+37 38103 obliterates 39654943
+37 38201 resumes 5987435
+37 38202 analyzable 28357832
+37 38203 terminator 39654943
+select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
+sum(price)
+234298
+select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
+fld1 sum(price)
+038008 234298
+explain select fld3 from t2 where 1>2 or 2>3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select fld3 from t2 where fld1=fld1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
+companynr count sum
+00 82 10355753
+29 95 14473298
+34 70 17788966
+37 588 83602098
+41 52 12816335
+select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
+companynr
+00
+29
+34
+37
+41
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
+companynr companyname count(*)
+68 company 10 12
+50 company 11 11
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+select count(*) from t2;
+count(*)
+1199
+select count(*) from t2 where fld1 < 098024;
+count(*)
+387
+select min(fld1) from t2 where fld1>= 098024;
+min(fld1)
+98024
+select max(fld1) from t2 where fld1>= 098024;
+max(fld1)
+1232609
+select count(*) from t3 where price2=76234234;
+count(*)
+4181
+select count(*) from t3 where companynr=512 and price2=76234234;
+count(*)
+4181
+explain select min(fld1),max(fld1),count(*) from t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(fld1),max(fld1),count(*) from t2;
+min(fld1) max(fld1) count(*)
+0 1232609 1199
+select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
+min(t2nr) max(t2nr)
+2115 2115
+select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
+count(*) min(t2nr) max(t2nr)
+4181 4 41804
+select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
+t2nr count(*)
+9 1
+19 1
+29 1
+39 1
+49 1
+59 1
+69 1
+79 1
+89 1
+99 1
+109 1
+119 1
+129 1
+139 1
+149 1
+159 1
+169 1
+179 1
+189 1
+199 1
+select max(t2nr) from t3 where price=983543950;
+max(t2nr)
+41807
+select t1.period from t3 = t1 limit 1;
+period
+1001
+select t1.period from t1 as t1 limit 1;
+period
+9410
+select t1.period as "Nuvarande period" from t1 as t1 limit 1;
+Nuvarande period
+9410
+select period as ok_period from t1 limit 1;
+ok_period
+9410
+select period as ok_period from t1 group by ok_period limit 1;
+ok_period
+9410
+select 1+1 as summa from t1 group by summa limit 1;
+summa
+2
+select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
+Nuvarande period
+9410
+show tables;
+Tables_in_test
+t1
+t2
+t3
+t4
+show tables from test like "s%";
+Tables_in_test (s%)
+show tables from test like "t?";
+Tables_in_test (t?)
+show full columns from t2;
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(11) NULL NO PRI NULL auto_increment #
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+companynr tinyint(2) unsigned zerofill NULL NO 00 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 'f%';
+Field Type Collation Null Key Default Extra Privileges Comment
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 's%';
+Field Type Collation Null Key Default Extra Privileges Comment
+show keys from t2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
+t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
+t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+drop table t4, t3, t2, t1;
+CREATE TABLE t1 (
+cont_nr int(11) NOT NULL auto_increment,
+ver_nr int(11) NOT NULL default '0',
+aufnr int(11) NOT NULL default '0',
+username varchar(50) NOT NULL default '',
+hdl_nr int(11) NOT NULL default '0',
+eintrag date NOT NULL default '0000-00-00',
+st_klasse varchar(40) NOT NULL default '',
+st_wert varchar(40) NOT NULL default '',
+st_zusatz varchar(40) NOT NULL default '',
+st_bemerkung varchar(255) NOT NULL default '',
+kunden_art varchar(40) NOT NULL default '',
+mcbs_knr int(11) default NULL,
+mcbs_aufnr int(11) NOT NULL default '0',
+schufa_status char(1) default '?',
+bemerkung text,
+wirknetz text,
+wf_igz int(11) NOT NULL default '0',
+tarifcode varchar(80) default NULL,
+recycle char(1) default NULL,
+sim varchar(30) default NULL,
+mcbs_tpl varchar(30) default NULL,
+emp_nr int(11) NOT NULL default '0',
+laufzeit int(11) default NULL,
+hdl_name varchar(30) default NULL,
+prov_hdl_nr int(11) NOT NULL default '0',
+auto_wirknetz varchar(50) default NULL,
+auto_billing varchar(50) default NULL,
+touch timestamp NOT NULL,
+kategorie varchar(50) default NULL,
+kundentyp varchar(20) NOT NULL default '',
+sammel_rech_msisdn varchar(30) NOT NULL default '',
+p_nr varchar(9) NOT NULL default '',
+suffix char(3) NOT NULL default '',
+PRIMARY KEY (cont_nr),
+KEY idx_aufnr(aufnr),
+KEY idx_hdl_nr(hdl_nr),
+KEY idx_st_klasse(st_klasse),
+KEY ver_nr(ver_nr),
+KEY eintrag_idx(eintrag),
+KEY emp_nr_idx(emp_nr),
+KEY wf_igz(wf_igz),
+KEY touch(touch),
+KEY hdl_tag(eintrag,hdl_nr),
+KEY prov_hdl_nr(prov_hdl_nr),
+KEY mcbs_aufnr(mcbs_aufnr),
+KEY kundentyp(kundentyp),
+KEY p_nr(p_nr,suffix)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
+INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
+Kundentyp kategorie
+Privat (Private Nutzung) Mobilfunk
+Warnings:
+Warning 1052 Column 'kundentyp' in group statement is ambiguous
+drop table t1;
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result
new file mode 100644
index 00000000000..9c1cf4b0ec3
--- /dev/null
+++ b/mysql-test/r/ssl_compress.result
@@ -0,0 +1,2165 @@
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+SHOW STATUS LIKE 'Compression';
+Variable_name Value
+Compression ON
+drop table if exists t1,t2,t3,t4;
+CREATE TABLE t1 (
+Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
+Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
+);
+INSERT INTO t1 VALUES (9410,9412);
+select period from t1;
+period
+9410
+select * from t1;
+Period Varor_period
+9410 9412
+select t1.* from t1;
+Period Varor_period
+9410 9412
+CREATE TABLE t2 (
+auto int not null auto_increment,
+fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
+companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
+fld3 char(30) DEFAULT '' NOT NULL,
+fld4 char(35) DEFAULT '' NOT NULL,
+fld5 char(35) DEFAULT '' NOT NULL,
+fld6 char(4) DEFAULT '' NOT NULL,
+UNIQUE fld1 (fld1),
+KEY fld3 (fld3),
+PRIMARY KEY (auto)
+);
+select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
+fld3
+imaginable
+select fld3 from t2 where fld3 like "%cultivation" ;
+fld3
+cultivation
+select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3,companynr from t2 where companynr = 58 order by fld3;
+fld3 companynr
+concoct 58
+druggists 58
+engrossing 58
+Eurydice 58
+exclaimers 58
+ferociousness 58
+hopelessness 58
+Huey 58
+imaginable 58
+judges 58
+merging 58
+ostrich 58
+peering 58
+Phelps 58
+presumes 58
+Ruth 58
+sentences 58
+Shylock 58
+straggled 58
+synergy 58
+thanking 58
+tying 58
+unlocks 58
+select fld3 from t2 order by fld3 desc limit 10;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select fld3 from t2 order by fld3 desc limit 5;
+fld3
+youthfulness
+yelped
+Wotan
+workers
+Witt
+select fld3 from t2 order by fld3 desc limit 5,5;
+fld3
+witchcraft
+Winsett
+Willy
+willed
+wildcats
+select t2.fld3 from t2 where fld3 = 'honeysuckle';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'h%le';
+fld3
+honeysuckle
+select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
+fld3
+select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
+fld3
+explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using index
+explain select fld3 from t2 ignore index (fld3,not_used);
+ERROR 42000: Key column 'not_used' doesn't exist in table
+explain select fld3 from t2 use index (not_used);
+ERROR 42000: Key column 'not_used' doesn't exist in table
+select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+fld3
+honeysuckle
+honoring
+explain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using index
+select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
+fld1 fld3
+148504 Colombo
+068305 Colombo
+000000 nondecreasing
+select fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';
+fld1 fld3
+232605 appendixes
+1232605 appendixes
+1232606 appendixes
+1232607 appendixes
+1232608 appendixes
+1232609 appendixes
+select fld1 from t2 where fld1=250501 or fld1="250502";
+fld1
+250501
+250502
+explain select fld1 from t2 where fld1=250501 or fld1="250502";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using index
+select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+fld1
+250501
+250502
+250505
+250601
+explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using index
+select fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';
+fld1 fld3
+218401 faithful
+018007 fanatic
+228311 fated
+018017 featherweight
+218022 feed
+088303 feminine
+058004 Fenton
+038017 fetched
+018054 fetters
+208101 fiftieth
+238007 filial
+013606 fingerings
+218008 finishers
+038205 firearm
+188505 fitting
+202301 Fitzpatrick
+238008 fixedly
+012001 flanking
+018103 flint
+018104 flopping
+188007 flurried
+013602 foldout
+226205 foothill
+232102 forgivably
+228306 forthcoming
+186002 freakish
+208113 freest
+231315 freezes
+036002 funereal
+226209 furnishings
+198006 furthermore
+select fld3 from t2 where fld3 like "L%" and fld3 = "ok";
+fld3
+select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");
+fld3
+Chantilly
+select fld1,fld3 from t2 where fld1 like "25050%";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select fld1,fld3 from t2 where fld1 like "25050_";
+fld1 fld3
+250501 poisoning
+250502 Iraqis
+250503 heaving
+250504 population
+250505 bomb
+select distinct companynr from t2;
+companynr
+00
+37
+36
+50
+58
+29
+40
+53
+65
+41
+34
+68
+select distinct companynr from t2 order by companynr;
+companynr
+00
+29
+34
+36
+37
+40
+41
+50
+53
+58
+65
+68
+select distinct companynr from t2 order by companynr desc;
+companynr
+68
+65
+58
+53
+50
+41
+40
+37
+36
+34
+29
+00
+select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";
+fld3 period
+obliterates 9410
+offload 9410
+opaquely 9410
+organizer 9410
+overestimating 9410
+overlay 9410
+select distinct fld3 from t2 where companynr = 34 order by fld3;
+fld3
+absentee
+accessed
+ahead
+alphabetic
+Asiaticizations
+attitude
+aye
+bankruptcies
+belays
+Blythe
+bomb
+boulevard
+bulldozes
+cannot
+caressing
+charcoal
+checksumming
+chess
+clubroom
+colorful
+cosy
+creator
+crying
+Darius
+diffusing
+duality
+Eiffel
+Epiphany
+Ernestine
+explorers
+exterminated
+famine
+forked
+Gershwins
+heaving
+Hodges
+Iraqis
+Italianization
+Lagos
+landslide
+libretto
+Majorca
+mastering
+narrowed
+occurred
+offerers
+Palestine
+Peruvianizes
+pharmaceutic
+poisoning
+population
+Pygmalion
+rats
+realest
+recording
+regimented
+retransmitting
+reviver
+rouses
+scars
+sicker
+sleepwalk
+stopped
+sugars
+translatable
+uncles
+unexpected
+uprisings
+versatility
+vest
+select distinct fld3 from t2 limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct fld3 from t2 having fld3 like "A%" limit 10;
+fld3
+abates
+abiding
+Abraham
+abrogating
+absentee
+abut
+accessed
+accruing
+accumulating
+accuracies
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%";
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+Adl
+adm
+Ado
+ads
+adv
+aer
+aff
+afi
+afl
+afo
+agi
+ahe
+aim
+air
+Ald
+alg
+ali
+all
+alp
+alr
+ama
+ame
+amm
+ana
+and
+ane
+Ang
+ani
+Ann
+Ant
+api
+app
+aqu
+Ara
+arc
+Arm
+arr
+Art
+Asi
+ask
+asp
+ass
+ast
+att
+aud
+Aug
+aut
+ave
+avo
+awe
+aye
+Azt
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;
+substring(fld3,1,3)
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+select distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;
+a
+aba
+abi
+Abr
+abs
+abu
+acc
+acq
+acu
+Ade
+adj
+create table t3 (
+period int not null,
+name char(32) not null,
+companynr int not null,
+price double(11,0),
+price2 double(11,0),
+key (period),
+key (name)
+);
+create temporary table tmp engine = myisam select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+insert into tmp select * from t3;
+insert into t3 select * from tmp;
+alter table t3 add t2nr int not null auto_increment primary key first;
+drop table tmp;
+SET SQL_BIG_TABLES=1;
+select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;
+namn
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+SET SQL_BIG_TABLES=0;
+select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;
+concat(fld3," ",fld3)
+Abraham Abraham
+abrogating abrogating
+admonishing admonishing
+Adolph Adolph
+afield afield
+aging aging
+ammonium ammonium
+analyzable analyzable
+animals animals
+animized animized
+select distinct fld5 from t2 limit 10;
+fld5
+neat
+Steinberg
+jarring
+tinily
+balled
+persist
+attainments
+fanatic
+measures
+rightfulness
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=1;
+select distinct fld3,count(*) from t2 group by companynr,fld3 limit 10;
+fld3 count(*)
+affixed 1
+and 1
+annoyers 1
+Anthony 1
+assayed 1
+assurers 1
+attendants 1
+bedlam 1
+bedpost 1
+boasted 1
+SET SQL_BIG_TABLES=0;
+select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
+fld3 repeat("a",length(fld3)) count(*)
+circus aaaaaa 1
+cited aaaaa 1
+Colombo aaaaaaa 1
+congresswoman aaaaaaaaaaaaa 1
+contrition aaaaaaaaaa 1
+corny aaaaa 1
+cultivation aaaaaaaaaaa 1
+definiteness aaaaaaaaaaaa 1
+demultiplex aaaaaaaaaaa 1
+disappointing aaaaaaaaaaaaa 1
+select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
+companynr rtrim(space(512+companynr))
+37
+78
+101
+154
+311
+447
+512
+select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by fld3;
+fld3
+explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index period period 4 NULL 41810
+1 SIMPLE t1 ref period period 4 test.t3.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+select period from t1;
+period
+9410
+select period from t1 where period=1900;
+period
+select fld3,period from t1,t2 where fld1 = 011401 order by period;
+fld3 period
+breaking 9410
+select fld3,period from t2,t3 where t2.fld1 = 011401 and t2.fld1=t3.t2nr and t3.period=1001;
+fld3 period
+breaking 1001
+explain select fld3,period from t2,t3 where t2.fld1 = 011401 and t3.t2nr=t2.fld1 and 1001 = t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 const fld1 fld1 4 const 1
+1 SIMPLE t3 const PRIMARY,period PRIMARY 4 const 1
+select fld3,period from t2,t1 where companynr*10 = 37*10;
+fld3 period
+breaking 9410
+Romans 9410
+intercepted 9410
+bewilderingly 9410
+astound 9410
+admonishing 9410
+sumac 9410
+flanking 9410
+combed 9410
+subjective 9410
+scatterbrain 9410
+Eulerian 9410
+Kane 9410
+overlay 9410
+perturb 9410
+goblins 9410
+annihilates 9410
+Wotan 9410
+snatching 9410
+concludes 9410
+laterally 9410
+yelped 9410
+grazing 9410
+Baird 9410
+celery 9410
+misunderstander 9410
+handgun 9410
+foldout 9410
+mystic 9410
+succumbed 9410
+Nabisco 9410
+fingerings 9410
+aging 9410
+afield 9410
+ammonium 9410
+boat 9410
+intelligibility 9410
+Augustine 9410
+teethe 9410
+dreaded 9410
+scholastics 9410
+audiology 9410
+wallet 9410
+parters 9410
+eschew 9410
+quitter 9410
+neat 9410
+Steinberg 9410
+jarring 9410
+tinily 9410
+balled 9410
+persist 9410
+attainments 9410
+fanatic 9410
+measures 9410
+rightfulness 9410
+capably 9410
+impulsive 9410
+starlet 9410
+terminators 9410
+untying 9410
+announces 9410
+featherweight 9410
+pessimist 9410
+daughter 9410
+decliner 9410
+lawgiver 9410
+stated 9410
+readable 9410
+attrition 9410
+cascade 9410
+motors 9410
+interrogate 9410
+pests 9410
+stairway 9410
+dopers 9410
+testicle 9410
+Parsifal 9410
+leavings 9410
+postulation 9410
+squeaking 9410
+contrasted 9410
+leftover 9410
+whiteners 9410
+erases 9410
+Punjab 9410
+Merritt 9410
+Quixotism 9410
+sweetish 9410
+dogging 9410
+scornfully 9410
+bellow 9410
+bills 9410
+cupboard 9410
+sureties 9410
+puddings 9410
+fetters 9410
+bivalves 9410
+incurring 9410
+Adolph 9410
+pithed 9410
+Miles 9410
+trimmings 9410
+tragedies 9410
+skulking 9410
+flint 9410
+flopping 9410
+relaxing 9410
+offload 9410
+suites 9410
+lists 9410
+animized 9410
+multilayer 9410
+standardizes 9410
+Judas 9410
+vacuuming 9410
+dentally 9410
+humanness 9410
+inch 9410
+Weissmuller 9410
+irresponsibly 9410
+luckily 9410
+culled 9410
+medical 9410
+bloodbath 9410
+subschema 9410
+animals 9410
+Micronesia 9410
+repetitions 9410
+Antares 9410
+ventilate 9410
+pityingly 9410
+interdependent 9410
+Graves 9410
+neonatal 9410
+chafe 9410
+honoring 9410
+realtor 9410
+elite 9410
+funereal 9410
+abrogating 9410
+sorters 9410
+Conley 9410
+lectured 9410
+Abraham 9410
+Hawaii 9410
+cage 9410
+hushes 9410
+Simla 9410
+reporters 9410
+Dutchman 9410
+descendants 9410
+groupings 9410
+dissociate 9410
+coexist 9410
+Beebe 9410
+Taoism 9410
+Connally 9410
+fetched 9410
+checkpoints 9410
+rusting 9410
+galling 9410
+obliterates 9410
+traitor 9410
+resumes 9410
+analyzable 9410
+terminator 9410
+gritty 9410
+firearm 9410
+minima 9410
+Selfridge 9410
+disable 9410
+witchcraft 9410
+betroth 9410
+Manhattanize 9410
+imprint 9410
+peeked 9410
+swelling 9410
+interrelationships 9410
+riser 9410
+Gandhian 9410
+peacock 9410
+bee 9410
+kanji 9410
+dental 9410
+scarf 9410
+chasm 9410
+insolence 9410
+syndicate 9410
+alike 9410
+imperial 9410
+convulsion 9410
+railway 9410
+validate 9410
+normalizes 9410
+comprehensive 9410
+chewing 9410
+denizen 9410
+schemer 9410
+chronicle 9410
+Kline 9410
+Anatole 9410
+partridges 9410
+brunch 9410
+recruited 9410
+dimensions 9410
+Chicana 9410
+announced 9410
+praised 9410
+employing 9410
+linear 9410
+quagmire 9410
+western 9410
+relishing 9410
+serving 9410
+scheduling 9410
+lore 9410
+eventful 9410
+arteriole 9410
+disentangle 9410
+cured 9410
+Fenton 9410
+avoidable 9410
+drains 9410
+detectably 9410
+husky 9410
+impelling 9410
+undoes 9410
+evened 9410
+squeezes 9410
+destroyer 9410
+rudeness 9410
+beaner 9410
+boorish 9410
+Everhart 9410
+encompass 9410
+mushrooms 9410
+Alison 9410
+externally 9410
+pellagra 9410
+cult 9410
+creek 9410
+Huffman 9410
+Majorca 9410
+governing 9410
+gadfly 9410
+reassigned 9410
+intentness 9410
+craziness 9410
+psychic 9410
+squabbled 9410
+burlesque 9410
+capped 9410
+extracted 9410
+DiMaggio 9410
+exclamation 9410
+subdirectory 9410
+Gothicism 9410
+feminine 9410
+metaphysically 9410
+sanding 9410
+Miltonism 9410
+freakish 9410
+index 9410
+straight 9410
+flurried 9410
+denotative 9410
+coming 9410
+commencements 9410
+gentleman 9410
+gifted 9410
+Shanghais 9410
+sportswriting 9410
+sloping 9410
+navies 9410
+leaflet 9410
+shooter 9410
+Joplin 9410
+babies 9410
+assails 9410
+admiring 9410
+swaying 9410
+Goldstine 9410
+fitting 9410
+Norwalk 9410
+analogy 9410
+deludes 9410
+cokes 9410
+Clayton 9410
+exhausts 9410
+causality 9410
+sating 9410
+icon 9410
+throttles 9410
+communicants 9410
+dehydrate 9410
+priceless 9410
+publicly 9410
+incidentals 9410
+commonplace 9410
+mumbles 9410
+furthermore 9410
+cautioned 9410
+parametrized 9410
+registration 9410
+sadly 9410
+positioning 9410
+babysitting 9410
+eternal 9410
+hoarder 9410
+congregates 9410
+rains 9410
+workers 9410
+sags 9410
+unplug 9410
+garage 9410
+boulder 9410
+specifics 9410
+Teresa 9410
+Winsett 9410
+convenient 9410
+buckboards 9410
+amenities 9410
+resplendent 9410
+sews 9410
+participated 9410
+Simon 9410
+certificates 9410
+Fitzpatrick 9410
+Evanston 9410
+misted 9410
+textures 9410
+save 9410
+count 9410
+rightful 9410
+chaperone 9410
+Lizzy 9410
+clenched 9410
+effortlessly 9410
+accessed 9410
+beaters 9410
+Hornblower 9410
+vests 9410
+indulgences 9410
+infallibly 9410
+unwilling 9410
+excrete 9410
+spools 9410
+crunches 9410
+overestimating 9410
+ineffective 9410
+humiliation 9410
+sophomore 9410
+star 9410
+rifles 9410
+dialysis 9410
+arriving 9410
+indulge 9410
+clockers 9410
+languages 9410
+Antarctica 9410
+percentage 9410
+ceiling 9410
+specification 9410
+regimented 9410
+ciphers 9410
+pictures 9410
+serpents 9410
+allot 9410
+realized 9410
+mayoral 9410
+opaquely 9410
+hostess 9410
+fiftieth 9410
+incorrectly 9410
+decomposition 9410
+stranglings 9410
+mixture 9410
+electroencephalography 9410
+similarities 9410
+charges 9410
+freest 9410
+Greenberg 9410
+tinting 9410
+expelled 9410
+warm 9410
+smoothed 9410
+deductions 9410
+Romano 9410
+bitterroot 9410
+corset 9410
+securing 9410
+environing 9410
+cute 9410
+Crays 9410
+heiress 9410
+inform 9410
+avenge 9410
+universals 9410
+Kinsey 9410
+ravines 9410
+bestseller 9410
+equilibrium 9410
+extents 9410
+relatively 9410
+pressure 9410
+critiques 9410
+befouled 9410
+rightfully 9410
+mechanizing 9410
+Latinizes 9410
+timesharing 9410
+Aden 9410
+embassies 9410
+males 9410
+shapelessly 9410
+mastering 9410
+Newtonian 9410
+finishers 9410
+abates 9410
+teem 9410
+kiting 9410
+stodgy 9410
+feed 9410
+guitars 9410
+airships 9410
+store 9410
+denounces 9410
+Pyle 9410
+Saxony 9410
+serializations 9410
+Peruvian 9410
+taxonomically 9410
+kingdom 9410
+stint 9410
+Sault 9410
+faithful 9410
+Ganymede 9410
+tidiness 9410
+gainful 9410
+contrary 9410
+Tipperary 9410
+tropics 9410
+theorizers 9410
+renew 9410
+already 9410
+terminal 9410
+Hegelian 9410
+hypothesizer 9410
+warningly 9410
+journalizing 9410
+nested 9410
+Lars 9410
+saplings 9410
+foothill 9410
+labeled 9410
+imperiously 9410
+reporters 9410
+furnishings 9410
+precipitable 9410
+discounts 9410
+excises 9410
+Stalin 9410
+despot 9410
+ripeness 9410
+Arabia 9410
+unruly 9410
+mournfulness 9410
+boom 9410
+slaughter 9410
+Sabine 9410
+handy 9410
+rural 9410
+organizer 9410
+shipyard 9410
+civics 9410
+inaccuracy 9410
+rules 9410
+juveniles 9410
+comprised 9410
+investigations 9410
+stabilizes 9410
+seminaries 9410
+Hunter 9410
+sporty 9410
+test 9410
+weasels 9410
+CERN 9410
+tempering 9410
+afore 9410
+Galatean 9410
+techniques 9410
+error 9410
+veranda 9410
+severely 9410
+Cassites 9410
+forthcoming 9410
+guides 9410
+vanish 9410
+lied 9410
+sawtooth 9410
+fated 9410
+gradually 9410
+widens 9410
+preclude 9410
+evenhandedly 9410
+percentage 9410
+disobedience 9410
+humility 9410
+gleaning 9410
+petted 9410
+bloater 9410
+minion 9410
+marginal 9410
+apiary 9410
+measures 9410
+precaution 9410
+repelled 9410
+primary 9410
+coverings 9410
+Artemia 9410
+navigate 9410
+spatial 9410
+Gurkha 9410
+meanwhile 9410
+Melinda 9410
+Butterfield 9410
+Aldrich 9410
+previewing 9410
+glut 9410
+unaffected 9410
+inmate 9410
+mineral 9410
+impending 9410
+meditation 9410
+ideas 9410
+miniaturizes 9410
+lewdly 9410
+title 9410
+youthfulness 9410
+creak 9410
+Chippewa 9410
+clamored 9410
+freezes 9410
+forgivably 9410
+reduce 9410
+McGovern 9410
+Nazis 9410
+epistle 9410
+socializes 9410
+conceptions 9410
+Kevin 9410
+uncovering 9410
+chews 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+appendixes 9410
+raining 9410
+infest 9410
+compartment 9410
+minting 9410
+ducks 9410
+roped 9410
+waltz 9410
+Lillian 9410
+repressions 9410
+chillingly 9410
+noncritical 9410
+lithograph 9410
+spongers 9410
+parenthood 9410
+posed 9410
+instruments 9410
+filial 9410
+fixedly 9410
+relives 9410
+Pandora 9410
+watering 9410
+ungrateful 9410
+secures 9410
+poison 9410
+dusted 9410
+encompasses 9410
+presentation 9410
+Kantian 9410
+select fld3,period,price,price2 from t2,t3 where t2.fld1=t3.t2nr and period >= 1001 and period <= 1002 and t2.companynr = 37 order by fld3,period, price;
+fld3 period price price2
+admonishing 1002 28357832 8723648
+analyzable 1002 28357832 8723648
+annihilates 1001 5987435 234724
+Antares 1002 28357832 8723648
+astound 1001 5987435 234724
+audiology 1001 5987435 234724
+Augustine 1002 28357832 8723648
+Baird 1002 28357832 8723648
+bewilderingly 1001 5987435 234724
+breaking 1001 5987435 234724
+Conley 1001 5987435 234724
+dentally 1002 28357832 8723648
+dissociate 1002 28357832 8723648
+elite 1001 5987435 234724
+eschew 1001 5987435 234724
+Eulerian 1001 5987435 234724
+flanking 1001 5987435 234724
+foldout 1002 28357832 8723648
+funereal 1002 28357832 8723648
+galling 1002 28357832 8723648
+Graves 1001 5987435 234724
+grazing 1001 5987435 234724
+groupings 1001 5987435 234724
+handgun 1001 5987435 234724
+humility 1002 28357832 8723648
+impulsive 1002 28357832 8723648
+inch 1001 5987435 234724
+intelligibility 1001 5987435 234724
+jarring 1001 5987435 234724
+lawgiver 1001 5987435 234724
+lectured 1002 28357832 8723648
+Merritt 1002 28357832 8723648
+neonatal 1001 5987435 234724
+offload 1002 28357832 8723648
+parters 1002 28357832 8723648
+pityingly 1002 28357832 8723648
+puddings 1002 28357832 8723648
+Punjab 1001 5987435 234724
+quitter 1002 28357832 8723648
+realtor 1001 5987435 234724
+relaxing 1001 5987435 234724
+repetitions 1001 5987435 234724
+resumes 1001 5987435 234724
+Romans 1002 28357832 8723648
+rusting 1001 5987435 234724
+scholastics 1001 5987435 234724
+skulking 1002 28357832 8723648
+stated 1002 28357832 8723648
+suites 1002 28357832 8723648
+sureties 1001 5987435 234724
+testicle 1002 28357832 8723648
+tinily 1002 28357832 8723648
+tragedies 1001 5987435 234724
+trimmings 1001 5987435 234724
+vacuuming 1001 5987435 234724
+ventilate 1001 5987435 234724
+wallet 1001 5987435 234724
+Weissmuller 1002 28357832 8723648
+Wotan 1002 28357832 8723648
+select t2.fld1,fld3,period,price,price2 from t2,t3 where t2.fld1>= 18201 and t2.fld1 <= 18811 and t2.fld1=t3.t2nr and period = 1001 and t2.companynr = 37;
+fld1 fld3 period price price2
+018201 relaxing 1001 5987435 234724
+018601 vacuuming 1001 5987435 234724
+018801 inch 1001 5987435 234724
+018811 repetitions 1001 5987435 234724
+create table t4 (
+companynr tinyint(2) unsigned zerofill NOT NULL default '00',
+companyname char(30) NOT NULL default '',
+PRIMARY KEY (companynr),
+UNIQUE KEY companyname(companyname)
+) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select SQL_SMALL_RESULT t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
+companynr companyname
+00 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select * from t1,t1 t12;
+Period Varor_period Period Varor_period
+9410 9412 9410 9412
+select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
+fld1 fld1
+250501 250501
+250502 250501
+250503 250501
+250504 250501
+250505 250501
+250501 250502
+250502 250502
+250503 250502
+250504 250502
+250505 250502
+250501 250503
+250502 250503
+250503 250503
+250504 250503
+250505 250503
+250501 250504
+250502 250504
+250503 250504
+250504 250504
+250505 250504
+250501 250505
+250502 250505
+250503 250505
+250504 250505
+250505 250505
+insert into t2 (fld1, companynr) values (999999,99);
+select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+companynr companyname
+99 NULL
+select count(*) from t2 left join t4 using (companynr) where t4.companynr is not null;
+count(*)
+1199
+explain select t2.companynr,companyname from t2 left join t4 using (companynr) where t4.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using where; Not exists
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1200 Using where; Not exists
+select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+companynr companyname
+select count(*) from t2 left join t4 using (companynr) where companynr is not null;
+count(*)
+1200
+explain select companynr,companyname from t2 left join t4 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+delete from t2 where fld1=999999;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0 or t4.companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where ifnull(t2.companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+companynr companynr
+37 36
+41 40
+explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t2.fld1 = 38208 or t2.fld1 = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select t2.fld1,t2.companynr,fld3,period from t3,t2 where (t3.t2nr = 38208 or t3.t2nr = 38008) and t2.fld1=t3.t2nr and period>=1008 and period<=1009;
+fld1 companynr fld3 period
+038008 37 reporters 1008
+038208 37 Selfridge 1008
+select period from t1 where (((period > 0) or period < 10000 or (period = 1900)) and (period=1900 and period <= 1901) or (period=1903 and (period=1903)) and period>=1902) or ((period=1904 or period=1905) or (period=1906 or period>1907)) or (period=1908 and period = 1909);
+period
+9410
+select period from t1 where ((period > 0 and period < 1) or (((period > 0 and period < 100) and (period > 10)) or (period > 10)) or (period > 0 and (period > 5 or period > 6)));
+period
+9410
+select a.fld1 from t2 as a,t2 b where ((a.fld1 = 250501 and a.fld1=b.fld1) or a.fld1=250502 or a.fld1=250503 or (a.fld1=250505 and a.fld1<=b.fld1 and b.fld1>=a.fld1)) and a.fld1=b.fld1;
+fld1
+250501
+250502
+250503
+250505
+select fld1 from t2 where fld1 in (250502,98005,98006,250503,250605,250606) and fld1 >=250502 and fld1 not in (250605,250606);
+fld1
+250502
+250503
+select fld1 from t2 where fld1 between 250502 and 250504;
+fld1
+250502
+250503
+250504
+select fld3 from t2 where (((fld3 like "_%L%" ) or (fld3 like "%ok%")) and ( fld3 like "L%" or fld3 like "G%")) and fld3 like "L%" ;
+fld3
+label
+labeled
+labeled
+landslide
+laterally
+leaflet
+lewdly
+Lillian
+luckily
+select count(*) from t1;
+count(*)
+1
+select companynr,count(*),sum(fld1) from t2 group by companynr;
+companynr count(*) sum(fld1)
+00 82 10355753
+29 95 14473298
+34 70 17788966
+36 215 22786296
+37 588 83602098
+40 37 6618386
+41 52 12816335
+50 11 1595438
+53 4 793210
+58 23 2254293
+65 10 2284055
+68 12 3097288
+select companynr,count(*) from t2 group by companynr order by companynr desc limit 5;
+companynr count(*)
+68 12
+65 10
+58 23
+53 4
+50 11
+select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+explain extended select count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 where companynr = 34 and fld4<>"";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+Warnings:
+Note 1003 select count(0) AS `count(*)`,min(`test`.`t2`.`fld4`) AS `min(fld4)`,max(`test`.`t2`.`fld4`) AS `max(fld4)`,sum(`test`.`t2`.`fld1`) AS `sum(fld1)`,avg(`test`.`t2`.`fld1`) AS `avg(fld1)`,std(`test`.`t2`.`fld1`) AS `std(fld1)`,variance(`test`.`t2`.`fld1`) AS `variance(fld1)` from `test`.`t2` where ((`test`.`t2`.`companynr` = 34) and (`test`.`t2`.`fld4` <> _latin1''))
+select companynr,count(*),min(fld4),max(fld4),sum(fld1),avg(fld1),std(fld1),variance(fld1) from t2 group by companynr limit 3;
+companynr count(*) min(fld4) max(fld4) sum(fld1) avg(fld1) std(fld1) variance(fld1)
+00 82 Anthony windmills 10355753 126289.6707 115550.9757 13352027981.7087
+29 95 abut wetness 14473298 152350.5053 8368.5480 70032594.9026
+34 70 absentee vest 17788966 254128.0857 3272.5940 10709871.3069
+select companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select /*! SQL_SMALL_RESULT */ companynr,t2nr,count(price),sum(price),min(price),max(price),avg(price) from t3 where companynr = 37 group by companynr,t2nr limit 10;
+companynr t2nr count(price) sum(price) min(price) max(price) avg(price)
+37 1 1 5987435 5987435 5987435 5987435.0000
+37 2 1 28357832 28357832 28357832 28357832.0000
+37 3 1 39654943 39654943 39654943 39654943.0000
+37 11 1 5987435 5987435 5987435 5987435.0000
+37 12 1 28357832 28357832 28357832 28357832.0000
+37 13 1 39654943 39654943 39654943 39654943.0000
+37 21 1 5987435 5987435 5987435 5987435.0000
+37 22 1 28357832 28357832 28357832 28357832.0000
+37 23 1 39654943 39654943 39654943 39654943.0000
+37 31 1 5987435 5987435 5987435 5987435.0000
+select companynr,count(price),sum(price),min(price),max(price),avg(price) from t3 group by companynr ;
+companynr count(price) sum(price) min(price) max(price) avg(price)
+37 12543 309394878010 5987435 39654943 24666736.6667
+78 8362 414611089292 726498 98439034 49582766.0000
+101 4181 3489454238 834598 834598 834598.0000
+154 4181 4112197254950 983543950 983543950 983543950.0000
+311 4181 979599938 234298 234298 234298.0000
+447 4181 9929180954 2374834 2374834 2374834.0000
+512 4181 3288532102 786542 786542 786542.0000
+select distinct mod(companynr,10) from t4 group by companynr;
+mod(companynr,10)
+0
+9
+4
+6
+7
+1
+3
+8
+5
+select distinct 1 from t4 group by companynr;
+1
+1
+select count(distinct fld1) from t2;
+count(distinct fld1)
+1199
+select companynr,count(distinct fld1) from t2 group by companynr;
+companynr count(distinct fld1)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(*) from t2 group by companynr;
+companynr count(*)
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,1000))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,1000)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct concat(fld1,repeat(65,200))) from t2 group by companynr;
+companynr count(distinct concat(fld1,repeat(65,200)))
+00 82
+29 95
+34 70
+36 215
+37 588
+40 37
+41 52
+50 11
+53 4
+58 23
+65 10
+68 12
+select companynr,count(distinct floor(fld1/100)) from t2 group by companynr;
+companynr count(distinct floor(fld1/100))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select companynr,count(distinct concat(repeat(65,1000),floor(fld1/100))) from t2 group by companynr;
+companynr count(distinct concat(repeat(65,1000),floor(fld1/100)))
+00 47
+29 35
+34 14
+36 69
+37 108
+40 16
+41 11
+50 9
+53 1
+58 1
+65 1
+68 1
+select sum(fld1),fld3 from t2 where fld3="Romans" group by fld1 limit 10;
+sum(fld1) fld3
+11402 Romans
+select name,count(*) from t3 where name='cloakroom' group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name='cloakroom' and price>10 group by name;
+name count(*)
+cloakroom 4181
+select count(*) from t3 where name='cloakroom' and price2=823742;
+count(*)
+4181
+select name,count(*) from t3 where name='cloakroom' and price2=823742 group by name;
+name count(*)
+cloakroom 4181
+select name,count(*) from t3 where name >= "extramarital" and price <= 39654943 group by name;
+name count(*)
+extramarital 4181
+gazer 4181
+gems 4181
+Iranizes 4181
+spates 4181
+tucked 4181
+violinist 4181
+select t2.fld3,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld3 count(*)
+spates 4181
+select companynr|0,companyname from t4 group by 1;
+companynr|0 companyname
+0 Unknown
+29 company 1
+34 company 2
+36 company 3
+37 company 4
+40 company 5
+41 company 6
+50 company 11
+53 company 7
+58 company 8
+65 company 9
+68 company 10
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by t2.companynr order by companyname;
+companynr companyname count(*)
+29 company 1 95
+68 company 10 12
+50 company 11 11
+34 company 2 70
+36 company 3 215
+37 company 4 588
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+00 Unknown 82
+select t2.fld1,count(*) from t2,t3 where t2.fld1=158402 and t3.name=t2.fld3 group by t3.name;
+fld1 count(*)
+158402 4181
+select sum(Period)/count(*) from t1;
+sum(Period)/count(*)
+9410.0000
+select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr;
+companynr count sum diff func
+37 12543 309394878010 0.0000 464091
+78 8362 414611089292 0.0000 652236
+101 4181 3489454238 0.0000 422281
+154 4181 4112197254950 0.0000 643874
+311 4181 979599938 0.0000 1300291
+447 4181 9929180954 0.0000 1868907
+512 4181 3288532102 0.0000 2140672
+select companynr,sum(price)/count(price) as avg from t3 group by companynr having avg > 70000000 order by avg;
+companynr avg
+154 983543950.0000
+select companynr,count(*) from t2 group by companynr order by 2 desc;
+companynr count(*)
+37 588
+36 215
+29 95
+00 82
+34 70
+41 52
+40 37
+58 23
+68 12
+50 11
+65 10
+53 4
+select companynr,count(*) from t2 where companynr > 40 group by companynr order by 2 desc;
+companynr count(*)
+41 52
+58 23
+68 12
+50 11
+65 10
+53 4
+select t2.fld4,t2.fld1,count(price),sum(price),min(price),max(price),avg(price) from t3,t2 where t3.companynr = 37 and t2.fld1 = t3.t2nr group by fld1,t2.fld4;
+fld4 fld1 count(price) sum(price) min(price) max(price) avg(price)
+teethe 000001 1 5987435 5987435 5987435 5987435.0000
+dreaded 011401 1 5987435 5987435 5987435 5987435.0000
+scholastics 011402 1 28357832 28357832 28357832 28357832.0000
+audiology 011403 1 39654943 39654943 39654943 39654943.0000
+wallet 011501 1 5987435 5987435 5987435 5987435.0000
+parters 011701 1 5987435 5987435 5987435 5987435.0000
+eschew 011702 1 28357832 28357832 28357832 28357832.0000
+quitter 011703 1 39654943 39654943 39654943 39654943.0000
+neat 012001 1 5987435 5987435 5987435 5987435.0000
+Steinberg 012003 1 39654943 39654943 39654943 39654943.0000
+balled 012301 1 5987435 5987435 5987435 5987435.0000
+persist 012302 1 28357832 28357832 28357832 28357832.0000
+attainments 012303 1 39654943 39654943 39654943 39654943.0000
+capably 012501 1 5987435 5987435 5987435 5987435.0000
+impulsive 012602 1 28357832 28357832 28357832 28357832.0000
+starlet 012603 1 39654943 39654943 39654943 39654943.0000
+featherweight 012701 1 5987435 5987435 5987435 5987435.0000
+pessimist 012702 1 28357832 28357832 28357832 28357832.0000
+daughter 012703 1 39654943 39654943 39654943 39654943.0000
+lawgiver 013601 1 5987435 5987435 5987435 5987435.0000
+stated 013602 1 28357832 28357832 28357832 28357832.0000
+readable 013603 1 39654943 39654943 39654943 39654943.0000
+testicle 013801 1 5987435 5987435 5987435 5987435.0000
+Parsifal 013802 1 28357832 28357832 28357832 28357832.0000
+leavings 013803 1 39654943 39654943 39654943 39654943.0000
+squeaking 013901 1 5987435 5987435 5987435 5987435.0000
+contrasted 016001 1 5987435 5987435 5987435 5987435.0000
+leftover 016201 1 5987435 5987435 5987435 5987435.0000
+whiteners 016202 1 28357832 28357832 28357832 28357832.0000
+erases 016301 1 5987435 5987435 5987435 5987435.0000
+Punjab 016302 1 28357832 28357832 28357832 28357832.0000
+Merritt 016303 1 39654943 39654943 39654943 39654943.0000
+sweetish 018001 1 5987435 5987435 5987435 5987435.0000
+dogging 018002 1 28357832 28357832 28357832 28357832.0000
+scornfully 018003 1 39654943 39654943 39654943 39654943.0000
+fetters 018012 1 28357832 28357832 28357832 28357832.0000
+bivalves 018013 1 39654943 39654943 39654943 39654943.0000
+skulking 018021 1 5987435 5987435 5987435 5987435.0000
+flint 018022 1 28357832 28357832 28357832 28357832.0000
+flopping 018023 1 39654943 39654943 39654943 39654943.0000
+Judas 018032 1 28357832 28357832 28357832 28357832.0000
+vacuuming 018033 1 39654943 39654943 39654943 39654943.0000
+medical 018041 1 5987435 5987435 5987435 5987435.0000
+bloodbath 018042 1 28357832 28357832 28357832 28357832.0000
+subschema 018043 1 39654943 39654943 39654943 39654943.0000
+interdependent 018051 1 5987435 5987435 5987435 5987435.0000
+Graves 018052 1 28357832 28357832 28357832 28357832.0000
+neonatal 018053 1 39654943 39654943 39654943 39654943.0000
+sorters 018061 1 5987435 5987435 5987435 5987435.0000
+epistle 018062 1 28357832 28357832 28357832 28357832.0000
+Conley 018101 1 5987435 5987435 5987435 5987435.0000
+lectured 018102 1 28357832 28357832 28357832 28357832.0000
+Abraham 018103 1 39654943 39654943 39654943 39654943.0000
+cage 018201 1 5987435 5987435 5987435 5987435.0000
+hushes 018202 1 28357832 28357832 28357832 28357832.0000
+Simla 018402 1 28357832 28357832 28357832 28357832.0000
+reporters 018403 1 39654943 39654943 39654943 39654943.0000
+coexist 018601 1 5987435 5987435 5987435 5987435.0000
+Beebe 018602 1 28357832 28357832 28357832 28357832.0000
+Taoism 018603 1 39654943 39654943 39654943 39654943.0000
+Connally 018801 1 5987435 5987435 5987435 5987435.0000
+fetched 018802 1 28357832 28357832 28357832 28357832.0000
+checkpoints 018803 1 39654943 39654943 39654943 39654943.0000
+gritty 018811 1 5987435 5987435 5987435 5987435.0000
+firearm 018812 1 28357832 28357832 28357832 28357832.0000
+minima 019101 1 5987435 5987435 5987435 5987435.0000
+Selfridge 019102 1 28357832 28357832 28357832 28357832.0000
+disable 019103 1 39654943 39654943 39654943 39654943.0000
+witchcraft 019201 1 5987435 5987435 5987435 5987435.0000
+betroth 030501 1 5987435 5987435 5987435 5987435.0000
+Manhattanize 030502 1 28357832 28357832 28357832 28357832.0000
+imprint 030503 1 39654943 39654943 39654943 39654943.0000
+swelling 031901 1 5987435 5987435 5987435 5987435.0000
+interrelationships 036001 1 5987435 5987435 5987435 5987435.0000
+riser 036002 1 28357832 28357832 28357832 28357832.0000
+bee 038001 1 5987435 5987435 5987435 5987435.0000
+kanji 038002 1 28357832 28357832 28357832 28357832.0000
+dental 038003 1 39654943 39654943 39654943 39654943.0000
+railway 038011 1 5987435 5987435 5987435 5987435.0000
+validate 038012 1 28357832 28357832 28357832 28357832.0000
+normalizes 038013 1 39654943 39654943 39654943 39654943.0000
+Kline 038101 1 5987435 5987435 5987435 5987435.0000
+Anatole 038102 1 28357832 28357832 28357832 28357832.0000
+partridges 038103 1 39654943 39654943 39654943 39654943.0000
+recruited 038201 1 5987435 5987435 5987435 5987435.0000
+dimensions 038202 1 28357832 28357832 28357832 28357832.0000
+Chicana 038203 1 39654943 39654943 39654943 39654943.0000
+select t3.companynr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 group by companynr,fld3;
+companynr fld3 sum(price)
+512 boat 786542
+512 capably 786542
+512 cupboard 786542
+512 decliner 786542
+512 descendants 786542
+512 dopers 786542
+512 erases 786542
+512 Micronesia 786542
+512 Miles 786542
+512 skies 786542
+select t2.companynr,count(*),min(fld3),max(fld3),sum(price),avg(price) from t2,t3 where t3.companynr >= 30 and t3.companynr <= 58 and t3.t2nr = t2.fld1 and 1+1=2 group by t2.companynr;
+companynr count(*) min(fld3) max(fld3) sum(price) avg(price)
+00 1 Omaha Omaha 5987435 5987435.0000
+36 1 dubbed dubbed 28357832 28357832.0000
+37 83 Abraham Wotan 1908978016 22999735.1325
+50 2 scribbled tapestry 68012775 34006387.5000
+select t3.companynr+0,t3.t2nr,fld3,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 37 group by 1,t3.t2nr,fld3,fld3,fld3,fld3,fld3 order by fld1;
+t3.companynr+0 t2nr fld3 sum(price)
+37 1 Omaha 5987435
+37 11401 breaking 5987435
+37 11402 Romans 28357832
+37 11403 intercepted 39654943
+37 11501 bewilderingly 5987435
+37 11701 astound 5987435
+37 11702 admonishing 28357832
+37 11703 sumac 39654943
+37 12001 flanking 5987435
+37 12003 combed 39654943
+37 12301 Eulerian 5987435
+37 12302 dubbed 28357832
+37 12303 Kane 39654943
+37 12501 annihilates 5987435
+37 12602 Wotan 28357832
+37 12603 snatching 39654943
+37 12701 grazing 5987435
+37 12702 Baird 28357832
+37 12703 celery 39654943
+37 13601 handgun 5987435
+37 13602 foldout 28357832
+37 13603 mystic 39654943
+37 13801 intelligibility 5987435
+37 13802 Augustine 28357832
+37 13803 teethe 39654943
+37 13901 scholastics 5987435
+37 16001 audiology 5987435
+37 16201 wallet 5987435
+37 16202 parters 28357832
+37 16301 eschew 5987435
+37 16302 quitter 28357832
+37 16303 neat 39654943
+37 18001 jarring 5987435
+37 18002 tinily 28357832
+37 18003 balled 39654943
+37 18012 impulsive 28357832
+37 18013 starlet 39654943
+37 18021 lawgiver 5987435
+37 18022 stated 28357832
+37 18023 readable 39654943
+37 18032 testicle 28357832
+37 18033 Parsifal 39654943
+37 18041 Punjab 5987435
+37 18042 Merritt 28357832
+37 18043 Quixotism 39654943
+37 18051 sureties 5987435
+37 18052 puddings 28357832
+37 18053 tapestry 39654943
+37 18061 trimmings 5987435
+37 18062 humility 28357832
+37 18101 tragedies 5987435
+37 18102 skulking 28357832
+37 18103 flint 39654943
+37 18201 relaxing 5987435
+37 18202 offload 28357832
+37 18402 suites 28357832
+37 18403 lists 39654943
+37 18601 vacuuming 5987435
+37 18602 dentally 28357832
+37 18603 humanness 39654943
+37 18801 inch 5987435
+37 18802 Weissmuller 28357832
+37 18803 irresponsibly 39654943
+37 18811 repetitions 5987435
+37 18812 Antares 28357832
+37 19101 ventilate 5987435
+37 19102 pityingly 28357832
+37 19103 interdependent 39654943
+37 19201 Graves 5987435
+37 30501 neonatal 5987435
+37 30502 scribbled 28357832
+37 30503 chafe 39654943
+37 31901 realtor 5987435
+37 36001 elite 5987435
+37 36002 funereal 28357832
+37 38001 Conley 5987435
+37 38002 lectured 28357832
+37 38003 Abraham 39654943
+37 38011 groupings 5987435
+37 38012 dissociate 28357832
+37 38013 coexist 39654943
+37 38101 rusting 5987435
+37 38102 galling 28357832
+37 38103 obliterates 39654943
+37 38201 resumes 5987435
+37 38202 analyzable 28357832
+37 38203 terminator 39654943
+select sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1= t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008;
+sum(price)
+234298
+select t2.fld1,sum(price) from t3,t2 where t2.fld1 = t3.t2nr and t3.companynr = 512 and t3.t2nr = 38008 and t2.fld1 = 38008 or t2.fld1 = t3.t2nr and t3.t2nr = 38008 and t2.fld1 = 38008 or t3.t2nr = t2.fld1 and t2.fld1 = 38008 group by t2.fld1;
+fld1 sum(price)
+038008 234298
+explain select fld3 from t2 where 1>2 or 2>3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
+explain select fld3 from t2 where fld1=fld1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199
+select companynr,fld1 from t2 HAVING fld1=250501 or fld1=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,fld1 from t2 WHERE fld1>=250501 HAVING fld1<=250502;
+companynr fld1
+34 250501
+34 250502
+select companynr,count(*) as count,sum(fld1) as sum from t2 group by companynr having count > 40 and sum/count >= 120000;
+companynr count sum
+00 82 10355753
+29 95 14473298
+34 70 17788966
+37 588 83602098
+41 52 12816335
+select companynr from t2 group by companynr having count(*) > 40 and sum(fld1)/count(*) >= 120000 ;
+companynr
+00
+29
+34
+37
+41
+select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.companynr group by companyname having t2.companynr >= 40;
+companynr companyname count(*)
+68 company 10 12
+50 company 11 11
+40 company 5 37
+41 company 6 52
+53 company 7 4
+58 company 8 23
+65 company 9 10
+select count(*) from t2;
+count(*)
+1199
+select count(*) from t2 where fld1 < 098024;
+count(*)
+387
+select min(fld1) from t2 where fld1>= 098024;
+min(fld1)
+98024
+select max(fld1) from t2 where fld1>= 098024;
+max(fld1)
+1232609
+select count(*) from t3 where price2=76234234;
+count(*)
+4181
+select count(*) from t3 where companynr=512 and price2=76234234;
+count(*)
+4181
+explain select min(fld1),max(fld1),count(*) from t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(fld1),max(fld1),count(*) from t2;
+min(fld1) max(fld1) count(*)
+0 1232609 1199
+select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742;
+min(t2nr) max(t2nr)
+2115 2115
+select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78;
+count(*) min(t2nr) max(t2nr)
+4181 4 41804
+select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20;
+t2nr count(*)
+9 1
+19 1
+29 1
+39 1
+49 1
+59 1
+69 1
+79 1
+89 1
+99 1
+109 1
+119 1
+129 1
+139 1
+149 1
+159 1
+169 1
+179 1
+189 1
+199 1
+select max(t2nr) from t3 where price=983543950;
+max(t2nr)
+41807
+select t1.period from t3 = t1 limit 1;
+period
+1001
+select t1.period from t1 as t1 limit 1;
+period
+9410
+select t1.period as "Nuvarande period" from t1 as t1 limit 1;
+Nuvarande period
+9410
+select period as ok_period from t1 limit 1;
+ok_period
+9410
+select period as ok_period from t1 group by ok_period limit 1;
+ok_period
+9410
+select 1+1 as summa from t1 group by summa limit 1;
+summa
+2
+select period as "Nuvarande period" from t1 group by "Nuvarande period" limit 1;
+Nuvarande period
+9410
+show tables;
+Tables_in_test
+t1
+t2
+t3
+t4
+show tables from test like "s%";
+Tables_in_test (s%)
+show tables from test like "t?";
+Tables_in_test (t?)
+show full columns from t2;
+Field Type Collation Null Key Default Extra Privileges Comment
+auto int(11) NULL NO PRI NULL auto_increment #
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+companynr tinyint(2) unsigned zerofill NULL NO 00 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 'f%';
+Field Type Collation Null Key Default Extra Privileges Comment
+fld1 int(6) unsigned zerofill NULL NO UNI 000000 #
+fld3 char(30) latin1_swedish_ci NO MUL #
+fld4 char(35) latin1_swedish_ci NO #
+fld5 char(35) latin1_swedish_ci NO #
+fld6 char(4) latin1_swedish_ci NO #
+show full columns from t2 from test like 's%';
+Field Type Collation Null Key Default Extra Privileges Comment
+show keys from t2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t2 0 PRIMARY 1 auto A 1199 NULL NULL BTREE
+t2 0 fld1 1 fld1 A 1199 NULL NULL BTREE
+t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
+drop table t4, t3, t2, t1;
+CREATE TABLE t1 (
+cont_nr int(11) NOT NULL auto_increment,
+ver_nr int(11) NOT NULL default '0',
+aufnr int(11) NOT NULL default '0',
+username varchar(50) NOT NULL default '',
+hdl_nr int(11) NOT NULL default '0',
+eintrag date NOT NULL default '0000-00-00',
+st_klasse varchar(40) NOT NULL default '',
+st_wert varchar(40) NOT NULL default '',
+st_zusatz varchar(40) NOT NULL default '',
+st_bemerkung varchar(255) NOT NULL default '',
+kunden_art varchar(40) NOT NULL default '',
+mcbs_knr int(11) default NULL,
+mcbs_aufnr int(11) NOT NULL default '0',
+schufa_status char(1) default '?',
+bemerkung text,
+wirknetz text,
+wf_igz int(11) NOT NULL default '0',
+tarifcode varchar(80) default NULL,
+recycle char(1) default NULL,
+sim varchar(30) default NULL,
+mcbs_tpl varchar(30) default NULL,
+emp_nr int(11) NOT NULL default '0',
+laufzeit int(11) default NULL,
+hdl_name varchar(30) default NULL,
+prov_hdl_nr int(11) NOT NULL default '0',
+auto_wirknetz varchar(50) default NULL,
+auto_billing varchar(50) default NULL,
+touch timestamp NOT NULL,
+kategorie varchar(50) default NULL,
+kundentyp varchar(20) NOT NULL default '',
+sammel_rech_msisdn varchar(30) NOT NULL default '',
+p_nr varchar(9) NOT NULL default '',
+suffix char(3) NOT NULL default '',
+PRIMARY KEY (cont_nr),
+KEY idx_aufnr(aufnr),
+KEY idx_hdl_nr(hdl_nr),
+KEY idx_st_klasse(st_klasse),
+KEY ver_nr(ver_nr),
+KEY eintrag_idx(eintrag),
+KEY emp_nr_idx(emp_nr),
+KEY wf_igz(wf_igz),
+KEY touch(touch),
+KEY hdl_tag(eintrag,hdl_nr),
+KEY prov_hdl_nr(prov_hdl_nr),
+KEY mcbs_aufnr(mcbs_aufnr),
+KEY kundentyp(kundentyp),
+KEY p_nr(p_nr,suffix)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
+INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. möchte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und geprüft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
+SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
+Kundentyp kategorie
+Privat (Private Nutzung) Mobilfunk
+Warnings:
+Warning 1052 Column 'kundentyp' in group statement is ambiguous
+drop table t1;
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+SHOW STATUS LIKE 'Compression';
+Variable_name Value
+Compression ON
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index e9616232fa1..5461e4dd563 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -17,3 +17,9 @@ Variable_name Value
Table_locks_immediate 3
Table_locks_waited 1
drop table t1;
+select 1;
+1
+1
+show status like 'last_query_cost';
+Variable_name Value
+Last_query_cost 0.000000
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 14806279362..d42e439f4de 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -2987,3 +2987,4 @@ select * from (select max(fld) from t1) as foo;
max(fld)
1
drop table t1;
+purge master logs before (select adddate(current_timestamp(), interval -4 day));
diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result
index bc902ea7b0f..026bcb4b370 100644
--- a/mysql-test/r/subselect2.result
+++ b/mysql-test/r/subselect2.result
@@ -14,6 +14,9 @@ DOCID VARCHAR(32)BINARY NOT NULL
, PRIMARY KEY ( DOCID )
) ENGINE=InnoDB
;
+INSERT INTO t1 (DOCID) VALUES ("1"), ("2");
+Warnings:
+Warning 1364 Field 'UUID' doesn't have a default value
CREATE TABLE t2
(
DOCID VARCHAR(32)BINARY NOT NULL
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index 0666fd76661..a23b584e510 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -152,3 +152,23 @@ EXECUTE my_stmt;
b count(*)
deallocate prepare my_stmt;
drop table t1,t2;
+CREATE TABLE t1 (
+school_name varchar(45) NOT NULL,
+country varchar(45) NOT NULL,
+funds_requested float NOT NULL,
+schooltype varchar(45) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+insert into t1 values ("the school", "USA", 1200, "Human");
+select count(country) as countrycount, sum(funds_requested) as smcnt,
+country, (select sum(funds_requested) from t1) as total_funds
+from t1
+group by country;
+countrycount smcnt country total_funds
+1 1200 USA 1200
+select count(country) as countrycount, sum(funds_requested) as smcnt,
+country, (select sum(funds_requested) from t1) as total_funds
+from t1
+group by country;
+countrycount smcnt country total_funds
+1 1200 USA 1200
+drop table t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index f68c4805d72..999f12a0573 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -73,7 +73,7 @@ Table Create Table
user CREATE TABLE `user` (
`Host` char(60) collate utf8_bin NOT NULL default '',
`User` char(16) collate utf8_bin NOT NULL default '',
- `Password` binary(41) NOT NULL default '',
+ `Password` char(41) character set latin1 collate latin1_bin NOT NULL default '',
`Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
diff --git a/mysql-test/r/type_binary.result b/mysql-test/r/type_binary.result
new file mode 100644
index 00000000000..49fd7ba5633
--- /dev/null
+++ b/mysql-test/r/type_binary.result
@@ -0,0 +1,113 @@
+create table t1 (s1 binary(3));
+insert into t1 values (0x61), (0x6120), (0x612020);
+select hex(s1) from t1;
+hex(s1)
+610000
+612000
+612020
+drop table t1;
+create table t1 (s1 binary(2), s2 varbinary(2));
+insert into t1 values (0x4100,0x4100);
+select length(concat('*',s1,'*',s2,'*')) from t1;
+length(concat('*',s1,'*',s2,'*'))
+7
+delete from t1;
+insert into t1 values (0x4120,0x4120);
+select length(concat('*',s1,'*',s2,'*')) from t1;
+length(concat('*',s1,'*',s2,'*'))
+7
+drop table t1;
+create table t1 (s1 varbinary(20), s2 varbinary(20));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `s1` varbinary(20) default NULL,
+ `s2` varbinary(20) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values (0x41,0x4100),(0x41,0x4120),(0x4100,0x4120);
+select hex(s1), hex(s2) from t1;
+hex(s1) hex(s2)
+41 4100
+41 4120
+4100 4120
+select count(*) from t1 where s1 < s2;
+count(*)
+3
+drop table t1;
+create table t1 (s1 varbinary(2), s2 varchar(1));
+insert into t1 values (0x41,'a'), (0x4100,'b'), (0x41,'c'), (0x4100,'d');
+select hex(s1),s2 from t1 order by s1,s2;
+hex(s1) s2
+41 a
+41 c
+4100 b
+4100 d
+drop table t1;
+create table t1 (s1 binary(2) primary key);
+insert into t1 values (0x01);
+insert into t1 values (0x0120);
+insert into t1 values (0x0100);
+ERROR 23000: Duplicate entry '' for key 1
+select hex(s1) from t1 order by s1;
+hex(s1)
+0100
+0120
+select hex(s1) from t1 where s1=0x01;
+hex(s1)
+select hex(s1) from t1 where s1=0x0120;
+hex(s1)
+0120
+select hex(s1) from t1 where s1=0x0100;
+hex(s1)
+0100
+select count(distinct s1) from t1;
+count(distinct s1)
+2
+alter table t1 drop primary key;
+select hex(s1) from t1 where s1=0x01;
+hex(s1)
+select hex(s1) from t1 where s1=0x0120;
+hex(s1)
+0120
+select hex(s1) from t1 where s1=0x0100;
+hex(s1)
+0100
+select count(distinct s1) from t1;
+count(distinct s1)
+2
+drop table t1;
+create table t1 (s1 varbinary(2) primary key);
+insert into t1 values (0x01);
+insert into t1 values (0x0120);
+insert into t1 values (0x0100);
+select hex(s1) from t1 order by s1;
+hex(s1)
+01
+0100
+0120
+select hex(s1) from t1 where s1=0x01;
+hex(s1)
+01
+select hex(s1) from t1 where s1=0x0120;
+hex(s1)
+0120
+select hex(s1) from t1 where s1=0x0100;
+hex(s1)
+0100
+select count(distinct s1) from t1;
+count(distinct s1)
+3
+alter table t1 drop primary key;
+select hex(s1) from t1 where s1=0x01;
+hex(s1)
+01
+select hex(s1) from t1 where s1=0x0120;
+hex(s1)
+0120
+select hex(s1) from t1 where s1=0x0100;
+hex(s1)
+0100
+select count(distinct s1) from t1;
+count(distinct s1)
+3
+drop table t1;
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 193ed298339..b366b1ed755 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -67,7 +67,7 @@ select * from t1;
a
Where
drop table t1;
-create table t1 (t text,c char(10),b blob, d binary(10));
+create table t1 (t text,c char(10),b blob, d varbinary(10));
insert into t1 values (NULL,NULL,NULL,NULL);
insert into t1 values ("","","","");
insert into t1 values ("hello","hello","hello","hello");
@@ -83,14 +83,14 @@ Field Type Collation Null Key Default Extra Privileges Comment
t text latin1_swedish_ci YES NULL #
c char(10) latin1_swedish_ci YES NULL #
b blob NULL YES NULL #
-d binary(10) NULL YES NULL #
+d varbinary(10) NULL YES NULL #
lock tables t1 WRITE;
show full fields from t1;
Field Type Collation Null Key Default Extra Privileges Comment
t text latin1_swedish_ci YES NULL #
c char(10) latin1_swedish_ci YES NULL #
b blob NULL YES NULL #
-d binary(10) NULL YES NULL #
+d varbinary(10) NULL YES NULL #
unlock tables;
select t from t1 where t like "hello";
t
@@ -718,3 +718,73 @@ t1 CREATE TABLE `t1` (
KEY `a` (`a`,`b`,`d`,`e`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
+CREATE table t1 (a blob);
+insert into t1 values ('b'),('a\0'),('a'),('a '),('aa'),(NULL);
+select hex(a) from t1 order by a;
+hex(a)
+NULL
+61
+6100
+6120
+6161
+62
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+b
+NULL
+6100
+610000
+612000
+616100
+6200
+alter table t1 modify a varbinary(5);
+select hex(a) from t1 order by a;
+hex(a)
+NULL
+61
+6100
+6120
+6161
+62
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+b
+NULL
+6100
+610000
+612000
+616100
+6200
+alter table t1 modify a char(5);
+select hex(a) from t1 order by a;
+hex(a)
+NULL
+6100
+61
+61
+6161
+62
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+b
+NULL
+610000
+6100
+6100
+616100
+6200
+alter table t1 modify a binary(5);
+select hex(a) from t1 order by a;
+hex(a)
+NULL
+6100000000
+6100000000
+6100000000
+6161000000
+6200000000
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+b
+NULL
+610000000000
+610000000000
+610000000000
+616100000000
+620000000000
+drop table t1;
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 6b124caac14..c10cb7d71f7 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -225,6 +225,21 @@ select * from t1 where reckey=1.09E2;
reckey recdesc
109 Has 109 as key
drop table t1;
+create table t1 (d double(10,1));
+create table t2 (d double(10,9));
+insert into t1 values ("100000000.0");
+insert into t2 values ("1.23456780");
+create table t3 select * from t2 union select * from t1;
+select * from t3;
+d
+1.234567800
+100000000.000000000
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `d` double(22,9) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2, t3;
create table t1 (s1 float(0,2));
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
create table t1 (s1 float(1,2));
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index be5e29ab662..1ed4135d52b 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -846,15 +846,14 @@ select 0/0;
NULL
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x;
x
-999999999999999999999999999999999999999999999999999999999999999999999999999999999
+99999999999999999999999999999999999999999999999999999999999999999
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x;
x
-NULL
+100000000000000000000000000000000000000000000000000000000000000000
Warnings:
Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
select 0.190287977636363637 + 0.040372670 * 0 - 0;
0.190287977636363637 + 0.040372670 * 0 - 0
0.190287977636363637
@@ -1019,3 +1018,28 @@ drop procedure wg2;
select cast(@non_existing_user_var/2 as DECIMAL);
cast(@non_existing_user_var/2 as DECIMAL)
NULL
+create table t (d decimal(0,10));
+ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'd').
+create table t1 (c1 decimal(64));
+insert into t1 values(
+89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
+Warnings:
+Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value adjusted for column 'c1' at row 1
+insert into t1 values(
+99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 *
+99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
+Warnings:
+Error 1292 Truncated incorrect DECIMAL value: ''
+Error 1292 Truncated incorrect DECIMAL value: ''
+Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1264 Out of range value adjusted for column 'c1' at row 1
+insert into t1 values(1e100);
+Warnings:
+Warning 1264 Out of range value adjusted for column 'c1' at row 1
+select * from t1;
+c1
+9999999999999999999999999999999999999999999999999999999999999999
+9999999999999999999999999999999999999999999999999999999999999999
+9999999999999999999999999999999999999999999999999999999999999999
+drop table t1;
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 9ca6370dff6..aeb44fa4e6c 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -263,3 +263,85 @@ test
delete from t1 where count(*)=1;
ERROR HY000: Invalid use of group function
drop table t1;
+create table t1 ( a int, b int default 0, index (a) );
+insert into t1 (a) values (0),(0),(0),(0),(0),(0),(0),(0);
+flush status;
+select a from t1 order by a limit 1;
+a
+0
+show status like 'handler_read%';
+Variable_name Value
+Handler_read_first 1
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 0
+flush status;
+update t1 set a=9999 order by a limit 1;
+update t1 set b=9999 order by a limit 1;
+show status like 'handler_read%';
+Variable_name Value
+Handler_read_first 1
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 2
+Handler_read_rnd_next 9
+flush status;
+delete from t1 order by a limit 1;
+show status like 'handler_read%';
+Variable_name Value
+Handler_read_first 1
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 0
+Handler_read_rnd_next 0
+flush status;
+delete from t1 order by a desc limit 1;
+show status like 'handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 1
+Handler_read_rnd_next 9
+alter table t1 disable keys;
+flush status;
+delete from t1 order by a limit 1;
+show status like 'handler_read%';
+Variable_name Value
+Handler_read_first 0
+Handler_read_key 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_rnd 1
+Handler_read_rnd_next 9
+select * from t1;
+a b
+0 0
+0 0
+0 0
+0 0
+0 0
+update t1 set a=a+10,b=1 order by a limit 3;
+update t1 set a=a+11,b=2 order by a limit 3;
+update t1 set a=a+12,b=3 order by a limit 3;
+select * from t1 order by a;
+a b
+11 2
+21 2
+22 3
+22 3
+23 3
+drop table t1;
+create table t1 (f1 date not null);
+insert into t1 values('2000-01-01'),('0000-00-00');
+update t1 set f1='2002-02-02' where f1 is null;
+select * from t1;
+f1
+2000-01-01
+2002-02-02
+drop table t1;
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index 17ac8809d52..700ec7b09e0 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 98 User var 1 139 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 139 Query 1 231 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 231 User var 1 273 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
-master-bin.000001 273 User var 1 311 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci
+master-bin.000001 273 User var 1 311 @`var2`=_binary 0x61 COLLATE binary
master-bin.000001 311 Query 1 411 use `test`; insert into t1 values (@var1),(@var2)
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
@@ -24,7 +24,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
INSERT INTO t1 VALUES(@`a b`);
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`;
-SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
+SET @`var2`:=_binary 0x61 COLLATE `binary`;
SET TIMESTAMP=10000;
insert into t1 values (@var1),(@var2);
# End of log file
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index acdc793fb69..75a680e504d 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -123,6 +123,17 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
0 1 1 0
1 3 2 0
3 6 3 0
+set @a=0;
+select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
+@a @a:="hello" @a @a:=3 @a @a:="hello again"
+0 hello 0 3 0 hello again
+0 hello 0 3 0 hello again
+0 hello 0 3 0 hello again
+select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
+@a @a:="hello" @a @a:=3 @a @a:="hello again"
+hello again hello hello again 3 hello again hello again
+hello again hello hello again 3 hello again hello again
+hello again hello hello again 3 hello again hello again
drop table t1;
set @a=_latin2'test';
select charset(@a),collation(@a),coercibility(@a);
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 30ebeb462df..3ecc48620b1 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -518,6 +518,14 @@ select ifnull(@@character_set_results,"really null");
ifnull(@@character_set_results,"really null")
really null
set names latin1;
+select @@have_innodb;
+@@have_innodb
+#
+set @test = @@query_prealloc_size;
+set @@query_prealloc_size = @test;
+select @@query_prealloc_size = @test;
+@@query_prealloc_size = @test
+1
create table t1 (a int);
select a into @x from t1;
Warnings:
@@ -542,9 +550,6 @@ set @@max_heap_table_size= 4294967296;
select @@max_heap_table_size > 0;
@@max_heap_table_size > 0
1
-select @@have_innodb;
-@@have_innodb
-#
select @@character_set_system;
@@character_set_system
utf8
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index e52ec950c8c..a74feb4de17 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -574,10 +574,10 @@ create view v1 as select * from t1;
drop table t1;
create table t1 (col1 char(5),newcol2 char(5));
insert into v1 values('a','aa');
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop table t1;
select * from v1;
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v1;
create view v1 (a,a) as select 'a','a';
ERROR 42S21: Duplicate column name 'a'
@@ -809,11 +809,11 @@ create table t1 (s1 int);
create view v1 as select x1() from t1;
drop function x1;
select * from v1;
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
-v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s)
+v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) or define
drop view v1;
drop table t1;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
@@ -847,13 +847,16 @@ cast(1 as char(3))
drop view v1;
create table t1 (a int);
create view v1 as select a from t1;
-create database seconddb;
-rename table v1 to seconddb.v1;
-ERROR HY000: Changing schema from 'test' to 'seconddb' is not allowed.
+create view v3 as select a from t1;
+create database mysqltest;
+rename table v1 to mysqltest.v1;
+ERROR HY000: Changing schema from 'test' to 'mysqltest' is not allowed.
rename table v1 to v2;
+rename table v3 to v1, v2 to t1;
+ERROR 42S01: Table 't1' already exists
drop table t1;
-drop view v2;
-drop database seconddb;
+drop view v2,v3;
+drop database mysqltest;
create view v1 as select 'a',1;
create view v2 as select * from v1 union all select * from v1;
create view v3 as select * from v2 where 1 = (select `1` from v2);
@@ -1357,7 +1360,7 @@ test.t1 check status OK
drop table t1;
check table v1;
Table Op Msg_type Msg_text
-test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s)
+test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v1;
create table t1 (a int);
create table t2 (a int);
@@ -1881,11 +1884,11 @@ CREATE VIEW v6 AS SELECT CONVERT_TZ(col1,'GMT','MET') FROM t2;
DROP TABLE t1;
CHECK TABLE v1, v2, v3, v4, v5, v6;
Table Op Msg_type Msg_text
-test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s)
+test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
test.v2 check status OK
-test.v3 check error View 'test.v3' references invalid table(s) or column(s) or function(s)
+test.v3 check error View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
test.v4 check status OK
-test.v5 check error View 'test.v5' references invalid table(s) or column(s) or function(s)
+test.v5 check error View 'test.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
test.v6 check status OK
drop view v1, v2, v3, v4, v5, v6;
drop table t2;
@@ -1905,11 +1908,11 @@ CREATE VIEW v6 AS SELECT f2() FROM t3;
drop function f1;
CHECK TABLE v1, v2, v3, v4, v5, v6;
Table Op Msg_type Msg_text
-test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s)
+test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
test.v2 check status OK
-test.v3 check error View 'test.v3' references invalid table(s) or column(s) or function(s)
+test.v3 check error View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
test.v4 check status OK
-test.v5 check error View 'test.v5' references invalid table(s) or column(s) or function(s)
+test.v5 check error View 'test.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
test.v6 check status OK
create function f1 () returns int return (select max(col1) from t1);
DROP TABLE t1;
@@ -2151,7 +2154,7 @@ Field Type Null Key Default Extra
f4 char(5) YES NULL
ALTER TABLE t1 CHANGE COLUMN f4 f4x CHAR(5);
DESCRIBE v1;
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP TABLE t1;
DROP VIEW v1;
create table t1 (f1 char);
@@ -2195,7 +2198,7 @@ r_object_id users_names
120001a080000542 guser02
drop view v1, v2;
drop table t1, t2;
-create definer=some_user@__% sql security invoker view v1 as select 1;
+create definer=some_user@`` sql security invoker view v1 as select 1;
ERROR HY000: View definer is not fully qualified
create definer=some_user@localhost sql security invoker view v1 as select 1;
Warnings:
@@ -2298,3 +2301,37 @@ a
3
DROP VIEW v1;
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b INT, INDEX(a,b));
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 (a INT);
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
+INSERT INTO t3 VALUES (1),(2),(3);
+CREATE VIEW v1 AS SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b;
+CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a;
+EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
+1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index
+EXPLAIN SELECT * FROM v1 WHERE a=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
+1 PRIMARY t2 ref a a 10 const,test.t1.b 2 Using where; Using index
+EXPLAIN SELECT * FROM v2 WHERE a=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
+1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
+DROP VIEW v1,v2;
+DROP TABLE t1,t2,t3;
+create table t1 (f1 int, f2 int);
+insert into t1 values(1,1),(1,2),(1,3);
+create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1;
+create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1;
+select * from v1;
+f1 group_concat(f2 order by f2 asc)
+1 1,2,3
+select * from v2;
+f1 group_concat(f2 order by f2 desc)
+1 3,2,1
+drop view v1,v2;
+drop table t1;
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index bac6e691069..43df5c29f92 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -305,5 +305,199 @@ create table mysqltest.t1 (a int);
grant all privileges on mysqltest.* to mysqltest_1@localhost;
use mysqltest;
create view v1 as select * from t1;
+use test;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
drop database mysqltest;
+create database mysqltest;
+create table mysqltest.t1 (a int, b int);
+grant select on mysqltest.t1 to mysqltest_1@localhost;
+grant create view,select on test.* to mysqltest_1@localhost;
+create view v1 as select * from mysqltest.t1;
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1`
+revoke select on mysqltest.t1 from mysqltest_1@localhost;
+select * from v1;
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+grant select on mysqltest.t1 to mysqltest_1@localhost;
+select * from v1;
+a b
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop view v1;
+drop database mysqltest;
+create database mysqltest;
+use mysqltest;
+create table t1 (a int);
+insert into t1 values (1);
+create table t2 (s1 int);
+drop function if exists f2;
+create function f2 () returns int begin declare v int; select s1 from t2
+into v; return v; end//
+create algorithm=TEMPTABLE view v1 as select f2() from t1;
+create algorithm=MERGE view v2 as select f2() from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
+create SQL SECURITY INVOKER view v5 as select * from v4;
+grant select on v1 to mysqltest_1@localhost;
+grant select on v2 to mysqltest_1@localhost;
+grant select on v3 to mysqltest_1@localhost;
+grant select on v4 to mysqltest_1@localhost;
+grant select on v5 to mysqltest_1@localhost;
+use mysqltest;
+select * from v1;
+f2()
+NULL
+Warnings:
+Warning 1329 No data to FETCH
+select * from v2;
+f2()
+NULL
+Warnings:
+Warning 1329 No data to FETCH
+select * from v3;
+ERROR HY000: View 'mysqltest.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v4;
+ERROR HY000: View 'mysqltest.v4' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v5;
+ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+use test;
+drop view v1, v2, v3, v4, v5;
+drop function f2;
+drop table t1, t2;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+create database mysqltest;
+use mysqltest;
+create table t1 (a int);
+insert into t1 values (1);
+create table t2 (s1 int);
+drop function if exists f2;
+create function f2 () returns int begin declare v int; select s1 from t2
+into v; return v; end//
+grant select on t1 to mysqltest_1@localhost;
+grant execute on function f2 to mysqltest_1@localhost;
+grant create view on mysqltest.* to mysqltest_1@localhost;
+use mysqltest;
+create algorithm=TEMPTABLE view v1 as select f2() from t1;
+create algorithm=MERGE view v2 as select f2() from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
+use test;
+create view v5 as select * from v1;
+revoke execute on function f2 from mysqltest_1@localhost;
+select * from v1;
+ERROR HY000: View 'mysqltest.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v2;
+ERROR HY000: View 'mysqltest.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v3;
+f2()
+NULL
+Warnings:
+Warning 1329 No data to FETCH
+select * from v4;
+f2()
+NULL
+Warnings:
+Warning 1329 No data to FETCH
+select * from v5;
+ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+drop view v1, v2, v3, v4, v5;
+drop function f2;
+drop table t1, t2;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+create database mysqltest;
+use mysqltest;
+create table t1 (a int);
+create table v1 (a int);
+insert into t1 values (1);
+grant select on t1 to mysqltest_1@localhost;
+grant select on v1 to mysqltest_1@localhost;
+grant create view on mysqltest.* to mysqltest_1@localhost;
+drop table v1;
+use mysqltest;
+create algorithm=TEMPTABLE view v1 as select *, a as b from t1;
+create algorithm=MERGE view v2 as select *, a as b from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
+create view v5 as select * from v1;
+use test;
+revoke select on t1 from mysqltest_1@localhost;
+select * from v1;
+ERROR HY000: View 'mysqltest.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v2;
+ERROR HY000: View 'mysqltest.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v3;
+a b
+1 1
+select * from v4;
+a b
+1 1
+select * from v5;
+ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+drop table t1;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+create database mysqltest;
+use mysqltest;
+create table t1 (a int);
+insert into t1 values (1);
+create algorithm=TEMPTABLE view v1 as select *, a as b from t1;
+create algorithm=MERGE view v2 as select *, a as b from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
+create SQL SECURITY INVOKER view v5 as select * from v4;
+grant select on v1 to mysqltest_1@localhost;
+grant select on v2 to mysqltest_1@localhost;
+grant select on v3 to mysqltest_1@localhost;
+grant select on v4 to mysqltest_1@localhost;
+grant select on v5 to mysqltest_1@localhost;
+use mysqltest;
+select * from v1;
+a b
+1 1
+select * from v2;
+a b
+1 1
+select * from v3;
+ERROR HY000: View 'mysqltest.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v4;
+ERROR HY000: View 'mysqltest.v4' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+select * from v5;
+ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+use test;
+drop view v1, v2, v3, v4, v5;
+drop table t1;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+drop view if exists v1;
+create table t1 as select * from mysql.user where user='';
+delete from mysql.user where user='';
+flush privileges;
+grant all on test.* to 'test14256'@'%';
+use test;
+create view v1 as select 42;
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42`
+select definer into @v1def1 from information_schema.views
+where table_schema = 'test' and table_name='v1';
+drop view v1;
+create definer=`test14256`@`%` view v1 as select 42;
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`test14256`@`%` SQL SECURITY DEFINER VIEW `v1` AS select 42 AS `42`
+select definer into @v1def2 from information_schema.views
+where table_schema = 'test' and table_name='v1';
+drop view v1;
+select @v1def1, @v1def2, @v1def1=@v1def2;
+@v1def1 @v1def2 @v1def1=@v1def2
+test14256@% test14256@% 1
+drop user test14256;
+insert into mysql.user select * from t1;
+flush privileges;
+drop table t1;
diff --git a/mysql-test/r/wait_timeout.result b/mysql-test/r/wait_timeout.result
new file mode 100644
index 00000000000..56232e481c0
--- /dev/null
+++ b/mysql-test/r/wait_timeout.result
@@ -0,0 +1,8 @@
+select 1;
+1
+1
+select 2;
+ERROR HY000: MySQL server has gone away
+select 3;
+3
+3
diff --git a/mysql-test/std_data/loaddata_dq.dat b/mysql-test/std_data/loaddata_dq.dat
new file mode 100644
index 00000000000..5bdddfa977a
--- /dev/null
+++ b/mysql-test/std_data/loaddata_dq.dat
@@ -0,0 +1,3 @@
+"field1","field2"
+"a""b","cd""ef"
+"a"b",c"d"e
diff --git a/mysql-test/std_data/ndb_config_mycnf2.cnf b/mysql-test/std_data/ndb_config_mycnf2.cnf
new file mode 100644
index 00000000000..3bf6b9a1194
--- /dev/null
+++ b/mysql-test/std_data/ndb_config_mycnf2.cnf
@@ -0,0 +1,31 @@
+#
+# Testing automatic node id generation
+#
+[cluster_config]
+NoOfReplicas=2
+Signum=39
+
+[cluster_config.cluster0]
+ndbd = localhost,localhost,localhost,localhost
+ndb_mgmd = localhost
+mysqld = ,,,,
+
+[cluster_config.cluster1]
+ndbd = localhost,localhost,localhost,localhost
+ndb_mgmd = localhost
+mysqld = ,,,,
+[cluster_config.ndbd.1.cluster1]
+NodeId=2
+[cluster_config.mysqld.1.cluster1]
+NodeId=1
+
+[cluster_config.cluster2]
+ndbd = localhost,localhost,localhost,localhost
+ndb_mgmd = localhost,localhost
+mysqld = ,,,,
+[cluster_config.mysqld.1.cluster2]
+NodeId=11
+[cluster_config.ndb_mgmd.1.cluster2]
+NodeId=1
+[cluster_config.ndbd.1.cluster2]
+NodeId=3
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 1beb7e4acdf..fdc835e1852 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -278,7 +278,7 @@ insert into t1 values ('ÔÅÓÔ');
select a,hex(a) from t1;
alter table t1 change a a char(10) character set cp1251;
select a,hex(a) from t1;
-alter table t1 change a a binary(10);
+alter table t1 change a a binary(4);
select a,hex(a) from t1;
alter table t1 change a a char(10) character set cp1251;
select a,hex(a) from t1;
@@ -373,24 +373,24 @@ drop table t1;
# Bug#11493 - Alter table rename to default database does not work without
# db name qualifying
#
-create database mysqltest1;
+create database mysqltest;
create table t1 (c1 int);
# Move table to other database.
-alter table t1 rename mysqltest1.t1;
+alter table t1 rename mysqltest.t1;
# Assure that it has moved.
--error 1051
drop table t1;
# Move table back.
-alter table mysqltest1.t1 rename t1;
+alter table mysqltest.t1 rename t1;
# Assure that it is back.
drop table t1;
# Now test for correct message if no database is selected.
# Create t1 in 'test'.
create table t1 (c1 int);
# Change to other db.
-use mysqltest1;
+use mysqltest;
# Drop the current db. This de-selects any db.
-drop database mysqltest1;
+drop database mysqltest;
# Now test for correct message.
--error 1046
alter table test.t1 rename t1;
diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test
index 4060892c389..a248c671c18 100644
--- a/mysql-test/t/analyse.test
+++ b/mysql-test/t/analyse.test
@@ -65,5 +65,30 @@ insert into t1 values (100000);
select * from t1 procedure analyse (1,1);
drop table t1;
+#
+# Bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server
+#
+create table t1 (product varchar(32), country_id int not null, year int,
+ profit int);
+insert into t1 values ( 'Computer', 2,2000, 1200),
+ ( 'TV', 1, 1999, 150),
+ ( 'Calculator', 1, 1999,50),
+ ( 'Computer', 1, 1999,1500),
+ ( 'Computer', 1, 2000,1500),
+ ( 'TV', 1, 2000, 150),
+ ( 'TV', 2, 2000, 100),
+ ( 'TV', 2, 2000, 100),
+ ( 'Calculator', 1, 2000,75),
+ ( 'Calculator', 2, 2000,75),
+ ( 'TV', 1, 1999, 100),
+ ( 'Computer', 1, 1999,1200),
+ ( 'Computer', 2, 2000,1500),
+ ( 'Calculator', 2, 2000,75),
+ ( 'Phone', 3, 2003,10)
+ ;
+create table t2 (country_id int primary key, country char(20) not null);
+insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland');
+select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse();
+drop table t1,t2;
# End of 4.1 tests
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 4318525fe43..ba2ad3ed8aa 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1339,10 +1339,19 @@ SELECT * FROM t2;
TRUNCATE TABLE t2;
SELECT * FROM t2;
+# Adding support for CHECK table
+CHECK TABLE t2;
+SELECT * FROM t2;
+
-# Just test syntax, we will never know if the out put is right or wrong
+# Just test syntax, we will never know if the output is right or wrong
# Must be the last test
INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
+
+# Adding test for alter table
+ALTER TABLE t2 DROP COLUMN fld6;
+SHOW CREATE TABLE t2;
+SELECT * from t2;
#
# Cleanup, test is over
#
diff --git a/mysql-test/t/archive_gis.test b/mysql-test/t/archive_gis.test
new file mode 100644
index 00000000000..ffbad923173
--- /dev/null
+++ b/mysql-test/t/archive_gis.test
@@ -0,0 +1,3 @@
+--source include/have_archive.inc
+SET storage_engine=archive;
+--source include/gis_generic.inc
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 3167682f816..97d8f28cd3f 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -962,6 +962,7 @@ source include/varchar.inc;
# Some errors/warnings on create
#
+--replace_result 1024 MAX_KEY_LENGTH 3072 MAX_KEY_LENGTH
create table t1 (v varchar(65530), key(v));
drop table if exists t1;
create table t1 (v varchar(65536));
diff --git a/mysql-test/t/bdb_gis.test b/mysql-test/t/bdb_gis.test
new file mode 100644
index 00000000000..88dcbb7cbe9
--- /dev/null
+++ b/mysql-test/t/bdb_gis.test
@@ -0,0 +1,3 @@
+-- source include/have_bdb.inc
+SET storage_engine=bdb;
+--source include/gis_generic.inc
diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test
index 02773b32302..1ac0cfebb28 100644
--- a/mysql-test/t/binary.test
+++ b/mysql-test/t/binary.test
@@ -56,7 +56,7 @@ drop table t1;
#
# Test of binary and upper/lower
#
-create table t1 (a char(15) binary, b binary(15));
+create table t1 (a char(3) binary, b binary(3));
insert into t1 values ('aaa','bbb'),('AAA','BBB');
select upper(a),upper(b) from t1;
select lower(a),lower(b) from t1;
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index 6220b4cbae7..70eb87131df 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -101,7 +101,7 @@ drop table t1;
# Bug 2202
# CAST from BINARY to non-BINARY and from non-BINARY to BINARY
#
-create table t1 (a binary(10), b char(10) character set koi8r);
+create table t1 (a binary(4), b char(4) character set koi8r);
insert into t1 values (_binary'ÔÅÓÔ',_binary'ÔÅÓÔ');
select a,b,cast(a as char character set cp1251),cast(b as binary) from t1;
set names koi8r;
@@ -160,6 +160,11 @@ select cast(concat('184467440','73709551615') as signed);
select cast(repeat('1',20) as unsigned);
select cast(repeat('1',20) as signed);
+#
+# Bug #13344: cast of large decimal to signed int not handled correctly
+#
+select cast(1.0e+300 as signed int);
+
# End of 4.1 tests
diff --git a/mysql-test/t/compress.test b/mysql-test/t/compress.test
new file mode 100644
index 00000000000..46244edd2a8
--- /dev/null
+++ b/mysql-test/t/compress.test
@@ -0,0 +1,15 @@
+# Turn on compression between the client and server
+# and run a number of tests
+
+-- source include/have_compress.inc
+
+connect (comp_con,localhost,root,,,,,COMPRESS);
+
+# Check compression turned on
+SHOW STATUS LIKE 'Compression';
+
+# Source select test case
+-- source include/common-tests.inc
+
+# Check compression turned on
+SHOW STATUS LIKE 'Compression';
diff --git a/mysql-test/t/connect.test b/mysql-test/t/connect.test
index 60ac7b88bbe..a867baa9fc9 100644
--- a/mysql-test/t/connect.test
+++ b/mysql-test/t/connect.test
@@ -1,7 +1,6 @@
# This test is to check various cases of connections
-# with right and wrong password, with and without database
-# Unfortunately the check is incomplete as we can't handle errors on connect
-# Also we can't connect without database
+# with right and wrong password, with and without database
+# Unfortunately the check is incomplete as we can't connect without database
# This test makes no sense with the embedded server
--source include/not_embedded.inc
@@ -10,69 +9,72 @@
drop table if exists t1,t2;
--enable_warnings
+
#connect (con1,localhost,root,,"");
#show tables;
connect (con1,localhost,root,,mysql);
show tables;
-connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
show tables;
-# Re enable this one day if error handling on connect will take place
-
-#connect (con1,localhost,root,z,test2);
-#--error 1045
-#connect (con1,localhost,root,z,);
-#--error 1045
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,root,z,test2);
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,root,z,);
grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
# Now check this user with different databases
-
#connect (con1,localhost,test,gambling,"");
#show tables;
-connect (con1,localhost,test,gambling,mysql);
+connect (con3,localhost,test,gambling,mysql);
show tables;
-connect (con1,localhost,test,gambling,test);
+connect (con4,localhost,test,gambling,test);
show tables;
-# Re enable this one day if error handling on connect will take place
-
-#connect (con1,localhost,test,,test2);
-#--error 1045
-#connect (con1,localhost,test,,"");
-#--error 1045
-#connect (con1,localhost,test,zorro,test2);
-#--error 1045
-#connect (con1,localhost,test,zorro,);
-#--error 1045
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,,test2);
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,,"");
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,zorro,test2);
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,zorro,);
# check if old password version also works
update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges;
-#connect (con1,localhost,test,gambling2,"");
-#show tables;
-connect (con1,localhost,test,gambling2,mysql);
+connect (con10,localhost,test,gambling2,);
+connect (con5,localhost,test,gambling2,mysql);
set password="";
--error 1372
set password='gambling3';
set password=old_password('gambling3');
show tables;
-connect (con1,localhost,test,gambling3,test);
+connect (con6,localhost,test,gambling3,test);
show tables;
-# Re enable this one day if error handling on connect will take place
-
-#connect (con1,localhost,test,,test2);
-#--error 1045
-#connect (con1,localhost,test,,);
-#--error 1045
-#connect (con1,localhost,test,zorro,test2);
-#--error 1045
-#connect (con1,localhost,test,zorro,);
-#--error 1045
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,,test2);
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,,);
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,zorro,test2);
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (fail_con,localhost,test,zorro,);
# remove user 'test' so that other tests which may use 'test'
@@ -84,13 +86,13 @@ flush privileges;
#
# Bug#12517: Clear user variables and replication events before
# closing temp tables in thread cleanup.
-connect (con2,localhost,root,,test);
-connection con2;
+connect (con7,localhost,root,,test);
+connection con7;
create table t1 (id integer not null auto_increment primary key);
create temporary table t2(id integer not null auto_increment primary key);
set @id := 1;
delete from t1 where id like @id;
-disconnect con2;
+disconnect con7;
--sleep 5
connection default;
drop table t1;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index b72dc49e89a..67ad3058153 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -545,4 +545,13 @@ create table t1 (a int);
create table if not exists t1 (a int);
drop table t1;
+# BUG#14139
+create table t1 (
+ a varchar(112) charset utf8 collate utf8_bin not null,
+ primary key (a)
+) select 'test' as a ;
+--warning 1364
+show create table t1;
+drop table t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test
index 1788dce755b..ffe2a12234e 100644
--- a/mysql-test/t/ctype_big5.test
+++ b/mysql-test/t/ctype_big5.test
@@ -38,4 +38,19 @@ INSERT INTO t1 VALUES(0xA741ADCCA66EB6DC20A7DAADCCABDCA66E);
SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST (0xA741ADCCA66EB6DC IN BOOLEAN MODE);
DROP TABLE t1;
+#
+# Bug#12476 Some big5 codes are still missing.
+#
+set names big5;
+create table t1 (a char character set big5);
+insert into t1 values (0xF9D6),(0xF9D7),(0xF9D8),(0xF9D9);
+insert into t1 values (0xF9DA),(0xF9DB),(0xF9DC);
+# Check round trip
+select hex(a) a, hex(@u:=convert(a using utf8)) b,
+hex(convert(@u using big5)) c from t1 order by a;
+# Check that there is no "illegal mix of collations" error with Unicode.
+alter table t1 convert to character set utf8;
+select hex(a) from t1 where a = _big5 0xF9DC;
+drop table t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test
index ea4b35a44a3..2d1e5f0bf9d 100644
--- a/mysql-test/t/ctype_cp1250_ch.test
+++ b/mysql-test/t/ctype_cp1250_ch.test
@@ -23,4 +23,25 @@ SELECT * FROM t1 WHERE popisek = '2005-01-1';
SELECT * FROM t1 WHERE popisek LIKE '2005-01-1';
drop table t1;
+#
+# Bug#13347: empty result from query with like and cp1250 charset
+#
+set names cp1250;
+CREATE TABLE t1
+(
+ id INT AUTO_INCREMENT PRIMARY KEY,
+ str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '',
+ UNIQUE KEY (str)
+);
+
+INSERT INTO t1 VALUES (NULL, 'a');
+INSERT INTO t1 VALUES (NULL, 'aa');
+INSERT INTO t1 VALUES (NULL, 'aaa');
+INSERT INTO t1 VALUES (NULL, 'aaaa');
+INSERT INTO t1 VALUES (NULL, 'aaaaa');
+INSERT INTO t1 VALUES (NULL, 'aaaaaa');
+INSERT INTO t1 VALUES (NULL, 'aaaaaaa');
+select * from t1 where str like 'aa%';
+drop table t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test
index 1aafe7b7266..463a9cea4bc 100644
--- a/mysql-test/t/ctype_cp1251.test
+++ b/mysql-test/t/ctype_cp1251.test
@@ -21,7 +21,7 @@ drop table t1;
#
# Test of binary and upper/lower
#
-create table t1 (a char(15) binary, b binary(15)) character set cp1251;
+create table t1 (a char(3) binary, b binary(3)) character set cp1251;
insert into t1 values ('aaa','bbb'),('AAA','BBB');
select upper(a),upper(b) from t1;
select lower(a),lower(b) from t1;
diff --git a/mysql-test/t/ctype_cp932.test b/mysql-test/t/ctype_cp932.test
index 3d630311b3a..082786e38af 100644
--- a/mysql-test/t/ctype_cp932.test
+++ b/mysql-test/t/ctype_cp932.test
@@ -424,3 +424,13 @@ SET collation_connection='cp932_japanese_ci';
-- source include/ctype_filesort.inc
SET collation_connection='cp932_bin';
-- source include/ctype_filesort.inc
+
+#
+# Bug#12547: Inserting long string into varchar causes table crash in cp932
+#
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert into t1 values ('ab');
+select * from t1;
+insert into t1 values ('abc');
+select * from t1;
diff --git a/mysql-test/t/ctype_cp932_binlog.test b/mysql-test/t/ctype_cp932_binlog.test
new file mode 100644
index 00000000000..270e27cf27f
--- /dev/null
+++ b/mysql-test/t/ctype_cp932_binlog.test
@@ -0,0 +1,34 @@
+-- source include/not_embedded.inc
+-- source include/have_cp932.inc
+
+--character_set cp932
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+set names cp932;
+set character_set_database = cp932;
+
+# Test prepared statement with 0x8300 sequence in parameter while
+# running with cp932 client character set.
+RESET MASTER;
+CREATE TABLE t1(f1 blob);
+PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
+SET @var1= x'8300';
+# TODO: Note that this doesn't actually test the code which was added for
+# bug#11338 because this syntax for prepared statements causes the PS to
+# be replicated differently than if we executed the PS from C or Java.
+# Using this syntax, variable names are inserted into the binlog instead
+# of values. The real goal of this test is to check the code that was
+# added to Item_param::query_val_str() in order to do hex encoding of
+# PS parameters when the client character set is cp932;
+# Bug#11338 has an example java program which can be used to verify this
+# code (and I have used it to test the fix) until there is some way to
+# exercise this code from mysql-test-run.
+EXECUTE stmt1 USING @var1;
+SHOW BINLOG EVENTS FROM 98;
+SELECT HEX(f1) FROM t1;
+DROP table t1;
+# end test for bug#11338
+
+# End of 4.1 tests
diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test
index 8953aaecaf8..a005b4769c4 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -55,6 +55,23 @@ SELECT
DROP TABLE t1;
#
+# Bug#13145: A table named "C-cedilla" can't be dropped.
+# Accept extended cp1252 letters as valid identifiers.
+# This test partially checks that "ctype" array is correct
+# for cp1252 extended characters 0x80-0x9F.
+#
+# 0x83 0x0192 #LATIN SMALL LETTER F WITH HOOK
+# 0x8A 0x0160 #LATIN CAPITAL LETTER S WITH CARON
+# 0x8C 0x0152 #LATIN CAPITAL LIGATURE OE
+# 0x8E 0x017D #LATIN CAPITAL LETTER Z WITH CARON
+# 0x9A 0x0161 #LATIN SMALL LETTER S WITH CARON
+# 0x9C 0x0153 #LATIN SMALL LIGATURE OE
+# 0x9E 0x017E #LATIN SMALL LETTER Z WITH CARON
+# 0x9F 0x0178 #LATIN CAPITAL LETTER Y WITH DIAERESIS
+#
+SELECT 1 as ƒ, 2 as Š, 3 as Œ, 4 as Ž, 5 as š, 6 as œ, 7 as ž, 8 as Ÿ;
+
+#
# Bug #6737: REGEXP gives wrong result with case sensitive collation
#
select 'a' regexp 'A' collate latin1_general_ci;
diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test
index 22e844c6868..0903c3dd7fa 100644
--- a/mysql-test/t/ctype_many.test
+++ b/mysql-test/t/ctype_many.test
@@ -148,7 +148,7 @@ SET CHARACTER SET koi8r;
SELECT * FROM t1;
-ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default '';
+ALTER TABLE t1 ADD bin_f CHAR(1) BYTE NOT NULL default '';
UPDATE t1 SET bin_f=koi8_ru_f;
SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1;
@@ -204,7 +204,7 @@ UPDATE t1 SET greek_f=CONVERT(ucs2_f USING greek) WHERE comment LIKE _latin2'GRE
UPDATE t1 SET armscii8_f=CONVERT(ucs2_f USING armscii8) WHERE comment LIKE _latin2'ARM%';
UPDATE t1 SET utf8_f=CONVERT(ucs2_f USING utf8) WHERE utf8_f=_utf8'';
UPDATE t1 SET ucs2_f=CONVERT(utf8_f USING ucs2) WHERE ucs2_f=_ucs2'';
-SELECT * FROM t1;
+SELECT comment, koi8_ru_f, utf8_f, hex(bin_f), ucs2_f, armscii8_f, greek_f FROM t1;
SET CHARACTER SET 'binary';
SELECT * FROM t1;
SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 8194dbdb438..5670e9efbf9 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -851,6 +851,23 @@ insert into t1 values (_utf8 0x5b);
select hex(a) from t1;
drop table t1;
+#
+# Bug#13751 find_in_set: Illegal mix of collations
+#
+set names 'latin1';
+create table t1 (a varchar(255)) default charset=utf8;
+select * from t1 where find_in_set('-1', a);
+drop table t1;
+
+#
+# Bug#13233: select distinct char(column) fails with utf8
+#
+create table t1 (a int);
+insert into t1 values (48),(49),(50);
+set names utf8;
+select distinct char(a) from t1;
+drop table t1;
+
# End of 4.1 tests
#
@@ -871,18 +888,32 @@ DROP TABLE t1;
#
set names utf8;
# correct value
-select hex(char(1));
-select char(0xd1,0x8f);
-select char(0xd18f);
-select char(53647);
+select hex(char(1 using utf8));
+select char(0xd1,0x8f using utf8);
+select char(0xd18f using utf8);
+select char(53647 using utf8);
# incorrect value: return with warning
-select char(0xff,0x8f);
+select char(0xff,0x8f using utf8);
# incorrect value in strict mode: return NULL with "Error" level warning
set sql_mode=traditional;
-select char(0xff,0x8f);
-select char(195);
-select char(196);
-select char(2557);
+select char(0xff,0x8f using utf8);
+select char(195 using utf8);
+select char(196 using utf8);
+select char(2557 using utf8);
+
+#
+# Check convert + char + using
+#
+select hex(convert(char(2557 using latin1) using utf8));
+
+#
+# char() without USING returns "binary" by default, any argument is ok
+#
+select hex(char(195));
+select hex(char(196));
+select hex(char(2557));
+
+
#
# Bug#12891: UNION doesn't return DISTINCT result for multi-byte characters
@@ -894,3 +925,20 @@ insert into t1 values('a'),('a'),(0xE38182),(0xE38182);
insert into t1 values('i'),('i'),(0xE38184),(0xE38184);
select * from t1 union distinct select * from t2;
drop table t1,t2;
+
+
+#
+# Bug#12371: executing prepared statement fails (illegal mix of collations)
+#
+set names utf8;
+create table t1 (a char(10), b varchar(10));
+insert into t1 values ('bar','kostja');
+insert into t1 values ('kostja','bar');
+prepare my_stmt from "select * from t1 where a=?";
+set @a:='bar';
+execute my_stmt using @a;
+set @a:='kostja';
+execute my_stmt using @a;
+set @a:=null;
+execute my_stmt using @a;
+drop table if exists t1;
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index f76f51fd12d..c007c2f5205 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -261,4 +261,12 @@ select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1,
str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2;
--enable_ps_protocol
+#
+# Bug #14016
+#
+create table t1 (f1 datetime);
+insert into t1 (f1) values ("2005-01-01");
+insert into t1 (f1) values ("2005-02-01");
+select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
+drop table t1;
# End of 4.1 tests
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index fe95a543fb5..eedf4b30e73 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -15,3 +15,4 @@ rpl_relayrotate : Unstable test case, bug#12429
rpl_until : Unstable test case, bug#12429
rpl_deadlock : Unstable test case, bug#12429
kill : Unstable test case, bug#9712
+archive_gis : The test fails on 32bit Linux
diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/t/drop_temp_table.test
index 38c13e3e5e4..bc06de4096c 100644
--- a/mysql-test/t/drop_temp_table.test
+++ b/mysql-test/t/drop_temp_table.test
@@ -1,6 +1,10 @@
# Embedded server doesn't support binlog
-- source include/not_embedded.inc
+--disable_warnings
+drop database if exists `drop-temp+table-test`;
+--enable_warnings
+
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test
index c401468a940..b6b3b90c083 100644
--- a/mysql-test/t/federated.test
+++ b/mysql-test/t/federated.test
@@ -75,6 +75,9 @@ eval CREATE TABLE federated.t2 (
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval SHOW CREATE TABLE federated.t2;
+
INSERT INTO federated.t2 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t2 (id, name) VALUES (2, 'fee');
@@ -348,7 +351,7 @@ DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
`name` char(32) NOT NULL DEFAULT '',
- `bincol` binary(4) NOT NULL,
+ `bincol` binary(1) NOT NULL,
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
`other` int NOT NULL DEFAULT 0,
PRIMARY KEY (id),
@@ -363,7 +366,7 @@ DROP TABLE IF EXISTS federated.t1;
eval CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
`name` char(32) NOT NULL DEFAULT '',
- `bincol` binary(4) NOT NULL,
+ `bincol` binary(1) NOT NULL,
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
`other` int NOT NULL DEFAULT 0,
PRIMARY KEY (id),
@@ -1185,5 +1188,40 @@ connection slave;
DROP TABLE federated.normal_table;
# END ALTER TEST
+#
+# Test BUG #14532 - bit columns broken in federated
+# storage engine
+#
+--disable_warnings
+DROP TABLE IF EXISTS federated.t1;
+--enable_warnings
+CREATE TABLE federated.t1 (
+ `bitty` bit(3)
+) DEFAULT CHARSET=latin1;
+
+connection master;
+
+--disable_warnings
+DROP TABLE IF EXISTS federated.t1;
+--enable_warnings
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE federated.t1 (
+ `bitty` bit(3)
+) ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+ CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+INSERT INTO federated.t1 VALUES (b'001');
+INSERT INTO federated.t1 VALUES (b'010');
+INSERT INTO federated.t1 VALUES (b'011');
+INSERT INTO federated.t1 VALUES (b'100');
+INSERT INTO federated.t1 VALUES (b'101');
+INSERT INTO federated.t1 VALUES (b'110');
+INSERT INTO federated.t1 VALUES (b'111');
+select * FROM federated.t1;
+drop table federated.t1;
+
+connection slave;
+drop table federated.t1;
source include/federated_cleanup.inc;
diff --git a/mysql-test/t/func_crypt.test b/mysql-test/t/func_crypt.test
index 5e0283feb28..cc3cdb9564d 100644
--- a/mysql-test/t/func_crypt.test
+++ b/mysql-test/t/func_crypt.test
@@ -49,4 +49,10 @@ select old_password(' i d k f a ');
explain extended select password('idkfa '), old_password('idkfa');
+#
+# Bug #13619: Crash on FreeBSD with salt like '_.'
+#
+--replace_column 1 #
+select encrypt('1234','_.');
+
# End of 4.1 tests
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 19596c1b55a..9237205eeb5 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -2,6 +2,8 @@
# simple test of all group functions
#
+--source include/have_innodb.inc
+
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index dd4edd8ca48..0472968f918 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -97,7 +97,7 @@ select 1 in ('1.1',2.0);
# Test case for bug #6365
-create table t1 (a char(20) character set binary);
+create table t1 (a char(2) character set binary);
insert into t1 values ('aa'), ('bb');
select * from t1 where a in (NULL, 'aa');
drop table t1;
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 633e36f51ab..24dd18daab1 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -116,4 +116,26 @@ insert into t1 values (1);
select rand(i) from t1;
drop table t1;
+#
+# Bug #14009: use of abs() on null value causes problems with filesort
+#
+# InnoDB is required to reproduce the fault, but it is okay if we default to
+# MyISAM when testing.
+create table t1 (a varchar(90), ts datetime not null, index (a)) engine=innodb default charset=utf8;
+insert into t1 values ('http://www.foo.com/', now());
+select a from t1 where a='http://www.foo.com/' order by abs(timediff(ts, 0));
+drop table t1;
+
# End of 4.1 tests
+
+#
+# Bug #13820 (No warning on log(negative)
+#
+set sql_mode='traditional';
+select ln(-1);
+select log10(-1);
+select log2(-1);
+select log(2,-1);
+select log(-2,1);
+set sql_mode='';
+
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 5f32b7b2b49..ac2bf820257 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -15,6 +15,7 @@ select bit_length('\n\t\r\b\0\_\%\\');
select char_length('\n\t\r\b\0\_\%\\');
select length(_latin1'\n\t\n\b\0\\_\\%\\');
select concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h');
+select hex(char(256));
select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;
select instr('hello','HE'), instr('hello',binary 'HE'), instr(binary 'hello','HE');
select position(binary 'll' in 'hello'),position('a' in binary 'hello');
@@ -467,6 +468,7 @@ SELECT lpad(12345, 5, "#");
#
SELECT conv(71, 10, 36), conv('1Z', 36, 10);
+SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
#
# Bug in SUBSTRING when mixed with CONCAT and ORDER BY (Bug #3089)
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 3dd7f7276fb..3a2eea59bed 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -404,4 +404,28 @@ delimiter ;//
call t_sysdate();
drop procedure t_sysdate;
+#
+# Bug #13534: timestampdiff() returned incorrect results across leap years
+#
+select timestampdiff(month,'2004-09-11','2004-09-11');
+select timestampdiff(month,'2004-09-11','2005-09-11');
+select timestampdiff(month,'2004-09-11','2006-09-11');
+select timestampdiff(month,'2004-09-11','2007-09-11');
+select timestampdiff(month,'2005-09-11','2004-09-11');
+select timestampdiff(month,'2005-09-11','2003-09-11');
+
+select timestampdiff(month,'2004-02-28','2005-02-28');
+select timestampdiff(month,'2004-02-29','2005-02-28');
+select timestampdiff(month,'2004-02-28','2005-02-28');
+select timestampdiff(month,'2004-03-29','2005-03-28');
+select timestampdiff(month,'2003-02-28','2004-02-29');
+select timestampdiff(month,'2003-02-28','2005-02-28');
+
+select timestampdiff(month,'1999-09-11','2001-10-10');
+select timestampdiff(month,'1999-09-11','2001-9-11');
+
+select timestampdiff(year,'1999-09-11','2001-9-11');
+select timestampdiff(year,'2004-02-28','2005-02-28');
+select timestampdiff(year,'2004-02-29','2005-02-28');
+
# End of 5.0 tests
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index aba2f33833a..bb3f621d194 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -372,6 +372,9 @@ insert into t1 values (pointfromtext('point(1,1)'));
drop table t1;
+select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000))));
+select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440))));
+
# End of 4.1 tests
#
@@ -395,3 +398,14 @@ show create function fn3;
select astext(fn3());
drop function fn3;
+#
+# Bug #12267 (primary key over GIS)
+#
+create table t1(pt POINT);
+alter table t1 add primary key pti(pt);
+drop table t1;
+create table t1(pt GEOMETRY);
+--error 1170
+alter table t1 add primary key pti(pt);
+alter table t1 add primary key pti(pt(20));
+drop table t1;
diff --git a/mysql-test/t/im_life_cycle.imtest b/mysql-test/t/im_life_cycle.imtest
index fff57e16eab..c2b1c9a56ec 100644
--- a/mysql-test/t/im_life_cycle.imtest
+++ b/mysql-test/t/im_life_cycle.imtest
@@ -46,6 +46,7 @@ SHOW INSTANCE STATUS mysqld2;
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
--connection mysql_con
+--replace_result $IM_MYSQLD1_PORT IM_MYSQLD1_PORT
SHOW VARIABLES LIKE 'port';
--connection default
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index f351d315680..8a28e8bbf02 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -499,8 +499,8 @@ drop table t1;
#
grant select on test.* to mysqltest_4@localhost;
-connect (user4,localhost,mysqltest_4,,);
-connection user4;
+connect (user10261,localhost,mysqltest_4,,);
+connection user10261;
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME';
connection default;
@@ -715,3 +715,24 @@ select ROUTINE_NAME from routines;
grant all on information_schema.* to 'user1'@'localhost';
--error 1044
grant select on information_schema.* to 'user1'@'localhost';
+
+#
+# Bug#14089 FROM list subquery always fails when information_schema is current database
+#
+use test;
+create table t1(id int);
+insert into t1(id) values (1);
+select 1 from (select 1 from test.t1) a;
+use information_schema;
+select 1 from (select 1 from test.t1) a;
+use test;
+drop table t1;
+
+#
+# Bug #14290: character_maximum_length for text fields
+#
+
+create table t1(a blob, b text charset utf8, c text charset ucs2);
+select data_type, character_octet_length, character_maximum_length
+ from information_schema.columns where table_name='t1';
+drop table t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 5a45b3524ac..cf0e08e2e66 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -1635,3 +1635,119 @@ drop function f1;
disconnect a;
disconnect b;
+#
+# BUG 14056 Column prefix index on UTF-8 primary key column causes: Can't find record..
+#
+
+create table t1 (
+ a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b char(10), c char(10), filler char(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+
+create table t1 (
+ a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b varchar(10), c varchar(10), filler varchar(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+
+create table t1 (
+ a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b text(10), c text(10), filler text(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xe880bde880bd,_utf8 0xe880bde880bd,'six');
+insert into t1 values (4,_utf8 0xe880bdD0B1e880bd,_utf8 0xe880bdD0B1e880bd,'seven');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05630563,_ucs2 0x05630563,'eleven');
+insert into t2 values (4,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,'point');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+
+create table t1 (
+ a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set utf8 engine = innodb;
+create table t2 (
+ a int, b blob(10), c blob(10), filler blob(10), primary key(a, b(2)), unique key (a, c(2))
+) character set ucs2 engine = innodb;
+insert into t1 values (1,'abcdefg','abcdefg','one');
+insert into t1 values (2,'ijkilmn','ijkilmn','two');
+insert into t1 values (3,'qrstuvw','qrstuvw','three');
+insert into t1 values (4,_utf8 0xe880bd,_utf8 0xe880bd,'four');
+insert into t1 values (4,_utf8 0x5b,_utf8 0x5b,'five');
+insert into t1 values (4,_utf8 0xD0B1,_utf8 0xD0B1,'eight');
+insert into t2 values (1,'abcdefg','abcdefg','one');
+insert into t2 values (2,'ijkilmn','ijkilmn','two');
+insert into t2 values (3,'qrstuvw','qrstuvw','three');
+insert into t2 values (4,_ucs2 0x00e400,_ucs2 0x00e400,'four');
+insert into t2 values (4,_ucs2 0x00640065,_ucs2 0x00640065,'five');
+insert into t2 values (4,_ucs2 0x00e400e50068,_ucs2 0x00e400e50068,'six');
+insert into t2 values (4,_ucs2 0x01fc,_ucs2 0x01fc,'seven');
+insert into t2 values (4,_ucs2 0x0120,_ucs2 0x0120,'eight');
+insert into t2 values (4,_ucs2 0x0563,_ucs2 0x0563,'ten');
+insert into t2 values (4,_ucs2 0x05612020,_ucs2 0x05612020,'taken');
+drop table t1;
+drop table t2;
+commit;
diff --git a/mysql-test/t/innodb_gis.test b/mysql-test/t/innodb_gis.test
new file mode 100644
index 00000000000..142b526af92
--- /dev/null
+++ b/mysql-test/t/innodb_gis.test
@@ -0,0 +1,3 @@
+--source include/have_innodb.inc
+SET storage_engine=innodb;
+--source include/gis_generic.inc
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 7116a25ff39..5dd6f338865 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -202,4 +202,26 @@ insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
drop table t1,t2,t3;
+#
+# Bug #12695 Item_func_isnull::update_used_tables() did not update
+# const_item_cache
+create table t1(f1 varchar(5) key);
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
+select * from t1;
+drop table t1;
+
+#
+# Bug #13392 values() fails with 'ambiguous' or returns NULL
+# with ON DUPLICATE and SELECT
+create table t1(x int, y int);
+create table t2(x int, z int);
+insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x);
+--error 1054
+insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
+--error 1054
+insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
+drop table t1,t2;
+
# End of 4.1 tests
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index 97842d6b4e6..7f3a9932d31 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -25,6 +25,7 @@ select ((@id := kill_id) - kill_id) from t1;
kill @id;
connection con1;
+--sleep 1
# this statement should fail
--error 2006,2013
diff --git a/mysql-test/t/kill_n_check.sh b/mysql-test/t/kill_n_check.sh
index 7fe30c4774c..e722b3a180d 100755
--- a/mysql-test/t/kill_n_check.sh
+++ b/mysql-test/t/kill_n_check.sh
@@ -39,7 +39,7 @@ new_pid=""
# echo "New PID: $new_pid"
-if [ "$expected_result" == "restarted" ]; then
+if [ "$expected_result" = "restarted" ]; then
if [ -z "$new_pid" ]; then
echo "Error: the process was killed."
@@ -54,7 +54,7 @@ if [ "$expected_result" == "restarted" ]; then
echo "Success: the process was restarted."
exit 0
-else # $expected_result == killed
+else # $expected_result = killed
if [ "$new_pid" -a "$new_pid" -ne "$original_pid" ]; then
echo "Error: the process was restarted."
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index cd3a8f0fd92..09d97a42714 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -31,7 +31,6 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated
select * from t1;
drop table t1;
-
#
# Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting
#
@@ -59,6 +58,15 @@ select * from t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
drop table t1;
+#
+# Bug #11203: LOAD DATA does not accept same characters for ESCAPED and
+# ENCLOSED
+#
+create table t1 (a varchar(20), b varchar(20));
+load data infile '../../std_data/loaddata_dq.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
+select * from t1;
+drop table t1;
+
# End of 4.1 tests
#
@@ -104,3 +112,5 @@ select * from t1;
# cleanup
drop table t1, t2;
+
+# End of 5.0 tests
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 73afcab5e27..f15b4d54275 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -629,6 +629,25 @@ show index from t1;
drop table t1;
+# WL#2609, CSC#XXXX: MyISAM
+set myisam_stats_method=nulls_ignored;
+show variables like 'myisam_stats_method';
+
+create table t1 (
+ a char(3), b char(4), c char(5), d char(6),
+ key(a,b,c,d)
+);
+insert into t1 values ('bcd','def1', NULL, 'zz');
+insert into t1 values ('bcd','def2', NULL, 'zz');
+insert into t1 values ('bce','def1', 'yuu', NULL);
+insert into t1 values ('bce','def2', NULL, 'quux');
+analyze table t1;
+show index from t1;
+delete from t1;
+analyze table t1;
+show index from t1;
+
+set myisam_stats_method=DEFAULT;
# End of 4.1 tests
#
@@ -703,6 +722,7 @@ insert into t1 values (10),(11),(12);
select * from t1;
check table t1;
drop table t1;
+disconnect con1;
# Same test with dynamic record length
create table t1 (a int, b varchar(30) default "hello");
@@ -727,8 +747,10 @@ insert into t1 (a) values (10),(11),(12);
select a from t1;
check table t1;
drop table t1;
+disconnect con1;
set global concurrent_insert=@save_concurrent_insert;
+
# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
# different statistics on the same table with NULL values.
create table t1 (a int, key(a));
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 0b031ea1be8..0783c043ef6 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -14,7 +14,7 @@ create table t1(a int);
insert into t1 values(1);
# Test delimiters
---exec $MYSQL test < "./t/mysql_delimiter.sql"
+--exec $MYSQL test 2>&1 < "./t/mysql_delimiter.sql"
--disable_query_log
# Test delimiter : supplied on the command line
diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test
index ccf5e0bf66a..66b57dd5fb7 100644
--- a/mysql-test/t/mysql_client_test.test
+++ b/mysql-test/t/mysql_client_test.test
@@ -6,7 +6,7 @@
# var/log/mysql_client_test.trace
--disable_result_log
---exec echo $MYSQL_CLIENT_TEST
---exec $MYSQL_CLIENT_TEST
+--exec echo $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
+--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
# End of 4.1 tests
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
new file mode 100644
index 00000000000..bc88be001ab
--- /dev/null
+++ b/mysql-test/t/mysqlcheck.test
@@ -0,0 +1,11 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+
+#
+# Bug #13783 mysqlcheck tries to optimize and analyze information_schema
+#
+--replace_result 'Table is already up to date' OK
+--exec $MYSQL_CHECK --all-databases --analyze --optimize
+--replace_result 'Table is already up to date' OK
+--exec $MYSQL_CHECK --analyze --optimize --databases test information_schema mysql
+--exec $MYSQL_CHECK --analyze --optimize information_schema schemata
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 7dafac2bde5..91a87e2c774 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -697,6 +697,18 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
drop table t1, t2;
+#
+# BUG #12123
+#
+create table t1 (a text character set utf8, b text character set latin1);
+insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
+select * from t1;
+--exec $MYSQL_DUMP --tab=$MYSQL_TEST_DIR/var/tmp/ test
+--exec $MYSQL test < $MYSQL_TEST_DIR/var/tmp/t1.sql
+--exec $MYSQL_IMPORT test $MYSQL_TEST_DIR/var/tmp/t1.txt
+select * from t1;
+
+drop table t1;
# End of 4.1 tests
#
@@ -905,5 +917,84 @@ DROP FUNCTION bug9056_func1;
DROP FUNCTION bug9056_func2;
DROP PROCEDURE bug9056_proc1;
DROP PROCEDURE bug9056_proc2;
+DROP PROCEDURE `a'b`;
drop table t1;
+#
+# BUG# 13052 - mysqldump timestamp reloads broken
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (`d` timestamp, unique (`d`));
+set time_zone='+00:00';
+insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00');
+# results should show two different time values
+select * from t1;
+set time_zone='Europe/Moscow';
+# results should show two same time values, despite unique
+select * from t1;
+set global time_zone='Europe/Moscow';
+--exec $MYSQL_DUMP --skip-comments --databases test
+--exec $MYSQL_DUMP --skip-tz-utc --skip-comments --databases test
+drop table t1;
+set global time_zone=default;
+set time_zone=default;
+
+#
+# Test of fix to BUG 13146 - ansi quotes break loading of triggers
+#
+--disable_warnings
+DROP TABLE IF EXISTS `t1 test`;
+CREATE TABLE `t1 test` (
+ `a1` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+DROP TABLE IF EXISTS `t2 test`;
+CREATE TABLE `t2 test` (
+ `a2` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+--enable_warnings
+
+DELIMITER //;
+CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
+INSERT INTO `t2 test` SET a2 = NEW.a1; END //
+DELIMITER ;//
+
+INSERT INTO `t1 test` VALUES (1);
+INSERT INTO `t1 test` VALUES (2);
+INSERT INTO `t1 test` VALUES (3);
+SELECT * FROM `t2 test`;
+# dump with compatible=ansi. Everything except triggers should be double
+# quoted
+--exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test
+
+--disable_warnings
+DROP TRIGGER `test trig`;
+DROP TABLE `t1 test`;
+DROP TABLE `t2 test`;
+--enable_warnings
+#
+# BUG# 12838 mysqldump -x with views exits with error
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (a int, b varchar(32), c varchar(32));
+insert into t1 values (1, 'first value', 'xxxx');
+insert into t1 values (2, 'second value', 'tttt');
+insert into t1 values (3, 'third value', 'vvv vvv');
+
+create view v1 as select * from t1;
+create view v0 as select * from v1;
+create view v2 as select * from v0;
+
+select * from v2;
+--exec $MYSQL_DUMP -x --skip-comments --databases test
+
+drop view v2;
+drop view v0;
+drop view v1;
+drop table t1;
diff --git a/mysql-test/t/mysqlshow.test b/mysql-test/t/mysqlshow.test
index 33ae8aef9a0..1e2e97a4e07 100644
--- a/mysql-test/t/mysqlshow.test
+++ b/mysql-test/t/mysqlshow.test
@@ -1,6 +1,10 @@
# Can't run test of external client with embedded server
-- source include/not_embedded.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2;
+--enable_warnings
+
#
## Bug #5036 mysqlshow is missing a column
#
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 11fbb023963..3d9dff4d373 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -358,11 +358,11 @@ select 3 from t1 ;
# Missing delimiter
# The comment will be "sucked into" the sleep command since
# delimiter is missing until after "show status"
---system echo "sleep 4" > var/log/mysqltest.sql
---system echo "# A comment" >> var/log/mysqltest.sql
---system echo "show status;" >> var/log/mysqltest.sql
+--system echo "sleep 4" > var/tmp/mysqltest.sql
+--system echo "# A comment" >> var/tmp/mysqltest.sql
+--system echo "show status;" >> var/tmp/mysqltest.sql
--error 1
---exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
+--exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1
#
# Extra delimiter
@@ -806,6 +806,66 @@ select "a" as col1, "c" as col2;
--error 1
--exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
+# ----------------------------------------------------------------------------
+# Test connect
+# ----------------------------------------------------------------------------
+
+--error 1
+--exec echo "connect;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect ();" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2,);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2,localhost);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2, localhost, root);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2, localhost, root,);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2,localhost,root,,illegal_db);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con1,localhost,root,,,illegal_port,);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1
+
+# Repeat connect/disconnect
+--exec echo "let \$i=100;" > var/tmp/con.sql
+--exec echo "while (\$i)" >> var/tmp/con.sql
+--exec echo "{" >> var/tmp/con.sql
+--exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql
+--exec echo " disconnect test_con1; " >> var/tmp/con.sql
+--exec echo " dec \$i; " >> var/tmp/con.sql
+--exec echo "}" >> var/tmp/con.sql
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
+# Repeat connect/disconnect, exceed max number of connections
+--exec echo "let \$i=200;" > var/tmp/con.sql
+--exec echo "while (\$i)" >> var/tmp/con.sql
+--exec echo "{" >> var/tmp/con.sql
+--exec echo " connect (test_con1,localhost,root,,); " >> var/tmp/con.sql
+--exec echo " disconnect test_con1; " >> var/tmp/con.sql
+--exec echo " dec \$i; " >> var/tmp/con.sql
+--exec echo "}" >> var/tmp/con.sql
+--error 1
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
+# Select disconnected connection
+--exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql
+--exec echo "disconnect test_con1; " >> var/tmp/con.sql
+--exec echo "connection test_con1;" >> var/tmp/con.sql
+--error 1
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
+# Connection name already used
+--exec echo "connect (test_con1,localhost,root,,);" > var/tmp/con.sql
+--exec echo "connect (test_con1,localhost,root,,);" >> var/tmp/con.sql
+--error 1
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
+
# ----------------------------------------------------------------------------
# Test mysqltest arguments
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test
index 1c78a4b8744..1a351018b8d 100644
--- a/mysql-test/t/ndb_basic.test
+++ b/mysql-test/t/ndb_basic.test
@@ -615,3 +615,12 @@ create table atablewithareallylongandirritatingname (a int);
insert into atablewithareallylongandirritatingname values (2);
select * from atablewithareallylongandirritatingname;
drop table atablewithareallylongandirritatingname;
+
+
+#
+# BUG#14514
+#
+
+CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb;
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test
index d090d12e81b..9f512430085 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/t/ndb_condition_pushdown.test
@@ -12,7 +12,7 @@ CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10),
vstring varchar(10),
- bin binary(7),
+ bin binary(2),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
diff --git a/mysql-test/t/ndb_config.test b/mysql-test/t/ndb_config.test
index 9d1c107472f..e40e89d76bd 100644
--- a/mysql-test/t/ndb_config.test
+++ b/mysql-test/t/ndb_config.test
@@ -11,3 +11,8 @@
# End of 4.1 tests
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.jonas --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf1.cnf --query=type,nodeid,host,IndexMemory,DataMemory --mycnf 2> /dev/null
+
+--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster0 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster1 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
+--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null
diff --git a/mysql-test/t/ndb_gis.test b/mysql-test/t/ndb_gis.test
new file mode 100644
index 00000000000..e14f462c32d
--- /dev/null
+++ b/mysql-test/t/ndb_gis.test
@@ -0,0 +1,5 @@
+--source include/have_ndb.inc
+SET storage_engine=ndbcluster;
+--source include/gis_generic.inc
+set engine_condition_pushdown = on;
+--source include/gis_generic.inc
diff --git a/mysql-test/t/ndb_types.test b/mysql-test/t/ndb_types.test
index 3446a409b2a..10b8eb87e2c 100644
--- a/mysql-test/t/ndb_types.test
+++ b/mysql-test/t/ndb_types.test
@@ -12,7 +12,7 @@ CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10) default "hello",
vstring varchar(10) default "hello",
- bin binary(7),
+ bin binary(2),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
diff --git a/mysql-test/t/not_embedded_server-master.opt b/mysql-test/t/not_embedded_server-master.opt
new file mode 100644
index 00000000000..35fcc5f30c6
--- /dev/null
+++ b/mysql-test/t/not_embedded_server-master.opt
@@ -0,0 +1 @@
+--loose-to-force-a-restart
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index e04c77ddf45..359b8b69a4d 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -1,6 +1,6 @@
# We test openssl. Result set is optimized to be compiled with --with-openssl.
# Use mysql-test-run with --with-openssl option.
--- source include/have_openssl_1.inc
+-- source include/have_openssl.inc
--disable_warnings
drop table if exists t1;
@@ -13,27 +13,36 @@ grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA
grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com";
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com";
flush privileges;
-connect (con1,localhost,ssl_user1,,);
-connect (con2,localhost,ssl_user2,,);
-connect (con3,localhost,ssl_user3,,);
-connect (con4,localhost,ssl_user4,,);
+
+connect (con1,localhost,ssl_user1,,,,,SSL);
+connect (con2,localhost,ssl_user2,,,,,SSL);
+connect (con3,localhost,ssl_user3,,,,,SSL);
+connect (con4,localhost,ssl_user4,,,,,SSL);
connection con1;
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
delete from t1;
connection con2;
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
delete from t1;
connection con3;
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
delete from t1;
connection con4;
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
--error 1142
delete from t1;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index c21d6c46b6c..646151a5aae 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -858,3 +858,16 @@ drop table t1;
set GLOBAL query_cache_size=0;
# End of 4.1 tests
+
+#
+# Bug #10303: problem with last_query_cost
+#
+
+SET GLOBAL query_cache_size=102400;
+create table t1(a int);
+insert into t1 values(0), (1), (4), (5);
+select * from t1 where a > 3;
+select * from t1 where a > 3;
+show status like 'last_query_cost';
+drop table t1;
+SET GLOBAL query_cache_size=0;
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 11c5e8d7bc5..f6493bac244 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -625,4 +625,9 @@ explain select * from t2 where a between 'a' and 'a ';
--replace_column 9 #
explain select * from t2 where a = 'a' or a='a ';
+update t1 set a='b' where a<>'a';
+--replace_column 9 #
+explain select * from t1 where a not between 'b' and 'b';
+select a, hex(filler) from t1 where a not between 'b' and 'b';
+
drop table t1,t2,t3;
diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/t/rpl_ddl.test
index 60a00a7b1b4..d2a41a305b6 100644
--- a/mysql-test/t/rpl_ddl.test
+++ b/mysql-test/t/rpl_ddl.test
@@ -392,6 +392,113 @@ connection master;
--horizontal_results
###############################################################
+# Cases with VIEWs
+###############################################################
+let $my_stmt= CREATE OR REPLACE VIEW v1 as select * from t1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW CREATE VIEW v1;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW CREATE VIEW v1;
+connection master;
+
+let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW CREATE VIEW v1;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW CREATE VIEW v1;
+connection master;
+
+let $my_stmt= DROP VIEW IF EXISTS v1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+--error 1146
+SHOW CREATE VIEW v1;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+--error 1146
+SHOW CREATE VIEW v1;
+connection master;
+
+###############################################################
+# Cases with TRIGGERs
+###############################################################
+let $my_stmt= CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TRIGGERS;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW TRIGGERS;
+connection master;
+
+let $my_stmt= DROP TRIGGER trg1;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SHOW TRIGGERS;
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SHOW TRIGGERS;
+connection master;
+
+###############################################################
+# Cases with USERs
+###############################################################
+let $my_stmt= CREATE USER user1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'user1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'user1';
+connection master;
+
+let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'rename1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'rename1';
+connection master;
+
+let $my_stmt= DROP USER rename1@localhost;
+let $my_master_commit= true;
+let $my_slave_commit= true;
+--source include/rpl_stmt_seq.inc
+SELECT user FROM mysql.user WHERE user = 'rename1';
+--disable_query_log
+SELECT '-------- switch to slave -------' as "";
+--enable_query_log
+connection slave;
+SELECT user FROM mysql.user WHERE user = 'rename1';
+connection master;
+
+###############################################################
# Cleanup
###############################################################
--disable_warnings
diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/t/rpl_dual_pos_advance-master.opt
new file mode 100644
index 00000000000..35fcc5f30c6
--- /dev/null
+++ b/mysql-test/t/rpl_dual_pos_advance-master.opt
@@ -0,0 +1 @@
+--loose-to-force-a-restart
diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/t/rpl_dual_pos_advance.test
new file mode 100644
index 00000000000..518fa9df885
--- /dev/null
+++ b/mysql-test/t/rpl_dual_pos_advance.test
@@ -0,0 +1,108 @@
+# This test checks that in a dual-head setup
+# A->B->A, where A has --log-slave-updates (why would it?
+# assume that there is a C as slave of A),
+# then the Exec_master_log_pos of SHOW SLAVE STATUS does
+# not stay too low on B(BUG#13023 due to events ignored because
+# of their server id).
+# It also will test BUG#13861.
+
+source include/master-slave.inc;
+
+
+# set up "dual head"
+
+connection slave;
+reset master;
+
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";
+
+start slave;
+
+# now we test it
+
+connection slave;
+
+create table t1 (n int);
+
+save_master_pos;
+connection master;
+sync_with_master;
+
+# Now test BUG#13861. This will be enabled when Guilhem fixes this
+# bug.
+
+# stop slave
+
+# create table t2 (n int); # create one ignored event
+
+# save_master_pos;
+# connection slave;
+# sync_with_master;
+
+# connection slave;
+
+# show tables;
+
+# save_master_pos;
+
+# create table t3 (n int);
+
+# connection master;
+
+# bug is that START SLAVE UNTIL may stop too late, we test that by
+# asking it to stop before creation of t3.
+
+# start slave until master_log_file="slave-bin.000001",master_log_pos=195;
+
+# wait until it's started (the position below is the start of "CREATE
+# TABLE t2") (otherwise wait_for_slave_to_stop may return at once)
+
+# select master_pos_wait("slave-bin.000001",137);
+
+# wait_for_slave_to_stop;
+
+# then BUG#13861 causes t3 to show up below (because stopped too
+# late).
+
+# show tables;
+
+# start slave;
+
+# BUG#13023 is that Exec_master_log_pos may stay too low "forever":
+
+connection master;
+
+create table t4 (n int); # create 3 ignored events
+create table t5 (n int);
+create table t6 (n int);
+
+save_master_pos;
+connection slave;
+sync_with_master;
+
+connection slave;
+
+save_master_pos;
+
+connection master;
+
+# then BUG#13023 caused hang below ("master" looks behind, while it's
+# not in terms of updates done).
+
+sync_with_master;
+
+show tables;
+
+# cleanup
+
+stop slave;
+reset slave;
+drop table t1,t4,t5,t6; # add t2 and t3 later
+
+save_master_pos;
+connection slave;
+sync_with_master;
+
+# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test
index f92c5504f43..a78b1901f51 100644
--- a/mysql-test/t/rpl_multi_update2.test
+++ b/mysql-test/t/rpl_multi_update2.test
@@ -4,6 +4,10 @@
source include/master-slave.inc;
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned
@@ -32,4 +36,27 @@ sync_with_master;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
+connection master;
+drop table t1,t2;
+sync_slave_with_master;
+
+#
+# BUG#13236 multi-update with subquery & --replicate-ignore-table
+#
+reset master;
+
+connection master;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (0);
+UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
+select * from t1;
+sync_slave_with_master;
+
+connection slave;
+select * from t1;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+
# End of 4.1 tests
diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/t/rpl_multi_update3.test
index 64e46882c16..36ac7a59cb3 100644
--- a/mysql-test/t/rpl_multi_update3.test
+++ b/mysql-test/t/rpl_multi_update3.test
@@ -158,4 +158,63 @@ SELECT * FROM t1;
connection master;
DROP TABLE t1, t2, t3;
+##############################################################################
+#
+# BUG#12618
+#
+# TEST: Replication of a statement containing a join in a multi-update.
+
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t1 (
+ idp int(11) NOT NULL default '0',
+ idpro int(11) default NULL,
+ price decimal(19,4) default NULL,
+ PRIMARY KEY (idp)
+);
+
+CREATE TABLE t2 (
+ idpro int(11) NOT NULL default '0',
+ price decimal(19,4) default NULL,
+ nbprice int(11) default NULL,
+ PRIMARY KEY (idpro)
+);
+
+INSERT INTO t1 VALUES
+ (1,1,'3.0000'),
+ (2,2,'1.0000'),
+ (3,1,'1.0000'),
+ (4,1,'4.0000'),
+ (5,3,'2.0000'),
+ (6,2,'4.0000');
+
+INSERT INTO t2 VALUES
+ (1,'0.0000',0),
+ (2,'0.0000',0),
+ (3,'0.0000',0);
+
+# This update sets t2 to the minimal prices for each product
+update
+ t2
+ join
+ ( select idpro, min(price) as min_price, count(*) as nbr_price
+ from t1
+ where idpro>0 and price>0
+ group by idpro
+ ) as table_price
+on t2.idpro = table_price.idpro
+set t2.price = table_price.min_price,
+ t2.nbprice = table_price.nbr_price;
+
+select "-- MASTER AFTER JOIN --" as "";
+select * from t1;
+select * from t2;
+
+sync_slave_with_master;
+
+select "-- SLAVE AFTER JOIN --" as "";
+select * from t1;
+select * from t2;
+
# End of 4.1 tests
diff --git a/mysql-test/t/rpl_openssl.test b/mysql-test/t/rpl_openssl.test
index 3c151721d8e..e15eb9b179a 100644
--- a/mysql-test/t/rpl_openssl.test
+++ b/mysql-test/t/rpl_openssl.test
@@ -1,4 +1,4 @@
-source include/have_openssl_1.inc;
+source include/have_openssl.inc;
source include/master-slave.inc;
# We don't test all types of ssl auth params here since it's a bit hard
diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/t/rpl_sp.test
index fa44b68bd8c..e62a6c73c0a 100644
--- a/mysql-test/t/rpl_sp.test
+++ b/mysql-test/t/rpl_sp.test
@@ -258,6 +258,23 @@ sync_slave_with_master;
select * from t1;
+#
+# Test for bug #13969 "Routines which are replicated from master can't be
+# executed on slave".
+#
+connection master;
+create procedure foo()
+ not deterministic
+ reads sql data
+ select * from t1;
+sync_slave_with_master;
+# This should not fail
+call foo();
+connection master;
+drop procedure foo;
+sync_slave_with_master;
+
+
# Clean up
connection master;
drop function fn1;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index f7de7239292..e7e6d899a66 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -7,7 +7,7 @@
#
--disable_warnings
-drop table if exists t1,t2,t3,t4;
+drop table if exists t1,t2,t3,t4,t11;
# The following may be left from older tests
drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa;
drop view if exists v1;
@@ -2070,6 +2070,7 @@ AND FK_firma_id = 2;
drop table t1;
#
+#
# Test for Bug#8009, SELECT failed on bigint unsigned when using HEX
#
@@ -2182,6 +2183,16 @@ select found_rows();
DROP TABLE t1;
#
+# Bug 7672 Unknown column error in order clause
+#
+CREATE TABLE t1 (a INT, b INT);
+(SELECT a, b AS c FROM t1) ORDER BY c+1;
+(SELECT a, b AS c FROM t1) ORDER BY b+1;
+SELECT a, b AS c FROM t1 ORDER BY c+1;
+SELECT a, b AS c FROM t1 ORDER BY b+1;
+drop table t1;
+
+#
# Bug #13356 assertion failed in resolve_const_item()
#
create table t1(f1 int, f2 int);
@@ -2189,8 +2200,59 @@ create table t2(f3 int);
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1));
select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1));
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL));
+insert into t1 values(1,1),(2,null);
+insert into t2 values(2);
+select * from t1,t2 where f1=f3 and (f1,f2) = (2,null);
+select * from t1,t2 where f1=f3 and (f1,f2) <=> (2,null);
drop table t1,t2;
+#
+# Bug #13535
+#
+create table t1 (f1 int not null auto_increment primary key, f2 varchar(10));
+create table t11 like t1;
+insert into t1 values(1,""),(2,"");
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+show table status like 't1%';
+select 123 as a from t1 where f1 is null;
+drop table t1,t11;
+
+# Bug 7672 Unknown column error in order clause
+#
+CREATE TABLE t1 (a INT, b INT);
+(SELECT a, b AS c FROM t1) ORDER BY c+1;
+(SELECT a, b AS c FROM t1) ORDER BY b+1;
+SELECT a, b AS c FROM t1 ORDER BY c+1;
+SELECT a, b AS c FROM t1 ORDER BY b+1;
+drop table t1;
+
+#
+# Bug #3874 (function in GROUP and LEFT JOIN)
+#
+
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, UNIQUE idx (a,b) );
+INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4);
+CREATE TABLE t2 ( a INT NOT NULL, b INT NOT NULL, e INT );
+INSERT INTO t2 VALUES ( 1,10,1), (1,10,2), (1,11,1), (1,11,2), (1,2,1), (1,2,2),(1,2,3);
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t1.a, t1.b, c;
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2 LEFT JOIN
+t1 ON t2.a = t1.a AND t2.b = t1.b GROUP BY t2.a, t2.b, c;
+SELECT t2.a, t2.b, IF(t1.b IS NULL,'',e) AS c, COUNT(*) AS d FROM t2,t1
+WHERE t2.a = t1.a AND t2.b = t1.b GROUP BY a, b, c;
+DROP TABLE IF EXISTS t1, t2;
+
+#
+# Bug #13855 select distinct with group by caused server crash
+#
+create table t1 (f1 int primary key, f2 int);
+create table t2 (f3 int, f4 int, primary key(f3,f4));
+insert into t1 values (1,1);
+insert into t2 values (1,1),(1,2);
+select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
+drop table t1,t2;
# End of 4.1 tests
#
@@ -2465,6 +2527,45 @@ SELECT ABS(IFNULL(NULL, NULL));
SELECT IFNULL(NULL, NULL);
#
+# BUG #12595 (ESCAPE must be exactly one)
+#
+SET @OLD_SQL_MODE12595=@@SQL_MODE, @@SQL_MODE='';
+SHOW LOCAL VARIABLES LIKE 'SQL_MODE';
+
+CREATE TABLE BUG_12595(a varchar(100));
+INSERT INTO BUG_12595 VALUES ('hakan%'), ('hakank'), ("ha%an");
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%';
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
+-- error 1210
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
+# this should work when sql_mode is not NO_BACKSLASH_ESCAPES
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE '';
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '';
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c;
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha%%an' ESCAPE '%';
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE '\\';
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|';
+
+SET @@SQL_MODE='NO_BACKSLASH_ESCAPES';
+SHOW LOCAL VARIABLES LIKE 'SQL_MODE';
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%';
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan*%' ESCAPE '*';
+-- error 1210
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan**%' ESCAPE '**';
+-- error 1210
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\%' ESCAPE '\\';
+#this gives an error when NO_BACKSLASH_ESCAPES is set
+-- error 1210
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan%' ESCAPE '';
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha\%an' ESCAPE 0x5c;
+SELECT * FROM BUG_12595 WHERE a LIKE 'ha|%an' ESCAPE '|';
+-- error 1210
+SELECT * FROM BUG_12595 WHERE a LIKE 'hakan\n%' ESCAPE '\n';
+
+SET @@SQL_MODE=@OLD_SQL_MODE12595;
+DROP TABLE BUG_12595;
+
+#
# Bug #6495 Illogical requirement for column qualification in NATURAL join
#
@@ -2581,31 +2682,50 @@ drop view v1, v2, v3;
# nested right join.
#
-create table a (
- id int(11) not null default '0'
-) engine=myisam default charset=latin1;
-
-insert into a values (123),(191),(192);
-
-create table b (
- id char(16) character set utf8 not null default ''
-) engine=myisam default charset=latin1;
-
-insert into b values ('58013'),('58014'),('58015'),('58016');
-
-create table c (
- a_id int(11) not null default '0',
- b_id char(16) character set utf8 default null
-) engine=myisam default charset=latin1;
-
-insert into c values
-(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
+create table t1 (id int(11) not null default '0');
+insert into t1 values (123),(191),(192);
+create table t2 (id char(16) character set utf8 not null);
+insert into t2 values ('58013'),('58014'),('58015'),('58016');
+create table t3 (a_id int(11) not null, b_id char(16) character set utf8);
+insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
-- both queries are equivalent
select count(*)
-from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id;
+from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id;
select count(*)
-from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id;
+from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id;
+
+drop table t1,t2,t3;
+
+#
+# Bug #13832 Incorrect parse order of join productions due to unspecified
+# operator priorities results in incorrect join tree.
+#
-drop table a, b, c;
+create table t1 (a int);
+create table t2 (b int);
+create table t3 (c int);
+select * from t1 join t2 join t3 on (t1.a=t3.c);
+select * from t1 join t2 left join t3 on (t1.a=t3.c);
+select * from t1 join t2 right join t3 on (t1.a=t3.c);
+select * from t1 join t2 straight_join t3 on (t1.a=t3.c);
+drop table t1, t2 ,t3;
+
+#
+# Bug #14093 Query takes a lot of time when date format is not valid
+# fix optimizes execution. so here we just check that returned set is
+# correct.
+create table t1(f1 int, f2 date);
+insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
+ (4,'2005-10-01'),(5,'2005-12-30');
+# should return all records
+select * from t1 where f2 >= 0;
+select * from t1 where f2 >= '0000-00-00';
+# should return 4,5
+select * from t1 where f2 >= '2005-09-31';
+select * from t1 where f2 >= '2005-09-3a';
+# should return 1,2,3
+select * from t1 where f2 <= '2005-09-31';
+select * from t1 where f2 <= '2005-09-3a';
+drop table t1;
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index b9fc991dc80..89d281a2c58 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -386,6 +386,19 @@ create table t1 (
SHOW CREATE TABLE t1;
DROP TABLE t1;
+# Test for BUG#93: 4.1 protocl crash on corupted frm and SHOW TABLE STATUS
+
+flush tables;
+
+# Create a junk frm file on disk
+system echo "this is a junk file for test" >> var/master-data/test/t1.frm ;
+--replace_column 6 # 7 # 8 # 9 #
+SHOW TABLE STATUS like 't1';
+--error 1033
+show create table t1;
+drop table t1;
+
+
# End of 4.1 tests
#
# BUG 12183 - SHOW OPEN TABLES behavior doesn't match grammar
diff --git a/mysql-test/t/skip_grants.test b/mysql-test/t/skip_grants.test
index 156547ea6aa..7a729f98661 100644
--- a/mysql-test/t/skip_grants.test
+++ b/mysql-test/t/skip_grants.test
@@ -19,3 +19,11 @@ drop table t1;
#
create procedure f1() select 1;
drop procedure f1;
+
+#
+# BUG#13504: creation view with DEFINER clause if --skip-grant-tables
+#
+create table t1 (a int);
+create definer='user'@'host' sql security definer view v1 as select * from t1;
+drop view v1;
+drop table t1;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index fa74c318db3..e2343cd905c 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1212,7 +1212,132 @@ call bug9367();
drop procedure bug9367;
drop table t1;
--enable_parsing
+
+#
+# BUG#13510: Setting password local variable changes current password
+#
+delimiter |;
+--disable_warnings
+drop procedure if exists bug13510_1|
+drop procedure if exists bug13510_2|
+drop procedure if exists bug13510_3|
+drop procedure if exists bug13510_4|
+--enable_warnings
+
+--error ER_SP_BAD_VAR_SHADOW
+create procedure bug13510_1()
+begin
+ declare password varchar(10);
+
+ set password = 'foo1';
+ select password;
+end|
+
+--error ER_SP_BAD_VAR_SHADOW
+create procedure bug13510_2()
+begin
+ declare names varchar(10);
+
+ set names = 'foo2';
+ select names;
+end|
+
+create procedure bug13510_3()
+begin
+ declare password varchar(10);
+
+ set `password` = 'foo3';
+ select password;
+end|
+
+create procedure bug13510_4()
+begin
+ declare names varchar(10);
+
+ set `names` = 'foo4';
+ select names;
+end|
+
+call bug13510_3()|
+call bug13510_4()|
+
+drop procedure bug13510_3|
+drop procedure bug13510_4|
+delimiter ;|
+
#
+# Bug#13514 "server crash when create a stored procedure before choose a
+# database" and
+# Bug#13587 "Server crash when SP is created without database
+# selected"
+#
+create database mysqltest1;
+use mysqltest1;
+drop database mysqltest1;
+--error ER_NO_DB_ERROR
+create function f1() returns int return 1;
+delimiter |;
+--error ER_NO_DB_ERROR
+create procedure p1(out param1 int)
+begin
+ select count(*) into param1 from t3;
+end|
+delimiter ;|
+use test;
+
+
+#
+# BUG#13037: undefined variable in IF cause erroneous error-message
+#
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS bug13037_p1;
+DROP PROCEDURE IF EXISTS bug13037_p2;
+DROP PROCEDURE IF EXISTS bug13037_p3;
+--enable_warnings
+
+delimiter |;
+
+CREATE PROCEDURE bug13037_p1()
+BEGIN
+ IF bug13037_foo THEN
+ SELECT 1;
+ END IF;
+END|
+
+CREATE PROCEDURE bug13037_p2()
+BEGIN
+ SET @bug13037_foo = bug13037_bar;
+END|
+
+CREATE PROCEDURE bug13037_p3()
+BEGIN
+ SELECT bug13037_foo;
+END|
+
+delimiter ;|
+
+--echo
+
+--error 1054
+CALL bug13037_p1();
+--error 1054
+CALL bug13037_p2();
+--error 1054
+CALL bug13037_p3();
+
+--error 1054
+CALL bug13037_p1();
+--error 1054
+CALL bug13037_p2();
+--error 1054
+CALL bug13037_p3();
+
+DROP PROCEDURE bug13037_p1;
+DROP PROCEDURE bug13037_p2;
+DROP PROCEDURE bug13037_p3;
+
+
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 6f1332f80d5..8d4f99abd71 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -336,6 +336,7 @@ connection user1;
do 1;
use test;
+disconnect user1;
connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
drop function bug_9503;
@@ -412,4 +413,28 @@ drop database mysqltest_1;
revoke usage on *.* from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
+#
+# BUG#12812 create view calling a function works without execute right
+# on function
+delimiter |;
+--disable_warnings
+drop function if exists bug12812|
+--enable_warnings
+create function bug12812() returns char(2)
+begin
+ return 'ok';
+end;
+create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+connect (test_user_12812,localhost,user_bug12812,ABC,test)|
+--error 1370
+SELECT test.bug12812()|
+--error 1370
+CREATE VIEW v1 AS SELECT test.bug12812()|
+# Cleanup
+connection default|
+disconnect test_user_12812|
+DROP USER user_bug12812@localhost|
+drop function bug12812|
+delimiter ;|
# End of 5.0 bugs.
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index e16e7456056..eaf69c0ab03 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -2431,7 +2431,7 @@ create function bug3788() returns date return cast("2005-03-04" as date)|
select bug3788()|
drop function bug3788|
-create function bug3788() returns binary(5) return 5|
+create function bug3788() returns binary(1) return 5|
select bug3788()|
drop function bug3788|
@@ -4037,28 +4037,6 @@ begin
end|
drop function bug9048|
-#
-# BUG#12812 create view calling a function works without execute right
-# on function
---disable_warnings
-drop function if exists bug12812|
---enable_warnings
-create function bug12812() returns char(2)
-begin
- return 'ok';
-end;
-create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
---replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
-connect (test_user_12812,localhost,user_bug12812,ABC,test)|
---error 1370
-SELECT test.bug12812()|
---error 1370
-CREATE VIEW v1 AS SELECT test.bug12812()|
-# Cleanup
-connection default|
-disconnect test_user_12812|
-DROP USER user_bug12812@localhost|
-drop function bug12812|
# Bug #12849 Stored Procedure: Crash on procedure call with CHAR type
# 'INOUT' parameter
#
@@ -4314,6 +4292,254 @@ call bug12589_1()|
call bug12589_2()|
call bug12589_3()|
+#
+# BUG#7049: Stored procedure CALL errors are ignored
+#
+--disable_warnings
+drop table if exists t3|
+drop procedure if exists bug7049_1|
+drop procedure if exists bug7049_2|
+drop procedure if exists bug7049_3|
+drop procedure if exists bug7049_4|
+drop procedure if exists bug7049_5|
+drop procedure if exists bug7049_6|
+drop function if exists bug7049_1|
+drop function if exists bug7049_2|
+--enable_warnings
+
+create table t3 ( x int unique )|
+
+create procedure bug7049_1()
+begin
+ insert into t3 values (42);
+ insert into t3 values (42);
+end|
+
+create procedure bug7049_2()
+begin
+ declare exit handler for sqlexception
+ select 'Caught it' as 'Result';
+
+ call bug7049_1();
+ select 'Missed it' as 'Result';
+end|
+
+create procedure bug7049_3()
+ call bug7049_1()|
+
+create procedure bug7049_4()
+begin
+ declare exit handler for sqlexception
+ select 'Caught it' as 'Result';
+
+ call bug7049_3();
+ select 'Missed it' as 'Result';
+end|
+
+create procedure bug7049_5()
+begin
+ declare x decimal(2,1);
+
+ set x = 'zap';
+end|
+
+create procedure bug7049_6()
+begin
+ declare exit handler for sqlwarning
+ select 'Caught it' as 'Result';
+
+ call bug7049_5();
+ select 'Missed it' as 'Result';
+end|
+
+create function bug7049_1()
+ returns int
+begin
+ insert into t3 values (42);
+ insert into t3 values (42);
+ return 42;
+end|
+
+create function bug7049_2()
+ returns int
+begin
+ declare x int default 0;
+ declare continue handler for sqlexception
+ set x = 1;
+
+ set x = bug7049_1();
+ return x;
+end|
+
+call bug7049_2()|
+select * from t3|
+delete from t3|
+call bug7049_4()|
+select * from t3|
+call bug7049_6()|
+select bug7049_2()|
+
+drop table t3|
+drop procedure bug7049_1|
+drop procedure bug7049_2|
+drop procedure bug7049_3|
+drop procedure bug7049_4|
+drop procedure bug7049_5|
+drop procedure bug7049_6|
+drop function bug7049_1|
+drop function bug7049_2|
+
+
+#
+# BUG#13941: replace() string fuction behaves badly inside stored procedure
+# (BUG#13914: IFNULL is returning garbage in stored procedure)
+#
+--disable_warnings
+drop function if exists bug13941|
+drop procedure if exists bug13941|
+--enable_warnings
+
+create function bug13941(p_input_str text)
+ returns text
+begin
+ declare p_output_str text;
+
+ set p_output_str = p_input_str;
+
+ set p_output_str = replace(p_output_str, 'xyzzy', 'plugh');
+ set p_output_str = replace(p_output_str, 'test', 'prova');
+ set p_output_str = replace(p_output_str, 'this', 'questo');
+ set p_output_str = replace(p_output_str, ' a ', 'una ');
+ set p_output_str = replace(p_output_str, 'is', '');
+
+ return p_output_str;
+end|
+
+create procedure bug13941(out sout varchar(128))
+begin
+ set sout = 'Local';
+ set sout = ifnull(sout, 'DEF');
+end|
+
+# Note: The bug showed different behaviour in different types of builds,
+# giving garbage results in some, and seemingly working in others.
+# Running with valgrind (or purify) is the safe way to check that it's
+# really working correctly.
+select bug13941('this is a test')|
+call bug13941(@a)|
+select @a|
+
+drop function bug13941|
+drop procedure bug13941|
+
+
+#
+# BUG#13095: Cannot create VIEWs in prepared statements
+#
+
+delimiter ;|
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS bug13095;
+DROP TABLE IF EXISTS bug13095_t1;
+DROP VIEW IF EXISTS bug13095_v1;
+--enable_warnings
+
+delimiter |;
+
+CREATE PROCEDURE bug13095(tbl_name varchar(32))
+BEGIN
+ SET @str =
+ CONCAT("CREATE TABLE ", tbl_name, "(stuff char(15))");
+ SELECT @str;
+ PREPARE stmt FROM @str;
+ EXECUTE stmt;
+
+ SET @str =
+ CONCAT("INSERT INTO ", tbl_name, " VALUES('row1'),('row2'),('row3')" );
+ SELECT @str;
+ PREPARE stmt FROM @str;
+ EXECUTE stmt;
+
+ SET @str =
+ CONCAT("CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM ", tbl_name);
+ SELECT @str;
+ PREPARE stmt FROM @str;
+ EXECUTE stmt;
+
+ SELECT * FROM bug13095_v1;
+
+ SET @str =
+ "DROP VIEW bug13095_v1";
+ SELECT @str;
+ PREPARE stmt FROM @str;
+ EXECUTE stmt;
+END|
+
+delimiter ;|
+
+CALL bug13095('bug13095_t1');
+
+--disable_warnings
+DROP PROCEDURE IF EXISTS bug13095;
+DROP VIEW IF EXISTS bug13095_v1;
+DROP TABLE IF EXISTS bug13095_t1;
+--enable_warnings
+
+delimiter |;
+
+#
+# BUG#14210: "Simple query with > operator on large table gives server
+# crash"
+# Check that cursors work in case when HEAP tables are converted to
+# MyISAM
+#
+--disable_warnings
+drop procedure if exists bug14210|
+--enable_warnings
+set @@session.max_heap_table_size=16384|
+select @@session.max_heap_table_size|
+# To trigger the memory corruption the original table must be InnoDB.
+# No harm if it's not, so don't warn if the suite is run with --skip-innodb
+--disable_warnings
+create table t3 (a char(255)) engine=InnoDB|
+--enable_warnings
+create procedure bug14210_fill_table()
+begin
+ declare table_size, max_table_size int default 0;
+ select @@session.max_heap_table_size into max_table_size;
+ delete from t3;
+ insert into t3 (a) values (repeat('a', 255));
+ repeat
+ insert into t3 select a from t3;
+ select count(*)*255 from t3 into table_size;
+ until table_size > max_table_size*2 end repeat;
+end|
+call bug14210_fill_table()|
+drop procedure bug14210_fill_table|
+create table t4 like t3|
+
+create procedure bug14210()
+begin
+ declare a char(255);
+ declare done int default 0;
+ declare c cursor for select * from t3;
+ declare continue handler for sqlstate '02000' set done = 1;
+ open c;
+ repeat
+ fetch c into a;
+ if not done then
+ insert into t4 values (upper(a));
+ end if;
+ until done end repeat;
+ close c;
+end|
+call bug14210()|
+select count(*) from t4|
+
+drop table t3, t4|
+drop procedure bug14210|
+set @@session.max_heap_table_size=default|
#
# BUG#NNNN: New bug synopsis
diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test
index b11afe9e59d..8ae9ced6c68 100644
--- a/mysql-test/t/sql_mode.test
+++ b/mysql-test/t/sql_mode.test
@@ -1,5 +1,6 @@
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2,v1,v2;
+drop view if exists t1,t2,v1,v2;
--enable_warnings
CREATE TABLE `t1` (
diff --git a/mysql-test/t/ssl.test b/mysql-test/t/ssl.test
new file mode 100644
index 00000000000..de88569d74a
--- /dev/null
+++ b/mysql-test/t/ssl.test
@@ -0,0 +1,17 @@
+# Turn on ssl between the client and server
+# and run a number of tests
+
+-- source include/have_openssl.inc
+
+connect (ssl_con,localhost,root,,,,,SSL);
+
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
+
+# Source select test case
+-- source include/common-tests.inc
+
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
+
+
diff --git a/mysql-test/t/ssl_compress.test b/mysql-test/t/ssl_compress.test
new file mode 100644
index 00000000000..f5fe86e9a81
--- /dev/null
+++ b/mysql-test/t/ssl_compress.test
@@ -0,0 +1,22 @@
+# Turn on compression between the client and server
+# and run a number of tests
+
+-- source include/have_openssl.inc
+-- source include/have_compress.inc
+
+connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS);
+
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
+
+# Check compression turned on
+SHOW STATUS LIKE 'Compression';
+
+# Source select test case
+-- source include/common-tests.inc
+
+# Check ssl turned on
+SHOW STATUS LIKE 'Ssl_cipher';
+
+# Check compression turned on
+SHOW STATUS LIKE 'Compression';
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 7fea51c9327..929a0cb5877 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -37,3 +37,10 @@ show status like 'Table_lock%';
drop table t1;
# End of 4.1 tests
+
+#
+# lost_query_cost
+#
+
+select 1;
+show status like 'last_query_cost';
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 5020902009d..cc621fb5835 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1962,4 +1962,9 @@ insert into t1 values ('1');
select * from (select max(fld) from t1) as foo;
drop table t1;
+#
+# BUG #10308: purge log with subselect
+#
+
+purge master logs before (select adddate(current_timestamp(), interval -4 day));
diff --git a/mysql-test/t/subselect2.test b/mysql-test/t/subselect2.test
index 839e94206d0..b21eda176b6 100644
--- a/mysql-test/t/subselect2.test
+++ b/mysql-test/t/subselect2.test
@@ -25,6 +25,8 @@ DOCID VARCHAR(32)BINARY NOT NULL
) ENGINE=InnoDB
;
+INSERT INTO t1 (DOCID) VALUES ("1"), ("2");
+
CREATE TABLE t2
(
DOCID VARCHAR(32)BINARY NOT NULL
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 3b1d2f393c2..a07cc93ad68 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -161,3 +161,25 @@ deallocate prepare my_stmt;
drop table t1,t2;
# End of 4.1 tests
+
+CREATE TABLE t1 (
+ school_name varchar(45) NOT NULL,
+ country varchar(45) NOT NULL,
+ funds_requested float NOT NULL,
+ schooltype varchar(45) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+insert into t1 values ("the school", "USA", 1200, "Human");
+
+select count(country) as countrycount, sum(funds_requested) as smcnt,
+ country, (select sum(funds_requested) from t1) as total_funds
+from t1
+group by country;
+
+select count(country) as countrycount, sum(funds_requested) as smcnt,
+ country, (select sum(funds_requested) from t1) as total_funds
+from t1
+group by country;
+
+drop table t1;
+
diff --git a/mysql-test/t/type_binary.test b/mysql-test/t/type_binary.test
new file mode 100644
index 00000000000..b5928cb14c4
--- /dev/null
+++ b/mysql-test/t/type_binary.test
@@ -0,0 +1,67 @@
+# check 0x00 padding
+create table t1 (s1 binary(3));
+insert into t1 values (0x61), (0x6120), (0x612020);
+select hex(s1) from t1;
+drop table t1;
+
+# check that 0x00 is not stripped in val_str
+create table t1 (s1 binary(2), s2 varbinary(2));
+insert into t1 values (0x4100,0x4100);
+select length(concat('*',s1,'*',s2,'*')) from t1;
+delete from t1;
+insert into t1 values (0x4120,0x4120);
+select length(concat('*',s1,'*',s2,'*')) from t1;
+drop table t1;
+
+# check that trailing 0x00 and 0x20 do matter on comparison
+create table t1 (s1 varbinary(20), s2 varbinary(20));
+show create table t1;
+insert into t1 values (0x41,0x4100),(0x41,0x4120),(0x4100,0x4120);
+select hex(s1), hex(s2) from t1;
+select count(*) from t1 where s1 < s2;
+drop table t1;
+
+# check that trailing 0x00 do matter on filesort
+create table t1 (s1 varbinary(2), s2 varchar(1));
+insert into t1 values (0x41,'a'), (0x4100,'b'), (0x41,'c'), (0x4100,'d');
+select hex(s1),s2 from t1 order by s1,s2;
+drop table t1;
+
+# check that 0x01 is padded to 0x0100 and thus we get a duplicate value
+create table t1 (s1 binary(2) primary key);
+insert into t1 values (0x01);
+insert into t1 values (0x0120);
+--error 1062
+insert into t1 values (0x0100);
+select hex(s1) from t1 order by s1;
+# check index search
+select hex(s1) from t1 where s1=0x01;
+select hex(s1) from t1 where s1=0x0120;
+select hex(s1) from t1 where s1=0x0100;
+select count(distinct s1) from t1;
+alter table t1 drop primary key;
+# check non-indexed search
+select hex(s1) from t1 where s1=0x01;
+select hex(s1) from t1 where s1=0x0120;
+select hex(s1) from t1 where s1=0x0100;
+select count(distinct s1) from t1;
+drop table t1;
+
+# check that 0x01 is not padded, and all three values are unique
+create table t1 (s1 varbinary(2) primary key);
+insert into t1 values (0x01);
+insert into t1 values (0x0120);
+insert into t1 values (0x0100);
+select hex(s1) from t1 order by s1;
+# check index search
+select hex(s1) from t1 where s1=0x01;
+select hex(s1) from t1 where s1=0x0120;
+select hex(s1) from t1 where s1=0x0100;
+select count(distinct s1) from t1;
+alter table t1 drop primary key;
+# check non-indexed search
+select hex(s1) from t1 where s1=0x01;
+select hex(s1) from t1 where s1=0x0120;
+select hex(s1) from t1 where s1=0x0100;
+select count(distinct s1) from t1;
+drop table t1;
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 1ec5c600296..503d7ffc0b9 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -67,9 +67,9 @@ select * from t1;
drop table t1;
#
-# test of blob, text, char and char binary
+# test of blob, text, char and varbinary
#
-create table t1 (t text,c char(10),b blob, d binary(10));
+create table t1 (t text,c char(10),b blob, d varbinary(10));
insert into t1 values (NULL,NULL,NULL,NULL);
insert into t1 values ("","","","");
insert into t1 values ("hello","hello","hello","hello");
@@ -404,3 +404,22 @@ alter table t1 add primary key (a,b,c(255),d);
alter table t1 add key (a,b,d,e);
show create table t1;
drop table t1;
+
+#
+# Test that blob's and varbinary are sorted according to length
+#
+
+CREATE table t1 (a blob);
+insert into t1 values ('b'),('a\0'),('a'),('a '),('aa'),(NULL);
+select hex(a) from t1 order by a;
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+alter table t1 modify a varbinary(5);
+select hex(a) from t1 order by a;
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+alter table t1 modify a char(5);
+select hex(a) from t1 order by a;
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+alter table t1 modify a binary(5);
+select hex(a) from t1 order by a;
+select hex(concat(a,'\0')) as b from t1 order by concat(a,'\0');
+drop table t1;
diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test
index cf2a2676ab0..6a0814ef113 100644
--- a/mysql-test/t/type_float.test
+++ b/mysql-test/t/type_float.test
@@ -146,6 +146,19 @@ select * from t1 where reckey=109;
select * from t1 where reckey=1.09E2;
drop table t1;
+#
+# Bug #13372 (decimal union)
+#
+create table t1 (d double(10,1));
+create table t2 (d double(10,9));
+insert into t1 values ("100000000.0");
+insert into t2 values ("1.23456780");
+create table t3 select * from t2 union select * from t1;
+select * from t3;
+show create table t3;
+drop table t1, t2, t3;
+
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test
index 3f04aa931d2..93a1a1afa45 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1044,3 +1044,25 @@ drop procedure wg2;
#
select cast(@non_existing_user_var/2 as DECIMAL);
+
+#
+# Bug #13667 (Inconsistency for decimal(m,d) specification
+#
+--error 1427
+create table t (d decimal(0,10));
+
+#
+# Bug #13573 (Wrong data inserted for too big values)
+#
+
+create table t1 (c1 decimal(64));
+--disable_ps_protocol
+insert into t1 values(
+89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
+insert into t1 values(
+99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 *
+99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
+--enable_ps_protocol
+insert into t1 values(1e100);
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 3822d1fe4e7..2a151f0dd38 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -227,4 +227,47 @@ select DATABASE();
delete from t1 where count(*)=1;
drop table t1;
+# BUG#12915: Optimize "DELETE|UPDATE ... ORDER BY ... LIMIT n" to use an index
+create table t1 ( a int, b int default 0, index (a) );
+insert into t1 (a) values (0),(0),(0),(0),(0),(0),(0),(0);
+
+flush status;
+select a from t1 order by a limit 1;
+show status like 'handler_read%';
+
+flush status;
+update t1 set a=9999 order by a limit 1;
+update t1 set b=9999 order by a limit 1;
+show status like 'handler_read%';
+
+flush status;
+delete from t1 order by a limit 1;
+show status like 'handler_read%';
+
+flush status;
+delete from t1 order by a desc limit 1;
+show status like 'handler_read%';
+
+alter table t1 disable keys;
+
+flush status;
+delete from t1 order by a limit 1;
+show status like 'handler_read%';
+
+select * from t1;
+update t1 set a=a+10,b=1 order by a limit 3;
+update t1 set a=a+11,b=2 order by a limit 3;
+update t1 set a=a+12,b=3 order by a limit 3;
+select * from t1 order by a;
+
+drop table t1;
+
+#
+# Bug#14186 select datefield is null not updated
+#
+create table t1 (f1 date not null);
+insert into t1 values('2000-01-01'),('0000-00-00');
+update t1 set f1='2002-02-02' where f1 is null;
+select * from t1;
+drop table t1;
# End of 4.1 tests
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index e3b5b4ef33e..61861c26ea8 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -70,6 +70,10 @@ create table t1 (i int not null);
insert t1 values (1),(2),(2),(3),(3),(3);
select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i;
select @a:=0; select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
+
+set @a=0;
+select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
+select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
drop table t1;
#
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index afd0fe23805..f23cc0152c1 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -398,6 +398,21 @@ set character_set_results=NULL;
select ifnull(@@character_set_results,"really null");
set names latin1;
+
+#
+# Bug #9613: @@have_innodb
+#
+
+--replace_column 1 #
+select @@have_innodb;
+
+#
+# Bug #13334: query_prealloc_size default less than minimum
+#
+set @test = @@query_prealloc_size;
+set @@query_prealloc_size = @test;
+select @@query_prealloc_size = @test;
+
# End of 4.1 tests
#
@@ -430,13 +445,6 @@ set @@max_heap_table_size= 4294967296;
select @@max_heap_table_size > 0;
#
-# Bug #9613: @@have_innodb
-#
-
---replace_column 1 #
-select @@have_innodb;
-
-#
# Bug #11775 Variable character_set_system does not exist (sometimes)
#
select @@character_set_system;
@@ -444,3 +452,5 @@ select @@character_set_system;
set global character_set_system = latin1;
--error 1238
set @@global.version_compile_os='234';
+
+# End of 5.0 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 15c8cccf69c..0bd0e572193 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -790,13 +790,16 @@ drop view v1;
#
create table t1 (a int);
create view v1 as select a from t1;
-create database seconddb;
+create view v3 as select a from t1;
+create database mysqltest;
-- error 1450
-rename table v1 to seconddb.v1;
+rename table v1 to mysqltest.v1;
rename table v1 to v2;
+--error 1050
+rename table v3 to v1, v2 to t1;
drop table t1;
-drop view v2;
-drop database seconddb;
+drop view v2,v3;
+drop database mysqltest;
#
# bug handling from VIEWs
@@ -2079,7 +2082,7 @@ drop table t1, t2;
# DEFINER information check
#
-- error ER_NO_VIEW_USER
-create definer=some_user@__% sql security invoker view v1 as select 1;
+create definer=some_user@`` sql security invoker view v1 as select 1;
create definer=some_user@localhost sql security invoker view v1 as select 1;
show create view v1;
drop view v1;
@@ -2167,3 +2170,33 @@ SELECT v_1.a FROM v1 AS v_1 GROUP BY v_1.a HAVING v_1.a IN (1,2,3);
DROP VIEW v1;
DROP TABLE t1;
+
+#
+# Bug #13327 view wasn't using index for const condition
+#
+
+CREATE TABLE t1 (a INT, b INT, INDEX(a,b));
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 (a INT);
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
+INSERT INTO t3 VALUES (1),(2),(3);
+CREATE VIEW v1 AS SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a AND t1.b=t2.b;
+CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a;
+EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1;
+EXPLAIN SELECT * FROM v1 WHERE a=1;
+EXPLAIN SELECT * FROM v2 WHERE a=1;
+DROP VIEW v1,v2;
+DROP TABLE t1,t2,t3;
+
+#
+# Bug #14466 lost sort order in GROUP_CONCAT() in a view
+#
+create table t1 (f1 int, f2 int);
+insert into t1 values(1,1),(1,2),(1,3);
+create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1;
+create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1;
+select * from v1;
+select * from v2;
+drop view v1,v2;
+drop table t1;
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index ea93345e894..7f0cb6d9406 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -401,8 +401,266 @@ grant all privileges on mysqltest.* to mysqltest_1@localhost;
connection user1;
use mysqltest;
create view v1 as select * from t1;
+use test;
connection root;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
drop database mysqltest;
+#
+# view definer grants revoking
+#
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+
+create table mysqltest.t1 (a int, b int);
+
+grant select on mysqltest.t1 to mysqltest_1@localhost;
+grant create view,select on test.* to mysqltest_1@localhost;
+
+connection user1;
+
+create view v1 as select * from mysqltest.t1;
+
+connection root;
+# check view definer information
+show create view v1;
+revoke select on mysqltest.t1 from mysqltest_1@localhost;
+-- error ER_VIEW_INVALID
+select * from v1;
+grant select on mysqltest.t1 to mysqltest_1@localhost;
+select * from v1;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop view v1;
+drop database mysqltest;
+
+#
+# rights on execution of view underlying functiond (BUG#9505)
+#
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+
+use mysqltest;
+create table t1 (a int);
+insert into t1 values (1);
+create table t2 (s1 int);
+--disable_warnings
+drop function if exists f2;
+--enable_warnings
+delimiter //;
+create function f2 () returns int begin declare v int; select s1 from t2
+into v; return v; end//
+delimiter ;//
+create algorithm=TEMPTABLE view v1 as select f2() from t1;
+create algorithm=MERGE view v2 as select f2() from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
+create SQL SECURITY INVOKER view v5 as select * from v4;
+grant select on v1 to mysqltest_1@localhost;
+grant select on v2 to mysqltest_1@localhost;
+grant select on v3 to mysqltest_1@localhost;
+grant select on v4 to mysqltest_1@localhost;
+grant select on v5 to mysqltest_1@localhost;
+
+connection user1;
+use mysqltest;
+select * from v1;
+select * from v2;
+-- error ER_VIEW_INVALID
+select * from v3;
+-- error ER_VIEW_INVALID
+select * from v4;
+-- error ER_VIEW_INVALID
+select * from v5;
+use test;
+
+connection root;
+drop view v1, v2, v3, v4, v5;
+drop function f2;
+drop table t1, t2;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+
+#
+# revertion of previous test, definer of view lost his/her rights to execute
+# function
+#
+
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+
+use mysqltest;
+create table t1 (a int);
+insert into t1 values (1);
+create table t2 (s1 int);
+--disable_warnings
+drop function if exists f2;
+--enable_warnings
+delimiter //;
+create function f2 () returns int begin declare v int; select s1 from t2
+into v; return v; end//
+delimiter ;//
+grant select on t1 to mysqltest_1@localhost;
+grant execute on function f2 to mysqltest_1@localhost;
+grant create view on mysqltest.* to mysqltest_1@localhost;
+
+connection user1;
+use mysqltest;
+create algorithm=TEMPTABLE view v1 as select f2() from t1;
+create algorithm=MERGE view v2 as select f2() from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
+use test;
+
+connection root;
+create view v5 as select * from v1;
+revoke execute on function f2 from mysqltest_1@localhost;
+-- error ER_VIEW_INVALID
+select * from v1;
+-- error ER_VIEW_INVALID
+select * from v2;
+select * from v3;
+select * from v4;
+-- error ER_VIEW_INVALID
+select * from v5;
+
+drop view v1, v2, v3, v4, v5;
+drop function f2;
+drop table t1, t2;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+
+#
+# definer/invoker rights for columns
+#
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+
+use mysqltest;
+create table t1 (a int);
+create table v1 (a int);
+insert into t1 values (1);
+grant select on t1 to mysqltest_1@localhost;
+grant select on v1 to mysqltest_1@localhost;
+grant create view on mysqltest.* to mysqltest_1@localhost;
+drop table v1;
+
+connection user1;
+use mysqltest;
+create algorithm=TEMPTABLE view v1 as select *, a as b from t1;
+create algorithm=MERGE view v2 as select *, a as b from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
+create view v5 as select * from v1;
+use test;
+
+connection root;
+revoke select on t1 from mysqltest_1@localhost;
+-- error ER_VIEW_INVALID
+select * from v1;
+-- error ER_VIEW_INVALID
+select * from v2;
+select * from v3;
+select * from v4;
+-- error ER_VIEW_INVALID
+select * from v5;
+
+#drop view v1, v2, v3, v4, v5;
+drop table t1;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+
+
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+
+use mysqltest;
+create table t1 (a int);
+insert into t1 values (1);
+create algorithm=TEMPTABLE view v1 as select *, a as b from t1;
+create algorithm=MERGE view v2 as select *, a as b from t1;
+create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from t1;
+create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
+create SQL SECURITY INVOKER view v5 as select * from v4;
+grant select on v1 to mysqltest_1@localhost;
+grant select on v2 to mysqltest_1@localhost;
+grant select on v3 to mysqltest_1@localhost;
+grant select on v4 to mysqltest_1@localhost;
+grant select on v5 to mysqltest_1@localhost;
+
+connection user1;
+use mysqltest;
+select * from v1;
+select * from v2;
+-- error ER_VIEW_INVALID
+select * from v3;
+-- error ER_VIEW_INVALID
+select * from v4;
+-- error ER_VIEW_INVALID
+select * from v5;
+use test;
+
+connection root;
+drop view v1, v2, v3, v4, v5;
+drop table t1;
+use test;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
+drop database mysqltest;
+
+#
+# BUG#14256: definer in view definition is not fully qualified
+#
+--disable_warnings
+drop view if exists v1;
+--enable_warnings
+
+# Backup anonymous users and remove them. (They get in the way of
+# the one we test with here otherwise.)
+create table t1 as select * from mysql.user where user='';
+delete from mysql.user where user='';
+flush privileges;
+
+# Create the test user
+grant all on test.* to 'test14256'@'%';
+
+connect (test14256,localhost,test14256,,test);
+connection test14256;
+use test;
+
+create view v1 as select 42;
+show create view v1;
+
+select definer into @v1def1 from information_schema.views
+ where table_schema = 'test' and table_name='v1';
+drop view v1;
+
+create definer=`test14256`@`%` view v1 as select 42;
+show create view v1;
+
+select definer into @v1def2 from information_schema.views
+ where table_schema = 'test' and table_name='v1';
+drop view v1;
+
+select @v1def1, @v1def2, @v1def1=@v1def2;
+
+connection root;
+drop user test14256;
+
+# Restore the anonymous users.
+insert into mysql.user select * from t1;
+flush privileges;
+
+drop table t1;
diff --git a/mysql-test/t/wait_timeout-master.opt b/mysql-test/t/wait_timeout-master.opt
new file mode 100644
index 00000000000..0ad622e9677
--- /dev/null
+++ b/mysql-test/t/wait_timeout-master.opt
@@ -0,0 +1 @@
+--wait-timeout=2
diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test
new file mode 100644
index 00000000000..26f91569868
--- /dev/null
+++ b/mysql-test/t/wait_timeout.test
@@ -0,0 +1,11 @@
+#
+# Bug #8731: wait_timeout does not work on Mac OS X
+#
+--disable_reconnect
+select 1;
+# wait_timeout is 2, so we should get disconnected now
+--sleep 5
+--error 2006
+select 2;
+--enable_reconnect
+select 3;
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 6b983dc38dd..a54bc550228 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -55,7 +55,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
my_gethostbyname.c rijndael.c my_aes.c sha1.c \
my_handler.c my_netware.c my_largepage.c \
- my_windac.c my_access.c
+ my_windac.c my_access.c base64.c
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
@@ -122,5 +122,10 @@ test_gethwaddr$(EXEEXT): my_gethwaddr.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN ./test_gethwaddr.c $(LDADD) $(LIBS)
$(RM) -f ./test_gethwaddr.c
+test_base64$(EXEEXT): base64.c $(LIBRARIES)
+ $(CP) $(srcdir)/base64.c ./test_base64.c
+ $(LINK) $(FLAGS) -DMAIN ./test_base64.c $(LDADD) $(LIBS)
+ $(RM) -f ./test_base64.c
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/mysys/base64.c b/mysys/base64.c
new file mode 100644
index 00000000000..c521f352690
--- /dev/null
+++ b/mysys/base64.c
@@ -0,0 +1,278 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <base64.h>
+#include <m_string.h> // strchr()
+
+#ifndef MAIN
+
+static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789+/";
+
+
+int
+base64_needed_encoded_length(int length_of_data)
+{
+ int nb_base64_chars;
+ nb_base64_chars= (length_of_data + 2) / 3 * 4;
+
+ return
+ nb_base64_chars + /* base64 char incl padding */
+ (nb_base64_chars - 1)/ 76 + /* newlines */
+ 1; /* NUL termination of string */
+}
+
+
+int
+base64_needed_decoded_length(int length_of_encoded_data)
+{
+ return ceil(length_of_encoded_data * 3 / 4);
+}
+
+
+/*
+ Encode a data as base64.
+
+ Note: We require that dst is pre-allocated to correct size.
+ See base64_needed_encoded_length().
+*/
+
+int
+base64_encode(const void *src, size_t src_len, char *dst)
+{
+ const unsigned char *s= (const unsigned char*)src;
+ size_t i= 0;
+ size_t len= 0;
+
+ for (; i < src_len; len += 4)
+ {
+ unsigned c;
+
+ if (len == 76)
+ {
+ len= 0;
+ *dst++= '\n';
+ }
+
+ c= s[i++];
+ c <<= 8;
+
+ if (i < src_len)
+ c += s[i];
+ c <<= 8;
+ i++;
+
+ if (i < src_len)
+ c += s[i];
+ i++;
+
+ *dst++= base64_table[(c >> 18) & 0x3f];
+ *dst++= base64_table[(c >> 12) & 0x3f];
+
+ if (i > (src_len + 1))
+ *dst++= '=';
+ else
+ *dst++= base64_table[(c >> 6) & 0x3f];
+
+ if (i > src_len)
+ *dst++= '=';
+ else
+ *dst++= base64_table[(c >> 0) & 0x3f];
+ }
+ *dst= '\0';
+
+ return 0;
+}
+
+
+static inline unsigned
+pos(unsigned char c)
+{
+ return strchr(base64_table, c) - base64_table;
+}
+
+
+#define SKIP_SPACE(src, i, size) \
+{ \
+ while (i < size && my_isspace(&my_charset_latin1, * src)) \
+ { \
+ i++; \
+ src++; \
+ } \
+ if (i == size) \
+ { \
+ i= size + 1; \
+ break; \
+ } \
+}
+
+
+/*
+ Decode a base64 string
+
+ Note: We require that dst is pre-allocated to correct size.
+ See base64_needed_decoded_length().
+
+ RETURN Number of bytes produced in dst or -1 in case of failure
+*/
+int
+base64_decode(const char *src, size_t size, void *dst)
+{
+ char b[3];
+ size_t i= 0;
+ unsigned char *d= (unsigned char*)dst;
+ size_t j;
+
+ while (i < size)
+ {
+ unsigned c= 0;
+ size_t mark= 0;
+
+ SKIP_SPACE(src, i, size);
+
+ c += pos(*src++);
+ c <<= 6;
+ i++;
+
+ SKIP_SPACE(src, i, size);
+
+ c += pos(*src++);
+ c <<= 6;
+ i++;
+
+ SKIP_SPACE(src, i, size);
+
+ if (* src != '=')
+ c += pos(*src++);
+ else
+ {
+ i= size;
+ mark= 2;
+ c <<= 6;
+ goto end;
+ }
+ c <<= 6;
+ i++;
+
+ SKIP_SPACE(src, i, size);
+
+ if (*src != '=')
+ c += pos(*src++);
+ else
+ {
+ i= size;
+ mark= 1;
+ goto end;
+ }
+ i++;
+
+ end:
+ b[0]= (c >> 16) & 0xff;
+ b[1]= (c >> 8) & 0xff;
+ b[2]= (c >> 0) & 0xff;
+
+ for (j=0; j<3-mark; j++)
+ *d++= b[j];
+ }
+
+ if (i != size)
+ {
+ return -1;
+ }
+ return d - (unsigned char*)dst;
+}
+
+
+#else /* MAIN */
+
+#define require(b) { \
+ if (!(b)) { \
+ printf("Require failed at %s:%d\n", __FILE__, __LINE__); \
+ abort(); \
+ } \
+}
+
+
+int
+main(void)
+{
+ int i;
+ size_t j;
+ size_t k, l;
+ size_t dst_len;
+ size_t needed_length;
+
+ for (i= 0; i < 500; i++)
+ {
+ /* Create source data */
+ const size_t src_len= rand() % 1000 + 1;
+
+ char * src= (char *) malloc(src_len);
+ char * s= src;
+ char * str;
+ char * dst;
+
+ for (j= 0; j<src_len; j++)
+ {
+ char c= rand();
+ *s++= c;
+ }
+
+ /* Encode */
+ needed_length= base64_needed_encoded_length(src_len);
+ str= (char *) malloc(needed_length);
+ for (k= 0; k < needed_length; k++)
+ str[k]= 0xff; /* Fill memory to check correct NUL termination */
+ require(base64_encode(src, src_len, str) == 0);
+ require(needed_length == strlen(str) + 1);
+
+ /* Decode */
+ dst= (char *) malloc(base64_needed_decoded_length(strlen(str)));
+ dst_len= base64_decode(str, strlen(str), dst);
+ require(dst_len == src_len);
+
+ if (memcmp(src, dst, src_len) != 0)
+ {
+ printf(" --------- src --------- --------- dst ---------\n");
+ for (k= 0; k<src_len; k+=8)
+ {
+ printf("%.4x ", (uint) k);
+ for (l=0; l<8 && k+l<src_len; l++)
+ {
+ unsigned char c= src[k+l];
+ printf("%.2x ", (unsigned)c);
+ }
+
+ printf(" ");
+
+ for (l=0; l<8 && k+l<dst_len; l++)
+ {
+ unsigned char c= dst[k+l];
+ printf("%.2x ", (unsigned)c);
+ }
+ printf("\n");
+ }
+ printf("src length: %.8x, dst length: %.8x\n",
+ (uint) src_len, (uint) dst_len);
+ require(0);
+ }
+ }
+ printf("Test succeeded.\n");
+ return 0;
+}
+
+#endif
diff --git a/mysys/charset.c b/mysys/charset.c
index e61d08cbc33..64b15fab0c2 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -38,6 +38,22 @@ my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2)
}
+static uint
+get_collation_number_internal(const char *name)
+{
+ CHARSET_INFO **cs;
+ for (cs= all_charsets;
+ cs < all_charsets+array_elements(all_charsets)-1 ;
+ cs++)
+ {
+ if ( cs[0] && cs[0]->name &&
+ !my_strcasecmp(&my_charset_latin1, cs[0]->name, name))
+ return cs[0]->number;
+ }
+ return 0;
+}
+
+
static my_bool init_state_maps(CHARSET_INFO *cs)
{
uint i;
@@ -189,7 +205,8 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs)
static int add_collation(CHARSET_INFO *cs)
{
- if (cs->name && (cs->number || (cs->number=get_collation_number(cs->name))))
+ if (cs->name && (cs->number ||
+ (cs->number=get_collation_number_internal(cs->name))))
{
if (!all_charsets[cs->number])
{
@@ -419,18 +436,8 @@ void free_charsets(void)
uint get_collation_number(const char *name)
{
- CHARSET_INFO **cs;
init_available_charsets(MYF(0));
-
- for (cs= all_charsets;
- cs < all_charsets+array_elements(all_charsets)-1 ;
- cs++)
- {
- if ( cs[0] && cs[0]->name &&
- !my_strcasecmp(&my_charset_latin1, cs[0]->name, name))
- return cs[0]->number;
- }
- return 0; /* this mimics find_type() */
+ return get_collation_number_internal(name);
}
diff --git a/mysys/mf_format.c b/mysys/mf_format.c
index 0fec9d27b1d..50f354df1cd 100644
--- a/mysys/mf_format.c
+++ b/mysys/mf_format.c
@@ -17,13 +17,12 @@
#include "mysys_priv.h"
#include <m_string.h>
- /*
- Formats a filename with possible replace of directory of extension
- Function can handle the case where 'to' == 'name'
- For a description of the flag values, consult my_sys.h
- The arguments should be in unix format.
- */
-
+/*
+ Formats a filename with possible replace of directory of extension
+ Function can handle the case where 'to' == 'name'
+ For a description of the flag values, consult my_sys.h
+ The arguments should be in unix format.
+*/
my_string fn_format(my_string to, const char *name, const char *dir,
const char *extension, uint flag)
@@ -54,8 +53,7 @@ my_string fn_format(my_string to, const char *name, const char *dir,
pack_dirname(dev,dev); /* Put in ./.. and ~/.. */
if (flag & MY_UNPACK_FILENAME)
(void) unpack_dirname(dev,dev); /* Replace ~/.. with dir */
- if (flag & MY_UNIX_PATH)
- to_unix_path(dev); /* Fix to MySQL representation */
+
if ((pos= (char*) strchr(name,FN_EXTCHAR)) != NullS)
{
if ((flag & MY_REPLACE_EXT) == 0) /* If we should keep old ext */
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 69410e9faaa..3b5e277b56d 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -2750,9 +2750,12 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond,
gettimeofday(&now, &tz);
/* Prepare timeout value */
timeout.tv_sec= now.tv_sec + KEYCACHE_TIMEOUT;
- timeout.tv_nsec= now.tv_usec * 1000; /* timeval uses microseconds. */
- /* timespec uses nanoseconds. */
- /* 1 nanosecond = 1000 micro seconds. */
+ /*
+ timeval uses microseconds.
+ timespec uses nanoseconds.
+ 1 nanosecond = 1000 micro seconds
+ */
+ timeout.tv_nsec= now.tv_usec * 1000;
KEYCACHE_THREAD_TRACE_END("started waiting");
#if defined(KEYCACHE_DEBUG)
cnt++;
@@ -2762,17 +2765,15 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond,
#endif
rc= pthread_cond_timedwait(cond, mutex, &timeout);
KEYCACHE_THREAD_TRACE_BEGIN("finished waiting");
-#if defined(KEYCACHE_DEBUG)
- if (rc == ETIMEDOUT)
+ if (rc == ETIMEDOUT || rc == ETIME)
{
+#if defined(KEYCACHE_DEBUG)
fprintf(keycache_debug_log,"aborted by keycache timeout\n");
fclose(keycache_debug_log);
abort();
- }
#endif
-
- if (rc == ETIMEDOUT)
keycache_dump();
+ }
#if defined(KEYCACHE_DEBUG)
KEYCACHE_DBUG_ASSERT(rc != ETIMEDOUT);
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index 31ef21632b9..95dc5afeae9 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -723,10 +723,10 @@ static longlong getopt_ll(char *arg, const struct my_option *optp, int *err)
ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L);
num= eval_num_suffix(arg, err, (char*) optp->name);
- if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value &&
+ if (num > 0 && (ulonglong) num > (ulonglong) optp->max_value &&
optp->max_value) /* if max value is not set -> no upper limit */
- num= (longlong) (ulong) optp->max_value;
- num= ((num - (longlong) optp->sub_size) / block_size);
+ num= (ulonglong) optp->max_value;
+ num= ((num - optp->sub_size) / block_size);
num= (longlong) (num * block_size);
return max(num, optp->min_value);
}
diff --git a/mysys/my_handler.c b/mysys/my_handler.c
index e14bd7529f9..56f2298a9f0 100644
--- a/mysys/my_handler.c
+++ b/mysys/my_handler.c
@@ -75,7 +75,7 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
SYNOPSIS
ha_key_cmp()
- keyseg Key segments of key to compare
+ keyseg Array of key segments of key to compare
a First key to compare, in format from _mi_pack_key()
This is normally key specified by user
b Second key to compare. This is always from a row
@@ -84,10 +84,26 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
next_flag How keys should be compared
If bit SEARCH_FIND is not set the keys includes the row
position and this should also be compared
+ diff_pos OUT Number of first keypart where values differ, counting
+ from one.
+ diff_pos[1] OUT (b + diff_pos[1]) points to first value in tuple b
+ that is different from corresponding value in tuple a.
+
+ EXAMPLES
+ Example1: if the function is called for tuples
+ ('aaa','bbb') and ('eee','fff'), then
+ diff_pos[0] = 1 (as 'aaa' != 'eee')
+ diff_pos[1] = 0 (offset from beggining of tuple b to 'eee' keypart).
+
+ Example2: if the index function is called for tuples
+ ('aaa','bbb') and ('aaa','fff'),
+ diff_pos[0] = 2 (as 'aaa' != 'eee')
+ diff_pos[1] = 3 (offset from beggining of tuple b to 'fff' keypart,
+ here we assume that first key part is CHAR(3) NOT NULL)
NOTES
Number-keys can't be splited
-
+
RETURN VALUES
<0 If a < b
0 If a == b
@@ -107,6 +123,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
float f_1,f_2;
double d_1,d_2;
uint next_key_length;
+ uchar *orig_b= b;
*diff_pos=0;
for ( ; (int) key_length >0 ; key_length=next_key_length, keyseg++)
@@ -114,6 +131,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
uchar *end;
uint piks=! (keyseg->flag & HA_NO_SORT);
(*diff_pos)++;
+ diff_pos[1]= (uint)(b - orig_b);
/* Handle NULL part */
if (keyseg->null_bit)
@@ -451,3 +469,84 @@ end:
}
return 0;
} /* ha_key_cmp */
+
+
+/*
+ Find the first NULL value in index-suffix values tuple
+
+ SYNOPSIS
+ ha_find_null()
+ keyseg Array of keyparts for key suffix
+ a Key suffix value tuple
+
+ DESCRIPTION
+ Find the first NULL value in index-suffix values tuple.
+ TODO Consider optimizing this fuction or its use so we don't search for
+ NULL values in completely NOT NULL index suffixes.
+
+ RETURN
+ First key part that has NULL as value in values tuple, or the last key part
+ (with keyseg->type==HA_TYPE_END) if values tuple doesn't contain NULLs.
+*/
+
+HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a)
+{
+ for (; (enum ha_base_keytype) keyseg->type != HA_KEYTYPE_END; keyseg++)
+ {
+ uchar *end;
+ if (keyseg->null_bit)
+ {
+ if (!*a++)
+ return keyseg;
+ }
+ end= a+ keyseg->length;
+
+ switch ((enum ha_base_keytype) keyseg->type) {
+ case HA_KEYTYPE_TEXT:
+ case HA_KEYTYPE_BINARY:
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int a_length;
+ get_key_length(a_length, a);
+ a += a_length;
+ break;
+ }
+ else
+ a= end;
+ break;
+ case HA_KEYTYPE_VARTEXT1:
+ case HA_KEYTYPE_VARBINARY1:
+ {
+ int a_length;
+ get_key_length(a_length, a);
+ a+= a_length;
+ break;
+ }
+ case HA_KEYTYPE_NUM:
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int alength= *a++;
+ end= a+alength;
+ }
+ a= end;
+ break;
+ case HA_KEYTYPE_INT8:
+ case HA_KEYTYPE_SHORT_INT:
+ case HA_KEYTYPE_USHORT_INT:
+ case HA_KEYTYPE_LONG_INT:
+ case HA_KEYTYPE_ULONG_INT:
+ case HA_KEYTYPE_INT24:
+ case HA_KEYTYPE_UINT24:
+#ifdef HAVE_LONG_LONG
+ case HA_KEYTYPE_LONGLONG:
+ case HA_KEYTYPE_ULONGLONG:
+#endif
+ case HA_KEYTYPE_FLOAT:
+ case HA_KEYTYPE_DOUBLE:
+ a= end;
+ break;
+ }
+ }
+ return keyseg;
+}
+
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index c3b0b57e549..1908c70f407 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -427,6 +427,18 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
do
{
#ifdef __BORLANDC__
+ attrib= find.ff_attrib;
+#else
+ attrib= find.attrib;
+ /*
+ Do not show hidden and system files which Windows sometimes create.
+ Note. Because Borland's findfirst() is called with the third
+ argument = 0 hidden/system files are excluded from the search.
+ */
+ if (attrib & (_A_HIDDEN | _A_SYSTEM))
+ continue;
+#endif
+#ifdef __BORLANDC__
if (!(finfo.name= strdup_root(names_storage, find.ff_name)))
goto error;
#else
@@ -442,11 +454,10 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
bzero(finfo.mystat, sizeof(MY_STAT));
#ifdef __BORLANDC__
finfo.mystat->st_size=find.ff_fsize;
- mode=MY_S_IREAD; attrib=find.ff_attrib;
#else
finfo.mystat->st_size=find.size;
- mode=MY_S_IREAD; attrib=find.attrib;
#endif
+ mode=MY_S_IREAD;
if (!(attrib & _A_RDONLY))
mode|=MY_S_IWRITE;
if (attrib & _A_SUBDIR)
diff --git a/mysys/my_os2cond.c b/mysys/my_os2cond.c
index 83a03d62046..bf3e85c26a9 100644
--- a/mysys/my_os2cond.c
+++ b/mysys/my_os2cond.c
@@ -22,7 +22,7 @@
** The following is a simple implementation of posix conditions
*****************************************************************************/
-#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
+#undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */
#include "mysys_priv.h"
#if defined(THREAD) && defined(OS2)
#include <m_string.h>
@@ -31,134 +31,109 @@
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
{
- APIRET rc = 0;
- HEV event;
- cond->waiting=0;
- /* Warp3 FP29 or Warp4 FP4 or better required */
- rc = DosCreateEventSem( NULL, &cond->semaphore, 0x0800, 0);
- if (rc)
- return ENOMEM;
-
+ cond->waiting= 0;
+ /* Warp3 FP29 or Warp4 FP4 or better required */
+ if (DosCreateEventSem(NULL, &cond->semaphore, 0x0800, 0))
+ return ENOMEM;
return 0;
}
int pthread_cond_destroy(pthread_cond_t *cond)
{
- APIRET rc;
-
- do {
- rc = DosCloseEventSem(cond->semaphore);
- if (rc == 301) DosPostEventSem(cond->semaphore);
- } while (rc == 301);
- if (rc)
- return EINVAL;
-
- return 0;
+ for (;;)
+ {
+ APIRET rc;
+ if ((rc= DosCloseEventSem(cond->semaphore)) != 301)
+ return rc ? EINVAL : 0;
+ DosPostEventSem(cond->semaphore);
+ }
}
int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
{
- APIRET rc;
- int rval;
-
- rval = 0;
- cond->waiting++;
-
- if (mutex) pthread_mutex_unlock(mutex);
-
- rc = DosWaitEventSem(cond->semaphore,SEM_INDEFINITE_WAIT);
- if (rc != 0)
- rval = EINVAL;
-
- if (mutex) pthread_mutex_lock(mutex);
-
- cond->waiting--;
-
- return rval;
+ int rval= 0;
+ cond->waiting++;
+ if (mutex)
+ pthread_mutex_unlock(mutex);
+ if (DosWaitEventSem(cond->semaphore, SEM_INDEFINITE_WAIT))
+ rval= EINVAL;
+ if (mutex)
+ pthread_mutex_lock(mutex);
+ cond->waiting--;
+ return rval;
}
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
- struct timespec *abstime)
+ struct timespec *abstime)
{
struct timeb curtime;
int result;
long timeout;
- APIRET rc;
- int rval;
-
- _ftime(&curtime);
- timeout= ((long) (abstime->ts_sec - curtime.time)*1000L +
- (long)((abstime->ts_nsec/1000) - curtime.millitm)/1000L);
- if (timeout < 0) /* Some safety */
- timeout = 0L;
+ int rval= 0;
- rval = 0;
- cond->waiting++;
+ _ftime(&curtime);
+ timeout= ((long) (abstime->ts_sec - curtime.time) * 1000L +
+ (long) ((abstime->ts_nsec / 1000) - curtime.millitm) / 1000L);
+ if (timeout < 0) /* Some safety */
+ timeout= 0L;
- if (mutex) pthread_mutex_unlock(mutex);
+ cond->waiting++;
- rc = DosWaitEventSem(cond->semaphore, timeout);
- if (rc != 0)
- rval= ETIMEDOUT;
+ if (mutex)
+ pthread_mutex_unlock(mutex);
+ if (DosWaitEventSem(cond->semaphore, timeout) != 0)
+ rval= ETIMEDOUT;
+ if (mutex)
+ pthread_mutex_lock(mutex);
- if (mutex) pthread_mutex_lock(mutex);
+ cond->waiting--;
- cond->waiting--;
-
- return rval;
+ return rval;
}
int pthread_cond_signal(pthread_cond_t *cond)
{
- APIRET rc;
-
- /* Bring the next thread off the condition queue: */
- rc = DosPostEventSem(cond->semaphore);
- return 0;
+ /* Bring the next thread off the condition queue: */
+ DosPostEventSem(cond->semaphore);
+ return 0;
}
int pthread_cond_broadcast(pthread_cond_t *cond)
{
- int i;
- APIRET rc;
-
- /*
- * Enter a loop to bring all threads off the
- * condition queue:
- */
- i = cond->waiting;
- while (i--) rc = DosPostEventSem(cond->semaphore);
-
- return 0 ;
+ int i;
+ /* Enter a loop to bring all threads off the condition queue */
+ for (i= cond->waiting; i--;)
+ DosPostEventSem(cond->semaphore);
+ return 0;
}
int pthread_attr_init(pthread_attr_t *connect_att)
{
- connect_att->dwStackSize = 0;
- connect_att->dwCreatingFlag = 0;
- connect_att->priority = 0;
+ connect_att->dwStackSize= 0;
+ connect_att->dwCreatingFlag= 0;
+ connect_att->priority= 0;
return 0;
}
-int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack)
+int pthread_attr_setstacksize(pthread_attr_t *connect_att, DWORD stack)
{
- connect_att->dwStackSize=stack;
+ connect_att->dwStackSize= stack;
return 0;
}
-int pthread_attr_setprio(pthread_attr_t *connect_att,int priority)
+int pthread_attr_setprio(pthread_attr_t *connect_att, int priority)
{
- connect_att->priority=priority;
+ connect_att->priority= priority;
return 0;
}
int pthread_attr_destroy(pthread_attr_t *connect_att)
{
- bzero((gptr) connect_att,sizeof(*connect_att));
+ bzero((gptr) connect_att, sizeof(*connect_att));
return 0;
}
@@ -166,22 +141,22 @@ int pthread_attr_destroy(pthread_attr_t *connect_att)
** Fix localtime_r() to be a bit safer
****************************************************************************/
-struct tm *localtime_r(const time_t *timep,struct tm *tmp)
+struct tm *localtime_r(const time_t *timep, struct tm *tmp)
{
- if (*timep == (time_t) -1) /* This will crash win32 */
+ if (*timep == (time_t) - 1) /* This will crash win32 */
{
- bzero(tmp,sizeof(*tmp));
+ bzero(tmp, sizeof(*tmp));
}
else
{
- struct tm *res=localtime(timep);
- if (!res) /* Wrong date */
+ struct tm *res= localtime(timep);
+ if (!res) /* Wrong date */
{
- bzero(tmp,sizeof(*tmp)); /* Keep things safe */
+ bzero(tmp, sizeof(*tmp)); /* Keep things safe */
return 0;
}
*tmp= *res;
}
return tmp;
}
-#endif /* __WIN__ */
+#endif /* __WIN__ */
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index 37517fb8327..315e966bf43 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -404,23 +404,6 @@ int sigwait(sigset_t *setp, int *sigp)
#endif /* DONT_USE_SIGSUSPEND */
#endif /* HAVE_SIGWAIT */
-/*****************************************************************************
-** Implement pthread_signal for systems that can't use signal() with threads
-** Currently this is only used with BSDI 3.0
-*****************************************************************************/
-
-#ifdef USE_PTHREAD_SIGNAL
-
-int pthread_signal(int sig, void (*func)())
-{
- struct sigaction sact;
- sact.sa_flags= 0;
- sact.sa_handler= func;
- sigemptyset(&sact.sa_mask);
- sigaction(sig, &sact, (struct sigaction*) 0);
- return 0;
-}
-#endif
/****************************************************************************
The following functions fixes that all pthread functions should work
diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c
index c8edb172890..a385bf1e530 100644
--- a/mysys/my_realloc.c
+++ b/mysys/my_realloc.c
@@ -52,7 +52,7 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags)
if ((point = (char*)realloc(oldpoint,size)) == NULL)
{
if (my_flags & MY_FREE_ON_ERROR)
- my_free(oldpoint,MyFLAGS);
+ my_free(oldpoint, my_flags);
if (my_flags & MY_HOLD_ON_ERROR)
DBUG_RETURN(oldpoint);
my_errno=errno;
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 05d14073953..e5b77de5e38 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -80,17 +80,7 @@ void init_thr_alarm(uint max_alarms)
pthread_mutex_init(&LOCK_alarm,MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_alarm,NULL);
#if THR_CLIENT_ALARM != SIGALRM || defined(USE_ALARM_THREAD)
-#if defined(HAVE_mit_thread)
- sigset(THR_CLIENT_ALARM,thread_alarm); /* int. thread system calls */
-#else
- {
- struct sigaction sact;
- sact.sa_flags = 0;
- bzero((char*) &sact, sizeof(sact));
- sact.sa_handler = thread_alarm;
- sigaction(THR_CLIENT_ALARM, &sact, (struct sigaction*) 0);
- }
-#endif
+ my_sigset(THR_CLIENT_ALARM,thread_alarm);
#endif
sigemptyset(&s);
sigaddset(&s, THR_SERVER_ALARM);
@@ -110,12 +100,12 @@ void init_thr_alarm(uint max_alarms)
#elif defined(USE_ONE_SIGNAL_HAND)
pthread_sigmask(SIG_BLOCK, &s, NULL); /* used with sigwait() */
#if THR_SERVER_ALARM == THR_CLIENT_ALARM
- sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */
+ my_sigset(THR_CLIENT_ALARM,process_alarm); /* Linuxthreads */
pthread_sigmask(SIG_UNBLOCK, &s, NULL);
#endif
#else
+ my_sigset(THR_SERVER_ALARM, process_alarm);
pthread_sigmask(SIG_UNBLOCK, &s, NULL);
- sigset(THR_SERVER_ALARM,process_alarm);
#endif
DBUG_VOID_RETURN;
}
@@ -290,7 +280,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
printf("thread_alarm\n"); fflush(stdout);
#endif
#ifdef DONT_REMEMBER_SIGNAL
- sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */
+ my_sigset(THR_CLIENT_ALARM,process_alarm); /* int. thread system calls */
#endif
return;
}
@@ -310,7 +300,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
process_alarm_part2(sig);
#ifndef USE_ALARM_THREAD
#if defined(DONT_REMEMBER_SIGNAL) && !defined(USE_ONE_SIGNAL_HAND)
- sigset(THR_SERVER_ALARM,process_alarm);
+ my_sigset(THR_SERVER_ALARM,process_alarm);
#endif
pthread_mutex_unlock(&LOCK_alarm);
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
@@ -512,7 +502,7 @@ static sig_handler thread_alarm(int sig)
printf("thread_alarm\n"); fflush(stdout);
#endif
#ifdef DONT_REMEMBER_SIGNAL
- sigset(sig,thread_alarm); /* int. thread system calls */
+ my_sigset(sig,thread_alarm); /* int. thread system calls */
#endif
}
#endif
@@ -916,7 +906,7 @@ static sig_handler print_signal_warning(int sig)
printf("Warning: Got signal %d from thread %s\n",sig,my_thread_name());
fflush(stdout);
#ifdef DONT_REMEMBER_SIGNAL
- sigset(sig,print_signal_warning); /* int. thread system calls */
+ my_sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
#ifndef OS2
if (sig == SIGALRM)
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 41266d61b0a..f5a8b618949 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -408,9 +408,10 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
set_timespec(wait_timeout, table_lock_wait_timeout);
while (!thread_var->abort || in_wait_list)
{
- int rc= can_deadlock ? pthread_cond_timedwait(cond, &data->lock->mutex,
- &wait_timeout) :
- pthread_cond_wait(cond, &data->lock->mutex);
+ int rc= (can_deadlock ?
+ pthread_cond_timedwait(cond, &data->lock->mutex,
+ &wait_timeout) :
+ pthread_cond_wait(cond, &data->lock->mutex));
/*
We must break the wait if one of the following occurs:
- the connection has been aborted (!thread_var->abort), but
@@ -426,7 +427,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
*/
if (data->cond == 0)
break;
- if (rc == ETIMEDOUT)
+ if (rc == ETIMEDOUT || rc == ETIME)
{
result= THR_LOCK_WAIT_TIMEOUT;
break;
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 2facb4e18cf..3326068d164 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -239,7 +239,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
pthread_mutex_unlock(&mp->global);
error=pthread_cond_timedwait(cond,&mp->mutex,abstime);
#ifdef EXTRA_DEBUG
- if (error && (error != EINTR && error != ETIMEDOUT))
+ if (error && (error != EINTR && error != ETIMEDOUT && error != ETIME))
{
fprintf(stderr,"safe_mutex: Got error: %d (%d) when doing a safe_mutex_timedwait at %s, line %d\n", error, errno, file, line);
}
diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools
index c85fced5739..26ac1d79f37 100755
--- a/netware/BUILD/compile-linux-tools
+++ b/netware/BUILD/compile-linux-tools
@@ -18,7 +18,6 @@ path=`dirname $0`
if test -e "Makefile"; then make -k clean; fi
# remove files
-rm -f NEW-RPMS/*
rm -f */.deps/*.P
rm -f */*.linux
diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END
index 60ef428b2a9..f7da0d9596e 100755
--- a/netware/BUILD/compile-netware-END
+++ b/netware/BUILD/compile-netware-END
@@ -12,7 +12,6 @@ path=`dirname $0`
if test -e "Makefile"; then make -k clean; fi
# remove files
-rm -f NEW-RPMS/*
rm -f */.deps/*.P
rm -rf Makefile.in.bk
diff --git a/netware/BUILD/compile-netware-src b/netware/BUILD/compile-netware-src
index df7f6fcdd1a..f4e8a53ffea 100644
--- a/netware/BUILD/compile-netware-src
+++ b/netware/BUILD/compile-netware-src
@@ -21,7 +21,6 @@ if test -e "Makefile"; then
fi
# remove other files
-rm -f NEW-RPMS/*
rm -f */.deps/*.P
rm -rf Makefile.in.bk
diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv
index 7f89a8faf7f..fa52568fcd6 100755
--- a/netware/BUILD/mwenv
+++ b/netware/BUILD/mwenv
@@ -19,9 +19,9 @@ export AR='mwldnlm'
export AR_FLAGS='-type library -o'
export AS='mwasmnlm'
export CC='mwccnlm -gccincludes'
-export CFLAGS='-enum int -O3 -align 8 -proc 686 -relax_pointers -dialect c'
+export CFLAGS='-enum int -align 8 -proc 686 -relax_pointers -dialect c'
export CXX='mwccnlm -gccincludes'
-export CXXFLAGS='-enum int -O3 -align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T'
+export CXXFLAGS='-enum int -align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T'
export LD='mwldnlm'
export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -map -flags pseudopreemption'
export RANLIB=:
diff --git a/netware/mysql.def b/netware/mysql.def
index b79c94b1bb1..16acc7babe1 100644
--- a/netware/mysql.def
+++ b/netware/mysql.def
@@ -6,6 +6,7 @@ SCREENNAME "MySQL Monitor[scrollable]"
COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Monitor"
VERSION 4, 0
+STACKSIZE 32768
MULTIPLE
XDCDATA ../netware/mysql.xdc
#DEBUG
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
index 7ca242178ff..92ed89b4770 100644
--- a/netware/mysql_test_run.c
+++ b/netware/mysql_test_run.c
@@ -173,7 +173,7 @@ void report_stats()
log_msg("\nFailed %u/%u test(s), %.02f%% successful.\n",
total_fail, total_test, percent);
log_msg("\nThe .out and .err files in %s may give you some\n", result_dir);
- log_msg("hint of what when wrong.\n");
+ log_msg("hint of what went wrong.\n");
log_msg("\nIf you want to report this error, please first read the documentation\n");
log_msg("at: http://www.mysql.com/doc/en/MySQL_test_suite.html\n");
}
diff --git a/netware/pack_isam.def b/netware/pack_isam.def
index b93cfdffbeb..9ea72a4f2e7 100644
--- a/netware/pack_isam.def
+++ b/netware/pack_isam.def
@@ -2,8 +2,10 @@
# Pack ISAM
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL ISAM Table Pack Tool"
COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL ISAM Table Pack Tool"
+SCREENNAME "MySQL ISAM Table Pack Tool"
VERSION 4, 0
XDCDATA ../netware/mysql.xdc
#DEBUG
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 734e3f70b13..5767728fe4f 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -226,13 +226,16 @@ copyfileto $BASE/mysql-test \
$CP mysql-test/lib/*.pl $BASE/mysql-test/lib
$CP mysql-test/lib/*.sql $BASE/mysql-test/lib
+$CP mysql-test/t/*.def $BASE/mysql-test/t
$CP mysql-test/include/*.inc $BASE/mysql-test/include
$CP mysql-test/t/*.def $BASE/mysql-test/t
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \
mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \
+ mysql-test/std_data/*.cnf \
$BASE/mysql-test/std_data
-$CP mysql-test/t/*.test mysql-test/t/*.disabled mysql-test/t/*.opt \
+$CP mysql-test/t/*.test mysql-test/t/*.imtest \
+ mysql-test/t/*.disabled mysql-test/t/*.opt \
mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t
$CP mysql-test/r/*.result mysql-test/r/*.require \
$BASE/mysql-test/r
@@ -269,8 +272,11 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \
if [ $BASE_SYSTEM = "netware" ] ; then
echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql
echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql
- sh ./scripts/mysql_create_system_tables.sh real >> $BASE/bin/init_db.sql
- sh ./scripts/mysql_create_system_tables.sh test > $BASE/bin/test_db.sql
+ sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \
+ >> $BASE/bin/init_db.sql
+ sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \
+ > $BASE/bin/test_db.sql
+ ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql
fi
#
diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh
index 67b1fbe8696..1f36108a5c4 100644
--- a/scripts/make_win_src_distribution.sh
+++ b/scripts/make_win_src_distribution.sh
@@ -289,7 +289,7 @@ cd $SOURCE
for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\
INSTALL-SOURCE INSTALL-WIN \
INSTALL-WIN-SOURCE \
- Docs/INSTALL-BINARY
+ Docs/INSTALL-BINARY Docs/manual.chm
do
print_debug "Copying file '$i'"
if [ -f $i ]
diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh
index babf3a1c83f..54f0ef230ad 100644
--- a/scripts/mysql_create_system_tables.sh
+++ b/scripts/mysql_create_system_tables.sh
@@ -123,7 +123,7 @@ then
c_u="$c_u CREATE TABLE user ("
c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL,"
c_u="$c_u User char(16) binary DEFAULT '' NOT NULL,"
- c_u="$c_u Password binary(41) DEFAULT '' NOT NULL,"
+ c_u="$c_u Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL,"
c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index 2248e0a84fd..9e45766c6d2 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -157,7 +157,7 @@ ALTER TABLE user
MODIFY User char(16) NOT NULL default '',
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE user
- MODIFY Password binary(41) NOT NULL default '',
+ MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '',
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 873aff251db..a584c384712 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -11,6 +11,7 @@
# executing mysqld_safe
KILL_MYSQLD=1;
+MYSQLD=
trap '' 1 2 3 15 # we shouldn't let anyone kill us
@@ -174,14 +175,6 @@ export MYSQL_HOME
user=@MYSQLD_USER@
niceness=0
-# Use the mysqld-max binary by default if the user doesn't specify a binary
-if test -x $ledir/mysqld-max
-then
- MYSQLD=mysqld-max
-else
- MYSQLD=mysqld
-fi
-
# these rely on $DATADIR by default, so we'll set them later on
pid_file=
err_log=
@@ -220,6 +213,16 @@ then
chown $user $mysql_unix_port_dir
fi
+# Use the mysqld-max binary by default if the user doesn't specify a binary
+if test -z "$MYSQLD"
+then
+ if test -x $ledir/mysqld-max
+ then
+ MYSQLD=mysqld-max
+ else
+ MYSQLD=mysqld
+ fi
+fi
if test ! -x $ledir/$MYSQLD
then
diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am
index b872adca09d..4fa2a0da405 100644
--- a/server-tools/instance-manager/Makefile.am
+++ b/server-tools/instance-manager/Makefile.am
@@ -15,7 +15,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
INCLUDES= @ZLIB_INCLUDES@ -I$(top_srcdir)/include \
- $(openssl_includes) -I$(top_builddir)/include
+ @openssl_includes@ @yassl_includes@ -I$(top_builddir)/include
DEFS= -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER
@@ -85,7 +85,7 @@ mysqlmanager_LDADD= liboptions.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \
- @openssl_libs@ @ZLIB_LIBS@
+ @openssl_libs@ @yassl_libs@ @ZLIB_LIBS@
tags:
diff --git a/server-tools/instance-manager/command.h b/server-tools/instance-manager/command.h
index 82ded800e65..b84cc6a8e9e 100644
--- a/server-tools/instance-manager/command.h
+++ b/server-tools/instance-manager/command.h
@@ -16,12 +16,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <my_global.h>
+
#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
#pragma interface
#endif
-#include <my_global.h>
-
/* Class responsible for allocation of im commands. */
class Instance_map;
diff --git a/server-tools/instance-manager/instance.cc b/server-tools/instance-manager/instance.cc
index ff3387334b6..3d54d000d5f 100644
--- a/server-tools/instance-manager/instance.cc
+++ b/server-tools/instance-manager/instance.cc
@@ -138,15 +138,25 @@ static int wait_process(My_process_info *pi)
static int start_process(Instance_options *instance_options,
My_process_info *pi)
{
+#ifndef __QNX__
*pi= fork();
+#else
+ /*
+ On QNX one cannot use fork() in multithreaded environment and we
+ should use spawn() or one of it's siblings instead.
+ Here we use spawnv(), which is a combination of fork() and execv()
+ in one call. It returns the pid of newly created process (>0) or -1
+ */
+ *pi= spawnv(P_NOWAIT, instance_options->mysqld_path, instance_options->argv);
+#endif
switch (*pi) {
- case 0:
+ case 0: /* never happens on QNX */
execv(instance_options->mysqld_path, instance_options->argv);
/* exec never returns */
exit(1);
- case 1:
- log_info("cannot fork() to start instance %s",
+ case -1:
+ log_info("cannot create a new process to start instance %s",
instance_options->instance_name);
return 1;
}
@@ -170,7 +180,8 @@ static int start_process(Instance_options *instance_options,
char *cmdline= new char[cmdlen];
if (cmdline == NULL)
return 1;
-
+
+ cmdline[0]= 0;
for (int i= 0; instance_options->argv[i] != 0; i++)
{
strcat(cmdline, "\"");
@@ -469,7 +480,7 @@ int Instance::stop()
status= pthread_cond_timedwait(&COND_instance_stopped,
&LOCK_instance,
&timeout);
- if (status == ETIMEDOUT)
+ if (status == ETIMEDOUT || status == ETIME)
break;
}
diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc
index 25609f489af..83f13b34aa2 100644
--- a/server-tools/instance-manager/instance_options.cc
+++ b/server-tools/instance-manager/instance_options.cc
@@ -47,14 +47,12 @@ static inline int create_mysqld_command(Buffer *buf,
if (buf->get_size()) /* malloc succeeded */
{
#ifdef __WIN__
- buf->append(position, "\"", 1);
- position++;
+ buf->append(position++, "\"", 1);
#endif
buf->append(position, mysqld_path_str, mysqld_path_len);
position+= mysqld_path_len;
#ifdef __WIN__
- buf->append(position, "\"", 1);
- position++;
+ buf->append(position++, "\"", 1);
#endif
/* here the '\0' character is copied from the option string */
buf->append(position, option, option_len);
@@ -336,10 +334,15 @@ int Instance_options::complete_initialization(const char *default_path,
uint instance_type)
{
const char *tmp;
+ char *end;
if (!mysqld_path && !(mysqld_path= strdup_root(&alloc, default_path)))
goto err;
+ // it's safe to cast this to char* since this is a buffer we are allocating
+ end= convert_dirname((char*)mysqld_path, mysqld_path, NullS);
+ end[-1]= 0;
+
mysqld_path_len= strlen(mysqld_path);
if (mysqld_port)
diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc
index 08c28dc9f7d..67d798a1700 100644
--- a/server-tools/instance-manager/listener.cc
+++ b/server-tools/instance-manager/listener.cc
@@ -122,11 +122,15 @@ void Listener_thread::run()
n++;
timeval tv;
- tv.tv_sec= 0;
- tv.tv_usec= 100000;
while (!thread_registry.is_shutdown())
{
fd_set read_fds_arg= read_fds;
+ /*
+ We should reintialize timer as on linux it is modified
+ to reflect amount of time not slept.
+ */
+ tv.tv_sec= 0;
+ tv.tv_usec= 100000;
/*
When using valgrind 2.0 this syscall doesn't get kicked off by a
@@ -358,12 +362,13 @@ void Listener_thread::handle_new_mysql_connection(Vio *vio)
pthread_attr_t mysql_thd_attr;
pthread_attr_init(&mysql_thd_attr);
pthread_attr_setdetachstate(&mysql_thd_attr, PTHREAD_CREATE_DETACHED);
- if (pthread_create(&mysql_thd_id, &mysql_thd_attr, mysql_connection,
- mysql_thread_args))
+ if (set_stacksize_n_create_thread(&mysql_thd_id, &mysql_thd_attr,
+ mysql_connection, mysql_thread_args))
{
delete mysql_thread_args;
vio_delete(vio);
- log_error("handle_one_mysql_connection(): pthread_create(mysql) failed");
+ log_error("handle_one_mysql_connection():"
+ "set_stacksize_n_create_thread(mysql) failed");
}
pthread_attr_destroy(&mysql_thd_attr);
}
diff --git a/server-tools/instance-manager/listener.h b/server-tools/instance-manager/listener.h
index e0ab5b8ef2b..28ccbf91731 100644
--- a/server-tools/instance-manager/listener.h
+++ b/server-tools/instance-manager/listener.h
@@ -16,13 +16,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <my_global.h>
+#include <my_pthread.h>
+
#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
#pragma interface
#endif
-#include <my_global.h>
-#include <my_pthread.h>
-
pthread_handler_t listener(void *arg);
diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc
index a42a25eadf3..3ecd5fbc0d0 100644
--- a/server-tools/instance-manager/manager.cc
+++ b/server-tools/instance-manager/manager.cc
@@ -162,12 +162,12 @@ void manager(const Options &options)
pthread_attr_init(&listener_thd_attr);
pthread_attr_setdetachstate(&listener_thd_attr, PTHREAD_CREATE_DETACHED);
- rc= pthread_create(&listener_thd_id, &listener_thd_attr, listener,
- &listener_args);
+ rc= set_stacksize_n_create_thread(&listener_thd_id, &listener_thd_attr,
+ listener, &listener_args);
pthread_attr_destroy(&listener_thd_attr);
if (rc)
{
- log_error("manager(): pthread_create(listener) failed");
+ log_error("manager(): set_stacksize_n_create_thread(listener) failed");
goto err;
}
@@ -187,12 +187,12 @@ void manager(const Options &options)
pthread_attr_init(&guardian_thd_attr);
pthread_attr_setdetachstate(&guardian_thd_attr, PTHREAD_CREATE_DETACHED);
- rc= pthread_create(&guardian_thd_id, &guardian_thd_attr, guardian,
- &guardian_thread);
+ rc= set_stacksize_n_create_thread(&guardian_thd_id, &guardian_thd_attr,
+ guardian, &guardian_thread);
pthread_attr_destroy(&guardian_thd_attr);
if (rc)
{
- log_error("manager(): pthread_create(guardian) failed");
+ log_error("manager(): set_stacksize_n_create_thread(guardian) failed");
goto err;
}
@@ -231,6 +231,16 @@ void manager(const Options &options)
}
#ifndef __WIN__
+/*
+ On some Darwin kernels SIGHUP is delivered along with most
+ signals. This is why we skip it's processing on these
+ platforms. For more details and test program see
+ Bug #14164 IM tests fail on MacOS X (powermacg5)
+*/
+#ifdef IGNORE_SIGHUP_SIGQUIT
+ if ( SIGHUP == signo )
+ continue;
+#endif
if (THR_SERVER_ALARM == signo)
process_alarm(signo);
else
diff --git a/server-tools/instance-manager/mysql_connection.h b/server-tools/instance-manager/mysql_connection.h
index 492937b2198..3496cc05815 100644
--- a/server-tools/instance-manager/mysql_connection.h
+++ b/server-tools/instance-manager/mysql_connection.h
@@ -16,13 +16,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
#include <my_global.h>
#include <my_pthread.h>
+#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
+#pragma interface
+#endif
pthread_handler_t mysql_connection(void *arg);
diff --git a/server-tools/instance-manager/options.h b/server-tools/instance-manager/options.h
index 3a60de2bb39..6d719c69629 100644
--- a/server-tools/instance-manager/options.h
+++ b/server-tools/instance-manager/options.h
@@ -16,16 +16,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
/*
Options - all possible options for the instance manager grouped in one
struct.
*/
#include <my_global.h>
+#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
+#pragma interface
+#endif
+
struct Options
{
#ifdef __WIN__
diff --git a/server-tools/instance-manager/parse_output.cc b/server-tools/instance-manager/parse_output.cc
index b5af3cb83a7..ebc45c1f7d4 100644
--- a/server-tools/instance-manager/parse_output.cc
+++ b/server-tools/instance-manager/parse_output.cc
@@ -24,6 +24,20 @@
#include "portability.h"
+void trim_space(const char **text, uint *word_len)
+{
+ const char *start= *text;
+ while (*start != 0 && *start == ' ')
+ start++;
+ *text= start;
+
+ int len= strlen(start);
+ const char *end= start + len - 1;
+ while (end > start && my_isspace(&my_charset_latin1, *end))
+ end--;
+ *word_len= (end - start)+1;
+}
+
/*
Parse output of the given command
@@ -82,20 +96,17 @@ int parse_output_and_get_value(const char *command, const char *word,
linebuf[sizeof(linebuf) - 1]= '\0'; /* safety */
/*
- Get the word, which might contain non-alphanumeric characters. (Usually
- these are '/', '-' and '.' in the path expressions and filenames)
+ Compare the start of our line with the word(s) we are looking for.
*/
- get_word((const char **) &linep, &found_word_len, NONSPACE);
if (!strncmp(word, linep, wordlen))
{
/*
- If we have found the word, return the next one (this is usually
- an option value) or the whole line (if flag)
+ If we have found our word(s), then move linep past the word(s)
*/
- linep+= found_word_len; /* swallow the previous one */
+ linep+= wordlen;
if (flag & GET_VALUE)
{
- get_word((const char **) &linep, &found_word_len, NONSPACE);
+ trim_space((const char**) &linep, &found_word_len);
if (input_buffer_len <= found_word_len)
goto err;
strmake(result, linep, found_word_len);
diff --git a/server-tools/instance-manager/priv.cc b/server-tools/instance-manager/priv.cc
index 02a788ec469..a5040aa2e83 100644
--- a/server-tools/instance-manager/priv.cc
+++ b/server-tools/instance-manager/priv.cc
@@ -18,6 +18,17 @@
#include "priv.h"
#include "portability.h"
+#if defined(__ia64__) || defined(__ia64)
+/*
+ We can live with 32K, but reserve 64K. Just to be safe.
+ On ia64 we need to reserve double of the size.
+*/
+#define IM_THREAD_STACK_SIZE (128*1024L)
+#else
+#define IM_THREAD_STACK_SIZE (64*1024)
+#endif
+
+
/* the pid of the manager process (of the signal thread on the LinuxThreads) */
pid_t manager_pid;
@@ -52,3 +63,28 @@ unsigned int test_flags= 0;
unsigned long bytes_sent = 0L, bytes_received = 0L;
unsigned long mysqld_net_retry_count = 10L;
unsigned long open_files_limit;
+
+/*
+ Change the stack size and start a thread. Return an error if either
+ pthread_attr_setstacksize or pthread_create fails.
+ Arguments are the same as for pthread_create().
+*/
+
+int set_stacksize_n_create_thread(pthread_t *thread, pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg)
+{
+ int rc= 0;
+
+#ifndef __WIN__
+ /*
+ Set stack size to be safe on the platforms with too small
+ default thread stack.
+ */
+ rc= pthread_attr_setstacksize(attr,
+ (size_t) (PTHREAD_STACK_MIN +
+ IM_THREAD_STACK_SIZE));
+#endif
+ if (!rc)
+ rc= pthread_create(thread, attr, start_routine, arg);
+ return rc;
+}
diff --git a/server-tools/instance-manager/priv.h b/server-tools/instance-manager/priv.h
index ce9d54293c7..4739bca68eb 100644
--- a/server-tools/instance-manager/priv.h
+++ b/server-tools/instance-manager/priv.h
@@ -22,7 +22,7 @@
#else
#include <unistd.h>
#endif
-
+#include "my_pthread.h"
/* the pid of the manager process (of the signal thread on the LinuxThreads) */
extern pid_t manager_pid;
@@ -80,4 +80,8 @@ extern unsigned long bytes_sent, bytes_received;
extern unsigned long mysqld_net_retry_count;
extern unsigned long open_files_limit;
+
+int set_stacksize_n_create_thread(pthread_t *thread, pthread_attr_t *attr,
+ void *(*start_routine)(void *), void *arg);
+
#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_PRIV_H
diff --git a/server-tools/instance-manager/thread_registry.cc b/server-tools/instance-manager/thread_registry.cc
index fe665f410e5..0091d713a91 100644
--- a/server-tools/instance-manager/thread_registry.cc
+++ b/server-tools/instance-manager/thread_registry.cc
@@ -1,4 +1,4 @@
-/* cOPYRIght (C) 2003 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2003 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,6 +38,14 @@ static void handle_signal(int __attribute__((unused)) sig_no)
#endif
/*
+ Thread_info initializer methods
+*/
+
+Thread_info::Thread_info() {}
+Thread_info::Thread_info(pthread_t thread_id_arg) :
+ thread_id(thread_id_arg) {}
+
+/*
TODO: think about moving signal information (now it's shutdown_in_progress)
to Thread_info. It will reduce contention and allow signal deliverence to
a particular thread, not to the whole worker crew
@@ -145,6 +153,7 @@ int Thread_registry::cond_timedwait(Thread_info *info, pthread_cond_t *cond,
pthread_mutex_t *mutex,
struct timespec *wait_time)
{
+ int rc;
pthread_mutex_lock(&LOCK_thread_registry);
if (shutdown_in_progress)
{
@@ -154,7 +163,8 @@ int Thread_registry::cond_timedwait(Thread_info *info, pthread_cond_t *cond,
info->current_cond= cond;
pthread_mutex_unlock(&LOCK_thread_registry);
/* sic: race condition here, cond can be signaled in deliver_shutdown */
- int rc= pthread_cond_timedwait(cond, mutex, wait_time);
+ if ((rc= pthread_cond_timedwait(cond, mutex, wait_time)) == ETIME)
+ rc= ETIMEDOUT; // For easier usage
pthread_mutex_lock(&LOCK_thread_registry);
info->current_cond= 0;
pthread_mutex_unlock(&LOCK_thread_registry);
@@ -172,6 +182,7 @@ void Thread_registry::deliver_shutdown()
{
Thread_info *info;
struct timespec shutdown_time;
+ int error;
set_timespec(shutdown_time, 1);
pthread_mutex_lock(&LOCK_thread_registry);
@@ -204,11 +215,13 @@ void Thread_registry::deliver_shutdown()
released - the only case when the predicate is false is when no other
threads exist.
*/
- while (pthread_cond_timedwait(&COND_thread_registry_is_empty,
- &LOCK_thread_registry,
- &shutdown_time) != ETIMEDOUT &&
+ while (((error= pthread_cond_timedwait(&COND_thread_registry_is_empty,
+ &LOCK_thread_registry,
+ &shutdown_time)) != ETIMEDOUT &&
+ error != ETIME) &&
head.next != &head)
;
+
/*
If previous signals did not reach some threads, they must be sleeping
in pthread_cond_wait or in a blocking syscall. Wake them up:
diff --git a/server-tools/instance-manager/thread_registry.h b/server-tools/instance-manager/thread_registry.h
index a1075e719d6..6dc320a8533 100644
--- a/server-tools/instance-manager/thread_registry.h
+++ b/server-tools/instance-manager/thread_registry.h
@@ -50,13 +50,12 @@
in manner, similar to ``quit'' signals.
*/
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
-
#include <my_global.h>
#include <my_pthread.h>
+#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
+#pragma interface
+#endif
/*
Thread_info - repository entry for each worker thread
@@ -67,13 +66,14 @@
class Thread_info
{
+public:
+ Thread_info();
+ Thread_info(pthread_t thread_id_arg);
+ friend class Thread_registry;
+private:
pthread_cond_t *current_cond;
Thread_info *prev, *next;
pthread_t thread_id;
- Thread_info() {}
- friend class Thread_registry;
-public:
- Thread_info(pthread_t thread_id_arg) : thread_id(thread_id_arg) {}
};
diff --git a/server-tools/instance-manager/user_map.h b/server-tools/instance-manager/user_map.h
index a57174a37c3..4134017dd9b 100644
--- a/server-tools/instance-manager/user_map.h
+++ b/server-tools/instance-manager/user_map.h
@@ -16,15 +16,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
-#pragma interface
-#endif
#include <my_global.h>
#include <my_sys.h>
#include <hash.h>
+#if defined(__GNUC__) && defined(USE_PRAGMA_INTERFACE)
+#pragma interface
+#endif
+
/*
User_map -- all users and passwords
*/
diff --git a/sql-common/client.c b/sql-common/client.c
index 08ad906e2b6..cc90b2a105a 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1474,6 +1474,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
const char *capath __attribute__((unused)),
const char *cipher __attribute__((unused)))
{
+ DBUG_ENTER("mysql_ssl_set");
#ifdef HAVE_OPENSSL
mysql->options.ssl_key= strdup_if_not_null(key);
mysql->options.ssl_cert= strdup_if_not_null(cert);
@@ -1481,7 +1482,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
mysql->options.ssl_capath= strdup_if_not_null(capath);
mysql->options.ssl_cipher= strdup_if_not_null(cipher);
#endif /* HAVE_OPENSSL */
- return 0;
+ DBUG_RETURN(0);
}
@@ -1494,6 +1495,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
static void
mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
{
+ DBUG_ENTER("mysql_ssl_free");
my_free(mysql->options.ssl_key, MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.ssl_cert, MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->options.ssl_ca, MYF(MY_ALLOW_ZERO_PTR));
@@ -1507,6 +1509,7 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
mysql->options.ssl_cipher= 0;
mysql->options.use_ssl = FALSE;
mysql->connector_fd = 0;
+ DBUG_VOID_RETURN;
}
#endif /* HAVE_OPENSSL */
diff --git a/sql/Makefile.am b/sql/Makefile.am
index ada462f5e09..98d4d6b3d3a 100644
--- a/sql/Makefile.am
+++ b/sql/Makefile.am
@@ -22,7 +22,8 @@ MYSQLBASEdir= $(prefix)
INCLUDES = @ZLIB_INCLUDES@ \
@bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \
-I$(top_builddir)/include -I$(top_srcdir)/include \
- -I$(top_srcdir)/regex -I$(srcdir) $(openssl_includes)
+ -I$(top_srcdir)/regex -I$(srcdir) $(yassl_includes) \
+ $(openssl_includes)
WRAPLIBS= @WRAPLIBS@
SUBDIRS = share
libexec_PROGRAMS = mysqld
@@ -42,7 +43,8 @@ mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
@bdb_libs@ @innodb_libs@ @pstack_libs@ \
@innodb_system_libs@ \
@ndbcluster_libs@ @ndbcluster_system_libs@ \
- $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ @openssl_libs@
+ $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
+ @yassl_libs@ @openssl_libs@
noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_strfunc.h item_timefunc.h item_uniq.h \
item_create.h item_subselect.h item_row.h \
diff --git a/sql/field.cc b/sql/field.cc
index d334dc1ab53..ef4d9429bda 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1630,6 +1630,7 @@ bool Field::needs_quotes(void)
case FIELD_TYPE_MEDIUM_BLOB :
case FIELD_TYPE_LONG_BLOB :
case FIELD_TYPE_GEOMETRY :
+ case FIELD_TYPE_BIT:
DBUG_RETURN(1);
case FIELD_TYPE_DECIMAL :
@@ -5883,7 +5884,8 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
memcpy(ptr,from,copy_length);
if (copy_length < field_length) // Append spaces if shorter
field_charset->cset->fill(field_charset,ptr+copy_length,
- field_length-copy_length,' ');
+ field_length-copy_length,
+ field_charset->pad_char);
if ((copy_length < length) && table->in_use->count_cuted_fields)
{ // Check if we loosed some info
@@ -6426,6 +6428,17 @@ int Field_varstring::key_cmp(const byte *a,const byte *b)
void Field_varstring::sort_string(char *to,uint length)
{
uint tot_length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+
+ if (field_charset == &my_charset_bin)
+ {
+ /* Store length last in high-byte order to sort longer strings first */
+ if (length_bytes == 1)
+ to[length-1]= tot_length;
+ else
+ mi_int2store(to+length-2, tot_length);
+ length-= length_bytes;
+ }
+
tot_length= my_strnxfrm(field_charset,
(uchar*) to, length,
(uchar*) ptr + length_bytes,
@@ -7073,8 +7086,7 @@ void Field_blob::get_key_image(char *buff, uint length, imagetype type)
return;
}
get_ptr(&blob);
- gobj= Geometry::create_from_wkb(&buffer,
- blob + SRID_SIZE, blob_length - SRID_SIZE);
+ gobj= Geometry::construct(&buffer, blob, blob_length);
if (gobj->get_mbr(&mbr, &dummy))
bzero(buff, SIZEOF_STORED_DOUBLE*4);
else
@@ -7136,6 +7148,13 @@ int Field_blob::key_cmp(const byte *a,const byte *b)
}
+uint32 Field_blob::sort_length() const
+{
+ return (uint32) (current_thd->variables.max_sort_length +
+ (field_charset == &my_charset_bin ? 0 : packlength));
+}
+
+
void Field_blob::sort_string(char *to,uint length)
{
char *blob;
@@ -7145,6 +7164,31 @@ void Field_blob::sort_string(char *to,uint length)
bzero(to,length);
else
{
+ if (field_charset == &my_charset_bin)
+ {
+ char *pos;
+
+ /*
+ Store length of blob last in blob to shorter blobs before longer blobs
+ */
+ length-= packlength;
+ pos= to+length;
+
+ switch (packlength) {
+ case 1:
+ *pos= (char) blob_length;
+ break;
+ case 2:
+ mi_int2store(pos, blob_length);
+ break;
+ case 3:
+ mi_int3store(pos, blob_length);
+ break;
+ case 4:
+ mi_int4store(pos, blob_length);
+ break;
+ }
+ }
memcpy_fixed(&blob,ptr+packlength,sizeof(char*));
blob_length=my_strnxfrm(field_charset,
@@ -7371,8 +7415,7 @@ void Field_geom::get_key_image(char *buff, uint length, imagetype type)
return;
}
get_ptr(&blob);
- gobj= Geometry::create_from_wkb(&buffer,
- blob + SRID_SIZE, blob_length - SRID_SIZE);
+ gobj= Geometry::construct(&buffer, blob, blob_length);
if (gobj->get_mbr(&mbr, &dummy))
bzero(buff, SIZEOF_STORED_DOUBLE*4);
else
@@ -7453,7 +7496,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
uint32 wkb_type;
if (length < SRID_SIZE + WKB_HEADER_SIZE + SIZEOF_STORED_DOUBLE*2)
goto err;
- wkb_type= uint4korr(from + WKB_HEADER_SIZE);
+ wkb_type= uint4korr(from + SRID_SIZE + 1);
if (wkb_type < (uint32) Geometry::wkb_point ||
wkb_type > (uint32) Geometry::wkb_end)
goto err;
@@ -8226,8 +8269,20 @@ void Field_bit_as_char::sql_type(String &res) const
Handling of field and create_field
*****************************************************************************/
+/*
+ Convert create_field::length from number of characters to number of bytes
+
+ SYNOPSIS
+ create_field::create_length_to_internal_length()
+
+ DESCRIPTION
+ Convert create_field::length from number of characters to number of bytes,
+ save original value in chars_length.
+*/
+
void create_field::create_length_to_internal_length(void)
{
+ chars_length= length;
switch (sql_type) {
case MYSQL_TYPE_TINY_BLOB:
case MYSQL_TYPE_MEDIUM_BLOB:
diff --git a/sql/field.h b/sql/field.h
index 3833f764787..77d00b671f6 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -137,6 +137,7 @@ public:
virtual bool eq_def(Field *field);
virtual uint32 pack_length() const { return (uint32) field_length; }
virtual uint32 pack_length_in_rec() const { return pack_length(); }
+ virtual uint32 sort_length() const { return pack_length(); }
virtual void reset(void) { bzero(ptr,pack_length()); }
virtual void reset_fields() {}
virtual void set_default()
@@ -1065,6 +1066,11 @@ public:
void reset(void) { bzero(ptr,field_length+length_bytes); }
uint32 pack_length() const { return (uint32) field_length+length_bytes; }
uint32 key_length() const { return (uint32) field_length; }
+ uint32 sort_length() const
+ {
+ return (uint32) field_length + (field_charset == &my_charset_bin ?
+ length_bytes : 0);
+ }
int store(const char *to,uint length,CHARSET_INFO *charset);
int store(longlong nr, bool unsigned_val);
int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
@@ -1144,6 +1150,7 @@ public:
void sort_string(char *buff,uint length);
uint32 pack_length() const
{ return (uint32) (packlength+table->s->blob_ptr_size); }
+ uint32 sort_length() const;
inline uint32 max_data_length() const
{
return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
@@ -1390,7 +1397,15 @@ public:
LEX_STRING comment; // Comment for field
Item *def; // Default value
enum enum_field_types sql_type;
+ /*
+ At various stages in execution this can be length of field in bytes or
+ max number of characters.
+ */
ulong length;
+ /*
+ The value of 'length' before a call to create_length_to_internal_length
+ */
+ uint32 chars_length;
uint decimals, flags, pack_length, key_length;
Field::utype unireg_check;
TYPELIB *interval; // Which interval to use
diff --git a/sql/filesort.cc b/sql/filesort.cc
index ad784c729fa..42d25dbbaee 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -50,7 +50,8 @@ static int merge_index(SORTPARAM *param,uchar *sort_buffer,
IO_CACHE *outfile);
static bool save_index(SORTPARAM *param,uchar **sort_keys, uint count,
FILESORT_INFO *table_sort);
-static uint sortlength(SORT_FIELD *sortorder, uint s_length,
+static uint suffix_length(ulong string_length);
+static uint sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length,
bool *multi_byte_charset);
static SORT_ADDON_FIELD *get_addon_fields(THD *thd, Field **ptabfield,
uint sortlength, uint *plength);
@@ -123,7 +124,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
sort_keys= (uchar **) NULL;
error= 1;
bzero((char*) &param,sizeof(param));
- param.sort_length= sortlength(sortorder, s_length, &multi_byte_charset);
+ param.sort_length= sortlength(thd, sortorder, s_length, &multi_byte_charset);
param.ref_length= table->file->ref_length;
param.addon_field= 0;
param.addon_length= 0;
@@ -585,6 +586,28 @@ err:
} /* write_keys */
+/*
+ Store length as suffix in high-byte-first order
+*/
+
+static inline void store_length(uchar *to, uint length, uint pack_length)
+{
+ switch (pack_length) {
+ case 1:
+ *to= (uchar) length;
+ break;
+ case 2:
+ mi_int2store(to, length);
+ break;
+ case 3:
+ mi_int3store(to, length);
+ default:
+ mi_int4store(to, length);
+ break;
+ }
+}
+
+
/* makes a sort-key from record */
static void make_sortkey(register SORTPARAM *param,
@@ -623,9 +646,11 @@ static void make_sortkey(register SORTPARAM *param,
maybe_null= item->maybe_null;
switch (sort_field->result_type) {
case STRING_RESULT:
- {
+ {
CHARSET_INFO *cs=item->collation.collation;
char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' ');
+ int diff;
+ uint sort_field_length;
if (maybe_null)
*to++=1;
@@ -644,24 +669,32 @@ static void make_sortkey(register SORTPARAM *param,
}
break;
}
- length=res->length();
- int diff=(int) (sort_field->length-length);
+ length= res->length();
+ sort_field_length= sort_field->length - sort_field->suffix_length;
+ diff=(int) (sort_field_length - length);
if (diff < 0)
{
diff=0; /* purecov: inspected */
- length=sort_field->length;
+ length= sort_field_length;
}
+ if (sort_field->suffix_length)
+ {
+ /* Store length last in result_string */
+ store_length(to + sort_field_length, length,
+ sort_field->suffix_length);
+ }
if (sort_field->need_strxnfrm)
{
char *from=(char*) res->ptr();
+ uint tmp_length;
if ((unsigned char *)from == to)
{
set_if_smaller(length,sort_field->length);
memcpy(param->tmp_buffer,from,length);
from=param->tmp_buffer;
}
- uint tmp_length=my_strnxfrm(cs,to,sort_field->length,
- (unsigned char *) from, length);
+ tmp_length= my_strnxfrm(cs,to,sort_field->length,
+ (unsigned char *) from, length);
DBUG_ASSERT(tmp_length == sort_field->length);
}
else
@@ -670,7 +703,7 @@ static void make_sortkey(register SORTPARAM *param,
cs->cset->fill(cs, (char *)to+length,diff,fill_char);
}
break;
- }
+ }
case INT_RESULT:
{
longlong value= item->val_int_result();
@@ -1170,11 +1203,25 @@ static int merge_index(SORTPARAM *param, uchar *sort_buffer,
} /* merge_index */
+static uint suffix_length(ulong string_length)
+{
+ if (string_length < 256)
+ return 1;
+ if (string_length < 256L*256L)
+ return 2;
+ if (string_length < 256L*256L*256L)
+ return 3;
+ return 4; // Can't sort longer than 4G
+}
+
+
+
/*
Calculate length of sort key
SYNOPSIS
sortlength()
+ thd Thread handler
sortorder Order of items to sort
uint s_length Number of items to sort
multi_byte_charset (out)
@@ -1190,10 +1237,10 @@ static int merge_index(SORTPARAM *param, uchar *sort_buffer,
*/
static uint
-sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset)
+sortlength(THD *thd, SORT_FIELD *sortorder, uint s_length,
+ bool *multi_byte_charset)
{
reg2 uint length;
- THD *thd= current_thd;
CHARSET_INFO *cs;
*multi_byte_charset= 0;
@@ -1201,19 +1248,17 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset)
for (; s_length-- ; sortorder++)
{
sortorder->need_strxnfrm= 0;
+ sortorder->suffix_length= 0;
if (sortorder->field)
{
- if (sortorder->field->type() == FIELD_TYPE_BLOB)
- sortorder->length= thd->variables.max_sort_length;
- else
+ cs= sortorder->field->sort_charset();
+ sortorder->length= sortorder->field->sort_length();
+
+ if (use_strnxfrm((cs=sortorder->field->sort_charset())))
{
- sortorder->length=sortorder->field->pack_length();
- if (use_strnxfrm((cs=sortorder->field->sort_charset())))
- {
- sortorder->need_strxnfrm= 1;
- *multi_byte_charset= 1;
- sortorder->length= cs->coll->strnxfrmlen(cs, sortorder->length);
- }
+ sortorder->need_strxnfrm= 1;
+ *multi_byte_charset= 1;
+ sortorder->length= cs->coll->strnxfrmlen(cs, sortorder->length);
}
if (sortorder->field->maybe_null())
length++; // Place for NULL marker
@@ -1229,6 +1274,12 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset)
sortorder->need_strxnfrm= 1;
*multi_byte_charset= 1;
}
+ else if (cs == &my_charset_bin)
+ {
+ /* Store length last to be able to sort blob/varbinary */
+ sortorder->suffix_length= suffix_length(sortorder->length);
+ sortorder->length+= sortorder->suffix_length;
+ }
break;
case INT_RESULT:
#if SIZEOF_LONG_LONG > 4
diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc
index 59c56e80cc3..c4801de5fb2 100644
--- a/sql/ha_archive.cc
+++ b/sql/ha_archive.cc
@@ -453,7 +453,6 @@ int ha_archive::free_share(ARCHIVE_SHARE *share)
*/
static const char *ha_archive_exts[] = {
ARZ,
- ARN,
ARM,
NullS
};
@@ -1053,4 +1052,81 @@ int ha_archive::delete_all_rows()
DBUG_ENTER("ha_archive::delete_all_rows");
DBUG_RETURN(0);
}
+
+/*
+ We just return state if asked.
+*/
+bool ha_archive::is_crashed() const
+{
+ return share->crashed;
+}
+
+/*
+ Simple scan of the tables to make sure everything is ok.
+*/
+
+int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
+{
+ int rc= 0;
+ byte *buf;
+ const char *old_proc_info=thd->proc_info;
+ ha_rows count= share->rows_recorded;
+ DBUG_ENTER("ha_archive::check");
+
+ thd->proc_info= "Checking table";
+ /* Flush any waiting data */
+ gzflush(share->archive_write, Z_SYNC_FLUSH);
+
+ /*
+ First we create a buffer that we can use for reading rows, and can pass
+ to get_row().
+ */
+ if (!(buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME))))
+ rc= HA_ERR_OUT_OF_MEM;
+
+ /*
+ Now we will rewind the archive file so that we are positioned at the
+ start of the file.
+ */
+ if (!rc)
+ read_data_header(archive);
+
+ if (!rc)
+ while (!(rc= get_row(archive, buf)))
+ count--;
+
+ my_free((char*)buf, MYF(0));
+
+ thd->proc_info= old_proc_info;
+
+ if ((rc && rc != HA_ERR_END_OF_FILE) || count)
+ {
+ share->crashed= FALSE;
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
+ }
+ else
+ {
+ DBUG_RETURN(HA_ADMIN_OK);
+ }
+}
+
+/*
+ Check and repair the table if needed.
+*/
+bool ha_archive::check_and_repair(THD *thd)
+{
+ HA_CHECK_OPT check_opt;
+ DBUG_ENTER("ha_archive::check_and_repair");
+
+ check_opt.init();
+
+ if (check(thd, &check_opt) == HA_ADMIN_CORRUPT)
+ {
+ DBUG_RETURN(repair(thd, &check_opt));
+ }
+ else
+ {
+ DBUG_RETURN(HA_ADMIN_OK);
+ }
+}
#endif /* HAVE_ARCHIVE_DB */
diff --git a/sql/ha_archive.h b/sql/ha_archive.h
index 849b5b5bd6c..56a4b9d1e27 100644
--- a/sql/ha_archive.h
+++ b/sql/ha_archive.h
@@ -68,7 +68,7 @@ public:
ulong table_flags() const
{
return (HA_REC_NOT_IN_SEQ | HA_NOT_EXACT_COUNT | HA_NO_AUTO_INCREMENT |
- HA_FILE_BASED | HA_CAN_INSERT_DELAYED);
+ HA_FILE_BASED | HA_CAN_INSERT_DELAYED | HA_CAN_GEOMETRY);
}
ulong index_flags(uint idx, uint part, bool all_parts) const
{
@@ -103,6 +103,9 @@ public:
}
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
+ bool is_crashed() const;
+ int check(THD* thd, HA_CHECK_OPT* check_opt);
+ bool check_and_repair(THD *thd);
};
bool archive_db_init(void);
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 3312b60e6c4..fa8cda44866 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -394,6 +394,7 @@ ha_berkeley::ha_berkeley(TABLE *table_arg)
int_table_flags(HA_REC_NOT_IN_SEQ | HA_FAST_KEY_READ |
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_NOT_EXACT_COUNT |
HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED |
+ HA_CAN_GEOMETRY |
HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX),
changed_rows(0), last_dup_key((uint) -1), version(0), using_ignore(0)
{}
diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h
index 95ff64a082a..b3ce72d374b 100644
--- a/sql/ha_berkeley.h
+++ b/sql/ha_berkeley.h
@@ -94,6 +94,9 @@ class ha_berkeley: public handler
uint max_supported_keys() const { return MAX_KEY-1; }
uint extra_rec_buf_length() const { return BDB_HIDDEN_PRIMARY_KEY_LENGTH; }
ha_rows estimate_rows_upper_bound();
+ uint max_supported_key_length() const { return UINT_MAX32; }
+ uint max_supported_key_part_length() const { return UINT_MAX32; }
+
const key_map *keys_to_use_for_scanning() { return &key_map_full; }
bool has_transactions() { return 1;}
diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc
index 66c2431844d..703646f8bf3 100644
--- a/sql/ha_federated.cc
+++ b/sql/ha_federated.cc
@@ -480,6 +480,7 @@ static int check_foreign_data_source(
String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
MYSQL *mysql;
DBUG_ENTER("ha_federated::check_foreign_data_source");
+
/* Zero the length, otherwise the string will have misc chars */
query.length(0);
@@ -564,6 +565,7 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num)
char buf[FEDERATED_QUERY_BUFFER_SIZE];
int buf_len;
DBUG_ENTER("ha_federated parse_url_error");
+
if (share->scheme)
{
DBUG_PRINT("info",
@@ -572,11 +574,9 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num)
my_free((gptr) share->scheme, MYF(0));
share->scheme= 0;
}
- buf_len= (table->s->connect_string.length > (FEDERATED_QUERY_BUFFER_SIZE - 1))
- ? FEDERATED_QUERY_BUFFER_SIZE - 1 : table->s->connect_string.length;
-
- strnmov(buf, table->s->connect_string.str, buf_len);
- buf[buf_len]= '\0';
+ buf_len= min(table->s->connect_string.length,
+ FEDERATED_QUERY_BUFFER_SIZE-1);
+ strmake(buf, table->s->connect_string.str, buf_len);
my_error(error_num, MYF(0), buf);
DBUG_RETURN(error_num);
}
@@ -767,12 +767,9 @@ uint ha_federated::convert_row_to_internal_format(byte *record, MYSQL_ROW row)
{
ulong *lengths;
Field **field;
-
DBUG_ENTER("ha_federated::convert_row_to_internal_format");
- // num_fields= mysql_num_fields(stored_result);
lengths= mysql_fetch_lengths(stored_result);
-
memset(record, 0, table->s->null_bytes);
for (field= table->field; *field; field++)
@@ -824,13 +821,8 @@ static bool emit_key_part_element(String *to, KEY_PART_INFO *part,
*buf++= '0';
*buf++= 'x';
- for (; len; ptr++,len--)
- {
- uint tmp= (uint)(uchar) *ptr;
- *buf++= _dig_vec_upper[tmp >> 4];
- *buf++= _dig_vec_upper[tmp & 15];
- }
- if (to->append(buff, (uint)(buf - buff)))
+ buf= octet2hex(buf, (char*) ptr, len);
+ if (to->append((char*) buff, (uint)(buf - buff)))
DBUG_RETURN(1);
}
else if (part->key_part_flag & HA_BLOB_PART)
@@ -1127,8 +1119,8 @@ bool ha_federated::create_where_from_key(String *to,
char tmpbuff[FEDERATED_QUERY_BUFFER_SIZE];
String tmp(tmpbuff, sizeof(tmpbuff), system_charset_info);
const key_range *ranges[2]= { start_key, end_key };
-
DBUG_ENTER("ha_federated::create_where_from_key");
+
tmp.length(0);
if (start_key == NULL && end_key == NULL)
DBUG_RETURN(1);
@@ -1177,6 +1169,7 @@ bool ha_federated::create_where_from_key(String *to,
switch(ranges[i]->flag) {
case(HA_READ_KEY_EXACT):
+ DBUG_PRINT("info", ("federated HA_READ_KEY_EXACT %d", i));
if (store_length >= length ||
!needs_quotes ||
key_part->type == HA_KEYTYPE_BIT ||
@@ -1211,6 +1204,7 @@ bool ha_federated::create_where_from_key(String *to,
}
break;
case(HA_READ_AFTER_KEY):
+ DBUG_PRINT("info", ("federated HA_READ_AFTER_KEY %d", i));
if (store_length >= length) /* end key */
{
if (emit_key_part_name(&tmp, key_part))
@@ -1235,6 +1229,7 @@ bool ha_federated::create_where_from_key(String *to,
break;
}
case(HA_READ_KEY_OR_NEXT):
+ DBUG_PRINT("info", ("federated HA_READ_KEY_OR_NEXT %d", i));
if (emit_key_part_name(&tmp, key_part) ||
tmp.append(FEDERATED_GE) ||
emit_key_part_element(&tmp, key_part, needs_quotes, 0, ptr,
@@ -1242,6 +1237,7 @@ bool ha_federated::create_where_from_key(String *to,
DBUG_RETURN(1);
break;
case(HA_READ_BEFORE_KEY):
+ DBUG_PRINT("info", ("federated HA_READ_BEFORE_KEY %d", i));
if (store_length >= length)
{
if (emit_key_part_name(&tmp, key_part) ||
@@ -1252,6 +1248,7 @@ bool ha_federated::create_where_from_key(String *to,
break;
}
case(HA_READ_KEY_OR_PREV):
+ DBUG_PRINT("info", ("federated HA_READ_KEY_OR_PREV %d", i));
if (emit_key_part_name(&tmp, key_part) ||
tmp.append(FEDERATED_LE) ||
emit_key_part_element(&tmp, key_part, needs_quotes, 0, ptr,
@@ -1334,7 +1331,6 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table)
query.append(FEDERATED_FROM);
query.append(FEDERATED_BTICK);
-
if (!(share= (FEDERATED_SHARE *)
my_multi_malloc(MYF(MY_WME),
&share, sizeof(*share),
@@ -1389,8 +1385,8 @@ error:
static int free_share(FEDERATED_SHARE *share)
{
DBUG_ENTER("free_share");
- pthread_mutex_lock(&federated_mutex);
+ pthread_mutex_lock(&federated_mutex);
if (!--share->use_count)
{
hash_delete(&federated_open_tables, (byte*) share);
@@ -1578,7 +1574,6 @@ int ha_federated::write_row(byte *buf)
values_string.length(0);
insert_string.length(0);
insert_field_value_string.length(0);
-
DBUG_ENTER("ha_federated::write_row");
DBUG_PRINT("info",
("table charset name %s csname %s",
@@ -1683,7 +1678,6 @@ int ha_federated::optimize(THD* thd, HA_CHECK_OPT* check_opt)
{
char query_buffer[STRING_BUFFER_USUAL_SIZE];
String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
-
DBUG_ENTER("ha_federated::optimize");
query.length(0);
@@ -1707,7 +1701,6 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
{
char query_buffer[STRING_BUFFER_USUAL_SIZE];
String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
-
DBUG_ENTER("ha_federated::repair");
query.length(0);
@@ -1753,14 +1746,16 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt)
int ha_federated::update_row(const byte *old_data, byte *new_data)
{
/*
- This used to control how the query was built. If there was a primary key,
- the query would be built such that there was a where clause with only
- that column as the condition. This is flawed, because if we have a multi-part
- primary key, it would only use the first part! We don't need to do this anyway,
- because read_range_first will retrieve the correct record, which is what is used
- to build the WHERE clause. We can however use this to append a LIMIT to the end
- if there is NOT a primary key. Why do this? Because we only are updating one
- record, and LIMIT enforces this.
+ This used to control how the query was built. If there was a
+ primary key, the query would be built such that there was a where
+ clause with only that column as the condition. This is flawed,
+ because if we have a multi-part primary key, it would only use the
+ first part! We don't need to do this anyway, because
+ read_range_first will retrieve the correct record, which is what
+ is used to build the WHERE clause. We can however use this to
+ append a LIMIT to the end if there is NOT a primary key. Why do
+ this? Because we only are updating one record, and LIMIT enforces
+ this.
*/
bool has_a_primary_key= (table->s->primary_key == 0 ? TRUE : FALSE);
/*
@@ -1787,7 +1782,6 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
String where_string(where_buffer,
sizeof(where_buffer),
&my_charset_bin);
-
DBUG_ENTER("ha_federated::update_row");
/*
set string lengths to 0 to avoid misc chars in string
@@ -1982,12 +1976,10 @@ int ha_federated::index_read_idx(byte *buf, uint index, const byte *key,
sizeof(sql_query_buffer),
&my_charset_bin);
key_range range;
+ DBUG_ENTER("ha_federated::index_read_idx");
index_string.length(0);
sql_query.length(0);
-
- DBUG_ENTER("ha_federated::index_read_idx");
-
statistic_increment(table->in_use->status_var.ha_read_key_count,
&LOCK_status);
@@ -2076,8 +2068,8 @@ int ha_federated::read_range_first(const key_range *start_key,
String sql_query(sql_query_buffer,
sizeof(sql_query_buffer),
&my_charset_bin);
-
DBUG_ENTER("ha_federated::read_range_first");
+
if (start_key == NULL && end_key == NULL)
DBUG_RETURN(0);
@@ -2392,7 +2384,6 @@ void ha_federated::info(uint flag)
MYSQL_RES *result= 0;
MYSQL_ROW row;
String status_query_string(status_buf, sizeof(status_buf), &my_charset_bin);
-
DBUG_ENTER("ha_federated::info");
error_code= ER_QUERY_ON_FOREIGN_DATA_SOURCE;
@@ -2483,10 +2474,10 @@ error:
int ha_federated::delete_all_rows()
{
- DBUG_ENTER("ha_federated::delete_all_rows");
-
char query_buffer[FEDERATED_QUERY_BUFFER_SIZE];
String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
+ DBUG_ENTER("ha_federated::delete_all_rows");
+
query.length(0);
query.set_charset(system_charset_info);
@@ -2498,11 +2489,12 @@ int ha_federated::delete_all_rows()
/*
TRUNCATE won't return anything in mysql_affected_rows
*/
- deleted+= records;
if (mysql_real_query(mysql, query.ptr(), query.length()))
{
DBUG_RETURN(stash_remote_error());
}
+ deleted+= records;
+ records= 0;
DBUG_RETURN(0);
}
@@ -2581,32 +2573,14 @@ THR_LOCK_DATA **ha_federated::store_lock(THD *thd,
int ha_federated::create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *create_info)
{
- int retval= 0;
- /*
- only a temporary share, to test the url
- */
- FEDERATED_SHARE tmp_share;
+ int retval;
+ FEDERATED_SHARE tmp_share; // Only a temporary share, to test the url
DBUG_ENTER("ha_federated::create");
- if ((retval= parse_url(&tmp_share, table_arg, 1)))
- goto error;
-
- if ((retval= check_foreign_data_source(&tmp_share, 1)))
- goto error;
-
- if (tmp_share.scheme)
- {
- my_free((gptr) tmp_share.scheme, MYF(0));
- tmp_share.scheme= 0;
- }
- DBUG_RETURN(retval);
+ if (!(retval= parse_url(&tmp_share, table_arg, 1)))
+ retval= check_foreign_data_source(&tmp_share, 1);
-error:
- if (tmp_share.scheme)
- {
- my_free((gptr) tmp_share.scheme, MYF(0));
- tmp_share.scheme= 0;
- }
+ my_free((gptr) tmp_share.scheme, MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN(retval);
}
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 12f8b984971..1fdc36c84fe 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -812,6 +812,7 @@ ha_innobase::ha_innobase(TABLE *table_arg)
HA_CAN_SQL_HANDLER |
HA_NOT_EXACT_COUNT |
HA_PRIMARY_KEY_IN_READ_INDEX |
+ HA_CAN_GEOMETRY |
HA_TABLE_SCAN_ON_INDEX),
last_dup_key((uint) -1),
start_of_scan(0),
@@ -2757,6 +2758,7 @@ get_innobase_type_from_mysql_type(
return(DATA_DOUBLE);
case FIELD_TYPE_DECIMAL:
return(DATA_DECIMAL);
+ case FIELD_TYPE_GEOMETRY:
case FIELD_TYPE_TINY_BLOB:
case FIELD_TYPE_MEDIUM_BLOB:
case FIELD_TYPE_BLOB:
@@ -2872,6 +2874,9 @@ ha_innobase::store_key_val_for_row(
ulint lenlen;
ulint len;
byte* data;
+ ulint key_len;
+ CHARSET_INFO* cs;
+ int error=0;
if (is_null) {
buff += key_part->length + 2;
@@ -2890,8 +2895,20 @@ ha_innobase::store_key_val_for_row(
/* In a column prefix index, we may need to truncate
the stored value: */
- if (len > key_part->length) {
- len = key_part->length;
+ cs = key_part->field->charset();
+
+ if (cs->mbmaxlen > 1 && key_part->length > 0) {
+ key_len = (ulint) cs->cset->well_formed_len(cs,
+ (const char *) data,
+ (const char *) data + key_part->length,
+ key_part->length / cs->mbmaxlen,
+ &error);
+ } else {
+ key_len = key_part->length;
+ }
+
+ if (len > key_len) {
+ len = key_len;
}
/* The length in a key value is always stored in 2
@@ -2915,6 +2932,11 @@ ha_innobase::store_key_val_for_row(
|| mysql_type == FIELD_TYPE_BLOB
|| mysql_type == FIELD_TYPE_LONG_BLOB) {
+ CHARSET_INFO* cs;
+ ulint key_len;
+ ulint len;
+ int error=0;
+
ut_a(key_part->key_part_flag & HA_PART_KEY_SEG);
if (is_null) {
@@ -2935,8 +2957,21 @@ ha_innobase::store_key_val_for_row(
indexes, and we may need to truncate the data to be
stored in the key value: */
- if (blob_len > key_part->length) {
- blob_len = key_part->length;
+ cs = key_part->field->charset();
+
+ if (cs->mbmaxlen > 1 && key_part->length > 0) {
+ key_len = (ulint) cs->cset->well_formed_len(cs,
+ (const char *) blob_data,
+ (const char *) blob_data
+ + key_part->length,
+ key_part->length / cs->mbmaxlen,
+ &error);
+ } else {
+ key_len = key_part->length;
+ }
+
+ if (blob_len > key_len) {
+ blob_len = key_len;
}
/* MySQL reserves 2 bytes for the length and the
@@ -2958,15 +2993,40 @@ ha_innobase::store_key_val_for_row(
value we store may be also in a column prefix
index. */
+ CHARSET_INFO* cs;
+ ulint len;
+ const mysql_byte* src_start;
+ int error=0;
+
if (is_null) {
buff += key_part->length;
continue;
}
- memcpy(buff, record + key_part->offset,
- key_part->length);
- buff += key_part->length;
+ cs = key_part->field->charset();
+ src_start = record + key_part->offset;
+
+ if (key_part->length > 0 && cs->mbmaxlen > 1) {
+ len = (ulint) cs->cset->well_formed_len(cs,
+ src_start,
+ src_start + key_part->length,
+ key_part->length / cs->mbmaxlen,
+ &error);
+ } else {
+ len = key_part->length;
+ }
+
+ memcpy(buff, src_start, len);
+ buff+=len;
+
+ /* Pad the unused space with spaces */
+
+ if (len < key_part->length) {
+ len = key_part->length - len;
+ memset(buff, ' ', len);
+ buff+=len;
+ }
}
}
@@ -6755,6 +6815,7 @@ ha_innobase::store_lock(
|| thd->lex->sql_command == SQLCOM_CALL)
&& !thd->tablespace_op
&& thd->lex->sql_command != SQLCOM_TRUNCATE
+ && thd->lex->sql_command != SQLCOM_OPTIMIZE
&& thd->lex->sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE;
@@ -7044,8 +7105,7 @@ ha_innobase::cmp_ref(
(const char*)ref1, len1,
(const char*)ref2, len2);
} else {
- result = field->key_cmp((const char*)ref1,
- (const char*)ref2);
+ result = field->key_cmp(ref1, ref2);
}
if (result) {
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 689dbf2fc24..03ef362c0d4 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -40,7 +40,7 @@ TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
myisam_recover_names, NULL};
const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal",
- NullS};
+ "nulls_ignored", NullS};
TYPELIB myisam_stats_method_typelib= {
array_elements(myisam_stats_method_names) - 1, "",
myisam_stats_method_names, NULL};
@@ -985,11 +985,16 @@ int ha_myisam::enable_indexes(uint mode)
{
sql_print_warning("Warning: Enabling keys got errno %d, retrying",
my_errno);
- thd->clear_error();
+ /* Repairing by sort failed. Now try standard repair method. */
param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
error= (repair(thd,param,0) != HA_ADMIN_OK);
- if (!error && thd->net.report_error)
- error= HA_ERR_CRASHED;
+ /*
+ If the standard repair succeeded, clear all error messages which
+ might have been set by the first repair. They can still be seen
+ with SHOW WARNINGS then.
+ */
+ if (! error)
+ thd->clear_error();
}
info(HA_STATUS_CONST);
thd->proc_info=save_proc_info;
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 50d9f5b701a..2340cc006f6 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -599,9 +599,9 @@ static bool ndb_supported_type(enum_field_types type)
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_SET:
case MYSQL_TYPE_BIT:
+ case MYSQL_TYPE_GEOMETRY:
return TRUE;
case MYSQL_TYPE_NULL:
- case MYSQL_TYPE_GEOMETRY:
break;
}
return FALSE;
@@ -3216,7 +3216,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
if (!thd_ndb->lock_count++)
{
PRINT_OPTION_FLAGS(thd);
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN | OPTION_TABLE_LOCK)))
+ if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
// Autocommit transaction
DBUG_ASSERT(!thd_ndb->stmt);
@@ -3388,11 +3388,11 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
}
/*
- When using LOCK TABLE's external_lock is only called when the actual
- TABLE LOCK is done.
- Under LOCK TABLES, each used tables will force a call to start_stmt.
- Ndb doesn't currently support table locks, and will do ordinary
- startTransaction for each transaction/statement.
+ Start a transaction for running a statement if one is not
+ already running in a transaction. This will be the case in
+ a BEGIN; COMMIT; block
+ When using LOCK TABLE's external_lock will start a transaction
+ since ndb does not currently does not support table locking
*/
int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type)
@@ -3402,17 +3402,10 @@ int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type)
PRINT_OPTION_FLAGS(thd);
Thd_ndb *thd_ndb= get_thd_ndb(thd);
- NdbTransaction *trans= thd_ndb->stmt;
+ NdbTransaction *trans= (thd_ndb->stmt)?thd_ndb->stmt:thd_ndb->all;
if (!trans){
Ndb *ndb= thd_ndb->ndb;
DBUG_PRINT("trans",("Starting transaction stmt"));
-
-#if 0
- NdbTransaction *tablock_trans= thd_ndb->all;
- DBUG_PRINT("info", ("tablock_trans: %x", (UintPtr)tablock_trans));
- DBUG_ASSERT(tablock_trans);
-// trans= ndb->hupp(tablock_trans);
-#endif
trans= ndb->startTransaction();
if (trans == NULL)
ERR_RETURN(ndb->getNdbError());
@@ -3709,6 +3702,7 @@ static int create_ndb_column(NDBCOL &col,
col.setStripeSize(0);
break;
//mysql_type_blob:
+ case MYSQL_TYPE_GEOMETRY:
case MYSQL_TYPE_BLOB:
if ((field->flags & BINARY_FLAG) && cs == &my_charset_bin)
col.setType(NDBCOL::Blob);
@@ -3774,7 +3768,6 @@ static int create_ndb_column(NDBCOL &col,
break;
}
case MYSQL_TYPE_NULL:
- case MYSQL_TYPE_GEOMETRY:
goto mysql_type_unsupported;
mysql_type_unsupported:
default:
@@ -3806,7 +3799,8 @@ int ha_ndbcluster::create(const char *name,
uint pack_length, length, i, pk_length= 0;
const void *data, *pack_data;
char name2[FN_HEADLEN];
- bool create_from_engine= (info->table_options & HA_CREATE_FROM_ENGINE);
+ bool create_from_engine= test(info->table_options &
+ HA_OPTION_CREATE_FROM_ENGINE);
DBUG_ENTER("ha_ndbcluster::create");
DBUG_PRINT("enter", ("name: %s", name));
@@ -3876,6 +3870,7 @@ int ha_ndbcluster::create(const char *name,
* 5 - from extra words added by tup/dict??
*/
switch (form->field[i]->real_type()) {
+ case MYSQL_TYPE_GEOMETRY:
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB:
@@ -4140,7 +4135,12 @@ ulonglong ha_ndbcluster::get_auto_increment()
--retries &&
ndb->getNdbError().status == NdbError::TemporaryError);
if (auto_value == NDB_FAILED_AUTO_INCREMENT)
- ERR_RETURN(ndb->getNdbError());
+ {
+ const NdbError err= ndb->getNdbError();
+ sql_print_error("Error %lu in ::get_auto_increment(): %s",
+ (ulong) err.code, err.message);
+ DBUG_RETURN(~(ulonglong) 0);
+ }
DBUG_RETURN((longlong)auto_value);
}
@@ -4161,6 +4161,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
HA_AUTO_PART_KEY |
HA_NO_PREFIX_CHAR_KEYS |
HA_NEED_READ_RANGE_BUFFER |
+ HA_CAN_GEOMETRY |
HA_CAN_BIT_FIELD),
m_share(0),
m_part_info(NULL),
@@ -6008,7 +6009,6 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
{
THD *thd; /* needs to be first for thread_stack */
Ndb* ndb;
- int error= 0;
struct timespec abstime;
my_thread_init();
@@ -6037,9 +6037,9 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
{
pthread_mutex_lock(&LOCK_ndb_util_thread);
- error= pthread_cond_timedwait(&COND_ndb_util_thread,
- &LOCK_ndb_util_thread,
- &abstime);
+ pthread_cond_timedwait(&COND_ndb_util_thread,
+ &LOCK_ndb_util_thread,
+ &abstime);
pthread_mutex_unlock(&LOCK_ndb_util_thread);
DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %d",
diff --git a/sql/handler.cc b/sql/handler.cc
index 5b07c9e9c24..1ec4ddf17b7 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -186,15 +186,18 @@ enum db_type ha_resolve_by_name(const char *name, uint namelen)
THD *thd= current_thd;
show_table_alias_st *table_alias;
handlerton **types;
- const char *ptr= name;
- if (thd && !my_strcasecmp(&my_charset_latin1, ptr, "DEFAULT"))
+ if (thd && !my_strnncoll(&my_charset_latin1,
+ (const uchar *)name, namelen,
+ (const uchar *)"DEFAULT", 7))
return (enum db_type) thd->variables.table_type;
retest:
for (types= sys_table_types; *types; types++)
{
- if (!my_strcasecmp(&my_charset_latin1, ptr, (*types)->name))
+ if (!my_strnncoll(&my_charset_latin1,
+ (const uchar *)name, namelen,
+ (const uchar *)(*types)->name, strlen((*types)->name)))
return (enum db_type) (*types)->db_type;
}
@@ -203,15 +206,21 @@ retest:
*/
for (table_alias= sys_table_aliases; table_alias->type; table_alias++)
{
- if (!my_strcasecmp(&my_charset_latin1, ptr, table_alias->alias))
+ if (!my_strnncoll(&my_charset_latin1,
+ (const uchar *)name, namelen,
+ (const uchar *)table_alias->alias,
+ strlen(table_alias->alias)))
{
- ptr= table_alias->type;
+ name= table_alias->type;
+ namelen= strlen(name);
goto retest;
}
}
return DB_TYPE_UNKNOWN;
}
+
+
const char *ha_get_storage_engine(enum db_type db_type)
{
handlerton **types;
@@ -220,25 +229,19 @@ const char *ha_get_storage_engine(enum db_type db_type)
if (db_type == (*types)->db_type)
return (*types)->name;
}
-
- return "none";
+ return "*NONE*";
}
+
bool ha_check_storage_engine_flag(enum db_type db_type, uint32 flag)
{
handlerton **types;
for (types= sys_table_types; *types; types++)
{
if (db_type == (*types)->db_type)
- {
- if ((*types)->flags & flag)
- return TRUE;
- else
- return FALSE;
- }
+ return test((*types)->flags & flag);
}
-
- return FALSE;
+ return FALSE; // No matching engine
}
@@ -299,26 +302,26 @@ enum db_type ha_checktype(THD *thd, enum db_type database_type,
} /* ha_checktype */
-handler *get_new_handler(TABLE *table, enum db_type db_type)
+handler *get_new_handler(TABLE *table, MEM_ROOT *alloc, enum db_type db_type)
{
handler *file;
switch (db_type) {
#ifndef NO_HASH
case DB_TYPE_HASH:
- file= new ha_hash(table);
+ file= new (alloc) ha_hash(table);
break;
#endif
case DB_TYPE_MRG_ISAM:
- file= new ha_myisammrg(table);
+ file= new (alloc) ha_myisammrg(table);
break;
#ifdef HAVE_BERKELEY_DB
case DB_TYPE_BERKELEY_DB:
- file= new ha_berkeley(table);
+ file= new (alloc) ha_berkeley(table);
break;
#endif
#ifdef HAVE_INNOBASE_DB
case DB_TYPE_INNODB:
- file= new ha_innobase(table);
+ file= new (alloc) ha_innobase(table);
break;
#endif
#ifdef HAVE_EXAMPLE_DB
@@ -329,51 +332,51 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
#ifdef HAVE_PARTITION_DB
case DB_TYPE_PARTITION_DB:
{
- file= new ha_partition(table);
+ file= new (alloc) ha_partition(table);
break;
}
#endif
#ifdef HAVE_ARCHIVE_DB
case DB_TYPE_ARCHIVE_DB:
- file= new ha_archive(table);
+ file= new (alloc) ha_archive(table);
break;
#endif
#ifdef HAVE_BLACKHOLE_DB
case DB_TYPE_BLACKHOLE_DB:
- file= new ha_blackhole(table);
+ file= new (alloc) ha_blackhole(table);
break;
#endif
#ifdef HAVE_FEDERATED_DB
case DB_TYPE_FEDERATED_DB:
- file= new ha_federated(table);
+ file= new (alloc) ha_federated(table);
break;
#endif
#ifdef HAVE_CSV_DB
case DB_TYPE_CSV_DB:
- file= new ha_tina(table);
+ file= new (alloc) ha_tina(table);
break;
#endif
#ifdef HAVE_NDBCLUSTER_DB
case DB_TYPE_NDBCLUSTER:
- file= new ha_ndbcluster(table);
+ file= new (alloc) ha_ndbcluster(table);
break;
#endif
case DB_TYPE_HEAP:
- file= new ha_heap(table);
+ file= new (alloc) ha_heap(table);
break;
default: // should never happen
{
enum db_type def=(enum db_type) current_thd->variables.table_type;
/* Try first with 'default table type' */
if (db_type != def)
- return get_new_handler(table, def);
+ return get_new_handler(table, alloc, def);
}
/* Fall back to MyISAM */
case DB_TYPE_MYISAM:
- file= new ha_myisam(table);
+ file= new (alloc) ha_myisam(table);
break;
case DB_TYPE_MRG_MYISAM:
- file= new ha_myisammrg(table);
+ file= new (alloc) ha_myisammrg(table);
break;
}
if (file)
@@ -383,8 +386,6 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
delete file;
file=0;
}
- }
- return file;
}
@@ -912,18 +913,25 @@ int ha_autocommit_or_rollback(THD *thd, int error)
DBUG_RETURN(error);
}
+
int ha_commit_or_rollback_by_xid(XID *xid, bool commit)
{
handlerton **types;
int res= 1;
for (types= sys_table_types; *types; types++)
+ {
if ((*types)->state == SHOW_OPTION_YES && (*types)->recover)
- res= res &&
- (*(commit ? (*types)->commit_by_xid : (*types)->rollback_by_xid))(xid);
+ {
+ if ((*(commit ? (*types)->commit_by_xid :
+ (*types)->rollback_by_xid))(xid));
+ res= 0;
+ }
+ }
return res;
}
+
#ifndef DBUG_OFF
/* this does not need to be multi-byte safe or anything */
static char* xid_to_str(char *buf, XID *xid)
@@ -1352,7 +1360,7 @@ int ha_delete_table(THD *thd, enum db_type table_type, const char *path,
/* DB_TYPE_UNKNOWN is used in ALTER TABLE when renaming only .frm files */
if (table_type == DB_TYPE_UNKNOWN ||
- ! (file=get_new_handler(&dummy_table, table_type)))
+ ! (file=get_new_handler(&dummy_table, thd->mem_root, table_type)))
DBUG_RETURN(ENOENT);
if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED))
@@ -2173,7 +2181,7 @@ int ha_create_table_from_engine(THD* thd,
DBUG_RETURN(3);
update_create_info_from_table(&create_info, &table);
- create_info.table_options|= HA_CREATE_FROM_ENGINE;
+ create_info.table_options|= HA_OPTION_CREATE_FROM_ENGINE;
if (lower_case_table_names == 2 &&
!(table.file->table_flags() & HA_FILE_BASED))
@@ -2626,6 +2634,7 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key,
TYPELIB *ha_known_exts(void)
{
+ MEM_ROOT *mem_root= current_thd->mem_root;
if (!known_extensions.type_names || mysys_usage_id != known_extensions_id)
{
handlerton **types;
@@ -2640,7 +2649,8 @@ TYPELIB *ha_known_exts(void)
{
if ((*types)->state == SHOW_OPTION_YES)
{
- handler *file= get_new_handler(0,(enum db_type) (*types)->db_type);
+ handler *file= get_new_handler(0, mem_root,
+ (enum db_type) (*types)->db_type);
for (ext= file->bas_ext(); *ext; ext++)
{
while ((old_ext= it++))
diff --git a/sql/handler.h b/sql/handler.h
index 2347c03ae2d..8d749c5fc33 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -664,6 +664,7 @@ typedef struct st_ha_create_information
uint options; /* OR of HA_CREATE_ options */
uint raid_type,raid_chunks;
uint merge_insert_method;
+ uint extra_size; /* length of extra data segment */
bool table_existed; /* 1 in create if table existed */
bool frm_only; /* 1 if no ha_create_table() */
bool varchar; /* 1 if table has a VARCHAR */
@@ -1389,7 +1390,7 @@ extern ulong total_ha, total_ha_2pc;
/* lookups */
enum db_type ha_resolve_by_name(const char *name, uint namelen);
const char *ha_get_storage_engine(enum db_type db_type);
-handler *get_new_handler(TABLE *table, enum db_type db_type);
+handler *get_new_handler(TABLE *table, MEM_ROOT *alloc, enum db_type db_type);
enum db_type ha_checktype(THD *thd, enum db_type database_type,
bool no_substitute, bool report_error);
bool ha_check_storage_engine_flag(enum db_type db_type, uint32 flag);
diff --git a/sql/item.cc b/sql/item.cc
index 5caac05f6ca..9a64b02f80b 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -696,6 +696,32 @@ Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs)
}
+Item *Item_param::safe_charset_converter(CHARSET_INFO *tocs)
+{
+ if (const_item())
+ {
+ Item_string *conv;
+ uint cnv_errors;
+ char buf[MAX_FIELD_WIDTH];
+ String tmp(buf, sizeof(buf), &my_charset_bin);
+ String cstr, *ostr= val_str(&tmp);
+ /*
+ As safe_charset_converter is not executed for
+ a parameter bound to NULL, ostr should never be 0.
+ */
+ cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &cnv_errors);
+ if (cnv_errors || !(conv= new Item_string(cstr.ptr(), cstr.length(),
+ cstr.charset(),
+ collation.derivation)))
+ return NULL;
+ conv->str_value.copy();
+ conv->str_value.mark_as_const();
+ return conv;
+ }
+ return NULL;
+}
+
+
Item *Item_static_string_func::safe_charset_converter(CHARSET_INFO *tocs)
{
Item_string *conv;
@@ -729,7 +755,8 @@ bool Item_string::eq(const Item *item, bool binary_cmp) const
{
if (binary_cmp)
return !stringcmp(&str_value, &item->str_value);
- return !sortcmp(&str_value, &item->str_value, collation.collation);
+ return (collation.collation == item->collation.collation &&
+ !sortcmp(&str_value, &item->str_value, collation.collation));
}
return 0;
}
@@ -817,9 +844,12 @@ String *Item_splocal::val_str(String *sp)
{
DBUG_ASSERT(fixed);
Item *it= this_item();
- String *ret= it->val_str(sp);
+ String *res= it->val_str(sp);
null_value= it->null_value;
+ if (!res)
+ return NULL;
+
/*
This way we mark returned value of val_str as const,
so that various functions (e.g. CONCAT) won't try to
@@ -836,12 +866,11 @@ String *Item_splocal::val_str(String *sp)
Item_param class contain some more details on the topic.
*/
- if (!ret)
- return NULL;
-
- str_value_ptr.set(ret->ptr(), ret->length(),
- ret->charset());
- return &str_value_ptr;
+ if (res != &str_value)
+ str_value.set(res->ptr(), res->length(), res->charset());
+ else
+ res->mark_as_const();
+ return &str_value;
}
@@ -858,17 +887,13 @@ my_decimal *Item_splocal::val_decimal(my_decimal *decimal_value)
bool Item_splocal::is_null()
{
Item *it= this_item();
- bool ret= it->is_null();
- null_value= it->null_value;
- return ret;
+ return it->is_null();
}
Item *
Item_splocal::this_item()
{
- THD *thd= current_thd;
-
return thd->spcont->get_item(m_offset);
}
@@ -882,25 +907,23 @@ Item_splocal::this_item_addr(THD *thd, Item **addr)
Item *
Item_splocal::this_const_item() const
{
- THD *thd= current_thd;
-
return thd->spcont->get_item(m_offset);
}
Item::Type
Item_splocal::type() const
{
- THD *thd= current_thd;
-
- if (thd->spcont)
+ if (thd && thd->spcont)
return thd->spcont->get_item(m_offset)->type();
return NULL_ITEM; // Anything but SUBSELECT_ITEM
}
-bool Item_splocal::fix_fields(THD *, Item **)
+bool Item_splocal::fix_fields(THD *thd_arg, Item **ref)
{
- Item *it= this_item();
+ Item *it;
+ thd= thd_arg; // Must be set before this_item()
+ it= this_item();
DBUG_ASSERT(it->fixed);
max_length= it->max_length;
decimals= it->decimals;
@@ -928,6 +951,7 @@ void Item_splocal::print(String *str)
/*****************************************************************************
Item_name_const methods
*****************************************************************************/
+
double Item_name_const::val_real()
{
DBUG_ASSERT(fixed);
@@ -966,9 +990,7 @@ my_decimal *Item_name_const::val_decimal(my_decimal *decimal_value)
bool Item_name_const::is_null()
{
- bool ret= value_item->is_null();
- null_value= value_item->null_value;
- return ret;
+ return value_item->is_null();
}
Item::Type Item_name_const::type() const
@@ -977,7 +999,7 @@ Item::Type Item_name_const::type() const
}
-bool Item_name_const::fix_fields(THD *thd, Item **)
+bool Item_name_const::fix_fields(THD *thd, Item **ref)
{
char buf[128];
String *item_name;
@@ -1356,7 +1378,7 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
been created in prepare. In this case register the change for
rollback.
*/
- if (arena)
+ if (arena && arena->is_conventional())
*arg= conv;
else
thd->change_item_tree(arg, conv);
@@ -2783,7 +2805,7 @@ int Item_copy_string::save_in_field(Field *field, bool no_conversions)
*/
/* ARGSUSED */
-bool Item::fix_fields(THD *thd, Item ** ref)
+bool Item::fix_fields(THD *thd, Item **ref)
{
// We do not check fields which are fixed during construction
@@ -3213,11 +3235,26 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
context->last_name_resolution_table,
reference,
IGNORE_EXCEPT_NON_UNIQUE,
- !any_privileges &&
- context->check_privileges,
+ !any_privileges,
TRUE)) ==
not_found_field)
{
+
+ /* Look up in current select's item_list to find aliased fields */
+ if (thd->lex->current_select->is_item_list_lookup)
+ {
+ uint counter;
+ bool not_used;
+ Item** res= find_item_in_list(this, thd->lex->current_select->item_list,
+ &counter, REPORT_EXCEPT_NOT_FOUND,
+ &not_used);
+ if (res != (Item **)not_found_item && (*res)->type() == Item::FIELD_ITEM)
+ {
+ set_field((*((Item_field**)res))->field);
+ return 0;
+ }
+ }
+
/*
If there are outer contexts (outer selects, but current select is
not derived table or view) try to resolve this reference in the
@@ -3260,9 +3297,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
last_name_resolution_table,
reference,
IGNORE_EXCEPT_NON_UNIQUE,
- outer_context->
- check_privileges,
- TRUE)) !=
+ TRUE, TRUE)) !=
not_found_field)
{
if (from_field)
@@ -3337,7 +3372,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
context->last_name_resolution_table,
reference, REPORT_ALL_ERRORS,
!any_privileges &&
- context->check_privileges, TRUE);
+ TRUE, TRUE);
}
goto error;
}
@@ -3412,7 +3447,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
We can leave expression substituted from view for next PS/SP rexecution
(i.e. do not register this substitution for reverting on cleupup()
(register_item_tree_changing())), because this subtree will be
- fix_field'ed during setup_tables()->setup_ancestor() (i.e. before
+ fix_field'ed during setup_tables()->setup_underlying() (i.e. before
all other expressions of query, and references on tables which do
not present in query will not make problems.
@@ -4512,8 +4547,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
last_name_resolution_table,
reference,
IGNORE_EXCEPT_NON_UNIQUE,
- outer_context->check_privileges,
- TRUE);
+ TRUE, TRUE);
if (! from_field)
goto error;
if (from_field == view_ref_found)
@@ -4638,7 +4672,7 @@ void Item_ref::cleanup()
void Item_ref::print(String *str)
{
- if (ref && *ref)
+ if (ref)
(*ref)->print(str);
else
Item_ident::print(str);
@@ -4770,8 +4804,7 @@ String *Item_ref::val_str(String* tmp)
bool Item_ref::is_null()
{
DBUG_ASSERT(fixed);
- (void) (*ref)->val_int_result();
- return (*ref)->null_value;
+ return (*ref)->is_null();
}
@@ -4825,7 +4858,7 @@ void Item_ref::make_field(Send_field *field)
void Item_ref_null_helper::print(String *str)
{
str->append("<ref_null_helper>(", 18);
- if (ref && *ref)
+ if (ref)
(*ref)->print(str);
else
str->append('?');
@@ -5053,8 +5086,17 @@ bool Item_insert_value::eq(const Item *item, bool binary_cmp) const
bool Item_insert_value::fix_fields(THD *thd, Item **items)
{
DBUG_ASSERT(fixed == 0);
- if (!arg->fixed && arg->fix_fields(thd, &arg))
- return TRUE;
+ /* We should only check that arg is in first table */
+ if (!arg->fixed)
+ {
+ bool res;
+ st_table_list *orig_next_table= context->last_name_resolution_table;
+ context->last_name_resolution_table= context->first_name_resolution_table;
+ res= arg->fix_fields(thd, &arg);
+ context->last_name_resolution_table= orig_next_table;
+ if (res)
+ return TRUE;
+ }
if (arg->type() == REF_ITEM)
{
@@ -5066,6 +5108,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items)
arg= ref->ref[0];
}
Item_field *field_arg= (Item_field *)arg;
+
if (field_arg->field->table->insert_values)
{
Field *def_field= (Field*) sql_alloc(field_arg->field->size_of());
@@ -5126,7 +5169,7 @@ void Item_trigger_field::setup_field(THD *thd, TABLE *table)
set field_idx properly.
*/
(void)find_field_in_table(thd, table, field_name, (uint) strlen(field_name),
- 0, 0, &field_idx);
+ 0, 0, &field_idx, 0);
thd->set_query_id= save_set_query_id;
triggers= table->triggers;
}
@@ -5241,32 +5284,21 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item)
}
case ROW_RESULT:
{
+ Item_row *item_row= (Item_row*) item;
+ Item_row *comp_item_row= (Item_row*) comp_item;
+ uint col;
new_item= 0;
/*
If item and comp_item are both Item_rows and have same number of cols
- then process items in Item_row one by one. If Item_row contain nulls
- substitute it by Item_null. Otherwise just return.
+ then process items in Item_row one by one.
+ We can't ignore NULL values here as this item may be used with <=>, in
+ which case NULL's are significant.
*/
- if (item->result_type() == comp_item->result_type() &&
- ((Item_row*)item)->cols() == ((Item_row*)comp_item)->cols())
- {
- Item_row *item_row= (Item_row*)item,*comp_item_row= (Item_row*)comp_item;
- if (item_row->null_inside())
- new_item= (Item*) new Item_null(name);
- else
- {
- int i= item_row->cols() - 1;
- for (; i >= 0; i--)
- {
- if (item_row->maybe_null && item_row->el(i)->is_null())
- {
- new_item= (Item*) new Item_null(name);
- break;
- }
- resolve_const_item(thd, item_row->addr(i), comp_item_row->el(i));
- }
- }
- }
+ DBUG_ASSERT(item->result_type() == comp_item->result_type());
+ DBUG_ASSERT(item_row->cols() == comp_item_row->cols());
+ col= item_row->cols();
+ while (col-- > 0)
+ resolve_const_item(thd, item_row->addr(col), comp_item_row->el(col));
break;
}
case REAL_RESULT:
@@ -5721,6 +5753,8 @@ enum_field_types Item_type_holder::get_real_type(Item *item)
bool Item_type_holder::join_types(THD *thd, Item *item)
{
+ uint max_length_orig= max_length;
+ uint decimals_orig= decimals;
DBUG_ENTER("Item_type_holder::join_types");
DBUG_PRINT("info:", ("was type %d len %d, dec %d name %s",
fld_type, max_length, decimals,
@@ -5747,7 +5781,10 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
}
else
max_length= max(max_length, display_length(item));
- if (Field::result_merge_type(fld_type) == STRING_RESULT)
+
+ switch (Field::result_merge_type(fld_type))
+ {
+ case STRING_RESULT:
{
const char *old_cs, *old_derivation;
old_cs= collation.collation->name;
@@ -5761,7 +5798,23 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
"UNION");
DBUG_RETURN(TRUE);
}
+ break;
+ }
+ case REAL_RESULT:
+ {
+ if (decimals != NOT_FIXED_DEC)
+ {
+ int delta1= max_length_orig - decimals_orig;
+ int delta2= item->max_length - item->decimals;
+ max_length= min(max(delta1, delta2) + decimals,
+ (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7);
+ }
+ else
+ max_length= (fld_type == MYSQL_TYPE_FLOAT) ? FLT_DIG+6 : DBL_DIG+7;
+ break;
}
+ default:;
+ };
maybe_null|= item->maybe_null;
get_full_info(item);
diff --git a/sql/item.h b/sql/item.h
index a8f013f60d4..8bc659c3060 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -294,15 +294,15 @@ struct Name_resolution_context: Sql_alloc
bool resolve_in_select_list;
/*
- When FALSE we do not check columns right of resolving items, used to
- prevent rights check on underlying tables of view
+ Security context of this name resolution context. It's used for views
+ and is non-zero only if the view is defined with SQL SECURITY DEFINER.
*/
- bool check_privileges;
+ Security_context *security_ctx;
Name_resolution_context()
:outer_context(0), table_list(0), select_lex(0),
error_processor_data(0),
- check_privileges(TRUE)
+ security_ctx(0)
{}
void init()
@@ -526,6 +526,7 @@ public:
double val_real_from_decimal();
virtual Field *get_tmp_table_field() { return 0; }
+ /* This is also used to create fields in CREATE ... SELECT: */
virtual Field *tmp_table_field(TABLE *t_arg) { return 0; }
virtual const char *full_name() const { return name ? name : "???"; }
@@ -721,13 +722,7 @@ class Item_splocal : public Item
public:
LEX_STRING m_name;
-
- /*
- Buffer, pointing to the string value of the item. We need it to
- protect internal buffer from changes. See comment to analogous
- member in Item_param for more details.
- */
- String str_value_ptr;
+ THD *thd;
/*
Position of this reference to SP variable in the statement (the
@@ -739,10 +734,10 @@ public:
Value of 0 means that this object doesn't corresponding to reference to
SP variable in query text.
*/
- int pos_in_query;
+ uint pos_in_query;
- Item_splocal(LEX_STRING name, uint offset, int pos_in_q=0)
- : m_offset(offset), m_name(name), pos_in_query(pos_in_q)
+ Item_splocal(LEX_STRING name, uint offset, uint pos_in_q=0)
+ : m_offset(offset), m_name(name), thd(0), pos_in_query(pos_in_q)
{
maybe_null= TRUE;
}
@@ -1200,6 +1195,7 @@ public:
constant, assert otherwise. This method is called only if
basic_const_item returned TRUE.
*/
+ Item *safe_charset_converter(CHARSET_INFO *tocs);
Item *new_item();
/*
Implement by-value equality evaluation if parameter value
@@ -1337,6 +1333,14 @@ public:
longlong val_int()
{
DBUG_ASSERT(fixed == 1);
+ if (value <= (double) LONGLONG_MIN)
+ {
+ return LONGLONG_MIN;
+ }
+ else if (value >= (double) (ulonglong) LONGLONG_MAX)
+ {
+ return LONGLONG_MAX;
+ }
return (longlong) (value+(value > 0 ? 0.5 : -0.5));
}
String *val_str(String*);
@@ -1622,7 +1626,7 @@ public:
}
Item *real_item()
{
- return (ref && *ref) ? (*ref)->real_item() : this;
+ return ref ? (*ref)->real_item() : this;
}
bool walk(Item_processor processor, byte *arg)
{ return (*ref)->walk(processor, arg); }
@@ -1746,6 +1750,7 @@ public:
return ref->save_in_field(field, no_conversions);
}
Item *new_item();
+ virtual Item *real_item() { return ref; }
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 138ebaaf9a5..06cb83a7101 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -186,13 +186,18 @@ static bool convert_constant_item(THD *thd, Field *field, Item **item)
{
if ((*item)->const_item())
{
+ /* For comparison purposes allow invalid dates like 2000-01-32 */
+ ulong orig_sql_mode= field->table->in_use->variables.sql_mode;
+ field->table->in_use->variables.sql_mode|= MODE_INVALID_DATES;
if (!(*item)->save_in_field(field, 1) && !((*item)->null_value))
{
Item *tmp=new Item_int_with_ref(field->val_int(), *item);
+ field->table->in_use->variables.sql_mode= orig_sql_mode;
if (tmp)
thd->change_item_tree(item, tmp);
return 1; // Item was replaced
}
+ field->table->in_use->variables.sql_mode= orig_sql_mode;
}
return 0;
}
@@ -2958,6 +2963,15 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
String *escape_str= escape_item->val_str(&tmp_value1);
if (escape_str)
{
+ if (escape_used_in_parsing && (
+ (((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
+ escape_str->numchars() != 1) ||
+ escape_str->numchars() > 1)))
+ {
+ my_error(ER_WRONG_ARGUMENTS,MYF(0),"ESCAPE");
+ return TRUE;
+ }
+
if (use_mb(cmp.cmp_collation.collation))
{
CHARSET_INFO *cs= escape_str->charset();
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index aa50593abf4..bfd32223d4c 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -985,13 +985,16 @@ class Item_func_like :public Item_bool_func2
enum { alphabet_size = 256 };
Item *escape_item;
+
+ bool escape_used_in_parsing;
public:
int escape;
- Item_func_like(Item *a,Item *b, Item *escape_arg)
+ Item_func_like(Item *a,Item *b, Item *escape_arg, bool escape_used)
:Item_bool_func2(a,b), canDoTurboBM(FALSE), pattern(0), pattern_len(0),
- bmGs(0), bmBc(0), escape_item(escape_arg) {}
+ bmGs(0), bmBc(0), escape_item(escape_arg),
+ escape_used_in_parsing(escape_used) {}
longlong val_int();
enum Functype functype() const { return LIKE_FUNC; }
optimize_type select_optimize() const;
diff --git a/sql/item_func.cc b/sql/item_func.cc
index f07460f2a05..f467981540b 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -32,6 +32,11 @@
#include "sp_rcontext.h"
#include "sp.h"
+#ifdef NO_EMBEDDED_ACCESS_CHECKS
+#define sp_restore_security_context(A,B) while (0) {}
+#endif
+
+
bool check_reserved_words(LEX_STRING *name)
{
if (!my_strcasecmp(system_charset_info, name->str, "GLOBAL") ||
@@ -967,8 +972,8 @@ my_decimal *Item_func_plus::decimal_op(my_decimal *decimal_value)
return 0;
val2= args[1]->val_decimal(&value2);
if (!(null_value= (args[1]->null_value ||
- my_decimal_add(E_DEC_FATAL_ERROR, decimal_value, val1,
- val2) > 1)))
+ (my_decimal_add(E_DEC_FATAL_ERROR, decimal_value, val1,
+ val2) > 3))))
return decimal_value;
return 0;
}
@@ -1040,8 +1045,8 @@ my_decimal *Item_func_minus::decimal_op(my_decimal *decimal_value)
return 0;
val2= args[1]->val_decimal(&value2);
if (!(null_value= (args[1]->null_value ||
- my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1,
- val2) > 1)))
+ (my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1,
+ val2) > 3))))
return decimal_value;
return 0;
}
@@ -1078,8 +1083,8 @@ my_decimal *Item_func_mul::decimal_op(my_decimal *decimal_value)
return 0;
val2= args[1]->val_decimal(&value2);
if (!(null_value= (args[1]->null_value ||
- my_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1,
- val2) > 1)))
+ (my_decimal_mul(E_DEC_FATAL_ERROR, decimal_value, val1,
+ val2) > 3))))
return decimal_value;
return 0;
}
@@ -1119,6 +1124,7 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
{
my_decimal value1, *val1;
my_decimal value2, *val2;
+ int err;
val1= args[0]->val_decimal(&value1);
if ((null_value= args[0]->null_value))
@@ -1126,17 +1132,15 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
val2= args[1]->val_decimal(&value2);
if ((null_value= args[1]->null_value))
return 0;
- switch (my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value,
- val1, val2, prec_increment)) {
- case E_DEC_TRUNCATED:
- case E_DEC_OK:
- return decimal_value;
- case E_DEC_DIV_ZERO:
- signal_divide_by_null();
- default:
- null_value= 1; // Safety
+ if ((err= my_decimal_div(E_DEC_FATAL_ERROR & ~E_DEC_DIV_ZERO, decimal_value,
+ val1, val2, prec_increment)) > 3)
+ {
+ if (err == E_DEC_DIV_ZERO)
+ signal_divide_by_null();
+ null_value= 1;
return 0;
}
+ return decimal_value;
}
@@ -1381,8 +1385,13 @@ double Item_func_ln::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if ((null_value=(args[0]->null_value || value <= 0.0)))
+ if ((null_value= args[0]->null_value))
+ return 0.0;
+ if (value <= 0.0)
+ {
+ signal_divide_by_null();
return 0.0;
+ }
return log(value);
}
@@ -1395,13 +1404,23 @@ double Item_func_log::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if ((null_value=(args[0]->null_value || value <= 0.0)))
+ if ((null_value= args[0]->null_value))
return 0.0;
+ if (value <= 0.0)
+ {
+ signal_divide_by_null();
+ return 0.0;
+ }
if (arg_count == 2)
{
double value2= args[1]->val_real();
- if ((null_value=(args[1]->null_value || value2 <= 0.0 || value == 1.0)))
+ if ((null_value= args[1]->null_value))
+ return 0.0;
+ if (value2 <= 0.0 || value == 1.0)
+ {
+ signal_divide_by_null();
return 0.0;
+ }
return log(value2) / log(value);
}
return log(value);
@@ -1411,8 +1430,14 @@ double Item_func_log2::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if ((null_value=(args[0]->null_value || value <= 0.0)))
+
+ if ((null_value=args[0]->null_value))
+ return 0.0;
+ if (value <= 0.0)
+ {
+ signal_divide_by_null();
return 0.0;
+ }
return log(value) / M_LN2;
}
@@ -1420,8 +1445,13 @@ double Item_func_log10::val_real()
{
DBUG_ASSERT(fixed == 1);
double value= args[0]->val_real();
- if ((null_value=(args[0]->null_value || value <= 0.0)))
- return 0.0; /* purecov: inspected */
+ if ((null_value= args[0]->null_value))
+ return 0.0;
+ if (value <= 0.0)
+ {
+ signal_divide_by_null();
+ return 0.0;
+ }
return log10(value);
}
@@ -2015,7 +2045,6 @@ String *Item_func_min_max::val_str(String *str)
{
String *res;
LINT_INIT(res);
- null_value= 0;
for (uint i=0; i < arg_count ; i++)
{
if (i == 0)
@@ -2030,14 +2059,11 @@ String *Item_func_min_max::val_str(String *str)
if ((cmp_sign < 0 ? cmp : -cmp) < 0)
res=res2;
}
- else
- res= 0;
}
if ((null_value= args[i]->null_value))
- break;
+ return 0;
}
- if (res) // If !NULL
- res->set_charset(collation.collation);
+ res->set_charset(collation.collation);
return res;
}
case ROW_RESULT:
@@ -2054,7 +2080,6 @@ double Item_func_min_max::val_real()
{
DBUG_ASSERT(fixed == 1);
double value=0.0;
- null_value= 0;
for (uint i=0; i < arg_count ; i++)
{
if (i == 0)
@@ -2076,7 +2101,6 @@ longlong Item_func_min_max::val_int()
{
DBUG_ASSERT(fixed == 1);
longlong value=0;
- null_value= 0;
for (uint i=0; i < arg_count ; i++)
{
if (i == 0)
@@ -2097,21 +2121,21 @@ longlong Item_func_min_max::val_int()
my_decimal *Item_func_min_max::val_decimal(my_decimal *dec)
{
DBUG_ASSERT(fixed == 1);
- my_decimal tmp_buf, *tmp, *res= NULL;
- null_value= 0;
+ my_decimal tmp_buf, *tmp, *res;
+ LINT_INIT(res);
+
for (uint i=0; i < arg_count ; i++)
{
if (i == 0)
res= args[i]->val_decimal(dec);
else
{
- tmp= args[i]->val_decimal(&tmp_buf);
- if (args[i]->null_value)
- res= 0;
- else if ((my_decimal_cmp(tmp, res) * cmp_sign) < 0)
+ tmp= args[i]->val_decimal(&tmp_buf); // Zero if NULL
+ if (tmp && (my_decimal_cmp(tmp, res) * cmp_sign) < 0)
{
if (tmp == &tmp_buf)
{
+ /* Move value out of tmp_buf as this will be reused on next loop */
my_decimal2decimal(tmp, dec);
res= dec;
}
@@ -2120,7 +2144,10 @@ my_decimal *Item_func_min_max::val_decimal(my_decimal *dec)
}
}
if ((null_value= args[i]->null_value))
+ {
+ res= 0;
break;
+ }
}
return res;
}
@@ -2349,7 +2376,7 @@ void Item_func_find_in_set::fix_length_and_dec()
}
}
}
- agg_arg_collations_for_comparison(cmp_collation, args, 2);
+ agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV);
}
static const char separator=',';
@@ -3031,9 +3058,13 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
thd->mysys_var->current_cond= &ull->cond;
set_timespec(abstime,lock_timeout);
- while (!thd->killed &&
- pthread_cond_timedwait(&ull->cond, &LOCK_user_locks,
- &abstime) != ETIMEDOUT && ull->locked) ;
+ while (ull->locked && !thd->killed)
+ {
+ int error= pthread_cond_timedwait(&ull->cond, &LOCK_user_locks, &abstime);
+ if (error == ETIMEDOUT || error == ETIME)
+ break;
+ }
+
if (ull->locked)
{
if (!--ull->count)
@@ -3077,7 +3108,7 @@ longlong Item_func_get_lock::val_int()
struct timespec abstime;
THD *thd=current_thd;
User_level_lock *ull;
- int error=0;
+ int error;
/*
In slave thread no need to get locks, everything is serialized. Anyway
@@ -3133,22 +3164,29 @@ longlong Item_func_get_lock::val_int()
thd->mysys_var->current_cond= &ull->cond;
set_timespec(abstime,timeout);
- while (!thd->killed &&
- (error=pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime))
- != ETIMEDOUT && error != EINVAL && ull->locked) ;
- if (thd->killed)
- error=EINTR; // Return NULL
+ error= 0;
+ while (ull->locked && !thd->killed)
+ {
+ error= pthread_cond_timedwait(&ull->cond,&LOCK_user_locks,&abstime);
+ if (error == ETIMEDOUT || error == ETIME)
+ break;
+ error= 0;
+ }
+
if (ull->locked)
{
if (!--ull->count)
+ {
+ DBUG_ASSERT(0);
delete ull; // Should never happen
- if (error != ETIMEDOUT)
+ }
+ if (!error) // Killed (thd->killed != 0)
{
error=1;
null_value=1; // Return NULL
}
}
- else
+ else // We got the lock
{
ull->locked=1;
ull->thread=thd->real_id;
@@ -3270,6 +3308,7 @@ void Item_func_benchmark::print(String *str)
str->append(')');
}
+
/* This function is just used to create tests with time gaps */
longlong Item_func_sleep::val_int()
@@ -3290,10 +3329,14 @@ longlong Item_func_sleep::val_int()
thd->mysys_var->current_mutex= &LOCK_user_locks;
thd->mysys_var->current_cond= &cond;
- while (!thd->killed &&
- (error= pthread_cond_timedwait(&cond, &LOCK_user_locks,
- &abstime)) != ETIMEDOUT &&
- error != EINVAL) ;
+ error= 0;
+ while (!thd->killed)
+ {
+ error= pthread_cond_timedwait(&cond, &LOCK_user_locks, &abstime);
+ if (error == ETIMEDOUT || error == ETIME)
+ break;
+ error= 0;
+ }
pthread_mutex_lock(&thd->mysys_var->mutex);
thd->mysys_var->current_mutex= 0;
@@ -3303,7 +3346,7 @@ longlong Item_func_sleep::val_int()
pthread_mutex_unlock(&LOCK_user_locks);
pthread_cond_destroy(&cond);
- return (error == ETIMEDOUT) ? 0 : 1;
+ return test(!error); // Return 1 killed
}
@@ -4485,7 +4528,6 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name,
LEX_STRING component)
{
sys_var *var;
- char buff[MAX_SYS_VAR_LENGTH*2+4+8], *pos;
LEX_STRING *base_name, *component_name;
if (component.str == 0 &&
@@ -4689,6 +4731,7 @@ Item_func_sp::execute(Field **flp)
if (execute(&it))
{
null_value= 1;
+ context->process_error(current_thd);
return 1;
}
if (!(f= *flp))
@@ -4711,9 +4754,16 @@ Item_func_sp::execute(Item **itp)
THD *thd= current_thd;
int res= -1;
Sub_statement_state statement_state;
- Security_context *save_ctx;
+ Security_context *save_security_ctx= thd->security_ctx, *save_ctx_func;
- if (find_and_check_access(thd, EXECUTE_ACL, &save_ctx))
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ if (context->security_ctx)
+ {
+ /* Set view definer security context */
+ thd->security_ctx= context->security_ctx;
+ }
+#endif
+ if (find_and_check_access(thd, EXECUTE_ACL, &save_ctx_func))
goto error;
/*
@@ -4731,12 +4781,13 @@ Item_func_sp::execute(Item **itp)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_FAILED_ROUTINE_BREAK_BINLOG,
ER(ER_FAILED_ROUTINE_BREAK_BINLOG));
-
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- sp_restore_security_context(thd, save_ctx);
-#endif
-
+ sp_restore_security_context(thd, save_ctx_func);
error:
+ thd->security_ctx= save_security_ctx;
+#else
+error:
+#endif
DBUG_RETURN(res);
}
@@ -4849,11 +4900,12 @@ Item_func_sp::tmp_table_field(TABLE *t_arg)
find_and_check_access()
thd thread handler
want_access requested access
- backup backup of security context or 0
+ save backup of security context
RETURN
FALSE Access granted
TRUE Requested access can't be granted or function doesn't exists
+ In this case security context is not changed and *save = 0
NOTES
Checks if requested access to function can be granted to user.
@@ -4868,12 +4920,11 @@ Item_func_sp::tmp_table_field(TABLE *t_arg)
bool
Item_func_sp::find_and_check_access(THD *thd, ulong want_access,
- Security_context **backup)
+ Security_context **save)
{
- bool res;
- Security_context *local_save,
- **save= (backup ? backup : &local_save);
- res= TRUE;
+ bool res= TRUE;
+
+ *save= 0; // Safety if error
if (! m_sp && ! (m_sp= sp_find_function(thd, m_name, TRUE)))
{
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", m_name->m_qname.str);
@@ -4883,26 +4934,31 @@ Item_func_sp::find_and_check_access(THD *thd, ulong want_access,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (check_routine_access(thd, want_access,
m_sp->m_db.str, m_sp->m_name.str, 0, FALSE))
- {
goto error;
- }
sp_change_security_context(thd, m_sp, save);
+ /*
+ If we changed context to run as another user, we need to check the
+ access right for the new context again as someone may have deleted
+ this person the right to use the procedure
+
+ TODO:
+ Cache if the definer has the right to use the object on the first
+ usage and only reset the cache if someone does a GRANT statement
+ that 'may' affect this.
+ */
if (*save &&
check_routine_access(thd, want_access,
m_sp->m_db.str, m_sp->m_name.str, 0, FALSE))
{
- goto error_check_ctx;
+ sp_restore_security_context(thd, *save);
+ *save= 0; // Safety
+ goto error;
}
- res= FALSE;
-error_check_ctx:
- if (*save && (res || !backup))
- sp_restore_security_context(thd, local_save);
-error:
-#else
- res= 0;
-error:
#endif
+ res= FALSE; // no error
+
+error:
return res;
}
@@ -4912,7 +4968,23 @@ Item_func_sp::fix_fields(THD *thd, Item **ref)
bool res;
DBUG_ASSERT(fixed == 0);
res= Item_func::fix_fields(thd, ref);
- if (!res && find_and_check_access(thd, EXECUTE_ACL, NULL))
- res= 1;
+ if (!res && thd->lex->view_prepare_mode)
+ {
+ /*
+ Here we check privileges of the stored routine only during view
+ creation, in order to validate the view. A runtime check is perfomed
+ in Item_func_sp::execute(), and this method is not called during
+ context analysis. We do not need to restore the security context
+ changed in find_and_check_access because all view structures created
+ in CREATE VIEW are not used for execution. Notice, that during view
+ creation we do not infer into stored routine bodies and do not check
+ privileges of its statements, which would probably be a good idea
+ especially if the view has SQL SECURITY DEFINER and the used stored
+ procedure has SQL SECURITY DEFINER
+ */
+ Security_context *save_ctx;
+ if (!(res= find_and_check_access(thd, EXECUTE_ACL, &save_ctx)))
+ sp_restore_security_context(thd, save_ctx);
+ }
return res;
}
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 4a6ceb4bf7d..2b92e72e728 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -81,8 +81,7 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
str->q_append(srid);
if ((null_value=
(args[0]->null_value ||
- !Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length()) ||
- str->append(*wkb))))
+ !Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length(), str))))
return 0;
return str;
}
@@ -99,8 +98,7 @@ String *Item_func_as_wkt::val_str(String *str)
if ((null_value=
(args[0]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)))))
+ !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
str->length(0);
@@ -126,8 +124,7 @@ String *Item_func_as_wkb::val_str(String *str)
if ((null_value=
(args[0]->null_value ||
- !(Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)))))
+ !(Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
str->copy(swkb->ptr() + SRID_SIZE, swkb->length() - SRID_SIZE,
@@ -145,8 +142,7 @@ String *Item_func_geometry_type::val_str(String *str)
if ((null_value=
(args[0]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)))))
+ !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
/* String will not move */
str->copy(geom->get_class_info()->m_name.str,
@@ -167,8 +163,7 @@ String *Item_func_envelope::val_str(String *str)
if ((null_value=
args[0]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE))))
+ !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
return 0;
srid= uint4korr(swkb->ptr());
@@ -191,8 +186,7 @@ String *Item_func_centroid::val_str(String *str)
uint32 srid;
if ((null_value= args[0]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE))))
+ !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
return 0;
str->set_charset(&my_charset_bin);
@@ -221,8 +215,7 @@ String *Item_func_spatial_decomp::val_str(String *str)
if ((null_value=
(args[0]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)))))
+ !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
srid= uint4korr(swkb->ptr());
@@ -270,8 +263,7 @@ String *Item_func_spatial_decomp_n::val_str(String *str)
if ((null_value=
(args[0]->null_value || args[1]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)))))
+ !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
str->set_charset(&my_charset_bin);
@@ -478,10 +470,8 @@ longlong Item_func_spatial_rel::val_int()
if ((null_value=
(args[0]->null_value ||
args[1]->null_value ||
- !(g1= Geometry::create_from_wkb(&buffer1, res1->ptr() + SRID_SIZE,
- res1->length() - SRID_SIZE)) ||
- !(g2= Geometry::create_from_wkb(&buffer2, res2->ptr() + SRID_SIZE,
- res2->length() - SRID_SIZE)) ||
+ !(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
+ !(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
g1->get_mbr(&mbr1, &dummy) ||
g2->get_mbr(&mbr2, &dummy))))
return 0;
@@ -546,8 +536,7 @@ longlong Item_func_isclosed::val_int()
null_value= (!swkb ||
args[0]->null_value ||
!(geom=
- Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ Geometry::construct(&buffer, swkb->ptr(), swkb->length())) ||
geom->is_closed(&isclosed));
return (longlong) isclosed;
@@ -569,9 +558,7 @@ longlong Item_func_dimension::val_int()
null_value= (!swkb ||
args[0]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())) ||
geom->dimension(&dim, &dummy));
return (longlong) dim;
}
@@ -586,9 +573,8 @@ longlong Item_func_numinteriorring::val_int()
Geometry *geom;
null_value= (!swkb ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length())) ||
geom->num_interior_ring(&num));
return (longlong) num;
}
@@ -603,9 +589,8 @@ longlong Item_func_numgeometries::val_int()
Geometry *geom;
null_value= (!swkb ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length())) ||
geom->num_geometries(&num));
return (longlong) num;
}
@@ -621,9 +606,8 @@ longlong Item_func_numpoints::val_int()
null_value= (!swkb ||
args[0]->null_value ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length())) ||
geom->num_points(&num));
return (longlong) num;
}
@@ -638,9 +622,8 @@ double Item_func_x::val_real()
Geometry *geom;
null_value= (!swkb ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length())) ||
geom->get_x(&res));
return res;
}
@@ -655,9 +638,8 @@ double Item_func_y::val_real()
Geometry *geom;
null_value= (!swkb ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length())) ||
geom->get_y(&res));
return res;
}
@@ -673,9 +655,8 @@ double Item_func_area::val_real()
const char *dummy;
null_value= (!swkb ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length())) ||
geom->area(&res, &dummy));
return res;
}
@@ -689,9 +670,8 @@ double Item_func_glength::val_real()
Geometry *geom;
null_value= (!swkb ||
- !(geom= Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)) ||
+ !(geom= Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length())) ||
geom->length(&res));
return res;
}
@@ -703,9 +683,8 @@ longlong Item_func_srid::val_int()
Geometry_buffer buffer;
null_value= (!swkb ||
- !Geometry::create_from_wkb(&buffer,
- swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE));
+ !Geometry::construct(&buffer,
+ swkb->ptr(), swkb->length()));
if (null_value)
return 0;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 018afac3812..1e8fe2e695f 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1504,7 +1504,13 @@ String *Item_func_encrypt::val_str(String *str)
salt_ptr= salt_str->c_ptr();
}
pthread_mutex_lock(&LOCK_crypt);
- char *tmp=crypt(res->c_ptr(),salt_ptr);
+ char *tmp= crypt(res->c_ptr(),salt_ptr);
+ if (!tmp)
+ {
+ pthread_mutex_unlock(&LOCK_crypt);
+ null_value= 1;
+ return 0;
+ }
str->set(tmp,(uint) strlen(tmp),res->charset());
str->copy();
pthread_mutex_unlock(&LOCK_crypt);
@@ -1964,21 +1970,16 @@ String *Item_func_char::val_str(String *str)
int32 num=(int32) args[i]->val_int();
if (!args[i]->null_value)
{
-#ifdef USE_MB
- if (use_mb(collation.collation))
- {
- if (num&0xFF000000L) {
- str->append((char)(num>>24));
- goto b2;
- } else if (num&0xFF0000L) {
-b2: str->append((char)(num>>16));
- goto b1;
- } else if (num&0xFF00L) {
-b1: str->append((char)(num>>8));
- }
+ if (num&0xFF000000L) {
+ str->append((char)(num>>24));
+ goto b2;
+ } else if (num&0xFF0000L) {
+ b2: str->append((char)(num>>16));
+ goto b1;
+ } else if (num&0xFF00L) {
+ b1: str->append((char)(num>>8));
}
-#endif
- str->append((char)num);
+ str->append((char) num);
}
}
str->set_charset(collation.collation);
@@ -1997,7 +1998,7 @@ b1: str->append((char)(num>>8));
enum MYSQL_ERROR::enum_warning_level level;
uint diff= str->length() - wlen;
set_if_smaller(diff, 3);
- octet2hex(hexbuf, (const uchar*) str->ptr() + wlen, diff);
+ octet2hex(hexbuf, str->ptr() + wlen, diff);
if (thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))
{
@@ -2436,6 +2437,7 @@ String *Item_func_collation::val_str(String *str)
String *Item_func_hex::val_str(String *str)
{
+ String *res;
DBUG_ASSERT(fixed == 1);
if (args[0]->result_type() != STRING_RESULT)
{
@@ -2464,24 +2466,16 @@ String *Item_func_hex::val_str(String *str)
}
/* Convert given string to a hex string, character by character */
- String *res= args[0]->val_str(str);
- const char *from, *end;
- char *to;
- if (!res || tmp_value.alloc(res->length()*2))
+ res= args[0]->val_str(str);
+ if (!res || tmp_value.alloc(res->length()*2+1))
{
null_value=1;
return 0;
}
null_value=0;
tmp_value.length(res->length()*2);
- for (from=res->ptr(), end=from+res->length(), to= (char*) tmp_value.ptr();
- from < end ;
- from++, to+=2)
- {
- uint tmp=(uint) (uchar) *from;
- to[0]=_dig_vec_upper[tmp >> 4];
- to[1]=_dig_vec_upper[tmp & 15];
- }
+
+ octet2hex((char*) tmp_value.ptr(), res->ptr(), res->length());
return &tmp_value;
}
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index fa098849a43..5889821293d 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -480,12 +480,15 @@ public:
class Item_func_char :public Item_str_func
{
public:
- Item_func_char(List<Item> &list) :Item_str_func(list) {}
+ Item_func_char(List<Item> &list) :Item_str_func(list)
+ { collation.set(&my_charset_bin); }
+ Item_func_char(List<Item> &list, CHARSET_INFO *cs) :Item_str_func(list)
+ { collation.set(cs); }
String *val_str(String *);
void fix_length_and_dec()
{
- collation.set(default_charset());
- maybe_null=0; max_length=arg_count;
+ maybe_null=0;
+ max_length=arg_count * collation.collation->mbmaxlen;
}
const char *func_name() const { return "char"; }
};
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 0e30bbd8a96..a32b0d1dbbf 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1413,6 +1413,12 @@ void subselect_union_engine::cleanup()
}
+bool subselect_union_engine::is_executed() const
+{
+ return unit->executed;
+}
+
+
void subselect_uniquesubquery_engine::cleanup()
{
DBUG_ENTER("subselect_uniquesubquery_engine::cleanup");
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 5b22930ae1f..f1c99f74498 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -110,6 +110,12 @@ public:
return eng == 0;
}
/*
+ True if this subquery has been already evaluated. Implemented only for
+ single select and union subqueries only.
+ */
+ bool is_evaluated() const;
+
+ /*
Used by max/min subquery to initialize value presence registration
mechanism. Engine call this method before rexecution query.
*/
@@ -317,6 +323,7 @@ public:
virtual void print(String *str)= 0;
virtual bool change_result(Item_subselect *si, select_subselect *result)= 0;
virtual bool no_tables()= 0;
+ virtual bool is_executed() const { return FALSE; }
};
@@ -342,6 +349,7 @@ public:
void print (String *str);
bool change_result(Item_subselect *si, select_subselect *result);
bool no_tables();
+ bool is_executed() const { return executed; }
};
@@ -363,6 +371,7 @@ public:
void print (String *str);
bool change_result(Item_subselect *si, select_subselect *result);
bool no_tables();
+ bool is_executed() const;
};
@@ -411,3 +420,10 @@ public:
int exec();
void print (String *str);
};
+
+
+inline bool Item_subselect::is_evaluated() const
+{
+ return engine->is_executed();
+}
+
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index b56d99cf245..b2eaf39d624 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -3173,6 +3173,10 @@ void Item_func_group_concat::print(String *str)
if (i)
str->append(',');
(*order[i]->item)->print(str);
+ if (order[i]->asc)
+ str->append(" ASC");
+ else
+ str->append(" DESC");
}
}
str->append(" separator \'", 12);
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 7f94c19647e..2b0314bb287 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1610,6 +1610,7 @@ void Item_func_date_format::fix_length_and_dec()
if (args[1]->type() == STRING_ITEM)
{ // Optimize the normal case
fixed_length=1;
+
/*
The result is a binary string (no reason to use collation->mbmaxlen
This is becasue make_date_time() only returns binary strings
@@ -1627,6 +1628,30 @@ void Item_func_date_format::fix_length_and_dec()
}
+bool Item_func_date_format::eq(const Item *item, bool binary_cmp) const
+{
+ Item_func_date_format *item_func;
+ if (item->type() != FUNC_ITEM)
+ return 0;
+ if (func_name() != ((Item_func*) item)->func_name())
+ return 0;
+ if (this == item)
+ return 1;
+ item_func= (Item_func_date_format*) item;
+ if (!args[0]->eq(item_func->args[0], binary_cmp))
+ return 0;
+ /*
+ We must compare format string case sensitive.
+ This needed because format modifiers with different case,
+ for example %m and %M, have different meaning.
+ */
+ if (!args[1]->eq(item_func->args[1], 1))
+ return 0;
+ return 1;
+}
+
+
+
uint Item_func_date_format::format_length(const String *format)
{
uint size=0;
@@ -2479,6 +2504,7 @@ void Item_func_add_time::fix_length_and_dec()
enum_field_types arg0_field_type;
decimals=0;
max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+ maybe_null= 1;
/*
The field type for the result of an Item_func_add_time function is defined
@@ -2723,16 +2749,16 @@ longlong Item_func_timestamp_diff::val_int()
int_type == INTERVAL_QUARTER ||
int_type == INTERVAL_MONTH)
{
- uint year;
- uint year_beg, year_end, month_beg, month_end;
- uint diff_days= (uint) (seconds/86400L);
- uint diff_years= 0;
+ uint year_beg, year_end, month_beg, month_end, day_beg, day_end;
+ uint years= 0;
if (neg == -1)
{
year_beg= ltime2.year;
year_end= ltime1.year;
month_beg= ltime2.month;
month_end= ltime1.month;
+ day_beg= ltime2.day;
+ day_end= ltime1.day;
}
else
{
@@ -2740,53 +2766,32 @@ longlong Item_func_timestamp_diff::val_int()
year_end= ltime2.year;
month_beg= ltime1.month;
month_end= ltime2.month;
- }
- /* calc years*/
- for (year= year_beg;year < year_end; year++)
- {
- uint days=calc_days_in_year(year);
- if (days > diff_days)
- break;
- diff_days-= days;
- diff_years++;
+ day_beg= ltime1.day;
+ day_end= ltime2.day;
}
- /* calc months; Current year is in the 'year' variable */
- month_beg--; /* Change months to be 0-11 for easier calculation */
- month_end--;
+ /* calc years */
+ years= year_end - year_beg;
+ if (month_end < month_beg || (month_end == month_beg && day_end < day_beg))
+ years-= 1;
- months= 12*diff_years;
- while (month_beg != month_end)
- {
- uint m_days= (uint) days_in_month[month_beg];
- if (month_beg == 1)
- {
- /* This is only calculated once so there is no reason to cache it*/
- uint leap= (uint) ((year & 3) == 0 && (year%100 ||
- (year%400 == 0 && year)));
- m_days+= leap;
- }
- if (m_days > diff_days)
- break;
- diff_days-= m_days;
- months++;
- if (month_beg++ == 11) /* if we wrap to next year */
- {
- month_beg= 0;
- year++;
- }
- }
- if (neg == -1)
- months= -months;
+ /* calc months */
+ months= 12*years;
+ if (month_end < month_beg || (month_end == month_beg && day_end < day_beg))
+ months+= 12 - (month_beg - month_end);
+ else
+ months+= (month_end - month_beg);
+ if (day_end < day_beg)
+ months-= 1;
}
switch (int_type) {
case INTERVAL_YEAR:
- return months/12;
+ return months/12*neg;
case INTERVAL_QUARTER:
- return months/3;
+ return months/3*neg;
case INTERVAL_MONTH:
- return months;
+ return months*neg;
case INTERVAL_WEEK:
return seconds/86400L/7L*neg;
case INTERVAL_DAY:
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 8e15acbc1fc..b2352e728c5 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -537,6 +537,7 @@ public:
{ return is_time_format ? "time_format" : "date_format"; }
void fix_length_and_dec();
uint format_length(const String *format);
+ bool eq(const Item *item, bool binary_cmp) const;
};
@@ -844,6 +845,7 @@ public:
{
decimals=0;
max_length=MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+ maybe_null= 1;
}
Field *tmp_table_field(TABLE *t_arg)
{
diff --git a/sql/log.cc b/sql/log.cc
index 0ab3e6f94ed..3341b0265eb 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -357,9 +357,10 @@ static int find_uniq_filename(char *name)
MYSQL_LOG::MYSQL_LOG()
:bytes_written(0), last_time(0), query_start(0), name(0),
- file_id(1), open_count(1), log_type(LOG_CLOSED), write_error(0), inited(0),
- need_start_event(1), prepared_xids(0), description_event_for_exec(0),
- description_event_for_queue(0)
+ prepared_xids(0), log_type(LOG_CLOSED), file_id(1), open_count(1),
+ readers_count(0), reset_pending(FALSE), write_error(FALSE), inited(FALSE),
+ need_start_event(TRUE),
+ description_event_for_exec(0), description_event_for_queue(0)
{
/*
We don't want to initialize LOCK_Log here as such initialization depends on
@@ -385,7 +386,9 @@ void MYSQL_LOG::cleanup()
delete description_event_for_exec;
(void) pthread_mutex_destroy(&LOCK_log);
(void) pthread_mutex_destroy(&LOCK_index);
+ (void) pthread_mutex_destroy(&LOCK_readers);
(void) pthread_cond_destroy(&update_cond);
+ (void) pthread_cond_destroy(&reset_cond);
}
DBUG_VOID_RETURN;
}
@@ -430,7 +433,9 @@ void MYSQL_LOG::init_pthread_objects()
inited= 1;
(void) pthread_mutex_init(&LOCK_log,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_index, MY_MUTEX_INIT_SLOW);
+ (void) pthread_mutex_init(&LOCK_readers, MY_MUTEX_INIT_SLOW);
(void) pthread_cond_init(&update_cond, 0);
+ (void) pthread_cond_init(&reset_cond, 0);
}
const char *MYSQL_LOG::generate_name(const char *log_name,
@@ -933,6 +938,13 @@ bool MYSQL_LOG::reset_logs(THD* thd)
*/
pthread_mutex_lock(&LOCK_log);
pthread_mutex_lock(&LOCK_index);
+
+ /*
+ we need one more lock to block attempts to open a log while
+ we are waiting untill all log files will be closed
+ */
+ pthread_mutex_lock(&LOCK_readers);
+
/*
The following mutex is needed to ensure that no threads call
'delete thd' as we would then risk missing a 'rollback' from this
@@ -955,6 +967,19 @@ bool MYSQL_LOG::reset_logs(THD* thd)
goto err;
}
+ reset_pending= TRUE;
+ /*
+ send update signal just in case so that all reader threads waiting
+ for log update will leave wait condition
+ */
+ signal_update();
+ /*
+ if there are active readers wait until all of them will
+ release opened files
+ */
+ while (readers_count)
+ pthread_cond_wait(&reset_cond, &LOCK_log);
+
for (;;)
{
my_delete(linfo.log_file_name, MYF(MY_WME));
@@ -973,7 +998,10 @@ bool MYSQL_LOG::reset_logs(THD* thd)
my_free((gptr) save_name, MYF(0));
err:
+ reset_pending= FALSE;
+
(void) pthread_mutex_unlock(&LOCK_thread_count);
+ pthread_mutex_unlock(&LOCK_readers);
pthread_mutex_unlock(&LOCK_index);
pthread_mutex_unlock(&LOCK_log);
DBUG_RETURN(error);
@@ -1354,7 +1382,8 @@ void MYSQL_LOG::new_file(bool need_lock)
to change base names at some point.
*/
THD *thd = current_thd; /* may be 0 if we are reacting to SIGHUP */
- Rotate_log_event r(thd,new_name+dirname_length(new_name));
+ Rotate_log_event r(thd,new_name+dirname_length(new_name),
+ 0, LOG_EVENT_OFFSET, 0);
r.write(&log_file);
bytes_written += r.data_written;
}
@@ -1433,7 +1462,7 @@ bool MYSQL_LOG::appendv(const char* buf, uint len,...)
DBUG_ASSERT(log_file.type == SEQ_READ_APPEND);
- pthread_mutex_lock(&LOCK_log);
+ safe_mutex_assert_owner(&LOCK_log);
do
{
if (my_b_append(&log_file,(byte*) buf,len))
@@ -1448,7 +1477,6 @@ bool MYSQL_LOG::appendv(const char* buf, uint len,...)
new_file(0);
err:
- pthread_mutex_unlock(&LOCK_log);
if (!error)
signal_update();
DBUG_RETURN(error);
@@ -2047,6 +2075,13 @@ void MYSQL_LOG::wait_for_update(THD* thd, bool is_slave)
{
const char *old_msg;
DBUG_ENTER("wait_for_update");
+
+ if (reset_pending)
+ {
+ pthread_mutex_unlock(&LOCK_log);
+ DBUG_VOID_RETURN;
+ }
+
old_msg= thd->enter_cond(&update_cond, &LOCK_log,
is_slave ?
"Has read all relay log; waiting for the slave I/O "
@@ -2297,6 +2332,32 @@ void MYSQL_LOG::signal_update()
DBUG_VOID_RETURN;
}
+void MYSQL_LOG::readers_addref()
+{
+ /*
+ There is no necessity for reference counting on *nix, since it allows to
+ delete opened files, however it is more clean way to wait
+ untill all files will be closed on *nix as well.
+ */
+ DBUG_ENTER("MYSQL_LOG::reader_addref");
+ pthread_mutex_lock(&LOCK_log);
+ pthread_mutex_lock(&LOCK_readers);
+ readers_count++;
+ pthread_mutex_unlock(&LOCK_readers);
+ pthread_mutex_unlock(&LOCK_log);
+ DBUG_VOID_RETURN;
+}
+
+void MYSQL_LOG::readers_release()
+{
+ DBUG_ENTER("MYSQL_LOG::reader_release");
+ pthread_mutex_lock(&LOCK_log);
+ readers_count--;
+ if (!readers_count)
+ pthread_cond_broadcast(&reset_cond);
+ pthread_mutex_unlock(&LOCK_log);
+ DBUG_VOID_RETURN;
+}
#ifdef __NT__
void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 7ee505939f0..081b498f01e 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -122,8 +122,9 @@ static char *pretty_print_str(char *packet, char *str, int len)
static inline char* slave_load_file_stem(char*buf, uint file_id,
int event_server_id)
{
- fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "",
- MY_UNPACK_FILENAME | MY_UNIX_PATH);
+ fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "", MY_UNPACK_FILENAME);
+ to_unix_path(buf);
+
buf = strend(buf);
buf = int10_to_str(::server_id, buf, 10);
*buf++ = '-';
@@ -212,24 +213,18 @@ static inline int read_str(char **buf, char *buf_end, char **str,
/*
Transforms a string into "" or its expression in 0x... form.
*/
+
char *str_to_hex(char *to, const char *from, uint len)
{
- char *p= to;
if (len)
{
- p= strmov(p, "0x");
- for (uint i= 0; i < len; i++, p+= 2)
- {
- /* val[i] is char. Casting to uchar helps greatly if val[i] < 0 */
- uint tmp= (uint) (uchar) from[i];
- p[0]= _dig_vec_upper[tmp >> 4];
- p[1]= _dig_vec_upper[tmp & 15];
- }
- *p= 0;
+ *to++= '0';
+ *to++= 'x';
+ to= octet2hex(to, from, len);
}
else
- p= strmov(p, "\"\"");
- return p; // pointer to end 0 of 'to'
+ to= strmov(to, "\"\"");
+ return to; // pointer to end 0 of 'to'
}
/*
@@ -702,7 +697,6 @@ failed my_b_read"));
*/
DBUG_RETURN(0);
}
-
uint data_len = uint4korr(head + EVENT_LEN_OFFSET);
char *buf= 0;
const char *error= 0;
@@ -882,15 +876,76 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
Log_event::print_header()
*/
-void Log_event::print_header(FILE* file)
+void Log_event::print_header(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
char llbuff[22];
+ my_off_t hexdump_from= print_event_info->hexdump_from;
+
fputc('#', file);
print_timestamp(file);
fprintf(file, " server id %d end_log_pos %s ", server_id,
- llstr(log_pos,llbuff));
+ llstr(log_pos,llbuff));
+
+ /* mysqlbinlog --hexdump */
+ if (print_event_info->hexdump_from)
+ {
+ fprintf(file, "\n");
+ uchar *ptr= (uchar*)temp_buf;
+ my_off_t size=
+ uint4korr(ptr + EVENT_LEN_OFFSET) - LOG_EVENT_MINIMAL_HEADER_LEN;
+ my_off_t i;
+
+ /* Header len * 4 >= header len * (2 chars + space + extra space) */
+ char *h, hex_string[LOG_EVENT_MINIMAL_HEADER_LEN*4]= {0};
+ char *c, char_string[16+1]= {0};
+
+ /* Pretty-print event common header if header is exactly 19 bytes */
+ if (print_event_info->common_header_len == LOG_EVENT_MINIMAL_HEADER_LEN)
+ {
+ fprintf(file, "# Position Timestamp Type Master ID "
+ "Size Master Pos Flags \n");
+ fprintf(file, "# %8.8lx %02x %02x %02x %02x %02x "
+ "%02x %02x %02x %02x %02x %02x %02x %02x "
+ "%02x %02x %02x %02x %02x %02x\n",
+ hexdump_from, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4],
+ ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], ptr[10], ptr[11],
+ ptr[12], ptr[13], ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]);
+ ptr += LOG_EVENT_MINIMAL_HEADER_LEN;
+ hexdump_from += LOG_EVENT_MINIMAL_HEADER_LEN;
+ }
+
+ /* Rest of event (without common header) */
+ for (i= 0, c= char_string, h=hex_string;
+ i < size;
+ i++, ptr++)
+ {
+ my_snprintf(h, 4, "%02x ", *ptr);
+ h += 3;
+
+ *c++= my_isalnum(&my_charset_bin, *ptr) ? *ptr : '.';
+
+ if (i % 16 == 15)
+ {
+ fprintf(file, "# %8.8lx %-48.48s |%16s|\n",
+ hexdump_from + (i & 0xfffffff0), hex_string, char_string);
+ hex_string[0]= 0;
+ char_string[0]= 0;
+ c= char_string;
+ h= hex_string;
+ }
+ else if (i % 8 == 7) *h++ = ' ';
+ }
+ *c= '\0';
+
+ /* Non-full last line */
+ if (hex_string[0]) {
+ printf("# %8.8lx %-48.48s |%s|\n# ",
+ hexdump_from + (i & 0xfffffff0), hex_string, char_string);
+ }
+ }
}
+
/*
Log_event::print_timestamp()
*/
@@ -1166,7 +1221,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
But it's likely that we don't want to use 32 bits for 3 bits; in the future
we will probably want to reclaim the 29 bits. So we need the &.
*/
- flags2= thd_arg->options & OPTIONS_WRITTEN_TO_BIN_LOG;
+ flags2= (uint32) (thd_arg->options & OPTIONS_WRITTEN_TO_BIN_LOG);
DBUG_ASSERT(thd->variables.character_set_client->number < 256*256);
DBUG_ASSERT(thd->variables.collation_connection->number < 256*256);
DBUG_ASSERT(thd->variables.collation_server->number < 256*256);
@@ -1373,25 +1428,25 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
*/
#ifdef MYSQL_CLIENT
-void Query_log_event::print_query_header(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Query_log_event::print_query_header(FILE* file,
+ PRINT_EVENT_INFO* print_event_info)
{
// TODO: print the catalog ??
char buff[40],*end; // Enough for SET TIMESTAMP
bool different_db= 1;
uint32 tmp;
- if (!short_form)
+ if (!print_event_info->short_form)
{
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\t%s\tthread_id=%lu\texec_time=%lu\terror_code=%d\n",
get_type_str(), (ulong) thread_id, (ulong) exec_time, error_code);
}
if (!(flags & LOG_EVENT_SUPPRESS_USE_F) && db)
{
- if (different_db= memcmp(last_event_info->db, db, db_len + 1))
- memcpy(last_event_info->db, db, db_len + 1);
+ if (different_db= memcmp(print_event_info->db, db, db_len + 1))
+ memcpy(print_event_info->db, db, db_len + 1);
if (db[0] && different_db)
fprintf(file, "use %s;\n", db);
}
@@ -1411,12 +1466,12 @@ void Query_log_event::print_query_header(FILE* file, bool short_form,
if (likely(flags2_inited)) /* likely as this will mainly read 5.0 logs */
{
/* tmp is a bitmask of bits which have changed. */
- if (likely(last_event_info->flags2_inited))
+ if (likely(print_event_info->flags2_inited))
/* All bits which have changed */
- tmp= (last_event_info->flags2) ^ flags2;
+ tmp= (print_event_info->flags2) ^ flags2;
else /* that's the first Query event we read */
{
- last_event_info->flags2_inited= 1;
+ print_event_info->flags2_inited= 1;
tmp= ~((uint32)0); /* all bits have changed */
}
@@ -1431,7 +1486,7 @@ void Query_log_event::print_query_header(FILE* file, bool short_form,
print_set_option(file, tmp, OPTION_RELAXED_UNIQUE_CHECKS, ~flags2,
"@@session.unique_checks", &need_comma);
fprintf(file,";\n");
- last_event_info->flags2= flags2;
+ print_event_info->flags2= flags2;
}
}
@@ -1450,37 +1505,37 @@ void Query_log_event::print_query_header(FILE* file, bool short_form,
if (likely(sql_mode_inited))
{
- if (unlikely(!last_event_info->sql_mode_inited)) /* first Query event */
+ if (unlikely(!print_event_info->sql_mode_inited)) /* first Query event */
{
- last_event_info->sql_mode_inited= 1;
+ print_event_info->sql_mode_inited= 1;
/* force a difference to force write */
- last_event_info->sql_mode= ~sql_mode;
+ print_event_info->sql_mode= ~sql_mode;
}
- if (unlikely(last_event_info->sql_mode != sql_mode))
+ if (unlikely(print_event_info->sql_mode != sql_mode))
{
fprintf(file,"SET @@session.sql_mode=%lu;\n",(ulong)sql_mode);
- last_event_info->sql_mode= sql_mode;
+ print_event_info->sql_mode= sql_mode;
}
}
- if (last_event_info->auto_increment_increment != auto_increment_increment ||
- last_event_info->auto_increment_offset != auto_increment_offset)
+ if (print_event_info->auto_increment_increment != auto_increment_increment ||
+ print_event_info->auto_increment_offset != auto_increment_offset)
{
fprintf(file,"SET @@session.auto_increment_increment=%lu, @@session.auto_increment_offset=%lu;\n",
auto_increment_increment,auto_increment_offset);
- last_event_info->auto_increment_increment= auto_increment_increment;
- last_event_info->auto_increment_offset= auto_increment_offset;
+ print_event_info->auto_increment_increment= auto_increment_increment;
+ print_event_info->auto_increment_offset= auto_increment_offset;
}
/* TODO: print the catalog when we feature SET CATALOG */
if (likely(charset_inited))
{
- if (unlikely(!last_event_info->charset_inited)) /* first Query event */
+ if (unlikely(!print_event_info->charset_inited)) /* first Query event */
{
- last_event_info->charset_inited= 1;
- last_event_info->charset[0]= ~charset[0]; // force a difference to force write
+ print_event_info->charset_inited= 1;
+ print_event_info->charset[0]= ~charset[0]; // force a difference to force write
}
- if (unlikely(bcmp(last_event_info->charset, charset, 6)))
+ if (unlikely(bcmp(print_event_info->charset, charset, 6)))
{
fprintf(file,"SET "
"@@session.character_set_client=%d,"
@@ -1490,24 +1545,23 @@ void Query_log_event::print_query_header(FILE* file, bool short_form,
uint2korr(charset),
uint2korr(charset+2),
uint2korr(charset+4));
- memcpy(last_event_info->charset, charset, 6);
+ memcpy(print_event_info->charset, charset, 6);
}
}
if (time_zone_len)
{
- if (bcmp(last_event_info->time_zone_str, time_zone_str, time_zone_len+1))
+ if (bcmp(print_event_info->time_zone_str, time_zone_str, time_zone_len+1))
{
fprintf(file,"SET @@session.time_zone='%s';\n", time_zone_str);
- memcpy(last_event_info->time_zone_str, time_zone_str, time_zone_len+1);
+ memcpy(print_event_info->time_zone_str, time_zone_str, time_zone_len+1);
}
}
}
-void Query_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- print_query_header(file, short_form, last_event_info);
+ print_query_header(file, print_event_info);
my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME));
fputs(";\n", file);
}
@@ -1805,11 +1859,11 @@ void Start_log_event_v3::pack_info(Protocol *protocol)
*/
#ifdef MYSQL_CLIENT
-void Start_log_event_v3::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- if (!short_form)
+ if (!print_event_info->short_form)
{
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tStart: binlog v %d, server v %s created ", binlog_version,
server_version);
print_timestamp(file);
@@ -2533,19 +2587,19 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len,
*/
#ifdef MYSQL_CLIENT
-void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Load_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- print(file, short_form, last_event_info, 0);
+ print(file, print_event_info, 0);
}
-void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info,
+void Load_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info,
bool commented)
{
DBUG_ENTER("Load_log_event::print");
- if (!short_form)
+ if (!print_event_info->short_form)
{
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tQuery\tthread_id=%ld\texec_time=%ld\n",
thread_id, exec_time);
}
@@ -2559,9 +2613,9 @@ void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_ev
But if commented, the "use" is going to be commented so we should not
update the last_db.
*/
- if ((different_db= memcmp(last_event_info->db, db, db_len + 1)) &&
+ if ((different_db= memcmp(print_event_info->db, db, db_len + 1)) &&
!commented)
- memcpy(last_event_info->db, db, db_len + 1);
+ memcpy(print_event_info->db, db, db_len + 1);
}
if (db && db[0] && different_db)
@@ -2950,13 +3004,13 @@ void Rotate_log_event::pack_info(Protocol *protocol)
*/
#ifdef MYSQL_CLIENT
-void Rotate_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Rotate_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
char buf[22];
- if (short_form)
+ if (print_event_info->short_form)
return;
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tRotate to ");
if (new_log_ident)
my_fwrite(file, (byte*) new_log_ident, (uint)ident_len,
@@ -2968,13 +3022,38 @@ void Rotate_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_
#endif /* MYSQL_CLIENT */
+
/*
- Rotate_log_event::Rotate_log_event()
+ Rotate_log_event::Rotate_log_event() (2 constructors)
*/
+
+#ifndef MYSQL_CLIENT
+Rotate_log_event::Rotate_log_event(THD* thd_arg,
+ const char* new_log_ident_arg,
+ uint ident_len_arg, ulonglong pos_arg,
+ uint flags_arg)
+ :Log_event(), new_log_ident(new_log_ident_arg),
+ pos(pos_arg),ident_len(ident_len_arg ? ident_len_arg :
+ (uint) strlen(new_log_ident_arg)), flags(flags_arg)
+{
+#ifndef DBUG_OFF
+ char buff[22];
+ DBUG_ENTER("Rotate_log_event::Rotate_log_event(THD*,...)");
+ DBUG_PRINT("enter",("new_log_ident %s pos %s flags %lu", new_log_ident_arg,
+ llstr(pos_arg, buff), flags));
+#endif
+ if (flags & DUP_NAME)
+ new_log_ident= my_strdup_with_length((const byte*) new_log_ident_arg,
+ ident_len, MYF(MY_WME));
+ DBUG_VOID_RETURN;
+}
+#endif
+
+
Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event)
- :Log_event(buf, description_event) ,new_log_ident(NULL),alloced(0)
+ :Log_event(buf, description_event) ,new_log_ident(0), flags(DUP_NAME)
{
DBUG_ENTER("Rotate_log_event::Rotate_log_event(char*,...)");
// The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET
@@ -2989,12 +3068,9 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
(header_size+post_header_len));
ident_offset = post_header_len;
set_if_smaller(ident_len,FN_REFLEN-1);
- if (!(new_log_ident= my_strdup_with_length((byte*) buf +
- ident_offset,
- (uint) ident_len,
- MYF(MY_WME))))
- DBUG_VOID_RETURN;
- alloced = 1;
+ new_log_ident= my_strdup_with_length((byte*) buf + ident_offset,
+ (uint) ident_len,
+ MYF(MY_WME));
DBUG_VOID_RETURN;
}
@@ -3152,16 +3228,15 @@ bool Intvar_log_event::write(IO_CACHE* file)
*/
#ifdef MYSQL_CLIENT
-void Intvar_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
char llbuff[22];
const char *msg;
LINT_INIT(msg);
- if (!short_form)
+ if (!print_event_info->short_form)
{
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tIntvar\n");
}
@@ -3242,12 +3317,12 @@ bool Rand_log_event::write(IO_CACHE* file)
#ifdef MYSQL_CLIENT
-void Rand_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
char llbuff[22],llbuff2[22];
- if (!short_form)
+ if (!print_event_info->short_form)
{
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tRand\n");
}
fprintf(file, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s;\n",
@@ -3312,14 +3387,14 @@ bool Xid_log_event::write(IO_CACHE* file)
#ifdef MYSQL_CLIENT
-void Xid_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- if (!short_form)
+ if (!print_event_info->short_form)
{
char buf[64];
longlong10_to_str(xid, buf, 10);
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tXid = %s\n", buf);
fflush(file);
}
@@ -3510,11 +3585,11 @@ bool User_var_log_event::write(IO_CACHE* file)
*/
#ifdef MYSQL_CLIENT
-void User_var_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- if (!short_form)
+ if (!print_event_info->short_form)
{
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tUser_var\n");
}
@@ -3685,11 +3760,11 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
#ifdef HAVE_REPLICATION
#ifdef MYSQL_CLIENT
-void Unknown_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Unknown_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- if (short_form)
+ if (print_event_info->short_form)
return;
- print_header(file);
+ print_header(file, print_event_info);
fputc('\n', file);
fprintf(file, "# %s", "Unknown event\n");
}
@@ -3756,12 +3831,12 @@ Slave_log_event::~Slave_log_event()
#ifdef MYSQL_CLIENT
-void Slave_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Slave_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
char llbuff[22];
- if (short_form)
+ if (print_event_info->short_form)
return;
- print_header(file);
+ print_header(file, print_event_info);
fputc('\n', file);
fprintf(file, "\
Slave: master_host: '%s' master_port: %d master_log: '%s' master_pos: %s\n",
@@ -3841,12 +3916,12 @@ int Slave_log_event::exec_event(struct st_relay_log_info* rli)
*/
#ifdef MYSQL_CLIENT
-void Stop_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info)
+void Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- if (short_form)
+ if (print_event_info->short_form)
return;
- print_header(file);
+ print_header(file, print_event_info);
fprintf(file, "\tStop\n");
fflush(file);
}
@@ -4020,19 +4095,20 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len,
*/
#ifdef MYSQL_CLIENT
-void Create_file_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info, bool enable_local)
+void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+ bool enable_local)
{
- if (short_form)
+ if (print_event_info->short_form)
{
if (enable_local && check_fname_outside_temp_buf())
- Load_log_event::print(file, 1, last_event_info);
+ Load_log_event::print(file, print_event_info);
return;
}
if (enable_local)
{
- Load_log_event::print(file, short_form, last_event_info, !check_fname_outside_temp_buf());
+ Load_log_event::print(file, print_event_info,
+ !check_fname_outside_temp_buf());
/*
That one is for "file_id: etc" below: in mysqlbinlog we want the #, in
SHOW BINLOG EVENTS we don't.
@@ -4044,10 +4120,9 @@ void Create_file_log_event::print(FILE* file, bool short_form,
}
-void Create_file_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- print(file,short_form,last_event_info,0);
+ print(file, print_event_info, 0);
}
#endif /* MYSQL_CLIENT */
@@ -4207,12 +4282,12 @@ bool Append_block_log_event::write(IO_CACHE* file)
*/
#ifdef MYSQL_CLIENT
-void Append_block_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Append_block_log_event::print(FILE* file,
+ PRINT_EVENT_INFO* print_event_info)
{
- if (short_form)
+ if (print_event_info->short_form)
return;
- print_header(file);
+ print_header(file, print_event_info);
fputc('\n', file);
fprintf(file, "#%s: file_id: %d block_len: %d\n",
get_type_str(), file_id, block_len);
@@ -4351,12 +4426,12 @@ bool Delete_file_log_event::write(IO_CACHE* file)
*/
#ifdef MYSQL_CLIENT
-void Delete_file_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Delete_file_log_event::print(FILE* file,
+ PRINT_EVENT_INFO* print_event_info)
{
- if (short_form)
+ if (print_event_info->short_form)
return;
- print_header(file);
+ print_header(file, print_event_info);
fputc('\n', file);
fprintf(file, "#Delete_file: file_id=%u\n", file_id);
}
@@ -4447,12 +4522,12 @@ bool Execute_load_log_event::write(IO_CACHE* file)
*/
#ifdef MYSQL_CLIENT
-void Execute_load_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Execute_load_log_event::print(FILE* file,
+ PRINT_EVENT_INFO* print_event_info)
{
- if (short_form)
+ if (print_event_info->short_form)
return;
- print_header(file);
+ print_header(file, print_event_info);
fputc('\n', file);
fprintf(file, "#Exec_load: file_id=%d\n",
file_id);
@@ -4659,18 +4734,18 @@ Execute_load_query_log_event::write_post_header_for_derived(IO_CACHE* file)
#ifdef MYSQL_CLIENT
-void Execute_load_query_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info)
+void Execute_load_query_log_event::print(FILE* file,
+ PRINT_EVENT_INFO* print_event_info)
{
- print(file, short_form, last_event_info, 0);
+ print(file, print_event_info, 0);
}
-void Execute_load_query_log_event::print(FILE* file, bool short_form,
- LAST_EVENT_INFO* last_event_info,
+void Execute_load_query_log_event::print(FILE* file,
+ PRINT_EVENT_INFO* print_event_info,
const char *local_fname)
{
- print_query_header(file, short_form, last_event_info);
+ print_query_header(file, print_event_info);
if (local_fname)
{
@@ -4691,7 +4766,7 @@ void Execute_load_query_log_event::print(FILE* file, bool short_form,
fprintf(file, ";\n");
}
- if (!short_form)
+ if (!print_event_info->short_form)
fprintf(file, "# file_id: %d \n", file_id);
}
#endif
diff --git a/sql/log_event.h b/sql/log_event.h
index 29580589a34..7783a97f03f 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -403,24 +403,34 @@ enum Log_event_type
Every time you update this enum (when you add a type), you have to
fix Format_description_log_event::Format_description_log_event().
*/
- UNKNOWN_EVENT= 0, START_EVENT_V3, QUERY_EVENT, STOP_EVENT, ROTATE_EVENT,
- INTVAR_EVENT, LOAD_EVENT, SLAVE_EVENT, CREATE_FILE_EVENT,
- APPEND_BLOCK_EVENT, EXEC_LOAD_EVENT, DELETE_FILE_EVENT,
+ UNKNOWN_EVENT= 0,
+ START_EVENT_V3= 1,
+ QUERY_EVENT= 2,
+ STOP_EVENT= 3,
+ ROTATE_EVENT= 4,
+ 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,
/*
NEW_LOAD_EVENT is like LOAD_EVENT except that it has a longer
sql_ex, allowing multibyte TERMINATED BY etc; both types share the
same class (Load_log_event)
*/
- NEW_LOAD_EVENT,
- RAND_EVENT, USER_VAR_EVENT,
- FORMAT_DESCRIPTION_EVENT,
- XID_EVENT,
- BEGIN_LOAD_QUERY_EVENT,
- EXECUTE_LOAD_QUERY_EVENT,
+ NEW_LOAD_EVENT= 12,
+ RAND_EVENT= 13,
+ USER_VAR_EVENT= 14,
+ FORMAT_DESCRIPTION_EVENT= 15,
+ XID_EVENT= 16,
+ BEGIN_LOAD_QUERY_EVENT= 17,
+ EXECUTE_LOAD_QUERY_EVENT= 18,
/*
- add new events here - right above this comment!
- existing events should never change their numbers
+ Add new events here - right above this comment!
+ Existing events (except ENUM_END_EVENT) should never change their numbers
*/
ENUM_END_EVENT /* end marker */
@@ -451,12 +461,23 @@ struct st_relay_log_info;
#ifdef MYSQL_CLIENT
/*
- A structure for mysqlbinlog to remember the last db, flags2, sql_mode etc; it
- is passed to events' print() methods, so that they print only the necessary
- USE and SET commands.
+ A structure for mysqlbinlog to know how to print events
+
+ This structure is passed to the event's print() methods,
+
+ There are two types of settings stored here:
+ 1. Last db, flags2, sql_mode etc comes from the last printed event.
+ They are stored so that only the necessary USE and SET commands
+ are printed.
+ 2. Other information on how to print the events, e.g. short_form,
+ hexdump_from. These are not dependent on the last event.
*/
-typedef struct st_last_event_info
+typedef struct st_print_event_info
{
+ /*
+ Settings for database, sql_mode etc that comes from the last event
+ that was printed.
+ */
// TODO: have the last catalog here ??
char db[FN_REFLEN+1]; // TODO: make this a LEX_STRING when thd->db is
bool flags2_inited;
@@ -467,12 +488,12 @@ typedef struct st_last_event_info
bool charset_inited;
char charset[6]; // 3 variables, each of them storable in 2 bytes
char time_zone_str[MAX_TIME_ZONE_NAME_LENGTH];
- st_last_event_info()
+ st_print_event_info()
:flags2_inited(0), sql_mode_inited(0),
auto_increment_increment(1),auto_increment_offset(1), charset_inited(0)
{
/*
- Currently we only use static LAST_EVENT_INFO objects, so zeroed at
+ Currently we only use static PRINT_EVENT_INFO objects, so zeroed at
program's startup, but these explicit bzero() is for the day someone
creates dynamic instances.
*/
@@ -480,7 +501,13 @@ typedef struct st_last_event_info
bzero(charset, sizeof(charset));
bzero(time_zone_str, sizeof(time_zone_str));
}
-} LAST_EVENT_INFO;
+
+ /* Settings on how to print the events */
+ bool short_form;
+ my_off_t hexdump_from;
+ uint8 common_header_len;
+
+} PRINT_EVENT_INFO;
#endif
@@ -589,9 +616,9 @@ public:
static Log_event* read_log_event(IO_CACHE* file,
const Format_description_log_event *description_event);
/* print*() functions are used by mysqlbinlog */
- virtual void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0) = 0;
+ virtual void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0) = 0;
void print_timestamp(FILE* file, time_t *ts = 0);
- void print_header(FILE* file);
+ void print_header(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
static void *operator new(size_t size)
@@ -751,8 +778,8 @@ public:
uint32 q_len_arg);
#endif /* HAVE_REPLICATION */
#else
- void print_query_header(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print_query_header(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Query_log_event(const char* buf, uint event_len,
@@ -806,7 +833,7 @@ public:
void pack_info(Protocol* protocol);
int exec_event(struct st_relay_log_info* rli);
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Slave_log_event(const char* buf, uint event_len);
@@ -894,8 +921,8 @@ public:
bool use_rli_only_for_errors);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info = 0);
- void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool commented);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info = 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool commented);
#endif
/*
@@ -984,7 +1011,7 @@ public:
#endif /* HAVE_REPLICATION */
#else
Start_log_event_v3() {}
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Start_log_event_v3(const char* buf,
@@ -1079,7 +1106,7 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Intvar_log_event(const char* buf, const Format_description_log_event* description_event);
@@ -1120,7 +1147,7 @@ class Rand_log_event: public Log_event
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Rand_log_event(const char* buf, const Format_description_log_event* description_event);
@@ -1157,7 +1184,7 @@ class Xid_log_event: public Log_event
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Xid_log_event(const char* buf, const Format_description_log_event* description_event);
@@ -1199,7 +1226,7 @@ public:
void pack_info(Protocol* protocol);
int exec_event(struct st_relay_log_info* rli);
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
User_var_log_event(const char* buf, const Format_description_log_event* description_event);
@@ -1225,7 +1252,7 @@ public:
{}
int exec_event(struct st_relay_log_info* rli);
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Stop_log_event(const char* buf, const Format_description_log_event* description_event):
@@ -1247,32 +1274,31 @@ public:
class Rotate_log_event: public Log_event
{
public:
+ enum {
+ DUP_NAME= 2 // if constructor should dup the string argument
+ };
const char* new_log_ident;
ulonglong pos;
uint ident_len;
- bool alloced;
+ uint flags;
#ifndef MYSQL_CLIENT
Rotate_log_event(THD* thd_arg, const char* new_log_ident_arg,
- uint ident_len_arg = 0,
- ulonglong pos_arg = LOG_EVENT_OFFSET)
- :Log_event(), new_log_ident(new_log_ident_arg),
- pos(pos_arg),ident_len(ident_len_arg ? ident_len_arg :
- (uint) strlen(new_log_ident_arg)), alloced(0)
- {}
+ uint ident_len_arg,
+ ulonglong pos_arg, uint flags);
#ifdef HAVE_REPLICATION
void pack_info(Protocol* protocol);
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Rotate_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event);
~Rotate_log_event()
{
- if (alloced)
- my_free((gptr) new_log_ident, MYF(0));
+ if (flags & DUP_NAME)
+ my_free((gptr) new_log_ident, MYF(MY_ALLOW_ZERO_PTR));
}
Log_event_type get_type_code() { return ROTATE_EVENT;}
int get_data_size() { return ident_len + ROTATE_HEADER_LEN;}
@@ -1317,8 +1343,8 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
- void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool enable_local);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
#endif
Create_file_log_event(const char* buf, uint event_len,
@@ -1385,7 +1411,7 @@ public:
virtual int get_create_or_append() const;
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Append_block_log_event(const char* buf, uint event_len,
@@ -1420,8 +1446,8 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
- void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool enable_local);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
#endif
Delete_file_log_event(const char* buf, uint event_len,
@@ -1456,7 +1482,7 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
#endif
Execute_load_log_event(const char* buf, uint event_len,
@@ -1541,11 +1567,10 @@ public:
int exec_event(struct st_relay_log_info* rli);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, bool short_form = 0,
- LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
/* Prints the query as LOAD DATA LOCAL and with rewritten filename */
- void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info,
- const char *local_fname);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+ const char *local_fname);
#endif
Execute_load_query_log_event(const char* buf, uint event_len,
const Format_description_log_event *description_event);
@@ -1574,7 +1599,7 @@ public:
Log_event(buf, description_event)
{}
~Unknown_log_event() {}
- void print(FILE* file, bool short_form= 0, LAST_EVENT_INFO* last_event_info= 0);
+ void print(FILE* file, PRINT_EVENT_INFO* print_event_info= 0);
Log_event_type get_type_code() { return UNKNOWN_EVENT;}
bool is_valid() const { return 1; }
};
diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc
index f188d27ff78..1bd16940b47 100644
--- a/sql/my_decimal.cc
+++ b/sql/my_decimal.cc
@@ -185,7 +185,7 @@ int str2my_decimal(uint mask, const char *from, uint length,
}
}
}
- check_result(mask, err);
+ check_result_and_overflow(mask, err, decimal_value);
return err;
}
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index b65e6aedaa2..b02abacf0a3 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -126,6 +126,19 @@ inline int decimal_operation_results(int result)
}
#endif /*MYSQL_CLIENT*/
+inline
+void max_my_decimal(my_decimal *to, int precision, int frac)
+{
+ DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&&
+ (frac <= DECIMAL_MAX_SCALE));
+ max_decimal(precision, frac, (decimal_t*) to);
+}
+
+inline void max_internal_decimal(my_decimal *to)
+{
+ max_my_decimal(to, DECIMAL_MAX_PRECISION, 0);
+}
+
inline int check_result(uint mask, int result)
{
if (result & mask)
@@ -133,6 +146,18 @@ inline int check_result(uint mask, int result)
return result;
}
+inline int check_result_and_overflow(uint mask, int result, my_decimal *val)
+{
+ if (check_result(mask, result) & E_DEC_OVERFLOW)
+ {
+ bool sign= val->sign();
+ val->fix_buffer_pointer();
+ max_internal_decimal(val);
+ val->sign(sign);
+ }
+ return result;
+}
+
inline uint my_decimal_length_to_precision(uint length, uint scale,
bool unsigned_flag)
{
@@ -256,7 +281,8 @@ int my_decimal2double(uint mask, const my_decimal *d, double *result)
inline
int str2my_decimal(uint mask, const char *str, my_decimal *d, char **end)
{
- return check_result(mask, string2decimal(str, (decimal_t*) d, end));
+ return check_result_and_overflow(mask, string2decimal(str,(decimal_t*)d,end),
+ d);
}
@@ -274,7 +300,7 @@ int string2my_decimal(uint mask, const String *str, my_decimal *d)
inline
int double2my_decimal(uint mask, double val, my_decimal *d)
{
- return check_result(mask, double2decimal(val, (decimal_t*) d));
+ return check_result_and_overflow(mask, double2decimal(val, (decimal_t*)d), d);
}
@@ -303,7 +329,9 @@ inline
int my_decimal_add(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
- return check_result(mask, decimal_add((decimal_t*) a, (decimal_t*) b, res));
+ return check_result_and_overflow(mask,
+ decimal_add((decimal_t*)a,(decimal_t*)b,res),
+ res);
}
@@ -311,7 +339,9 @@ inline
int my_decimal_sub(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
- return check_result(mask, decimal_sub((decimal_t*) a, (decimal_t*) b, res));
+ return check_result_and_overflow(mask,
+ decimal_sub((decimal_t*)a,(decimal_t*)b,res),
+ res);
}
@@ -319,7 +349,9 @@ inline
int my_decimal_mul(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
- return check_result(mask, decimal_mul((decimal_t*) a, (decimal_t*) b, res));
+ return check_result_and_overflow(mask,
+ decimal_mul((decimal_t*)a,(decimal_t*)b,res),
+ res);
}
@@ -327,8 +359,10 @@ inline
int my_decimal_div(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b, int div_scale_inc)
{
- return check_result(mask, decimal_div((decimal_t*) a, (decimal_t*) b, res,
- div_scale_inc));
+ return check_result_and_overflow(mask,
+ decimal_div((decimal_t*)a,(decimal_t*)b,res,
+ div_scale_inc),
+ res);
}
@@ -336,7 +370,9 @@ inline
int my_decimal_mod(uint mask, my_decimal *res, const my_decimal *a,
const my_decimal *b)
{
- return check_result(mask, decimal_mod((decimal_t*) a, (decimal_t*) b, res));
+ return check_result_and_overflow(mask,
+ decimal_mod((decimal_t*)a,(decimal_t*)b,res),
+ res);
}
@@ -347,13 +383,5 @@ int my_decimal_cmp(const my_decimal *a, const my_decimal *b)
return decimal_cmp((decimal_t*) a, (decimal_t*) b);
}
-inline
-void max_my_decimal(my_decimal *to, int precision, int frac)
-{
- DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION)&&
- (frac <= DECIMAL_MAX_SCALE));
- max_decimal(precision, frac, (decimal_t*) to);
-}
-
#endif /*my_decimal_h*/
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 0110cb70892..a967e2ee7fe 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -702,11 +702,11 @@ int mysql_explain_select(THD *thd, SELECT_LEX *sl, char const *type,
select_result *result);
bool mysql_union(THD *thd, LEX *lex, select_result *result,
SELECT_LEX_UNIT *unit, ulong setup_tables_done_option);
-int mysql_handle_derived(LEX *lex, int (*processor)(THD *thd,
- LEX *lex,
- TABLE_LIST *table));
-int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *t);
-int mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *t);
+bool mysql_handle_derived(LEX *lex, bool (*processor)(THD *thd,
+ LEX *lex,
+ TABLE_LIST *table));
+bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *t);
+bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *t);
Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
Item ***copy_func, Field **from_field,
bool group, bool modify_item,
@@ -780,7 +780,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create);
TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update);
TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem,
bool *refresh, uint flags);
-TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table);
+bool reopen_name_locked_table(THD* thd, TABLE_LIST* table);
TABLE *find_locked_table(THD *thd, const char *db,const char *table_name);
bool reopen_table(TABLE *table,bool locked);
bool reopen_tables(THD *thd,bool get_locks,bool in_refresh);
@@ -816,8 +816,8 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
Field *
find_field_in_table(THD *thd, TABLE *table, const char *name,
uint length, bool check_grants, bool allow_rowid,
- uint *cached_field_index_ptr);
-
+ uint *cached_field_index_ptr,
+ Security_context *sctx);
Field *
find_field_in_table_sef(TABLE *table, const char *name);
@@ -1323,7 +1323,6 @@ int openfrm(THD *thd, const char *name,const char *alias,uint filestat,
int readfrm(const char *name, const void** data, uint* length);
int writefrm(const char* name, const void* data, uint len);
int closefrm(TABLE *table);
-db_type get_table_type(THD *thd, const char *name);
int read_string(File file, gptr *to, uint length);
void free_blobs(TABLE *table);
int set_zone(int nr,int min_zone,int max_zone);
@@ -1362,6 +1361,8 @@ void change_byte(byte *,uint,char,char);
void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
SQL_SELECT *select,
int use_record_cache, bool print_errors);
+void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+ bool print_error, uint idx);
void end_read_record(READ_RECORD *info);
ha_rows filesort(THD *thd, TABLE *form,struct st_sort_field *sortorder,
uint s_length, SQL_SELECT *select,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 47184a577ee..660e83db7d1 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -585,6 +585,20 @@ HANDLE smem_event_connect_request= 0;
#include "sslopt-vars.h"
#ifdef HAVE_OPENSSL
+#include <openssl/crypto.h>
+#ifndef HAVE_YASSL
+typedef struct CRYPTO_dynlock_value
+{
+ rw_lock_t lock;
+} openssl_lock_t;
+
+static openssl_lock_t *openssl_stdlocks;
+static openssl_lock_t *openssl_dynlock_create(const char *, int);
+static void openssl_dynlock_destroy(openssl_lock_t *, const char *, int);
+static void openssl_lock_function(int, int, const char *, int);
+static void openssl_lock(int, openssl_lock_t *, const char *, int);
+static unsigned long openssl_id_function();
+#endif
char *des_key_file;
struct st_VioSSLAcceptorFd *ssl_acceptor_fd;
#endif /* HAVE_OPENSSL */
@@ -920,7 +934,7 @@ static void __cdecl kill_server(int sig_ptr)
RETURN_FROM_KILL_SERVER;
kill_in_progress=TRUE;
abort_loop=1; // This should be set
- signal(sig,SIG_IGN);
+ my_sigset(sig,SIG_IGN);
if (sig == MYSQL_KILL_SIGNAL || sig == 0)
sql_print_information(ER(ER_NORMAL_SHUTDOWN),my_progname);
else
@@ -969,11 +983,6 @@ pthread_handler_t kill_server_thread(void *arg __attribute__((unused)))
}
#endif
-#if defined(__amiga__)
-#undef sigset
-#define sigset signal
-#endif
-
extern "C" sig_handler print_signal_warning(int sig)
{
if (!DBUG_IN_USE)
@@ -983,7 +992,7 @@ extern "C" sig_handler print_signal_warning(int sig)
sig,my_thread_id());
}
#ifdef DONT_REMEMBER_SIGNAL
- sigset(sig,print_signal_warning); /* int. thread system calls */
+ my_sigset(sig,print_signal_warning); /* int. thread system calls */
#endif
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
if (sig == SIGALRM)
@@ -1173,6 +1182,11 @@ static void clean_up_mutexes()
(void) pthread_mutex_destroy(&LOCK_user_conn);
#ifdef HAVE_OPENSSL
(void) pthread_mutex_destroy(&LOCK_des_key_file);
+#ifndef HAVE_YASSL
+ for (int i= 0; i < CRYPTO_num_locks(); ++i)
+ (void) rwlock_destroy(&openssl_stdlocks[i].lock);
+ OPENSSL_free(openssl_stdlocks);
+#endif
#endif
#ifdef HAVE_REPLICATION
(void) pthread_mutex_destroy(&LOCK_rpl_status);
@@ -1183,6 +1197,7 @@ static void clean_up_mutexes()
(void) rwlock_destroy(&LOCK_sys_init_slave);
(void) pthread_mutex_destroy(&LOCK_global_system_variables);
(void) pthread_mutex_destroy(&LOCK_global_read_lock);
+ (void) pthread_mutex_destroy(&LOCK_uuid_generator);
(void) pthread_cond_destroy(&COND_thread_count);
(void) pthread_cond_destroy(&COND_refresh);
(void) pthread_cond_destroy(&COND_thread_cache);
@@ -2058,8 +2073,8 @@ static void init_signals(void)
DBUG_ENTER("init_signals");
if (test_flags & TEST_SIGINT)
- sigset(THR_KILL_SIGNAL,end_thread_signal);
- sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
+ my_sigset(THR_KILL_SIGNAL,end_thread_signal);
+ my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
if (!(test_flags & TEST_NO_STACKTRACE) || (test_flags & TEST_CORE_ON_SIGNAL))
{
@@ -2093,13 +2108,8 @@ static void init_signals(void)
}
#endif
(void) sigemptyset(&set);
-#ifdef THREAD_SPECIFIC_SIGPIPE
- sigset(SIGPIPE,abort_thread);
+ my_sigset(SIGPIPE,SIG_IGN);
sigaddset(&set,SIGPIPE);
-#else
- (void) signal(SIGPIPE,SIG_IGN); // Can't know which thread
- sigaddset(&set,SIGPIPE);
-#endif
sigaddset(&set,SIGINT);
#ifndef IGNORE_SIGHUP_SIGQUIT
sigaddset(&set,SIGQUIT);
@@ -2326,6 +2336,8 @@ static int my_message_sql(uint error, const char *str, myf MyFlags)
if (thd->spcont &&
thd->spcont->find_handler(error, MYSQL_ERROR::WARN_LEVEL_ERROR))
{
+ if (! thd->spcont->found_handler_here())
+ thd->net.report_error= 1; /* Make "select" abort correctly */
DBUG_RETURN(0);
}
@@ -2729,6 +2741,17 @@ static int init_thread_environment()
(void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST);
#ifdef HAVE_OPENSSL
(void) pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST);
+#ifndef HAVE_YASSL
+ openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() *
+ sizeof(openssl_lock_t));
+ for (int i= 0; i < CRYPTO_num_locks(); ++i)
+ (void) my_rwlock_init(&openssl_stdlocks[i].lock, NULL);
+ CRYPTO_set_dynlock_create_callback(openssl_dynlock_create);
+ CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy);
+ CRYPTO_set_dynlock_lock_callback(openssl_lock);
+ CRYPTO_set_locking_callback(openssl_lock_function);
+ CRYPTO_set_id_callback(openssl_id_function);
+#endif
#endif
(void) my_rwlock_init(&LOCK_sys_init_connect, NULL);
(void) my_rwlock_init(&LOCK_sys_init_slave, NULL);
@@ -2761,6 +2784,75 @@ static int init_thread_environment()
}
+#if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL)
+static unsigned long openssl_id_function()
+{
+ return (unsigned long) pthread_self();
+}
+
+
+static openssl_lock_t *openssl_dynlock_create(const char *file, int line)
+{
+ openssl_lock_t *lock= new openssl_lock_t;
+ my_rwlock_init(&lock->lock, NULL);
+ return lock;
+}
+
+
+static void openssl_dynlock_destroy(openssl_lock_t *lock, const char *file,
+ int line)
+{
+ rwlock_destroy(&lock->lock);
+ delete lock;
+}
+
+
+static void openssl_lock_function(int mode, int n, const char *file, int line)
+{
+ if (n < 0 || n > CRYPTO_num_locks())
+ {
+ /* Lock number out of bounds. */
+ sql_print_error("Fatal: OpenSSL interface problem (n = %d)", n);
+ abort();
+ }
+ openssl_lock(mode, &openssl_stdlocks[n], file, line);
+}
+
+
+static void openssl_lock(int mode, openssl_lock_t *lock, const char *file,
+ int line)
+{
+ int err;
+ char const *what;
+
+ switch (mode) {
+ case CRYPTO_LOCK|CRYPTO_READ:
+ what = "read lock";
+ err = rw_rdlock(&lock->lock);
+ break;
+ case CRYPTO_LOCK|CRYPTO_WRITE:
+ what = "write lock";
+ err = rw_wrlock(&lock->lock);
+ break;
+ case CRYPTO_UNLOCK|CRYPTO_READ:
+ case CRYPTO_UNLOCK|CRYPTO_WRITE:
+ what = "unlock";
+ err = rw_unlock(&lock->lock);
+ break;
+ default:
+ /* Unknown locking mode. */
+ sql_print_error("Fatal: OpenSSL interface problem (mode=0x%x)", mode);
+ abort();
+ }
+ if (err)
+ {
+ sql_print_error("Fatal: can't %s OpenSSL %s lock", what);
+ abort();
+ }
+}
+#endif /* HAVE_OPENSSL */
+
+
static void init_ssl()
{
#ifdef HAVE_OPENSSL
@@ -2772,7 +2864,14 @@ static void init_ssl()
opt_ssl_cipher);
DBUG_PRINT("info",("ssl_acceptor_fd: 0x%lx", (long) ssl_acceptor_fd));
if (!ssl_acceptor_fd)
+ {
opt_use_ssl = 0;
+ have_openssl= SHOW_OPTION_DISABLED;
+ }
+ }
+ else
+ {
+ have_openssl= SHOW_OPTION_DISABLED;
}
if (des_key_file)
load_des_key_file(des_key_file);
@@ -2938,6 +3037,23 @@ server.");
sql_print_error("Can't init databases");
unireg_abort(1);
}
+
+ /*
+ Check that the default storage engine is actually available.
+ */
+ if (!ha_storage_engine_is_enabled((enum db_type)
+ global_system_variables.table_type))
+ {
+ if (!opt_bootstrap)
+ {
+ sql_print_error("Default storage engine (%s) is not available",
+ ha_get_storage_engine((enum db_type)
+ global_system_variables.table_type));
+ unireg_abort(1);
+ }
+ global_system_variables.table_type= DB_TYPE_MYISAM;
+ }
+
tc_log= (total_ha_2pc > 1 ? (opt_bin_log ?
(TC_LOG *) &mysql_bin_log :
(TC_LOG *) &tc_log_mmap) :
@@ -3594,7 +3710,6 @@ static void bootstrap(FILE *file)
THD *thd= new THD;
thd->bootstrap=1;
- thd->client_capabilities=0;
my_net_init(&thd->net,(st_vio*) 0);
thd->max_client_packet_length= thd->net.max_packet;
thd->security_ctx->master_access= ~(ulong)0;
@@ -5164,7 +5279,7 @@ replicating a LOAD DATA INFILE command.",
{"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
"The update log is deprecated since version 5.0, is replaced by the binary \
log and this option does nothing anymore.",
- 0, 0, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ 0, 0, 0, GET_DISABLED, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sql-mode", OPT_SQL_MODE,
"Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.",
(gptr*) &sql_mode_str, (gptr*) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0,
@@ -5560,7 +5675,8 @@ The minimum value for this variable is 4096.",
GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
{"myisam_stats_method", OPT_MYISAM_STATS_METHOD,
"Specifies how MyISAM index statistics collection code should threat NULLs. "
- "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).",
+ "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
+ "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
(gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
@@ -5638,7 +5754,8 @@ The minimum value for this variable is 4096.",
"Persistent buffer for query parsing and execution",
(gptr*) &global_system_variables.query_prealloc_size,
(gptr*) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
- REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, 16384, ~0L, 0, 1024, 0},
+ REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, QUERY_ALLOC_PREALLOC_SIZE,
+ ~0L, 0, 1024, 0},
{"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE,
"Allocation block size for storing ranges during optimization",
(gptr*) &global_system_variables.range_alloc_block_size,
@@ -5902,6 +6019,7 @@ struct show_var_st status_vars[]= {
{"Com_xa_recover", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_RECOVER]),SHOW_LONG_STATUS},
{"Com_xa_rollback", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_ROLLBACK]),SHOW_LONG_STATUS},
{"Com_xa_start", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_START]),SHOW_LONG_STATUS},
+ {"Compression", (char*) 0, SHOW_NET_COMPRESSION},
{"Connections", (char*) &thread_id, SHOW_LONG_CONST},
{"Created_tmp_disk_tables", (char*) offsetof(STATUS_VAR, created_tmp_disk_tables), SHOW_LONG_STATUS},
{"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG},
@@ -6814,6 +6932,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
case OPT_MYISAM_STATS_METHOD:
{
+ ulong method_conv;
myisam_stats_method_str= argument;
int method;
if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
@@ -6821,7 +6940,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument);
exit(1);
}
- global_system_variables.myisam_stats_method= method-1;
+ switch (method-1) {
+ case 0:
+ method_conv= MI_STATS_METHOD_NULLS_EQUAL;
+ break;
+ case 1:
+ method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL;
+ break;
+ case 2:
+ method_conv= MI_STATS_METHOD_IGNORE_NULLS;
+ break;
+ }
+ global_system_variables.myisam_stats_method= method_conv;
break;
}
case OPT_SQL_MODE:
@@ -6929,22 +7059,6 @@ static void get_options(int argc,char **argv)
!opt_slow_log)
sql_print_warning("options --log-slow-admin-statements and --log-queries-not-using-indexes have no effect if --log-slow-queries is not set");
- /*
- Check that the default storage engine is actually available.
- */
- if (!ha_storage_engine_is_enabled((enum db_type)
- global_system_variables.table_type))
- {
- if (!opt_bootstrap)
- {
- sql_print_error("Default storage engine (%s) is not available",
- ha_get_storage_engine((enum db_type)
- global_system_variables.table_type));
- exit(1);
- }
- global_system_variables.table_type= DB_TYPE_MYISAM;
- }
-
if (argc > 0)
{
fprintf(stderr, "%s: Too many arguments (first extra is '%s').\nUse --help to get a list of available options\n", my_progname, *argv);
@@ -7106,6 +7220,7 @@ static void fix_paths(void)
CHARSET_DIR, NullS);
}
(void) my_load_path(mysql_charsets_dir, mysql_charsets_dir, buff);
+ convert_dirname(mysql_charsets_dir, mysql_charsets_dir, NullS);
charsets_dir=mysql_charsets_dir;
if (init_tmpdir(&mysql_tmpdir_list, opt_mysql_tmpdir))
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 2f4cf1c4752..2400672a3f9 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -932,7 +932,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
}
THD *thd= current_thd;
- if (!(file= get_new_handler(head, head->s->db_type)))
+ if (!(file= get_new_handler(head, thd->mem_root, head->s->db_type)))
goto failure;
DBUG_PRINT("info", ("Allocated new handler %p", file));
if (file->ha_open(head->s->path, head->db_stat, HA_OPEN_IGNORE_IF_LOCKED))
@@ -1366,6 +1366,95 @@ SEL_ARG *SEL_ARG::clone_tree()
/*
+ Find the best index to retrieve first N records in given order
+
+ SYNOPSIS
+ get_index_for_order()
+ table Table to be accessed
+ order Required ordering
+ limit Number of records that will be retrieved
+
+ DESCRIPTION
+ Find the best index that allows to retrieve first #limit records in the
+ given order cheaper then one would retrieve them using full table scan.
+
+ IMPLEMENTATION
+ Run through all table indexes and find the shortest index that allows
+ records to be retrieved in given order. We look for the shortest index
+ as we will have fewer index pages to read with it.
+
+ This function is used only by UPDATE/DELETE, so we take into account how
+ the UPDATE/DELETE code will work:
+ * index can only be scanned in forward direction
+ * HA_EXTRA_KEYREAD will not be used
+ Perhaps these assumptions could be relaxed
+
+ RETURN
+ index number
+ MAX_KEY if no such index was found.
+*/
+
+uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit)
+{
+ uint idx;
+ uint match_key= MAX_KEY, match_key_len= MAX_KEY_LENGTH + 1;
+ ORDER *ord;
+
+ for (ord= order; ord; ord= ord->next)
+ if (!ord->asc)
+ return MAX_KEY;
+
+ for (idx= 0; idx < table->s->keys; idx++)
+ {
+ if (!(table->keys_in_use_for_query.is_set(idx)))
+ continue;
+ KEY_PART_INFO *keyinfo= table->key_info[idx].key_part;
+ uint partno= 0;
+
+ /*
+ The below check is sufficient considering we now have either BTREE
+ indexes (records are returned in order for any index prefix) or HASH
+ indexes (records are not returned in order for any index prefix).
+ */
+ if (!(table->file->index_flags(idx, 0, 1) & HA_READ_ORDER))
+ continue;
+ for (ord= order; ord; ord= ord->next, partno++)
+ {
+ Item *item= order->item[0];
+ if (!(item->type() == Item::FIELD_ITEM &&
+ ((Item_field*)item)->field->eq(keyinfo[partno].field)))
+ break;
+ }
+
+ if (!ord && table->key_info[idx].key_length < match_key_len)
+ {
+ /*
+ Ok, the ordering is compatible and this key is shorter then
+ previous match (we want shorter keys as we'll have to read fewer
+ index pages for the same number of records)
+ */
+ match_key= idx;
+ match_key_len= table->key_info[idx].key_length;
+ }
+ }
+
+ if (match_key != MAX_KEY)
+ {
+ /*
+ Found an index that allows records to be retrieved in the requested
+ order. Now we'll check if using the index is cheaper then doing a table
+ scan.
+ */
+ double full_scan_time= table->file->scan_time();
+ double index_scan_time= table->file->read_time(match_key, 1, limit);
+ if (index_scan_time > full_scan_time)
+ match_key= MAX_KEY;
+ }
+ return match_key;
+}
+
+
+/*
Table rows retrieval plan. Range optimizer creates QUICK_SELECT_I-derived
objects from table read plans.
*/
@@ -3692,6 +3781,7 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
SEL_ARG *tree= 0;
MEM_ROOT *alloc= param->mem_root;
char *str;
+ ulong orig_sql_mode;
DBUG_ENTER("get_mm_leaf");
/*
@@ -3837,13 +3927,20 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
value->result_type() != STRING_RESULT &&
field->cmp_type() != value->result_type())
goto end;
-
+ /* For comparison purposes allow invalid dates like 2000-01-32 */
+ orig_sql_mode= field->table->in_use->variables.sql_mode;
+ if (value->real_item()->type() == Item::STRING_ITEM &&
+ (field->type() == FIELD_TYPE_DATE ||
+ field->type() == FIELD_TYPE_DATETIME))
+ field->table->in_use->variables.sql_mode|= MODE_INVALID_DATES;
if (value->save_in_field_no_warnings(field, 1) < 0)
{
+ field->table->in_use->variables.sql_mode= orig_sql_mode;
/* This happens when we try to insert a NULL field in a not null column */
tree= &null_element; // cmp with NULL is never TRUE
goto end;
}
+ field->table->in_use->variables.sql_mode= orig_sql_mode;
str= (char*) alloc_root(alloc, key_part->store_length+1);
if (!str)
goto end;
@@ -7045,19 +7142,15 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree)
*/
if (thd->query_id == cur_field->query_id)
{
- bool is_covered= FALSE;
KEY_PART_INFO *key_part= cur_index_info->key_part;
KEY_PART_INFO *key_part_end= key_part + cur_index_info->key_parts;
- for (; key_part != key_part_end ; key_part++)
+ for (;;)
{
if (key_part->field == cur_field)
- {
- is_covered= TRUE;
break;
- }
+ if (++key_part == key_part_end)
+ goto next_index; // Field was not part of key
}
- if (!is_covered)
- goto next_index;
}
}
}
diff --git a/sql/opt_range.h b/sql/opt_range.h
index 37d77033c8d..f84058f3b64 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -716,4 +716,6 @@ public:
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
struct st_table_ref *ref,
ha_rows records);
+uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit);
+
#endif
diff --git a/sql/parse_file.cc b/sql/parse_file.cc
index 5c7053e6e2a..d3e5645bafc 100644
--- a/sql/parse_file.cc
+++ b/sql/parse_file.cc
@@ -372,8 +372,10 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name,
if (revision > 0 && !access(arc_path, F_OK))
{
- ulonglong limit= (revision > num_view_backups) ? revision - num_view_backups : 0;
- while (revision > limit) {
+ ulonglong limit= ((revision > num_view_backups) ?
+ revision - num_view_backups : 0);
+ for (; revision > limit ; revision--)
+ {
my_snprintf(old_path, FN_REFLEN, "%s/%s%s-%04lu",
arc_path, old_name, reg_ext, (ulong)revision);
(void) unpack_filename(old_path, old_path);
@@ -381,7 +383,6 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name,
arc_path, new_name, reg_ext, (ulong)revision);
(void) unpack_filename(new_path, new_path);
my_rename(old_path, new_path, MYF(0));
- revision--;
}
}
return 0;
diff --git a/sql/password.c b/sql/password.c
index aa05be8c740..562df3ae226 100644
--- a/sql/password.c
+++ b/sql/password.c
@@ -316,18 +316,21 @@ void create_random_string(char *to, uint length, struct rand_struct *rand_st)
octet2hex()
buf OUT output buffer. Must be at least 2*len+1 bytes
str, len IN the beginning and the length of the input string
+
+ RETURN
+ buf+len*2
*/
-void
-octet2hex(char *to, const unsigned char *str, uint len)
+char *octet2hex(char *to, const char *str, uint len)
{
- const uint8 *str_end= str + len;
+ const byte *str_end= str + len;
for (; str != str_end; ++str)
{
- *to++= _dig_vec_upper[(*str & 0xF0) >> 4];
- *to++= _dig_vec_upper[*str & 0x0F];
+ *to++= _dig_vec_upper[((uchar) *str) >> 4];
+ *to++= _dig_vec_upper[((uchar) *str) & 0x0F];
}
*to= '\0';
+ return to;
}
diff --git a/sql/protocol.cc b/sql/protocol.cc
index ade94a483a8..8c3e5a62820 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -76,6 +76,8 @@ void net_send_error(THD *thd, uint sql_errno, const char *err)
if (thd->spcont && thd->spcont->find_handler(sql_errno,
MYSQL_ERROR::WARN_LEVEL_ERROR))
{
+ if (! thd->spcont->found_handler_here())
+ thd->net.report_error= 1; /* Make "select" abort correctly */
DBUG_VOID_RETURN;
}
thd->query_error= 1; // needed to catch query errors during replication
@@ -181,6 +183,8 @@ net_printf_error(THD *thd, uint errcode, ...)
if (thd->spcont && thd->spcont->find_handler(errcode,
MYSQL_ERROR::WARN_LEVEL_ERROR))
{
+ if (! thd->spcont->found_handler_here())
+ thd->net.report_error= 1; /* Make "select" abort correctly */
DBUG_VOID_RETURN;
}
thd->query_error= 1; // needed to catch query errors during replication
diff --git a/sql/records.cc b/sql/records.cc
index b3610cf1bbf..4958e39a5a0 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -28,8 +28,50 @@ static int rr_from_pointers(READ_RECORD *info);
static int rr_from_cache(READ_RECORD *info);
static int init_rr_cache(THD *thd, READ_RECORD *info);
static int rr_cmp(uchar *a,uchar *b);
+static int rr_index_first(READ_RECORD *info);
+static int rr_index(READ_RECORD *info);
+
+
+/*
+ Initialize READ_RECORD structure to perform full index scan
+
+ SYNOPSIS
+ init_read_record_idx()
+ info READ_RECORD structure to initialize.
+ thd Thread handle
+ table Table to be accessed
+ print_error If true, call table->file->print_error() if an error
+ occurs (except for end-of-records error)
+ idx index to scan
+
+ DESCRIPTION
+ Initialize READ_RECORD structure to perform full index scan (in forward
+ direction) using read_record.read_record() interface.
+
+ This function has been added at late stage and is used only by
+ UPDATE/DELETE. Other statements perform index scans using
+ join_read_first/next functions.
+*/
+
+void init_read_record_idx(READ_RECORD *info, THD *thd, TABLE *table,
+ bool print_error, uint idx)
+{
+ bzero((char*) info,sizeof(*info));
+ info->table= table;
+ info->file= table->file;
+ info->record= table->record[0];
+ info->print_error= print_error;
+
+ table->status=0; /* And it's always found */
+ if (!table->file->inited)
+ {
+ table->file->ha_index_init(idx);
+ table->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY);
+ }
+ /* read_record will be changed to rr_index in rr_index_first */
+ info->read_record= rr_index_first;
+}
- /* init struct for read with info->read_record */
/*
init_read_record is used to scan by using a number of different methods.
@@ -225,6 +267,21 @@ void end_read_record(READ_RECORD *info)
}
}
+static int rr_handle_error(READ_RECORD *info, int error)
+{
+ if (error == HA_ERR_END_OF_FILE)
+ error= -1;
+ else
+ {
+ if (info->print_error)
+ info->table->file->print_error(error, MYF(0));
+ if (error < 0) // Fix negative BDB errno
+ error= 1;
+ }
+ return error;
+}
+
+
/* Read a record from head-database */
static int rr_quick(READ_RECORD *info)
@@ -239,15 +296,7 @@ static int rr_quick(READ_RECORD *info)
}
if (tmp != HA_ERR_RECORD_DELETED)
{
- if (tmp == HA_ERR_END_OF_FILE)
- tmp= -1;
- else
- {
- if (info->print_error)
- info->file->print_error(tmp,MYF(0));
- if (tmp < 0) // Fix negative BDB errno
- tmp=1;
- }
+ tmp= rr_handle_error(info, tmp);
break;
}
}
@@ -255,6 +304,57 @@ static int rr_quick(READ_RECORD *info)
}
+/*
+ Reads first row in an index scan
+
+ SYNOPSIS
+ rr_index_first()
+ info Scan info
+
+ RETURN
+ 0 Ok
+ -1 End of records
+ 1 Error
+*/
+
+
+static int rr_index_first(READ_RECORD *info)
+{
+ int tmp= info->file->index_first(info->record);
+ info->read_record= rr_index;
+ if (tmp)
+ tmp= rr_handle_error(info, tmp);
+ return tmp;
+}
+
+
+/*
+ Reads index sequentially after first row
+
+ SYNOPSIS
+ rr_index()
+ info Scan info
+
+ DESCRIPTION
+ Read the next index record (in forward direction) and translate return
+ value.
+
+ RETURN
+ 0 Ok
+ -1 End of records
+ 1 Error
+*/
+
+
+static int rr_index(READ_RECORD *info)
+{
+ int tmp= info->file->index_next(info->record);
+ if (tmp)
+ tmp= rr_handle_error(info, tmp);
+ return tmp;
+}
+
+
static int rr_sequential(READ_RECORD *info)
{
int tmp;
@@ -265,17 +365,13 @@ static int rr_sequential(READ_RECORD *info)
info->thd->send_kill_message();
return 1;
}
+ /*
+ rnd_next can return RECORD_DELETED for MyISAM when one thread is
+ reading and another deleting without locks.
+ */
if (tmp != HA_ERR_RECORD_DELETED)
{
- if (tmp == HA_ERR_END_OF_FILE)
- tmp= -1;
- else
- {
- if (info->print_error)
- info->table->file->print_error(tmp,MYF(0));
- if (tmp < 0) // Fix negative BDB errno
- tmp=1;
- }
+ tmp= rr_handle_error(info, tmp);
break;
}
}
@@ -286,23 +382,18 @@ static int rr_sequential(READ_RECORD *info)
static int rr_from_tempfile(READ_RECORD *info)
{
int tmp;
-tryNext:
- if (my_b_read(info->io_cache,info->ref_pos,info->ref_length))
- return -1; /* End of file */
- if ((tmp=info->file->rnd_pos(info->record,info->ref_pos)))
+ for (;;)
{
- if (tmp == HA_ERR_END_OF_FILE)
- tmp= -1;
- else if (tmp == HA_ERR_RECORD_DELETED ||
- (tmp == HA_ERR_KEY_NOT_FOUND && info->ignore_not_found_rows))
- goto tryNext;
- else
- {
- if (info->print_error)
- info->file->print_error(tmp,MYF(0));
- if (tmp < 0) // Fix negative BDB errno
- tmp=1;
- }
+ if (my_b_read(info->io_cache,info->ref_pos,info->ref_length))
+ return -1; /* End of file */
+ if (!(tmp=info->file->rnd_pos(info->record,info->ref_pos)))
+ break;
+ /* The following is extremely unlikely to happen */
+ if (tmp == HA_ERR_RECORD_DELETED ||
+ (tmp == HA_ERR_KEY_NOT_FOUND && info->ignore_not_found_rows))
+ continue;
+ tmp= rr_handle_error(info, tmp);
+ break;
}
return tmp;
} /* rr_from_tempfile */
@@ -340,26 +431,23 @@ static int rr_from_pointers(READ_RECORD *info)
{
int tmp;
byte *cache_pos;
-tryNext:
- if (info->cache_pos == info->cache_end)
- return -1; /* End of file */
- cache_pos=info->cache_pos;
- info->cache_pos+=info->ref_length;
- if ((tmp=info->file->rnd_pos(info->record,cache_pos)))
+ for (;;)
{
- if (tmp == HA_ERR_END_OF_FILE)
- tmp= -1;
- else if (tmp == HA_ERR_RECORD_DELETED ||
- (tmp == HA_ERR_KEY_NOT_FOUND && info->ignore_not_found_rows))
- goto tryNext;
- else
- {
- if (info->print_error)
- info->file->print_error(tmp,MYF(0));
- if (tmp < 0) // Fix negative BDB errno
- tmp=1;
- }
+ if (info->cache_pos == info->cache_end)
+ return -1; /* End of file */
+ cache_pos= info->cache_pos;
+ info->cache_pos+= info->ref_length;
+
+ if (!(tmp=info->file->rnd_pos(info->record,cache_pos)))
+ break;
+
+ /* The following is extremely unlikely to happen */
+ if (tmp == HA_ERR_RECORD_DELETED ||
+ (tmp == HA_ERR_KEY_NOT_FOUND && info->ignore_not_found_rows))
+ continue;
+ tmp= rr_handle_error(info, tmp);
+ break;
}
return tmp;
}
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 35035a8b5a5..823930121fe 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -68,7 +68,6 @@ static int init_failsafe_rpl_thread(THD* thd)
*/
thd->system_thread = thd->bootstrap = 1;
thd->security_ctx->skip_grants();
- thd->client_capabilities = 0;
my_net_init(&thd->net, 0);
thd->net.read_timeout = slave_net_timeout;
thd->max_client_packet_length=thd->net.max_packet;
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 3aabc4e5b1f..5c2cc77d66a 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -5210,8 +5210,7 @@ ER_WARN_VIEW_WITHOUT_KEY
rus "ïÂÎÏ×ÌÑÅÍÙÊ view ÎÅ ÓÏÄÅÒÖÉÔ ËÌÀÞÁ ÉÓÐÏÌØÚÏ×ÁÎÎÙÈ(ÏÊ) × ÎÅÍ ÔÁÂÌÉÃ(Ù)"
ukr "View, ÝÏ ÏÎÏ×ÌÀÅÔØÓÑ, ΊͦÓÔÉÔØ ÐÏ×ÎÏÇÏ ËÌÀÞÁ ÔÁÂÌÉæ(Ø), ÝÏ ×ÉËÏÒ¦ÓÔÁÎÁ × ÎØÀÏÍÕ"
ER_VIEW_INVALID
- eng "View '%-.64s.%-.64s' references invalid table(s) or column(s) or function(s)"
- rus "View '%-.64s.%-.64s' ÓÓÙÌÁÅÔÓÑ ÎÁ ÎÅÓÕÝÅÓÔ×ÕÀÝÉÅ ÔÁÂÌÉÃÙ ÉÌÉ ÓÔÏÌÂÃÙ ÉÌÉ ÆÕÎËÃÉÉ"
+ eng "View '%-.64s.%-.64s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them"
ER_SP_NO_DROP_SP
eng "Can't drop or alter a %s from within another stored routine"
ER_SP_GOTO_IN_HNDLR
@@ -5420,6 +5419,8 @@ ER_ROW_IS_REFERENCED_2 23000
eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)"
ER_NO_REFERENCED_ROW_2 23000
eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)"
+ER_SP_BAD_VAR_SHADOW 42000
+ eng "Variable '%-.64s' must be quoted with `...`, or renamed"
ER_PARTITION_REQUIRES_VALUES_ERROR
eng "%s PARTITIONING requires definition of VALUES %s for each partition"
swe "%s PARTITIONering kräver definition av VALUES %s för varje partition"
diff --git a/sql/slave.cc b/sql/slave.cc
index 279be4d9c8c..2ae51e37930 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -564,6 +564,20 @@ int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset,
rli->slave_skip_counter=0;
pthread_mutex_lock(&rli->data_lock);
+
+ /*
+ we close the relay log fd possibly left open by the slave SQL thread,
+ to be able to delete it; the relay log fd possibly left open by the slave
+ I/O thread will be closed naturally in reset_logs() by the
+ close(LOG_CLOSE_TO_BE_OPENED) call
+ */
+ if (rli->cur_log_fd >= 0)
+ {
+ end_io_cache(&rli->cache_buf);
+ my_close(rli->cur_log_fd, MYF(MY_WME));
+ rli->cur_log_fd= -1;
+ }
+
if (rli->relay_log.reset_logs(thd))
{
*errmsg = "Failed during log reset";
@@ -1393,9 +1407,26 @@ static int init_relay_log_info(RELAY_LOG_INFO* rli,
{
char buf[FN_REFLEN];
const char *ln;
+ static bool name_warning_sent= 0;
ln= rli->relay_log.generate_name(opt_relay_logname, "-relay-bin",
1, buf);
-
+ /* We send the warning only at startup, not after every RESET SLAVE */
+ if (!opt_relay_logname && !opt_relaylog_index_name && !name_warning_sent)
+ {
+ /*
+ User didn't give us info to name the relay log index file.
+ Picking `hostname`-relay-bin.index like we do, causes replication to
+ fail if this slave's hostname is changed later. So, we would like to
+ instead require a name. But as we don't want to break many existing
+ setups, we only give warning, not error.
+ */
+ sql_print_warning("Neither --relay-log nor --relay-log-index were used;"
+ " so replication "
+ "may break when this MySQL server acts as a "
+ "slave and has his hostname changed!! Please "
+ "use '--relay-log=%s' to avoid this problem.", ln);
+ name_warning_sent= 1;
+ }
/*
note, that if open() fails, we'll still have index file open
but a destructor will take care of that
@@ -1619,6 +1650,55 @@ static int count_relay_log_space(RELAY_LOG_INFO* rli)
}
+/*
+ Builds a Rotate from the ignored events' info and writes it to relay log.
+
+ SYNOPSIS
+ write_ignored_events_info_to_relay_log()
+ thd pointer to I/O thread's thd
+ mi
+
+ DESCRIPTION
+ Slave I/O thread, going to die, must leave a durable trace of the
+ ignored events' end position for the use of the slave SQL thread, by
+ calling this function. Only that thread can call it (see assertion).
+ */
+static void write_ignored_events_info_to_relay_log(THD *thd, MASTER_INFO *mi)
+{
+ RELAY_LOG_INFO *rli= &mi->rli;
+ pthread_mutex_t *log_lock= rli->relay_log.get_log_lock();
+ DBUG_ASSERT(thd == mi->io_thd);
+ pthread_mutex_lock(log_lock);
+ if (rli->ign_master_log_name_end[0])
+ {
+ DBUG_PRINT("info",("writing a Rotate event to track down ignored events"));
+ Rotate_log_event *ev= new Rotate_log_event(thd, rli->ign_master_log_name_end,
+ 0, rli->ign_master_log_pos_end,
+ Rotate_log_event::DUP_NAME);
+ rli->ign_master_log_name_end[0]= 0;
+ /* can unlock before writing as slave SQL thd will soon see our Rotate */
+ pthread_mutex_unlock(log_lock);
+ if (likely((bool)ev))
+ {
+ ev->server_id= 0; // don't be ignored by slave SQL thread
+ if (unlikely(rli->relay_log.append(ev)))
+ sql_print_error("Slave I/O thread failed to write a Rotate event"
+ " to the relay log, "
+ "SHOW SLAVE STATUS may be inaccurate");
+ rli->relay_log.harvest_bytes_written(&rli->log_space_total);
+ flush_master_info(mi, 1);
+ delete ev;
+ }
+ else
+ sql_print_error("Slave I/O thread failed to create a Rotate event"
+ " (out of memory?), "
+ "SHOW SLAVE STATUS may be inaccurate");
+ }
+ else
+ pthread_mutex_unlock(log_lock);
+}
+
+
void init_master_info_with_options(MASTER_INFO* mi)
{
mi->master_log_name[0] = 0;
@@ -2168,7 +2248,7 @@ st_relay_log_info::st_relay_log_info()
{
group_relay_log_name[0]= event_relay_log_name[0]=
group_master_log_name[0]= 0;
- last_slave_error[0]=0; until_log_name[0]= 0;
+ last_slave_error[0]= until_log_name[0]= ign_master_log_name_end[0]= 0;
bzero((char*) &info_file, sizeof(info_file));
bzero((char*) &cache_buf, sizeof(cache_buf));
@@ -2371,7 +2451,7 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name,
else
pthread_cond_wait(&data_cond, &data_lock);
DBUG_PRINT("info",("Got signal of master update or timed out"));
- if (error == ETIMEDOUT)
+ if (error == ETIMEDOUT || error == ETIME)
{
error= -1;
break;
@@ -2427,7 +2507,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->system_thread = (thd_type == SLAVE_THD_SQL) ?
SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO;
thd->security_ctx->skip_grants();
- thd->client_capabilities = 0;
my_net_init(&thd->net, 0);
thd->net.read_timeout = slave_net_timeout;
thd->slave_thread = 1;
@@ -2761,12 +2840,20 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
wait for something for example inside of next_event().
*/
pthread_mutex_lock(&rli->data_lock);
-
+ /*
+ This tests if the position of the end of the last previous executed event
+ hits the UNTIL barrier.
+ We would prefer to test if the position of the start (or possibly) end of
+ the to-be-read event hits the UNTIL barrier, this is different if there
+ was an event ignored by the I/O thread just before (BUG#13861 to be
+ fixed).
+ */
if (rli->until_condition!=RELAY_LOG_INFO::UNTIL_NONE &&
rli->is_until_satisfied())
{
+ char buf[22];
sql_print_error("Slave SQL thread stopped because it reached its"
- " UNTIL position %ld", (long) rli->until_pos());
+ " UNTIL position %s", llstr(rli->until_pos(), buf));
/*
Setting abort_slave flag because we do not want additional message about
error in query execution to be printed.
@@ -2954,6 +3041,7 @@ pthread_handler_t handle_slave_io(void *arg)
THD *thd; // needs to be first for thread_stack
MYSQL *mysql;
MASTER_INFO *mi = (MASTER_INFO*)arg;
+ RELAY_LOG_INFO *rli= &mi->rli;
char llbuff[22];
uint retry_count;
@@ -3196,16 +3284,16 @@ reconnect done to recover from failed read");
char llbuf1[22], llbuf2[22];
DBUG_PRINT("info", ("log_space_limit=%s log_space_total=%s \
ignore_log_space_limit=%d",
- llstr(mi->rli.log_space_limit,llbuf1),
- llstr(mi->rli.log_space_total,llbuf2),
- (int) mi->rli.ignore_log_space_limit));
+ llstr(rli->log_space_limit,llbuf1),
+ llstr(rli->log_space_total,llbuf2),
+ (int) rli->ignore_log_space_limit));
}
#endif
- if (mi->rli.log_space_limit && mi->rli.log_space_limit <
- mi->rli.log_space_total &&
- !mi->rli.ignore_log_space_limit)
- if (wait_for_relay_log_space(&mi->rli))
+ if (rli->log_space_limit && rli->log_space_limit <
+ rli->log_space_total &&
+ !rli->ignore_log_space_limit)
+ if (wait_for_relay_log_space(rli))
{
sql_print_error("Slave I/O thread aborted while waiting for relay \
log space");
@@ -3236,10 +3324,12 @@ err:
mysql_close(mysql);
mi->mysql=0;
}
+ write_ignored_events_info_to_relay_log(thd, mi);
thd->proc_info = "Waiting for slave mutex on exit";
pthread_mutex_lock(&mi->run_lock);
mi->slave_running = 0;
mi->io_thd = 0;
+
/* Forget the relay log's format */
delete mi->rli.relay_log.description_event_for_queue;
mi->rli.relay_log.description_event_for_queue= 0;
@@ -3618,6 +3708,7 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev)
if (unlikely(!rev->is_valid()))
DBUG_RETURN(1);
+ /* Safe copy as 'rev' has been "sanitized" in Rotate_log_event's ctor */
memcpy(mi->master_log_name, rev->new_log_ident, rev->ident_len+1);
mi->master_log_pos= rev->pos;
DBUG_PRINT("info", ("master_log_pos: '%s' %d",
@@ -3868,6 +3959,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
int error= 0;
ulong inc_pos;
RELAY_LOG_INFO *rli= &mi->rli;
+ pthread_mutex_t *log_lock= rli->relay_log.get_log_lock();
DBUG_ENTER("queue_event");
if (mi->rli.relay_log.description_event_for_queue->binlog_version<4 &&
@@ -3876,11 +3968,6 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
pthread_mutex_lock(&mi->data_lock);
- /*
- TODO: figure out if other events in addition to Rotate
- require special processing.
- Guilhem 2003-06 : I don't think so.
- */
switch (buf[EVENT_TYPE_OFFSET]) {
case STOP_EVENT:
/*
@@ -3965,14 +4052,21 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
direct master (an unsupported, useless setup!).
*/
+ pthread_mutex_lock(log_lock);
+
if ((uint4korr(buf + SERVER_ID_OFFSET) == ::server_id) &&
!replicate_same_server_id)
{
/*
Do not write it to the relay log.
- We still want to increment, so that we won't re-read this event from the
- master if the slave IO thread is now stopped/restarted (more efficient if
- the events we are ignoring are big LOAD DATA INFILE).
+ a) We still want to increment mi->master_log_pos, so that we won't
+ re-read this event from the master if the slave IO thread is now
+ stopped/restarted (more efficient if the events we are ignoring are big
+ LOAD DATA INFILE).
+ b) We want to record that we are skipping events, for the information of
+ the slave SQL thread, otherwise that thread may let
+ rli->group_relay_log_pos stay too small if the last binlog's event is
+ ignored.
But events which were generated by this slave and which do not exist in
the master's binlog (i.e. Format_desc, Rotate & Stop) should not increment
mi->master_log_pos.
@@ -3980,7 +4074,13 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
if (buf[EVENT_TYPE_OFFSET]!=FORMAT_DESCRIPTION_EVENT &&
buf[EVENT_TYPE_OFFSET]!=ROTATE_EVENT &&
buf[EVENT_TYPE_OFFSET]!=STOP_EVENT)
+ {
mi->master_log_pos+= inc_pos;
+ memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN);
+ DBUG_ASSERT(rli->ign_master_log_name_end[0]);
+ rli->ign_master_log_pos_end= mi->master_log_pos;
+ }
+ rli->relay_log.signal_update(); // the slave SQL thread needs to re-check
DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos));
}
else
@@ -3993,8 +4093,11 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
rli->relay_log.harvest_bytes_written(&rli->log_space_total);
}
else
- error=3;
+ error= 3;
+ rli->ign_master_log_name_end[0]= 0; // last event is not ignored
}
+ pthread_mutex_unlock(log_lock);
+
err:
pthread_mutex_unlock(&mi->data_lock);
@@ -4377,7 +4480,28 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
time_t save_timestamp= rli->last_master_timestamp;
rli->last_master_timestamp= 0;
- DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count);
+ DBUG_ASSERT(rli->relay_log.get_open_count() ==
+ rli->cur_log_old_open_count);
+
+ if (rli->ign_master_log_name_end[0])
+ {
+ /* We generate and return a Rotate, to make our positions advance */
+ DBUG_PRINT("info",("seeing an ignored end segment"));
+ ev= new Rotate_log_event(thd, rli->ign_master_log_name_end,
+ 0, rli->ign_master_log_pos_end,
+ Rotate_log_event::DUP_NAME);
+ rli->ign_master_log_name_end[0]= 0;
+ pthread_mutex_unlock(log_lock);
+ if (unlikely(!ev))
+ {
+ errmsg= "Slave SQL thread failed to create a Rotate event "
+ "(out of memory?), SHOW SLAVE STATUS may be inaccurate";
+ goto err;
+ }
+ ev->server_id= 0; // don't be ignored by slave SQL thread
+ DBUG_RETURN(ev);
+ }
+
/*
We can, and should release data_lock while we are waiting for
update. If we do not, show slave status will block
diff --git a/sql/slave.h b/sql/slave.h
index d99145cbe47..c994bfb2d34 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -304,6 +304,17 @@ typedef struct st_relay_log_info
*/
ulong trans_retries, retried_trans;
+ /*
+ If the end of the hot relay log is made of master's events ignored by the
+ slave I/O thread, these two keep track of the coords (in the master's
+ binlog) of the last of these events seen by the slave I/O thread. If not,
+ ign_master_log_name_end[0] == 0.
+ As they are like a Rotate event read/written from/to the relay log, they
+ are both protected by rli->relay_log.LOCK_log.
+ */
+ char ign_master_log_name_end[FN_REFLEN];
+ ulonglong ign_master_log_pos_end;
+
st_relay_log_info();
~st_relay_log_info();
diff --git a/sql/sp.cc b/sql/sp.cc
index 18d94a85884..b385c6457a5 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -208,7 +208,7 @@ db_find_routine_aux(THD *thd, int type, sp_name *name, TABLE *table)
{
byte key[MAX_KEY_LENGTH]; // db, name, optional key length type
DBUG_ENTER("db_find_routine_aux");
- DBUG_PRINT("enter", ("type: %d name: %*s",
+ DBUG_PRINT("enter", ("type: %d name: %.*s",
type, name->m_name.length, name->m_name.str));
/*
@@ -275,7 +275,7 @@ db_find_routine(THD *thd, int type, sp_name *name, sp_head **sphp)
ulong sql_mode;
Open_tables_state open_tables_state_backup;
DBUG_ENTER("db_find_routine");
- DBUG_PRINT("enter", ("type: %d name: %*s",
+ DBUG_PRINT("enter", ("type: %d name: %.*s",
type, name->m_name.length, name->m_name.str));
*sphp= 0; // In case of errors
@@ -479,7 +479,8 @@ db_create_routine(THD *thd, int type, sp_head *sp)
char olddb[128];
bool dbchanged;
DBUG_ENTER("db_create_routine");
- DBUG_PRINT("enter", ("type: %d name: %*s",type,sp->m_name.length,sp->m_name.str));
+ DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length,
+ sp->m_name.str));
dbchanged= FALSE;
if ((ret= sp_use_new_db(thd, sp->m_db.str, olddb, sizeof(olddb),
@@ -606,7 +607,7 @@ db_drop_routine(THD *thd, int type, sp_name *name)
TABLE *table;
int ret;
DBUG_ENTER("db_drop_routine");
- DBUG_PRINT("enter", ("type: %d name: %*s",
+ DBUG_PRINT("enter", ("type: %d name: %.*s",
type, name->m_name.length, name->m_name.str));
if (!(table= open_proc_table_for_update(thd)))
@@ -628,7 +629,7 @@ db_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics)
int ret;
bool opened;
DBUG_ENTER("db_update_routine");
- DBUG_PRINT("enter", ("type: %d name: %*s",
+ DBUG_PRINT("enter", ("type: %d name: %.*s",
type, name->m_name.length, name->m_name.str));
if (!(table= open_proc_table_for_update(thd)))
@@ -922,7 +923,7 @@ sp_find_procedure(THD *thd, sp_name *name, bool cache_only)
{
sp_head *sp;
DBUG_ENTER("sp_find_procedure");
- DBUG_PRINT("enter", ("name: %*s.%*s",
+ DBUG_PRINT("enter", ("name: %.*s.%.*s",
name->m_db.length, name->m_db.str,
name->m_name.length, name->m_name.str));
@@ -980,7 +981,7 @@ sp_create_procedure(THD *thd, sp_head *sp)
{
int ret;
DBUG_ENTER("sp_create_procedure");
- DBUG_PRINT("enter", ("name: %*s", sp->m_name.length, sp->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str));
ret= db_create_routine(thd, TYPE_ENUM_PROCEDURE, sp);
DBUG_RETURN(ret);
@@ -992,7 +993,7 @@ sp_drop_procedure(THD *thd, sp_name *name)
{
int ret;
DBUG_ENTER("sp_drop_procedure");
- DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
ret= db_drop_routine(thd, TYPE_ENUM_PROCEDURE, name);
if (!ret)
@@ -1006,7 +1007,7 @@ sp_update_procedure(THD *thd, sp_name *name, st_sp_chistics *chistics)
{
int ret;
DBUG_ENTER("sp_update_procedure");
- DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
ret= db_update_routine(thd, TYPE_ENUM_PROCEDURE, name, chistics);
if (!ret)
@@ -1020,7 +1021,7 @@ sp_show_create_procedure(THD *thd, sp_name *name)
{
sp_head *sp;
DBUG_ENTER("sp_show_create_procedure");
- DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
if ((sp= sp_find_procedure(thd, name)))
{
@@ -1072,7 +1073,7 @@ sp_find_function(THD *thd, sp_name *name, bool cache_only)
{
sp_head *sp;
DBUG_ENTER("sp_find_function");
- DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
if (!(sp= sp_cache_lookup(&thd->sp_func_cache, name)) &&
!cache_only)
@@ -1089,7 +1090,7 @@ sp_create_function(THD *thd, sp_head *sp)
{
int ret;
DBUG_ENTER("sp_create_function");
- DBUG_PRINT("enter", ("name: %*s", sp->m_name.length, sp->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str));
ret= db_create_routine(thd, TYPE_ENUM_FUNCTION, sp);
DBUG_RETURN(ret);
@@ -1101,7 +1102,7 @@ sp_drop_function(THD *thd, sp_name *name)
{
int ret;
DBUG_ENTER("sp_drop_function");
- DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
ret= db_drop_routine(thd, TYPE_ENUM_FUNCTION, name);
if (!ret)
@@ -1115,7 +1116,7 @@ sp_update_function(THD *thd, sp_name *name, st_sp_chistics *chistics)
{
int ret;
DBUG_ENTER("sp_update_procedure");
- DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
ret= db_update_routine(thd, TYPE_ENUM_FUNCTION, name, chistics);
if (!ret)
@@ -1129,7 +1130,7 @@ sp_show_create_function(THD *thd, sp_name *name)
{
sp_head *sp;
DBUG_ENTER("sp_show_create_function");
- DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+ DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
if ((sp= sp_find_function(thd, name)))
{
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index 495f969eeac..fea6a67f32c 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -132,7 +132,7 @@ void sp_cache_insert(sp_cache **cp, sp_head *sp)
return; // End of memory error
c->version= Cversion; // No need to lock when reading long variable
}
- DBUG_PRINT("info",("sp_cache: inserting: %*s", sp->m_qname.length,
+ DBUG_PRINT("info",("sp_cache: inserting: %.*s", sp->m_qname.length,
sp->m_qname.str));
c->insert(sp);
*cp= c; // Update *cp if it was NULL
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 671acbc2a0c..abc66ce0b21 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -280,7 +280,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type,
DBUG_PRINT("info", ("STRING_RESULT: null"));
goto return_null_item;
}
- DBUG_PRINT("info",("STRING_RESULT: %*s",
+ DBUG_PRINT("info",("STRING_RESULT: %.*s",
s->length(), s->c_ptr_quick()));
/*
Reuse mechanism in sp_eval_func_item() is only employed for assignments
@@ -293,6 +293,22 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type,
if (it == reuse)
DBUG_RETURN(it);
+ /*
+ For some functions, 's' is now pointing to an argument of the
+ function, which might be a local variable that is to be reused.
+ In this case, new(reuse, &rsize) below will call the destructor
+ and 's' ends up pointing to freed memory.
+ A somewhat ugly fix is to simply copy the string to our local one
+ (which is unused by most functions anyway), but only if 's' is
+ pointing somewhere else than to 'tmp' or 'it->str_value'.
+ */
+ if (reuse && s != &tmp && s != &it->str_value)
+ {
+ if (tmp.copy((const String)(*s)))
+ DBUG_RETURN(NULL);
+ s= &tmp;
+ }
+
CREATE_ON_CALLERS_ARENA(it= new(reuse, &rsize)
Item_string(it->collation.collation),
use_callers_arena, &backup_arena);
@@ -323,7 +339,7 @@ sp_eval_func_item(THD *thd, Item **it_addr, enum enum_field_types type,
return_null_item:
CREATE_ON_CALLERS_ARENA(it= new(reuse, &rsize) Item_null(),
- use_callers_arena, &backup_arena);
+ use_callers_arena, &backup_arena);
end:
it->rsize= rsize;
@@ -354,7 +370,7 @@ sp_name::init_qname(THD *thd)
return;
m_qname.length= m_sroutines_key.length - 1;
m_qname.str= m_sroutines_key.str + 1;
- sprintf(m_qname.str, "%*s.%*s",
+ sprintf(m_qname.str, "%.*s.%.*s",
m_db.length, (m_db.length ? m_db.str : ""),
m_name.length, m_name.str);
}
@@ -794,6 +810,7 @@ static bool subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
splocal < sp_vars_uses.back(); splocal++)
{
Item *val;
+ (*splocal)->thd= thd; // fix_fields() is not yet done
/* append the text between sp ref occurences */
res|= qbuf.append(cur + prev_pos, (*splocal)->pos_in_query - prev_pos);
prev_pos= (*splocal)->pos_in_query + (*splocal)->m_name.length;
@@ -1051,8 +1068,10 @@ int sp_head::execute(THD *thd)
original thd->db will then have been freed */
if (dbchanged)
{
+ /* No access check when changing back to where we came from.
+ (It would generate an error from mysql_change_db() when olddb=="") */
if (! thd->killed)
- ret= mysql_change_db(thd, olddb, 0);
+ ret= mysql_change_db(thd, olddb, 1);
}
m_flags&= ~IS_INVOKED;
DBUG_RETURN(ret);
@@ -1110,7 +1129,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, Item **resp)
DBUG_RETURN(-1);
// QQ Should have some error checking here? (types, etc...)
- if (!(nctx= new sp_rcontext(csize, hmax, cmax)))
+ if (!(nctx= new sp_rcontext(octx, csize, hmax, cmax)))
goto end;
for (i= 0 ; i < argcount ; i++)
{
@@ -1254,7 +1273,7 @@ int sp_head::execute_procedure(THD *thd, List<Item> *args)
save_spcont= octx= thd->spcont;
if (! octx)
{ // Create a temporary old context
- if (!(octx= new sp_rcontext(csize, hmax, cmax)))
+ if (!(octx= new sp_rcontext(octx, csize, hmax, cmax)))
DBUG_RETURN(-1);
thd->spcont= octx;
@@ -1262,7 +1281,7 @@ int sp_head::execute_procedure(THD *thd, List<Item> *args)
thd->spcont->callers_arena= thd;
}
- if (!(nctx= new sp_rcontext(csize, hmax, cmax)))
+ if (!(nctx= new sp_rcontext(octx, csize, hmax, cmax)))
{
thd->spcont= save_spcont;
DBUG_RETURN(-1);
@@ -2390,7 +2409,10 @@ sp_instr_hreturn::print(String *str)
str->append("hreturn ");
str->qs_append(m_frame);
if (m_dest)
+ {
+ str->append(' ');
str->qs_append(m_dest);
+ }
}
@@ -2650,9 +2672,24 @@ sp_change_security_context(THD *thd, sp_head *sp, Security_context **backup)
sp->m_definer_host.str,
sp->m_db.str))
{
+#ifdef NOT_YET_REPLICATION_SAFE
+ /*
+ Until we don't properly replicate information about stored routine
+ definer with stored routine creation statement all stored routines
+ on slave are created under ''@'' definer. Therefore we won't be able
+ to run any routine which was replicated from master on slave server
+ if we emit error here. This will cause big problems for users
+ who use slave for fail-over. So until we fully implement WL#2897
+ "Complete definer support in the stored routines" we run suid
+ stored routines for which we were unable to find definer under
+ invoker security context.
+ */
my_error(ER_NO_SUCH_USER, MYF(0), sp->m_definer_user.str,
sp->m_definer_host.str);
return TRUE;
+#else
+ return FALSE;
+#endif
}
*backup= thd->security_ctx;
thd->security_ctx= &sp->m_security_ctx;
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index 252bd7e5cab..ccb38358049 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -29,9 +29,9 @@
#include "sp_rcontext.h"
#include "sp_pcontext.h"
-sp_rcontext::sp_rcontext(uint fsize, uint hmax, uint cmax)
+sp_rcontext::sp_rcontext(sp_rcontext *prev, uint fsize, uint hmax, uint cmax)
: m_count(0), m_fsize(fsize), m_result(NULL), m_hcount(0), m_hsp(0),
- m_ihsp(0), m_hfound(-1), m_ccount(0)
+ m_ihsp(0), m_hfound(-1), m_ccount(0), m_prev_ctx(prev)
{
m_frame= (Item **)sql_alloc(fsize * sizeof(Item*));
m_handler= (sp_handler_t *)sql_alloc(hmax * sizeof(sp_handler_t));
@@ -116,7 +116,11 @@ sp_rcontext::find_handler(uint sql_errno,
}
}
if (found < 0)
+ {
+ if (m_prev_ctx)
+ return m_prev_ctx->find_handler(sql_errno, level);
return FALSE;
+ }
m_hfound= found;
return TRUE;
}
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 22fa4f6e865..cae5c5467c9 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -66,7 +66,7 @@ class sp_rcontext : public Sql_alloc
*/
Query_arena *callers_arena;
- sp_rcontext(uint fsize, uint hmax, uint cmax);
+ sp_rcontext(sp_rcontext *prev, uint fsize, uint hmax, uint cmax);
~sp_rcontext()
{
@@ -149,6 +149,13 @@ class sp_rcontext : public Sql_alloc
return m_handler[m_hfound].type;
}
+ // Returns true if we found a handler in this context
+ inline bool
+ found_handler_here()
+ {
+ return (m_hfound >= 0);
+ }
+
// Clears the handler find state
inline void
clear_handler()
@@ -226,6 +233,8 @@ private:
sp_cursor **m_cstack;
uint m_ccount;
+ sp_rcontext *m_prev_ctx; // Previous context (NULL if none)
+
}; // class sp_rcontext : public Sql_alloc
diff --git a/sql/spatial.cc b/sql/spatial.cc
index 176f1f2fbfe..5af1bec45ca 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -121,24 +121,21 @@ Geometry::Class_info *Geometry::find_class(const char *name, uint32 len)
return 0;
}
-Geometry *Geometry::create_from_wkb(Geometry_buffer *buffer,
- const char *data, uint32 data_len)
+
+Geometry *Geometry::construct(Geometry_buffer *buffer,
+ const char *data, uint32 data_len)
{
uint32 geom_type;
Geometry *result;
+ char byte_order;
- if (data_len < 1 + 4)
+ if (data_len < SRID_SIZE + WKB_HEADER_SIZE) // < 4 + (1 + 4)
return NULL;
- data++;
- /*
- FIXME: check byte ordering
- Also check if we could replace this with one byte
- */
- geom_type= uint4korr(data);
- data+= 4;
+ byte_order= data[SRID_SIZE];
+ geom_type= uint4korr(data + SRID_SIZE + 1);
if (!(result= create_by_typeid(buffer, (int) geom_type)))
return NULL;
- result->m_data= data;
+ result->m_data= data+ SRID_SIZE + WKB_HEADER_SIZE;
result->m_data_end= data + data_len;
return result;
}
@@ -170,13 +167,71 @@ Geometry *Geometry::create_from_wkt(Geometry_buffer *buffer,
return NULL;
if (init_stream)
{
- result->init_from_wkb(wkt->ptr(), wkt->length());
+ result->set_data_ptr(wkt->ptr(), wkt->length());
result->shift_wkb_header();
}
return result;
}
+static double wkb_get_double(const char *ptr, Geometry::wkbByteOrder bo)
+{
+ double res;
+ if (bo != Geometry::wkb_xdr)
+ float8get(res, ptr);
+ else
+ {
+ char inv_array[8];
+ inv_array[0]= ptr[7];
+ inv_array[1]= ptr[6];
+ inv_array[2]= ptr[5];
+ inv_array[3]= ptr[4];
+ inv_array[4]= ptr[3];
+ inv_array[5]= ptr[2];
+ inv_array[6]= ptr[1];
+ inv_array[7]= ptr[0];
+ float8get(res, inv_array);
+ }
+ return res;
+}
+
+
+static uint32 wkb_get_uint(const char *ptr, Geometry::wkbByteOrder bo)
+{
+ if (bo != Geometry::wkb_xdr)
+ return uint4korr(ptr);
+ /* else */
+ {
+ char inv_array[4];
+ inv_array[0]= ptr[3];
+ inv_array[1]= ptr[2];
+ inv_array[2]= ptr[1];
+ inv_array[3]= ptr[0];
+ return uint4korr(inv_array);
+ }
+}
+
+
+int Geometry::create_from_wkb(Geometry_buffer *buffer,
+ const char *wkb, uint32 len, String *res)
+{
+ uint32 geom_type;
+ Geometry *geom;
+
+ if (len < WKB_HEADER_SIZE)
+ return 1;
+ geom_type= wkb_get_uint(wkb+1, (wkbByteOrder)wkb[0]);
+ if (!(geom= create_by_typeid(buffer, (int) geom_type)) ||
+ res->reserve(WKB_HEADER_SIZE, 512))
+ return 1;
+
+ res->q_append((char) wkb_ndr);
+ res->q_append(geom_type);
+ return geom->init_from_wkb(wkb+WKB_HEADER_SIZE, len - WKB_HEADER_SIZE,
+ (wkbByteOrder) wkb[0], res);
+}
+
+
bool Geometry::envelope(String *result) const
{
MBR mbr;
@@ -346,6 +401,20 @@ bool Gis_point::init_from_wkt(Gis_read_stream *trs, String *wkb)
}
+uint Gis_point::init_from_wkb(const char *wkb, uint len,
+ wkbByteOrder bo, String *res)
+{
+ double x, y;
+ if (len < POINT_DATA_SIZE || res->reserve(POINT_DATA_SIZE))
+ return 0;
+ x= wkb_get_double(wkb, bo);
+ y= wkb_get_double(wkb + SIZEOF_STORED_DOUBLE, bo);
+ res->q_append(x);
+ res->q_append(y);
+ return POINT_DATA_SIZE;
+}
+
+
bool Gis_point::get_data_as_wkt(String *txt, const char **end) const
{
double x, y;
@@ -415,6 +484,33 @@ bool Gis_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb)
}
+uint Gis_line_string::init_from_wkb(const char *wkb, uint len,
+ wkbByteOrder bo, String *res)
+{
+ uint32 n_points, proper_length;
+ const char *wkb_end;
+ Gis_point p;
+
+ if (len < 4)
+ return 0;
+ n_points= wkb_get_uint(wkb, bo);
+ proper_length= 4 + n_points * POINT_DATA_SIZE;
+
+ if (len < proper_length || res->reserve(proper_length))
+ return 0;
+
+ res->q_append(n_points);
+ wkb_end= wkb + proper_length;
+ for (wkb+= 4; wkb<wkb_end; wkb+= POINT_DATA_SIZE)
+ {
+ if (!p.init_from_wkb(wkb, POINT_DATA_SIZE, bo, res))
+ return 0;
+ }
+
+ return proper_length;
+}
+
+
bool Gis_line_string::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_points;
@@ -594,7 +690,7 @@ bool Gis_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb)
trs->check_next_symbol(')'))
return 1;
- ls.init_from_wkb(wkb->ptr()+ls_pos, wkb->length()-ls_pos);
+ ls.set_data_ptr(wkb->ptr() + ls_pos, wkb->length() - ls_pos);
if (ls.is_closed(&closed) || !closed)
{
trs->set_error_msg("POLYGON's linear ring isn't closed");
@@ -609,6 +705,43 @@ bool Gis_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb)
}
+uint Gis_polygon::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
+ String *res)
+{
+ uint32 n_linear_rings;
+ const char *wkb_orig= wkb;
+
+ if (len < 4)
+ return 0;
+
+ n_linear_rings= wkb_get_uint(wkb, bo);
+ if (res->reserve(4, 512))
+ return 0;
+ wkb+= 4;
+ len-= 4;
+ res->q_append(n_linear_rings);
+
+ while (n_linear_rings--)
+ {
+ Gis_line_string ls;
+ uint32 ls_pos= res->length();
+ int ls_len;
+ int closed;
+
+ if (!(ls_len= ls.init_from_wkb(wkb, len, bo, res)))
+ return 0;
+
+ ls.set_data_ptr(res->ptr() + ls_pos, res->length() - ls_pos);
+
+ if (ls.is_closed(&closed) || !closed)
+ return 0;
+ wkb+= ls_len;
+ }
+
+ return (uint) (wkb - wkb_orig);
+}
+
+
bool Gis_polygon::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_linear_rings;
@@ -897,6 +1030,36 @@ bool Gis_multi_point::init_from_wkt(Gis_read_stream *trs, String *wkb)
}
+uint Gis_multi_point::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
+ String *res)
+{
+ uint32 n_points;
+ uint proper_size;
+ Gis_point p;
+ const char *wkb_end;
+
+ if (len < 4)
+ return 0;
+ n_points= wkb_get_uint(wkb, bo);
+ proper_size= 4 + n_points * (WKB_HEADER_SIZE + POINT_DATA_SIZE);
+
+ if (len < proper_size || res->reserve(proper_size))
+ return 0;
+
+ res->q_append(n_points);
+ wkb_end= wkb + proper_size;
+ for (wkb+=4; wkb < wkb_end; wkb+= (WKB_HEADER_SIZE + POINT_DATA_SIZE))
+ {
+ res->q_append((char)wkb_ndr);
+ res->q_append((uint32)wkb_point);
+ if (!p.init_from_wkb(wkb + WKB_HEADER_SIZE,
+ POINT_DATA_SIZE, (wkbByteOrder) wkb[0], res))
+ return 0;
+ }
+ return proper_size;
+}
+
+
bool Gis_multi_point::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_points;
@@ -1006,6 +1169,44 @@ bool Gis_multi_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb)
}
+uint Gis_multi_line_string::init_from_wkb(const char *wkb, uint len,
+ wkbByteOrder bo, String *res)
+{
+ uint32 n_line_strings;
+ const char *wkb_orig= wkb;
+
+ if (len < 4)
+ return 0;
+ n_line_strings= wkb_get_uint(wkb, bo);
+
+ if (res->reserve(4, 512))
+ return 0;
+ res->q_append(n_line_strings);
+
+ wkb+= 4;
+ while (n_line_strings--)
+ {
+ Gis_line_string ls;
+ int ls_len;
+
+ if ((len < WKB_HEADER_SIZE) ||
+ res->reserve(WKB_HEADER_SIZE, 512))
+ return 0;
+
+ res->q_append((char) wkb_ndr);
+ res->q_append((uint32) wkb_linestring);
+
+ if (!(ls_len= ls.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
+ (wkbByteOrder) wkb[0], res)))
+ return 0;
+ ls_len+= WKB_HEADER_SIZE;;
+ wkb+= ls_len;
+ len-= ls_len;
+ }
+ return (uint) (wkb - wkb_orig);
+}
+
+
bool Gis_multi_line_string::get_data_as_wkt(String *txt,
const char **end) const
{
@@ -1111,7 +1312,7 @@ int Gis_multi_line_string::length(double *len) const
double ls_len;
Gis_line_string ls;
data+= WKB_HEADER_SIZE;
- ls.init_from_wkb(data, (uint32) (m_data_end - data));
+ ls.set_data_ptr(data, (uint32) (m_data_end - data));
if (ls.length(&ls_len))
return 1;
*len+= ls_len;
@@ -1140,7 +1341,7 @@ int Gis_multi_line_string::is_closed(int *closed) const
Gis_line_string ls;
if (no_data(data, 0))
return 1;
- ls.init_from_wkb(data, (uint32) (m_data_end - data));
+ ls.set_data_ptr(data, (uint32) (m_data_end - data));
if (ls.is_closed(closed))
return 1;
if (!*closed)
@@ -1222,6 +1423,43 @@ bool Gis_multi_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb)
}
+uint Gis_multi_polygon::init_from_wkb(const char *wkb, uint len,
+ wkbByteOrder bo, String *res)
+{
+ uint32 n_poly;
+ const char *wkb_orig= wkb;
+
+ if (len < 4)
+ return 0;
+ n_poly= wkb_get_uint(wkb, bo);
+
+ if (res->reserve(4, 512))
+ return 0;
+ res->q_append(n_poly);
+
+ wkb+=4;
+ while (n_poly--)
+ {
+ Gis_polygon p;
+ int p_len;
+
+ if (len < WKB_HEADER_SIZE ||
+ res->reserve(WKB_HEADER_SIZE, 512))
+ return 0;
+ res->q_append((char) wkb_ndr);
+ res->q_append((uint32) wkb_polygon);
+
+ if (!(p_len= p.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
+ (wkbByteOrder) wkb[0], res)))
+ return 0;
+ p_len+= WKB_HEADER_SIZE;
+ wkb+= p_len;
+ len-= p_len;
+ }
+ return (uint) (wkb - wkb_orig);
+}
+
+
bool Gis_multi_polygon::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_polygons;
@@ -1358,7 +1596,7 @@ int Gis_multi_polygon::area(double *ar, const char **end_of_data) const
Gis_polygon p;
data+= WKB_HEADER_SIZE;
- p.init_from_wkb(data, (uint32) (m_data_end - data));
+ p.set_data_ptr(data, (uint32) (m_data_end - data));
if (p.area(&p_area, &data))
return 1;
result+= p_area;
@@ -1390,7 +1628,7 @@ int Gis_multi_polygon::centroid(String *result) const
while (n_polygons--)
{
data+= WKB_HEADER_SIZE;
- p.init_from_wkb(data, (uint32) (m_data_end - data));
+ p.set_data_ptr(data, (uint32) (m_data_end - data));
if (p.area(&cur_area, &data) ||
p.centroid_xy(&cur_cx, &cur_cy))
return 1;
@@ -1444,7 +1682,7 @@ uint32 Gis_geometry_collection::get_data_size() const
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return GET_SIZE_ERROR;
- geom->init_from_wkb(data, (uint) (m_data_end - data));
+ geom->set_data_ptr(data, (uint) (m_data_end - data));
if ((object_size= geom->get_data_size()) == GET_SIZE_ERROR)
return GET_SIZE_ERROR;
data+= object_size;
@@ -1484,6 +1722,48 @@ bool Gis_geometry_collection::init_from_wkt(Gis_read_stream *trs, String *wkb)
}
+uint Gis_geometry_collection::init_from_wkb(const char *wkb, uint len,
+ wkbByteOrder bo, String *res)
+{
+ uint32 n_geom;
+ const char *wkb_orig= wkb;
+
+ if (len < 4)
+ return 0;
+ n_geom= wkb_get_uint(wkb, bo);
+
+ if (res->reserve(4, 512))
+ return 0;
+ res->q_append(n_geom);
+
+ wkb+= 4;
+ while (n_geom--)
+ {
+ Geometry_buffer buffer;
+ Geometry *geom;
+ int g_len;
+ uint32 wkb_type;
+
+ if (len < WKB_HEADER_SIZE ||
+ res->reserve(WKB_HEADER_SIZE, 512))
+ return 0;
+
+ res->q_append((char) wkb_ndr);
+ wkb_type= wkb_get_uint(wkb+1, (wkbByteOrder) wkb[0]);
+ res->q_append(wkb_type);
+
+ if (!(geom= create_by_typeid(&buffer, wkb_type)) ||
+ !(g_len= geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len,
+ (wkbByteOrder) wkb[0], res)))
+ return 0;
+ g_len+= WKB_HEADER_SIZE;
+ wkb+= g_len;
+ len-= g_len;
+ }
+ return (uint) (wkb - wkb_orig);
+}
+
+
bool Gis_geometry_collection::get_data_as_wkt(String *txt,
const char **end) const
{
@@ -1508,7 +1788,7 @@ bool Gis_geometry_collection::get_data_as_wkt(String *txt,
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
- geom->init_from_wkb(data, (uint) (m_data_end - data));
+ geom->set_data_ptr(data, (uint) (m_data_end - data));
if (geom->as_wkt(txt, &data))
return 1;
if (txt->append(",", 1, 512))
@@ -1543,7 +1823,7 @@ bool Gis_geometry_collection::get_mbr(MBR *mbr, const char **end) const
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
- geom->init_from_wkb(data, (uint32) (m_data_end - data));
+ geom->set_data_ptr(data, (uint32) (m_data_end - data));
if (geom->get_mbr(mbr, &data))
return 1;
}
@@ -1584,7 +1864,7 @@ int Gis_geometry_collection::geometry_n(uint32 num, String *result) const
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
- geom->init_from_wkb(data, (uint) (m_data_end - data));
+ geom->set_data_ptr(data, (uint) (m_data_end - data));
if ((length= geom->get_data_size()) == GET_SIZE_ERROR)
return 1;
data+= length;
@@ -1637,7 +1917,7 @@ bool Gis_geometry_collection::dimension(uint32 *res_dim, const char **end) const
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
- geom->init_from_wkb(data, (uint32) (m_data_end - data));
+ geom->set_data_ptr(data, (uint32) (m_data_end - data));
if (geom->dimension(&dim, &end_data))
return 1;
set_if_bigger(*res_dim, dim);
diff --git a/sql/spatial.h b/sql/spatial.h
index b5ea7d641d1..4253689c078 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -207,6 +207,10 @@ public:
virtual const Class_info *get_class_info() const=0;
virtual uint32 get_data_size() const=0;
virtual bool init_from_wkt(Gis_read_stream *trs, String *wkb)=0;
+
+ /* returns the length of the wkb that was read */
+ virtual uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
+ String *res)=0;
virtual bool get_data_as_wkt(String *txt, const char **end) const=0;
virtual bool get_mbr(MBR *mbr, const char **end) const=0;
virtual bool dimension(uint32 *dim, const char **end) const=0;
@@ -236,11 +240,13 @@ public:
return my_reinterpret_cast(Geometry *)(buffer);
}
- static Geometry *create_from_wkb(Geometry_buffer *buffer,
- const char *data, uint32 data_len);
+ static Geometry *construct(Geometry_buffer *buffer,
+ const char *data, uint32 data_len);
static Geometry *create_from_wkt(Geometry_buffer *buffer,
Gis_read_stream *trs, String *wkt,
bool init_stream=1);
+ static int create_from_wkb(Geometry_buffer *buffer,
+ const char *wkb, uint32 len, String *res);
int as_wkt(String *wkt, const char **end)
{
uint32 len= get_class_info()->m_name.length;
@@ -254,7 +260,7 @@ public:
return 0;
}
- inline void init_from_wkb(const char *data, uint32 data_len)
+ inline void set_data_ptr(const char *data, uint32 data_len)
{
m_data= data;
m_data_end= data + data_len;
@@ -298,6 +304,7 @@ class Gis_point: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
@@ -344,6 +351,7 @@ class Gis_line_string: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int length(double *len) const;
@@ -369,6 +377,7 @@ class Gis_polygon: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int area(double *ar, const char **end) const;
@@ -394,6 +403,7 @@ class Gis_multi_point: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
@@ -415,6 +425,7 @@ class Gis_multi_line_string: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
@@ -438,6 +449,7 @@ class Gis_multi_polygon: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
@@ -461,6 +473,7 @@ class Gis_geometry_collection: public Geometry
public:
uint32 get_data_size() const;
bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ uint init_from_wkb(const char *wkb, uint len, wkbByteOrder bo, String *res);
bool get_data_as_wkt(String *txt, const char **end) const;
bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 7a87f01258a..c47507bdd27 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -193,6 +193,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
my_bool return_val= 1;
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
char tmp_name[NAME_LEN+1];
+ int password_length;
DBUG_ENTER("acl_load");
grant_version++; /* Privileges updated */
@@ -249,7 +250,9 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
init_read_record(&read_record_info,thd,table=tables[1].table,NULL,1,0);
VOID(my_init_dynamic_array(&acl_users,sizeof(ACL_USER),50,100));
- if (table->field[2]->field_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
+ password_length= table->field[2]->field_length /
+ table->field[2]->charset()->mbmaxlen;
+ if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
{
sql_print_error("Fatal error: mysql.user table is damaged or in "
"unsupported 3.20 format.");
@@ -257,10 +260,10 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
}
DBUG_PRINT("info",("user table fields: %d, password length: %d",
- table->s->fields, table->field[2]->field_length));
+ table->s->fields, password_length));
pthread_mutex_lock(&LOCK_global_system_variables);
- if (table->field[2]->field_length < SCRAMBLED_PASSWORD_CHAR_LENGTH)
+ if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH)
{
if (opt_secure_auth)
{
@@ -930,6 +933,9 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
ACL_USER *acl_user= 0;
DBUG_ENTER("acl_getroot_no_password");
+ DBUG_PRINT("enter", ("Host: '%s', Ip: '%s', User: '%s', db: '%s'",
+ (host ? host : "(NULL)"), (ip ? ip : "(NULL)"),
+ (user ? user : "(NULL)"), (db ? db : "(NULL)")));
sctx->user= user;
sctx->host= host;
sctx->ip= ip;
@@ -1486,6 +1492,11 @@ end:
bool is_acl_user(const char *host, const char *user)
{
bool res;
+
+ /* --skip-grants */
+ if (!initialized)
+ return TRUE;
+
VOID(pthread_mutex_lock(&acl_cache->lock));
res= find_acl_user(host, user, TRUE) != NULL;
VOID(pthread_mutex_unlock(&acl_cache->lock));
@@ -3504,17 +3515,38 @@ end:
bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
uint show_table, uint number, bool no_errors)
{
- TABLE_LIST *table;
+ TABLE_LIST *table, *first_not_own_table= thd->lex->first_not_own_table();
Security_context *sctx= thd->security_ctx;
+ uint i;
DBUG_ENTER("check_grant");
DBUG_ASSERT(number > 0);
+ /*
+ Walk through the list of tables that belong to the query and save the
+ requested access (orig_want_privilege) to be able to use it when
+ checking access rights to the underlying tables of a view. Our grant
+ system gradually eliminates checked bits from want_privilege and thus
+ after all checks are done we can no longer use it.
+ The check that first_not_own_table is not reached is for the case when
+ the given table list refers to the list for prelocking (contains tables
+ of other queries). For simple queries first_not_own_table is 0.
+ */
+ for (i= 0, table= tables;
+ table != first_not_own_table && i < number;
+ table= table->next_global, i++)
+ {
+ /* Remove SHOW_VIEW_ACL, because it will be checked during making view */
+ table->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
+ }
+
want_access&= ~sctx->master_access;
if (!want_access)
DBUG_RETURN(0); // ok
rw_rdlock(&LOCK_grant);
- for (table= tables; table && number--; table= table->next_global)
+ for (table= tables;
+ table && number-- && table != first_not_own_table;
+ table= table->next_global)
{
GRANT_TABLE *grant_table;
if (!(~table->grant.privilege & want_access) ||
@@ -3524,8 +3556,16 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
It is subquery in the FROM clause. VIEW set table->derived after
table opening, but this function always called before table opening.
*/
- table->grant.want_privilege= 0;
- continue; // Already checked
+ if (!table->referencing_view)
+ {
+ /*
+ If it's a temporary table created for a subquery in the FROM
+ clause, or an INFORMATION_SCHEMA table, drop the request for
+ a privilege.
+ */
+ table->grant.want_privilege= 0;
+ }
+ continue;
}
if (!(grant_table= table_hash_search(sctx->host, sctx->ip,
table->db, sctx->priv_user,
@@ -5834,24 +5874,37 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
const char *db, const char *table)
{
Security_context *sctx= thd->security_ctx;
+ DBUG_ENTER("fill_effective_table_privileges");
+ DBUG_PRINT("enter", ("Host: '%s', Ip: '%s', User: '%s', table: `%s`.`%s`",
+ sctx->priv_host, (sctx->ip ? sctx->ip : "(NULL)"),
+ (sctx->priv_user ? sctx->priv_user : "(NULL)"),
+ db, table));
/* --skip-grants */
if (!initialized)
{
+ DBUG_PRINT("info", ("skip grants"));
grant->privilege= ~NO_ACCESS; // everything is allowed
- return;
+ DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege));
+ DBUG_VOID_RETURN;
}
/* global privileges */
grant->privilege= sctx->master_access;
if (!sctx->priv_user)
- return; // it is slave
+ {
+ DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege));
+ DBUG_VOID_RETURN; // it is slave
+ }
/* db privileges */
grant->privilege|= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, 0);
if (!grant_option)
- return;
+ {
+ DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege));
+ DBUG_VOID_RETURN;
+ }
/* table privileges */
if (grant->version != grant_version)
@@ -5868,6 +5921,8 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant,
{
grant->privilege|= grant->grant_table->privs;
}
+ DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege));
+ DBUG_VOID_RETURN;
}
#else /* NO_EMBEDDED_ACCESS_CHECKS */
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 669f998cde5..e1f4b8f6076 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -466,7 +466,9 @@ void field_real::add()
void field_decimal::add()
{
+ /*TODO - remove rounding stuff after decimal_div returns proper frac */
my_decimal dec_buf, *dec= item->val_decimal(&dec_buf);
+ my_decimal rounded;
uint length;
TREE_ELEMENT *element;
@@ -476,6 +478,9 @@ void field_decimal::add()
return;
}
+ my_decimal_round(E_DEC_FATAL_ERROR, dec, item->decimals, FALSE,&rounded);
+ dec= &rounded;
+
length= my_decimal_string_length(dec);
if (decimal_is_zero(dec))
@@ -1021,10 +1026,16 @@ String *field_decimal::avg(String *s, ha_rows rows)
s->set((double) 0.0, 1,my_thd_charset);
return s;
}
- my_decimal num, avg_val;
+ my_decimal num, avg_val, rounded_avg;
+ int prec_increment= current_thd->variables.div_precincrement;
+
int2my_decimal(E_DEC_FATAL_ERROR, rows - nulls, FALSE, &num);
- my_decimal_div(E_DEC_FATAL_ERROR, &avg_val, sum+cur_sum, &num, 0);
- my_decimal2string(E_DEC_FATAL_ERROR, &avg_val, 0, 0, '0', s);
+ my_decimal_div(E_DEC_FATAL_ERROR, &avg_val, sum+cur_sum, &num, prec_increment);
+ /* TODO remove this after decimal_div returns proper frac */
+ my_decimal_round(E_DEC_FATAL_ERROR, &avg_val,
+ min(sum[cur_sum].frac + prec_increment, DECIMAL_MAX_SCALE),
+ FALSE,&rounded_avg);
+ my_decimal2string(E_DEC_FATAL_ERROR, &rounded_avg, 0, 0, '0', s);
return s;
}
@@ -1036,13 +1047,19 @@ String *field_decimal::std(String *s, ha_rows rows)
s->set((double) 0.0, 1,my_thd_charset);
return s;
}
- my_decimal num, std_val, sum2, sum2d;
+ my_decimal num, tmp, sum2, sum2d;
+ double std_sqr;
+ int prec_increment= current_thd->variables.div_precincrement;
+
int2my_decimal(E_DEC_FATAL_ERROR, rows - nulls, FALSE, &num);
my_decimal_mul(E_DEC_FATAL_ERROR, &sum2, sum+cur_sum, sum+cur_sum);
- my_decimal_div(E_DEC_FATAL_ERROR, &std_val, &sum2, &num, 0);
- my_decimal_sub(E_DEC_FATAL_ERROR, &sum2, sum_sqr+cur_sum, &std_val);
- my_decimal_div(E_DEC_FATAL_ERROR, &std_val, &sum2, &num, 0);
- my_decimal2string(E_DEC_FATAL_ERROR, &std_val, 0, 0, '0', s);
+ my_decimal_div(E_DEC_FATAL_ERROR, &tmp, &sum2, &num, prec_increment);
+ my_decimal_sub(E_DEC_FATAL_ERROR, &sum2, sum_sqr+cur_sum, &tmp);
+ my_decimal_div(E_DEC_FATAL_ERROR, &tmp, &sum2, &num, prec_increment);
+ my_decimal2double(E_DEC_FATAL_ERROR, &tmp, &std_sqr);
+ s->set(((double) std_sqr <= 0.0 ? 0.0 : sqrt(std_sqr)),
+ min(item->decimals + prec_increment, NOT_FIXED_DEC), my_thd_charset);
+
return s;
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 1de9411cad0..30dec528845 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -37,11 +37,11 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
TABLE_LIST *table_list, MEM_ROOT *mem_root);
static void free_cache_entry(TABLE *entry);
static void mysql_rm_tmp_tables(void);
-static my_bool open_new_frm(const char *path, const char *alias,
- const char *db, const char *table_name,
- uint db_stat, uint prgflag,
- uint ha_open_flags, TABLE *outparam,
- TABLE_LIST *table_desc, MEM_ROOT *mem_root);
+static bool open_new_frm(THD *thd, const char *path, const char *alias,
+ const char *db, const char *table_name,
+ uint db_stat, uint prgflag,
+ uint ha_open_flags, TABLE *outparam,
+ TABLE_LIST *table_desc, MEM_ROOT *mem_root);
extern "C" byte *table_cache_key(const byte *record,uint *length,
my_bool not_used __attribute__((unused)))
@@ -976,32 +976,57 @@ void wait_for_refresh(THD *thd)
}
-TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
+/*
+ Open table which is already name-locked by this thread.
+
+ SYNOPSIS
+ reopen_name_locked_table()
+ thd Thread handle
+ table_list TABLE_LIST object for table to be open, TABLE_LIST::table
+ member should point to TABLE object which was used for
+ name-locking.
+
+ NOTE
+ This function assumes that its caller already acquired LOCK_open mutex.
+
+ RETURN VALUE
+ FALSE - Success
+ TRUE - Error
+*/
+
+bool reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
{
- DBUG_ENTER("reopen_name_locked_table");
- if (thd->killed)
- DBUG_RETURN(0);
- TABLE *table;
+ TABLE *table= table_list->table;
TABLE_SHARE *share;
- if (!(table = table_list->table))
- DBUG_RETURN(0);
+ char *db= table_list->db;
+ char *table_name= table_list->table_name;
+ char key[MAX_DBKEY_LENGTH];
+ uint key_length;
+ TABLE orig_table;
+ DBUG_ENTER("reopen_name_locked_table");
- char* db = thd->db ? thd->db : table_list->db;
- char* table_name = table_list->table_name;
- char key[MAX_DBKEY_LENGTH];
- uint key_length;
+ safe_mutex_assert_owner(&LOCK_open);
+
+ if (thd->killed || !table)
+ DBUG_RETURN(TRUE);
+
+ orig_table= *table;
key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
- pthread_mutex_lock(&LOCK_open);
if (open_unireg_entry(thd, table, db, table_name, table_name, 0,
thd->mem_root) ||
!(table->s->table_cache_key= memdup_root(&table->mem_root, (char*) key,
key_length)))
{
- delete table->triggers;
- closefrm(table);
- pthread_mutex_unlock(&LOCK_open);
- DBUG_RETURN(0);
+ intern_close_table(table);
+ /*
+ If there was an error during opening of table (for example if it
+ does not exist) '*table' object can be wiped out. To be able
+ properly release name-lock in this case we should restore this
+ object to its original state.
+ */
+ *table= orig_table;
+ DBUG_RETURN(TRUE);
}
share= table->s;
@@ -1011,7 +1036,6 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
share->flush_version=0;
table->in_use = thd;
check_unused();
- pthread_mutex_unlock(&LOCK_open);
table->next = thd->open_tables;
thd->open_tables = table;
table->tablenr=thd->current_tablenr++;
@@ -1021,7 +1045,7 @@ TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table_list)
table->status=STATUS_NO_RECORD;
table->keys_in_use_for_query= share->keys_in_use;
table->used_keys= share->keys_for_keyread;
- DBUG_RETURN(table);
+ DBUG_RETURN(FALSE);
}
@@ -1169,10 +1193,11 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
*/
{
char path[FN_REFLEN];
+ db_type not_used;
strxnmov(path, FN_REFLEN, mysql_data_home, "/", table_list->db, "/",
table_list->table_name, reg_ext, NullS);
(void) unpack_filename(path, path);
- if (mysql_frm_type(path) == FRMTYPE_VIEW)
+ if (mysql_frm_type(thd, path, &not_used) == FRMTYPE_VIEW)
{
TABLE tab;// will not be used (because it's VIEW) but have to be passed
table= &tab;
@@ -1731,7 +1756,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
thd->open_options, entry)) &&
(error != 5 ||
(fn_format(path, path, 0, reg_ext, MY_UNPACK_FILENAME),
- open_new_frm(path, alias, db, name,
+ open_new_frm(thd, path, alias, db, name,
(uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE |
HA_GET_INDEX | HA_TRY_READ_ONLY),
READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD,
@@ -1947,11 +1972,11 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
derived/information schema tables and views possible. Thus "counter"
may be still zero for prelocked statement...
- NOTE: The above notes may be out of date. Please wait for psergey to
+ NOTE: The above notes may be out of date. Please wait for psergey to
document new prelocked behavior.
*/
-
- if (!thd->prelocked_mode && !thd->lex->requires_prelocking() &&
+
+ if (!thd->prelocked_mode && !thd->lex->requires_prelocking() &&
thd->lex->sroutines_list.elements)
{
bool first_no_prelocking, need_prelocking;
@@ -2001,7 +2026,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
/* VIEW placeholder */
(*counter)--;
- /*
+ /*
tables->next_global list consists of two parts:
1) Query tables and underlying tables of views.
2) Tables used by all stored routines that this statement invokes on
@@ -2610,7 +2635,7 @@ bool rm_temporary_table(enum db_type base, char *path)
if (my_delete(path,MYF(0)))
error=1; /* purecov: inspected */
*fn_ext(path)='\0'; // remove extension
- handler *file=get_new_handler((TABLE*) 0, base);
+ handler *file= get_new_handler((TABLE*) 0, current_thd->mem_root, base);
if (file && file->delete_table(path))
{
error=1;
@@ -2658,6 +2683,47 @@ static void update_field_dependencies(THD *thd, Field *field, TABLE *table)
}
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+/*
+ Check column rights in given security context
+
+ SYNOPSIS
+ check_grant_column_in_sctx()
+ thd thread handler
+ grant grant information structure
+ db db name
+ table table name
+ name column name
+ length column name length
+ check_grants need to check grants
+ sctx 0 or security context
+
+ RETURN
+ FALSE OK
+ TRUE access denied
+*/
+
+static bool check_grant_column_in_sctx(THD *thd, GRANT_INFO *grant,
+ const char *db, const char *table,
+ const char *name, uint length,
+ bool check_grants,
+ Security_context *sctx)
+{
+ if (!check_grants)
+ return FALSE;
+ Security_context *save_security_ctx= thd->security_ctx;
+ bool res;
+ if (sctx)
+ {
+ thd->security_ctx= sctx;
+ }
+ res= check_grant_column(thd, grant, db, table, name, length);
+ thd->security_ctx= save_security_ctx;
+ return res;
+}
+#endif
+
+
/*
Find a field by name in a view that uses merge algorithm.
@@ -2708,11 +2774,11 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list,
*/
DBUG_RETURN(((Item_field*) (field_it.item()))->field);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (check_grants &&
- check_grant_column(thd, &table_list->grant,
- table_list->view_db.str,
- table_list->view_name.str,
- name, length))
+ if (check_grant_column_in_sctx(thd, &table_list->grant,
+ table_list->view_db.str,
+ table_list->view_name.str, name, length,
+ check_grants,
+ table_list->security_ctx))
DBUG_RETURN(WRONG_GRANT);
#endif
// in PS use own arena or data will be freed after prepare
@@ -2789,7 +2855,6 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
Natural_join_column *nj_col;
Field *found_field;
Query_arena *arena, backup;
-
DBUG_ENTER("find_field_in_natural_join");
DBUG_PRINT("enter", ("field name: '%s', ref 0x%lx",
name, (ulong) ref));
@@ -2814,6 +2879,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
if (nj_col->view_field)
{
+ Item *item;
/*
The found field is a view field, we do as in find_field_in_view()
and return a pointer to pointer to the Item of that field.
@@ -2821,7 +2887,7 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
if (register_tree_change)
arena= thd->activate_stmt_arena_if_needed(&backup);
- Item *item= nj_col->create_item(thd);
+ item= nj_col->create_item(thd);
if (register_tree_change && arena)
thd->restore_active_arena(arena, &backup);
@@ -2881,7 +2947,8 @@ find_field_in_natural_join(THD *thd, TABLE_LIST *table_ref, const char *name,
Field *
find_field_in_table(THD *thd, TABLE *table, const char *name, uint length,
bool check_grants, bool allow_rowid,
- uint *cached_field_index_ptr)
+ uint *cached_field_index_ptr,
+ Security_context *sctx)
{
Field **field_ptr, *field;
uint cached_field_index= *cached_field_index_ptr;
@@ -2890,7 +2957,7 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, uint length,
/* We assume here that table->field < NO_CACHED_FIELD_INDEX = UINT_MAX */
if (cached_field_index < table->s->fields &&
- !my_strcasecmp(system_charset_info,
+ !my_strcasecmp(system_charset_info,
table->field[cached_field_index]->field_name, name))
field_ptr= table->field + cached_field_index;
else if (table->s->name_hash.records)
@@ -2921,9 +2988,10 @@ find_field_in_table(THD *thd, TABLE *table, const char *name, uint length,
update_field_dependencies(thd, field, table);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (check_grants && check_grant_column(thd, &table->grant,
- table->s->db,
- table->s->table_name, name, length))
+ if (check_grant_column_in_sctx(thd, &table->grant,
+ table->s->db, table->s->table_name,
+ name, length,
+ check_grants, sctx))
field= WRONG_GRANT;
#endif
DBUG_RETURN(field);
@@ -3035,7 +3103,8 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
DBUG_ASSERT(table_list->table);
if ((fld= find_field_in_table(thd, table_list->table, name, length,
check_grants_table, allow_rowid,
- cached_field_index_ptr)))
+ cached_field_index_ptr,
+ table_list->security_ctx)))
*actual_table= table_list;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/* check for views with temporary table algorithm */
@@ -3205,7 +3274,8 @@ find_field_in_tables(THD *thd, Item_ident *item,
test(table_ref->table->
grant.want_privilege) &&
check_privileges,
- 1, &(item->cached_field_index));
+ 1, &(item->cached_field_index),
+ table_ref->security_ctx);
else
found= find_field_in_table_ref(thd, table_ref, name, item->name,
NULL, NULL, length, ref,
@@ -4293,7 +4363,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
thd->set_query_id=set_query_id;
thd->allow_sum_func= allow_sum_func;
- thd->where="field list";
+ thd->where= THD::DEFAULT_WHERE;
/*
To prevent fail on forward lookup we fill it with zerows,
@@ -4345,8 +4415,12 @@ TABLE_LIST **make_leaves_list(TABLE_LIST **list, TABLE_LIST *tables)
{
for (TABLE_LIST *table= tables; table; table= table->next_local)
{
- if (table->view && table->effective_algorithm == VIEW_ALGORITHM_MERGE)
- list= make_leaves_list(list, table->ancestor);
+ if (table->merge_underlying_list)
+ {
+ DBUG_ASSERT(table->view &&
+ table->effective_algorithm == VIEW_ALGORITHM_MERGE);
+ list= make_leaves_list(list, table->merge_underlying_list);
+ }
else
{
*list= table;
@@ -4446,16 +4520,17 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
table_list;
table_list= table_list->next_local)
{
- if (table_list->ancestor)
+ if (table_list->merge_underlying_list)
{
- DBUG_ASSERT(table_list->view);
+ DBUG_ASSERT(table_list->view &&
+ table_list->effective_algorithm == VIEW_ALGORITHM_MERGE);
Query_arena *arena= thd->stmt_arena, backup;
bool res;
if (arena->is_conventional())
arena= 0; // For easier test
else
thd->set_n_backup_active_arena(arena, &backup);
- res= table_list->setup_ancestor(thd);
+ res= table_list->setup_underlying(thd);
if (arena)
thd->restore_active_arena(arena, &backup);
if (res)
@@ -5233,6 +5308,7 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order)
SYNOPSIS
open_new_frm()
+ THD thread handler
path path to .frm
alias alias for table
db database
@@ -5246,8 +5322,8 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order)
mem_root temporary MEM_ROOT for parsing
*/
-static my_bool
-open_new_frm(const char *path, const char *alias,
+static bool
+open_new_frm(THD *thd, const char *path, const char *alias,
const char *db, const char *table_name,
uint db_stat, uint prgflag,
uint ha_open_flags, TABLE *outparam, TABLE_LIST *table_desc,
@@ -5269,7 +5345,7 @@ open_new_frm(const char *path, const char *alias,
my_error(ER_WRONG_OBJECT, MYF(0), db, table_name, "BASE TABLE");
goto err;
}
- if (mysql_make_view(parser, table_desc))
+ if (mysql_make_view(thd, parser, table_desc))
goto err;
}
else
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index f17825e6d2c..c150489f311 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1204,6 +1204,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
#endif /*!EMBEDDED_LIBRARY*/
thd->limit_found_rows = query->found_rows();
+ thd->status_var.last_query_cost= 0.0;
BLOCK_UNLOCK_RD(query_block);
DBUG_RETURN(1); // Result sent to client
@@ -2207,15 +2208,10 @@ Query_cache::register_tables_from_list(TABLE_LIST *tables_used,
tables_used->view_db.length + 1,
HA_CACHE_TBL_NONTRANSACT, 0, 0))
DBUG_RETURN(0);
- {
- TABLE_COUNTER_TYPE inc= register_tables_from_list(tables_used->ancestor,
- n + 1,
- block_table + 1);
- if (!inc)
- DBUG_RETURN(0);
- n+= inc;
- block_table+= inc;
- }
+ /*
+ We do not need to register view tables here because they are already
+ present in the global list.
+ */
}
else
{
@@ -2831,13 +2827,6 @@ static TABLE_COUNTER_TYPE process_and_count_tables(TABLE_LIST *tables_used,
tables_used->view_name.str,
tables_used->view_db.str));
*tables_type|= HA_CACHE_TBL_NONTRANSACT;
- {
- TABLE_COUNTER_TYPE subcount;
- if (!(subcount= process_and_count_tables(tables_used->ancestor,
- tables_type)))
- DBUG_RETURN(0);
- table_count+= subcount;
- }
}
else
{
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index fc7ea6a2794..fc9df020b6c 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -44,6 +44,8 @@
*/
char internal_table_name[2]= "*";
+const char * const THD::DEFAULT_WHERE= "field list";
+
/*****************************************************************************
** Instansiate templates
@@ -218,6 +220,7 @@ THD::THD()
#ifndef EMBEDDED_LIBRARY
net.vio=0;
#endif
+ client_capabilities= 0; // minimalistic client
net.last_error[0]=0; // If error on boot
net.query_cache_query=0; // If error on boot
ull=0;
@@ -233,7 +236,7 @@ THD::THD()
/* Variables with default values */
proc_info="login";
- where="field list";
+ where= THD::DEFAULT_WHERE;
server_id = ::server_id;
slave_net = 0;
command=COM_CONNECT;
@@ -544,6 +547,8 @@ void THD::cleanup_after_query()
}
/* Free Items that were created during this execution */
free_items();
+ /* Reset where. */
+ where= THD::DEFAULT_WHERE;
}
/*
@@ -1703,15 +1708,19 @@ Statement_map::Statement_map() :
int Statement_map::insert(Statement *statement)
{
- int rc= my_hash_insert(&st_hash, (byte *) statement);
+ int res= my_hash_insert(&st_hash, (byte *) statement);
+ if (res)
+ return res;
if (statement->name.str)
{
- if ((rc= my_hash_insert(&names_hash, (byte*)statement)))
+ if ((res= my_hash_insert(&names_hash, (byte*)statement)))
+ {
hash_delete(&st_hash, (byte*)statement);
+ return res;
+ }
}
- if (rc == 0)
- last_found_statement= statement;
- return rc;
+ last_found_statement= statement;
+ return res;
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 9e751c37608..0a34de11528 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -189,8 +189,11 @@ class MYSQL_LOG: public TC_LOG
{
private:
/* LOCK_log and LOCK_index are inited by init_pthread_objects() */
- pthread_mutex_t LOCK_log, LOCK_index;
+ pthread_mutex_t LOCK_log, LOCK_index, LOCK_readers;
+ pthread_mutex_t LOCK_prep_xids;
+ pthread_cond_t COND_prep_xids;
pthread_cond_t update_cond;
+ pthread_cond_t reset_cond;
ulonglong bytes_written;
time_t last_time,query_start;
IO_CACHE log_file;
@@ -198,21 +201,6 @@ class MYSQL_LOG: public TC_LOG
char *name;
char time_buff[20],db[NAME_LEN+1];
char log_file_name[FN_REFLEN],index_file_name[FN_REFLEN];
- // current file sequence number for load data infile binary logging
- uint file_id;
- uint open_count; // For replication
- volatile enum_log_type log_type;
- enum cache_type io_cache_type;
- bool write_error, inited;
- bool need_start_event;
- /*
- no_auto_events means we don't want any of these automatic events :
- Start/Rotate/Stop. That is, in 4.x when we rotate a relay log, we don't want
- a Rotate_log event to be written to the relay log. When we start a relay log
- etc. So in 4.x this is 1 for relay logs, 0 for binlogs.
- In 5.0 it's 0 for relay logs too!
- */
- bool no_auto_events;
/*
The max size before rotation (usable only if log_type == LOG_BIN: binary
logs and relay logs).
@@ -224,13 +212,38 @@ class MYSQL_LOG: public TC_LOG
fix_max_relay_log_size).
*/
ulong max_size;
-
ulong prepared_xids; /* for tc log - number of xids to remember */
- pthread_mutex_t LOCK_prep_xids;
- pthread_cond_t COND_prep_xids;
+ volatile enum_log_type log_type;
+ enum cache_type io_cache_type;
+ // current file sequence number for load data infile binary logging
+ uint file_id;
+ uint open_count; // For replication
+ int readers_count;
+ bool reset_pending;
+ bool write_error, inited;
+ bool need_start_event;
+ /*
+ no_auto_events means we don't want any of these automatic events :
+ Start/Rotate/Stop. That is, in 4.x when we rotate a relay log, we don't
+ want a Rotate_log event to be written to the relay log. When we start a
+ relay log etc. So in 4.x this is 1 for relay logs, 0 for binlogs.
+ In 5.0 it's 0 for relay logs too!
+ */
+ bool no_auto_events;
friend class Log_event;
public:
+ /*
+ These describe the log's format. This is used only for relay logs.
+ _for_exec is used by the SQL thread, _for_queue by the I/O thread. It's
+ necessary to have 2 distinct objects, because the I/O thread may be reading
+ events in a different format from what the SQL thread is reading (consider
+ the case of a master which has been upgraded from 5.0 to 5.1 without doing
+ RESET MASTER, or from 4.x to 5.0).
+ */
+ Format_description_log_event *description_event_for_exec,
+ *description_event_for_queue;
+
MYSQL_LOG();
/*
note that there's no destructor ~MYSQL_LOG() !
@@ -243,18 +256,6 @@ public:
int log(THD *thd, my_xid xid);
void unlog(ulong cookie, my_xid xid);
int recover(IO_CACHE *log, Format_description_log_event *fdle);
-
- /*
- These describe the log's format. This is used only for relay logs.
- _for_exec is used by the SQL thread, _for_queue by the I/O thread. It's
- necessary to have 2 distinct objects, because the I/O thread may be reading
- events in a different format from what the SQL thread is reading (consider
- the case of a master which has been upgraded from 5.0 to 5.1 without doing
- RESET MASTER, or from 4.x to 5.0).
- */
- Format_description_log_event *description_event_for_exec,
- *description_event_for_queue;
-
void reset_bytes_written()
{
bytes_written = 0;
@@ -334,6 +335,9 @@ public:
int purge_logs_before_date(time_t purge_time);
int purge_first_log(struct st_relay_log_info* rli, bool included);
bool reset_logs(THD* thd);
+ inline bool is_reset_pending() { return reset_pending; }
+ void readers_addref();
+ void readers_release();
void close(uint exiting);
// iterating through the log index file
@@ -1115,6 +1119,14 @@ class THD :public Statement,
public Open_tables_state
{
public:
+ /*
+ Constant for THD::where initialization in the beginning of every query.
+
+ It's needed because we do not save/restore THD::where normally during
+ primary (non subselect) query execution.
+ */
+ static const char * const DEFAULT_WHERE;
+
#ifdef EMBEDDED_LIBRARY
struct st_mysql *mysql;
struct st_mysql_data *data;
@@ -1911,6 +1923,7 @@ typedef struct st_sort_field {
Field *field; /* Field to sort */
Item *item; /* Item if not sorting fields */
uint length; /* Length of sort field */
+ uint suffix_length; /* Length suffix (0-4) */
Item_result result_type; /* Type of item */
bool reverse; /* if descending sort */
bool need_strxnfrm; /* If we have to use strxnfrm() */
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 584601fe202..816aba25218 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -38,6 +38,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
bool using_limit=limit != HA_POS_ERROR;
bool transactional_table, safe_update, const_cond;
ha_rows deleted;
+ uint usable_index= MAX_KEY;
SELECT_LEX *select_lex= &thd->lex->select_lex;
DBUG_ENTER("mysql_delete");
@@ -141,27 +142,42 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
tables.table = table;
tables.alias = table_list->alias;
- table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
- MYF(MY_FAE | MY_ZEROFILL));
if (select_lex->setup_ref_array(thd, order->elements) ||
setup_order(thd, select_lex->ref_pointer_array, &tables,
- fields, all_fields, (ORDER*) order->first) ||
- !(sortorder=make_unireg_sortorder((ORDER*) order->first, &length)) ||
+ fields, all_fields, (ORDER*) order->first))
+ {
+ delete select;
+ free_underlaid_joins(thd, &thd->lex->select_lex);
+ DBUG_RETURN(TRUE);
+ }
+
+ if (!select && limit != HA_POS_ERROR)
+ usable_index= get_index_for_order(table, (ORDER*)(order->first), limit);
+
+ if (usable_index == MAX_KEY)
+ {
+ table->sort.io_cache= (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
+ MYF(MY_FAE | MY_ZEROFILL));
+
+ if (!(sortorder= make_unireg_sortorder((ORDER*) order->first,
+ &length)) ||
(table->sort.found_records = filesort(thd, table, sortorder, length,
- select, HA_POS_ERROR,
- &examined_rows))
+ select, HA_POS_ERROR,
+ &examined_rows))
== HA_POS_ERROR)
- {
+ {
+ delete select;
+ free_underlaid_joins(thd, &thd->lex->select_lex);
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ Filesort has already found and selected the rows we want to delete,
+ so we don't need the where clause
+ */
delete select;
free_underlaid_joins(thd, select_lex);
- DBUG_RETURN(TRUE);
+ select= 0;
}
- /*
- Filesort has already found and selected the rows we want to delete,
- so we don't need the where clause
- */
- delete select;
- select= 0;
}
/* If quick select is used, initialize it before retrieving rows. */
@@ -171,7 +187,11 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
free_underlaid_joins(thd, select_lex);
DBUG_RETURN(TRUE);
}
- init_read_record(&info,thd,table,select,1,1);
+ if (usable_index==MAX_KEY)
+ init_read_record(&info,thd,table,select,1,1);
+ else
+ init_read_record_idx(&info, thd, table, 1, usable_index);
+
deleted=0L;
init_ftfuncs(thd, select_lex, 1);
thd->proc_info="updating";
@@ -404,8 +424,9 @@ bool mysql_multi_delete_prepare(THD *thd)
if (!(target_tbl->table= target_tbl->correspondent_table->table))
{
DBUG_ASSERT(target_tbl->correspondent_table->view &&
- target_tbl->correspondent_table->ancestor &&
- target_tbl->correspondent_table->ancestor->next_local);
+ target_tbl->correspondent_table->merge_underlying_list &&
+ target_tbl->correspondent_table->merge_underlying_list->
+ next_local);
my_error(ER_VIEW_DELETE_MERGE_VIEW, MYF(0),
target_tbl->correspondent_table->view_db.str,
target_tbl->correspondent_table->view_name.str);
@@ -830,7 +851,8 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
if (!dont_send_ok)
{
db_type table_type;
- if ((table_type=get_table_type(thd, path)) == DB_TYPE_UNKNOWN)
+ mysql_frm_type(thd, path, &table_type);
+ if (table_type == DB_TYPE_UNKNOWN)
{
my_error(ER_NO_SUCH_TABLE, MYF(0),
table_list->db, table_list->table_name);
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 74b239e1637..e1817985cbd 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -35,14 +35,14 @@
processor procedure of derived table processing
RETURN
- 0 ok
- 1 Error and error message given
+ FALSE OK
+ TRUE Error
*/
-int
-mysql_handle_derived(LEX *lex, int (*processor)(THD*, LEX*, TABLE_LIST*))
+bool
+mysql_handle_derived(LEX *lex, bool (*processor)(THD*, LEX*, TABLE_LIST*))
{
- int res= 0;
+ bool res= FALSE;
if (lex->derived_tables)
{
lex->thd->derived_tables_processing= TRUE;
@@ -95,16 +95,16 @@ out:
close_thread_tables()
RETURN
- 0 ok
- 1 Error and an error message was given
+ FALSE OK
+ TRUE Error
*/
-int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
+bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
{
SELECT_LEX_UNIT *unit= orig_table_list->derived;
- int res= 0;
ulonglong create_options;
DBUG_ENTER("mysql_derived_prepare");
+ bool res= FALSE;
if (unit)
{
SELECT_LEX *first_select= unit->first_select();
@@ -118,7 +118,7 @@ int mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
sl->context.outer_context= 0;
if (!(derived_result= new select_union))
- DBUG_RETURN(1); // out of memory
+ DBUG_RETURN(TRUE); // out of memory
// st_select_lex_unit::prepare correctly work for single select
if ((res= unit->prepare(thd, derived_result, 0)))
@@ -184,7 +184,10 @@ exit:
table->derived_select_number= first_select->select_number;
table->s->tmp_table= TMP_TABLE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- table->grant.privilege= SELECT_ACL;
+ if (orig_table_list->referencing_view)
+ table->grant= orig_table_list->grant;
+ else
+ table->grant.privilege= SELECT_ACL;
#endif
orig_table_list->db= (char *)"";
orig_table_list->db_length= 0;
@@ -195,8 +198,8 @@ exit:
thd->derived_tables= table;
}
}
- else if (orig_table_list->ancestor)
- orig_table_list->set_ancestor();
+ else if (orig_table_list->merge_underlying_list)
+ orig_table_list->set_underlying_merge();
DBUG_RETURN(res);
}
@@ -220,15 +223,15 @@ exit:
Due to evaluation of LIMIT clause it can not be used at prepared stage.
RETURN
- 0 ok
- 1 Error and an error message was given
+ FALSE OK
+ TRUE Error
*/
-int mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
+bool mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
{
TABLE *table= orig_table_list->table;
SELECT_LEX_UNIT *unit= orig_table_list->derived;
- int res= 0;
+ bool res= FALSE;
/*check that table creation pass without problem and it is derived table */
if (table && unit)
@@ -271,7 +274,7 @@ int mysql_derived_filling(THD *thd, LEX *lex, TABLE_LIST *orig_table_list)
there were no derived tables
*/
if (derived_result->flush())
- res= 1;
+ res= TRUE;
if (!lex->describe)
unit->cleanup();
diff --git a/sql/sql_error.cc b/sql/sql_error.cc
index 2e262569386..191a6e0a1fd 100644
--- a/sql/sql_error.cc
+++ b/sql/sql_error.cc
@@ -144,6 +144,8 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
thd->really_abort_on_warning()) ?
MYSQL_ERROR::WARN_LEVEL_ERROR : level))
{
+ if (! thd->spcont->found_handler_here())
+ thd->net.report_error= 1; /* Make "select" abort correctly */
DBUG_RETURN(NULL);
}
query_cache_abort(&thd->net);
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index dc2255fd6e8..0715aeeaa5b 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -599,7 +599,8 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen,
{
Item *cond= new Item_func_like(new Item_field(pfname),
new Item_string(mask,mlen,pfname->charset()),
- new Item_string("\\",1,&my_charset_latin1));
+ new Item_string("\\",1,&my_charset_latin1),
+ FALSE);
if (thd->is_fatal_error)
return 0; // OOM
return prepare_simple_select(thd, cond, table, error);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index beca9842e6d..8877cc17bf0 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1822,7 +1822,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
#endif
if (thd->killed || di->status)
break;
- if (error == ETIMEDOUT)
+ if (error == ETIMEDOUT || error == ETIME)
{
thd->killed= THD::KILL_CONNECTION;
break;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index d76e8d04ae6..64f9256cc83 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -176,6 +176,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->spcont= NULL;
lex->proc_list.first= 0;
lex->query_tables_own_last= 0;
+ lex->escape_used= FALSE;
if (lex->sroutines.records)
my_hash_reset(&lex->sroutines);
@@ -1134,6 +1135,7 @@ void st_select_lex::init_query()
ref_pointer_array= 0;
select_n_having_items= 0;
subquery_in_having= explicit_limit= 0;
+ is_item_list_lookup= 0;
first_execution= 1;
first_cond_optimization= 1;
parsing_place= NO_MATTER;
@@ -1166,6 +1168,7 @@ void st_select_lex::init_select()
select_limit= 0; /* denotes the default limit = HA_POS_ERROR */
offset_limit= 0; /* denotes the default offset = 0 */
with_sum_func= 0;
+
}
/*
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 7640b6eb569..96ed32a0d2e 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -362,8 +362,8 @@ public:
friend class st_select_lex_unit;
friend bool mysql_new_select(struct st_lex *lex, bool move_down);
- friend my_bool mysql_make_view (File_parser *parser,
- TABLE_LIST *table);
+ friend bool mysql_make_view(THD *thd, File_parser *parser,
+ TABLE_LIST *table);
private:
void fast_exclude();
};
@@ -387,12 +387,12 @@ protected:
select_result *result;
ulong found_rows_for_union;
bool res;
+public:
bool prepared, // prepare phase already performed for UNION (unit)
optimized, // optimize phase already performed for UNION (unit)
executed, // already executed
cleaned;
-public:
// list of fields which points to temporary table for union
List<Item> item_list;
/*
@@ -483,6 +483,7 @@ public:
List<Item> item_list; /* list of fields & expressions */
List<String> interval_list, use_index, *use_index_ptr,
ignore_index, *ignore_index_ptr;
+ bool is_item_list_lookup;
/*
Usualy it is pointer to ftfunc_list_alloc, but in union used to create fake
select_lex for calling mysql_select under results of union
@@ -639,6 +640,11 @@ public:
SELECT_LEX and all nested SELECT_LEXes and SELECT_LEX_UNITs).
*/
bool cleanup();
+ /*
+ Recursively cleanup the join of this select lex and of all nested
+ select lexes.
+ */
+ void cleanup_all_joins(bool full);
};
typedef class st_select_lex SELECT_LEX;
@@ -746,6 +752,7 @@ typedef struct st_lex
/* store original leaf_tables for INSERT SELECT and PS/SP */
TABLE_LIST *leaf_tables_insert;
st_lex_user *create_view_definer;
+ char *create_view_start;
char *create_view_select_start;
/* Partition info structure filled in by PARTITION BY parse part */
partition_info *part_info;
@@ -810,6 +817,11 @@ typedef struct st_lex
*/
uint table_count;
uint8 describe;
+ /*
+ A flag that indicates what kinds of derived tables are present in the
+ query (0 if no derived tables, otherwise a combination of flags
+ DERIVED_SUBQUERY and DERIVED_VIEW).
+ */
uint8 derived_tables;
uint8 create_view_algorithm;
uint8 create_view_check;
@@ -904,6 +916,8 @@ typedef struct st_lex
during replication ("LOCAL 'filename' REPLACE INTO" part).
*/
uchar *fname_start, *fname_end;
+
+ bool escape_used;
st_lex();
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 895065241f4..44ddf11757a 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1025,8 +1025,20 @@ int READ_INFO::read_field()
*to++= (byte) escape_char;
goto found_eof;
}
- *to++ = (byte) unescape((char) chr);
- continue;
+ /*
+ When escape_char == enclosed_char, we treat it like we do for
+ handling quotes in SQL parsing -- you can double-up the
+ escape_char to include it literally, but it doesn't do escapes
+ like \n. This allows: LOAD DATA ... ENCLOSED BY '"' ESCAPED BY '"'
+ with data like: "fie""ld1", "field2"
+ */
+ if (escape_char != enclosed_char || chr == escape_char)
+ {
+ *to++ = (byte) unescape((char) chr);
+ continue;
+ }
+ PUSH(chr);
+ chr= escape_char;
}
#ifdef ALLOW_LINESEPARATOR_IN_STRINGS
if (chr == line_term_char)
diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc
index 34334d3a01d..1d3acd1696c 100644
--- a/sql/sql_manager.cc
+++ b/sql/sql_manager.cc
@@ -58,12 +58,14 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused)))
set_timespec(abstime, flush_time);
reset_flush_time = FALSE;
}
- while (!manager_status && !error && !abort_loop)
- error = pthread_cond_timedwait(&COND_manager, &LOCK_manager, &abstime);
+ while (!manager_status && (!error || error == EINTR) && !abort_loop)
+ error= pthread_cond_timedwait(&COND_manager, &LOCK_manager, &abstime);
}
else
- while (!manager_status && !error && !abort_loop)
- error = pthread_cond_wait(&COND_manager, &LOCK_manager);
+ {
+ while (!manager_status && (!error || error == EINTR) && !abort_loop)
+ error= pthread_cond_wait(&COND_manager, &LOCK_manager);
+ }
status = manager_status;
manager_status = 0;
pthread_mutex_unlock(&LOCK_manager);
@@ -71,7 +73,7 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused)))
if (abort_loop)
break;
- if (error) /* == ETIMEDOUT */
+ if (error == ETIMEDOUT || error == ETIME)
{
flush_tables();
error = 0;
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index f5391cd546d..939961ab7e8 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1769,6 +1769,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Saved variable value */
my_bool old_innodb_table_locks=
IF_INNOBASE_DB(thd->variables.innodb_table_locks, FALSE);
+ /* used as fields initializator */
+ lex_start(thd, 0, 0);
statistic_increment(thd->status_var.com_stat[SQLCOM_SHOW_FIELDS],
@@ -2319,8 +2321,6 @@ mysql_execute_command(THD *thd)
LEX *lex= thd->lex;
/* first SELECT_LEX (have special meaning for many of non-SELECTcommands) */
SELECT_LEX *select_lex= &lex->select_lex;
- bool slave_fake_lock= 0;
- MYSQL_LOCK *fake_prev_lock= 0;
/* first table of first SELECT_LEX */
TABLE_LIST *first_table= (TABLE_LIST*) select_lex->table_list.first;
/* list of all tables in query */
@@ -2369,34 +2369,21 @@ mysql_execute_command(THD *thd)
#ifdef HAVE_REPLICATION
if (thd->slave_thread)
{
- if (lex->sql_command == SQLCOM_UPDATE_MULTI)
- {
- DBUG_PRINT("info",("need faked locked tables"));
-
- if (check_multi_update_lock(thd))
- goto error;
-
- /* Fix for replication, the tables are opened and locked,
- now we pretend that we have performed a LOCK TABLES action */
-
- fake_prev_lock= thd->locked_tables;
- if (thd->lock)
- thd->locked_tables= thd->lock;
- thd->lock= 0;
- slave_fake_lock= 1;
- }
/*
- Skip if we are in the slave thread, some table rules have been
- given and the table list says the query should not be replicated.
+ Check if statment should be skipped because of slave filtering
+ rules
Exceptions are:
+ - UPDATE MULTI: For this statement, we want to check the filtering
+ rules later in the code
- SET: we always execute it (Not that many SET commands exists in
the binary log anyway -- only 4.1 masters write SET statements,
in 5.0 there are no SET statements in the binary log)
- DROP TEMPORARY TABLE IF EXISTS: we always execute it (otherwise we
have stale files on slave caused by exclusion of one tmp table).
*/
- if (!(lex->sql_command == SQLCOM_SET_OPTION) &&
+ if (!(lex->sql_command == SQLCOM_UPDATE_MULTI) &&
+ !(lex->sql_command == SQLCOM_SET_OPTION) &&
!(lex->sql_command == SQLCOM_DROP_TABLE &&
lex->drop_temporary && lex->drop_if_exists) &&
all_tables_not_ok(thd, all_tables))
@@ -2419,7 +2406,7 @@ mysql_execute_command(THD *thd)
}
#endif
}
-#endif /* !HAVE_REPLICATION */
+#endif /* HAVE_REPLICATION */
/*
When option readonly is set deny operations which change tables.
@@ -3211,23 +3198,36 @@ end_with_restore_list:
if (result != 2)
break;
case SQLCOM_UPDATE_MULTI:
+ {
+ DBUG_ASSERT(first_table == all_tables && first_table != 0);
+ /* if we switched from normal update, rights are checked */
+ if (result != 2)
{
- DBUG_ASSERT(first_table == all_tables && first_table != 0);
- /* if we switched from normal update, rights are checked */
- if (result != 2)
- {
- if ((res= multi_update_precheck(thd, all_tables)))
- break;
- }
- else
- res= 0;
-
- res= mysql_multi_update(thd, all_tables,
- &select_lex->item_list,
- &lex->value_list,
- select_lex->where,
- select_lex->options,
- lex->duplicates, lex->ignore, unit, select_lex);
+ if ((res= multi_update_precheck(thd, all_tables)))
+ break;
+ }
+ else
+ res= 0;
+
+ if ((res= mysql_multi_update_prepare(thd)))
+ break;
+
+#ifdef HAVE_REPLICATION
+ /* Check slave filtering rules */
+ if (thd->slave_thread && all_tables_not_ok(thd, all_tables))
+ {
+ /* we warn the slave SQL thread */
+ my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
+ break;
+ }
+#endif /* HAVE_REPLICATION */
+
+ res= mysql_multi_update(thd, all_tables,
+ &select_lex->item_list,
+ &lex->value_list,
+ select_lex->where,
+ select_lex->options,
+ lex->duplicates, lex->ignore, unit, select_lex);
break;
}
case SQLCOM_REPLACE:
@@ -3688,6 +3688,8 @@ end_with_restore_list:
if (check_access(thd, INSERT_ACL, "mysql", 0, 1, 1, 0) &&
check_global_access(thd,CREATE_USER_ACL))
break;
+ if (end_active_trans(thd))
+ goto error;
if (!(res= mysql_create_user(thd, lex->users_list)))
{
if (mysql_bin_log.is_open())
@@ -3704,6 +3706,8 @@ end_with_restore_list:
if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 1, 0) &&
check_global_access(thd,CREATE_USER_ACL))
break;
+ if (end_active_trans(thd))
+ goto error;
if (!(res= mysql_drop_user(thd, lex->users_list)))
{
if (mysql_bin_log.is_open())
@@ -3720,6 +3724,8 @@ end_with_restore_list:
if (check_access(thd, UPDATE_ACL, "mysql", 0, 1, 1, 0) &&
check_global_access(thd,CREATE_USER_ACL))
break;
+ if (end_active_trans(thd))
+ goto error;
if (!(res= mysql_rename_user(thd, lex->users_list)))
{
if (mysql_bin_log.is_open())
@@ -4066,6 +4072,19 @@ end_with_restore_list:
DBUG_ASSERT(lex->sphead != 0);
+ if (!lex->sphead->m_db.str || !lex->sphead->m_db.str[0])
+ {
+ if (! thd->db)
+ {
+ my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
+ delete lex->sphead;
+ lex->sphead= 0;
+ goto error;
+ }
+ lex->sphead->m_db.length= strlen(thd->db);
+ lex->sphead->m_db.str= thd->db;
+ }
+
if (check_access(thd, CREATE_PROC_ACL, lex->sphead->m_db.str, 0, 0, 0,
is_schema_db(lex->sphead->m_db.str)))
{
@@ -4075,13 +4094,10 @@ end_with_restore_list:
}
if (end_active_trans(thd))
- goto error;
-
- if (!lex->sphead->m_db.str || !lex->sphead->m_db.str[0])
{
- lex->sphead->m_db.length= strlen(thd->db);
- lex->sphead->m_db.str= strmake_root(thd->mem_root, thd->db,
- lex->sphead->m_db.length);
+ delete lex->sphead;
+ lex->sphead= 0;
+ goto error;
}
name= lex->sphead->name(&namelen);
@@ -4108,11 +4124,23 @@ end_with_restore_list:
goto error;
}
+ /*
+ We need to copy name and db in order to use them for
+ check_routine_access which is called after lex->sphead has
+ been deleted.
+ */
name= thd->strdup(name);
- db= thd->strmake(lex->sphead->m_db.str, lex->sphead->m_db.length);
+ lex->sphead->m_db.str= db= thd->strmake(lex->sphead->m_db.str,
+ lex->sphead->m_db.length);
res= (result= lex->sphead->create(thd));
if (result == SP_OK)
{
+ /*
+ We must cleanup the unit and the lex here because
+ sp_grant_privileges calls (indirectly) db_find_routine,
+ which in turn may call yyparse with THD::lex.
+ TODO: fix db_find_routine to use a temporary lex.
+ */
lex->unit.cleanup();
delete lex->sphead;
lex->sphead= 0;
@@ -4514,6 +4542,9 @@ end_with_restore_list:
}
case SQLCOM_CREATE_VIEW:
{
+ if (end_active_trans(thd))
+ goto error;
+
if (!(res= mysql_create_view(thd, thd->lex->create_view_mode)) &&
mysql_bin_log.is_open())
{
@@ -4528,7 +4559,8 @@ end_with_restore_list:
command[thd->lex->create_view_mode].length);
view_store_options(thd, first_table, &buff);
buff.append("VIEW ", 5);
- if (!first_table->current_db_used)
+ /* Test if user supplied a db (ie: we did not use thd->db) */
+ if (first_table->db != thd->db && first_table->db[0])
{
append_identifier(thd, &buff, first_table->db,
first_table->db_length);
@@ -4560,6 +4592,9 @@ end_with_restore_list:
}
case SQLCOM_CREATE_TRIGGER:
{
+ if (end_active_trans(thd))
+ goto error;
+
res= mysql_create_or_drop_trigger(thd, all_tables, 1);
/* We don't care about trigger body after this point */
@@ -4569,6 +4604,9 @@ end_with_restore_list:
}
case SQLCOM_DROP_TRIGGER:
{
+ if (end_active_trans(thd))
+ goto error;
+
res= mysql_create_or_drop_trigger(thd, all_tables, 0);
break;
}
@@ -4776,14 +4814,6 @@ error:
res= 1;
cleanup:
- if (unlikely(slave_fake_lock))
- {
- DBUG_PRINT("info",("undoing faked lock"));
- thd->lock= thd->locked_tables;
- thd->locked_tables= fake_prev_lock;
- if (thd->lock == thd->locked_tables)
- thd->lock= 0;
- }
DBUG_RETURN(res || thd->net.report_error);
}
@@ -4854,7 +4884,6 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
bool db_is_pattern= test(want_access & GRANT_ACL);
#endif
ulong dummy;
- const char *db_name;
DBUG_ENTER("check_access");
DBUG_PRINT("enter",("db: %s want_access: %lu master_access: %lu",
db ? db : "", want_access, sctx->master_access));
@@ -4872,15 +4901,16 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
DBUG_RETURN(TRUE); /* purecov: tested */
}
- db_name= db ? db : thd->db;
if (schema_db)
{
if (want_access & ~(SELECT_ACL | EXTRA_ACL))
{
if (!no_errors)
+ {
+ const char *db_name= db ? db : thd->db;
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
- sctx->priv_user,
- sctx->priv_host, db_name);
+ sctx->priv_user, sctx->priv_host, db_name);
+ }
DBUG_RETURN(TRUE);
}
else
@@ -5000,8 +5030,14 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
{
uint found=0;
ulong found_access=0;
- TABLE_LIST *org_tables=tables;
- for (; tables; tables= tables->next_global)
+ TABLE_LIST *org_tables= tables;
+ TABLE_LIST *first_not_own_table= thd->lex->first_not_own_table();
+ /*
+ The check that first_not_own_table is not reached is for the case when
+ the given table list refers to the list for prelocking (contains tables
+ of other queries). For simple queries first_not_own_table is 0.
+ */
+ for (; tables != first_not_own_table; tables= tables->next_global)
{
if (tables->schema_table &&
(want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
@@ -5012,6 +5048,11 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
information_schema_name.str);
return TRUE;
}
+ /*
+ Register access for view underlying table.
+ Remove SHOW_VIEW_ACL, because it will be checked during making view
+ */
+ tables->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL);
if (tables->derived || tables->schema_table || tables->belong_to_view ||
(tables->table && (int)tables->table->s->tmp_table) ||
my_tz_check_n_skip_implicit_tables(&tables,
@@ -5055,11 +5096,16 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name,
tables->db= db;
tables->table_name= tables->alias= name;
- if ((thd->security_ctx->master_access & want_access) == want_access &&
- !thd->db)
+ /*
+ The following test is just a shortcut for check_access() (to avoid
+ calculating db_access) under the assumption that it's common to
+ give persons global right to execute all stored SP (but not
+ necessary to create them).
+ */
+ if ((thd->security_ctx->master_access & want_access) == want_access)
tables->grant.privilege= want_access;
else if (check_access(thd,want_access,db,&tables->grant.privilege,
- 0, no_errors, test(tables->schema_table)))
+ 0, no_errors, 0))
return TRUE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -5760,7 +5806,7 @@ new_create_field(THD *thd, char *field_name, enum_field_types type,
case FIELD_TYPE_NULL:
break;
case FIELD_TYPE_NEWDECIMAL:
- if (!length)
+ if (!length && !new_field->decimals)
new_field->length= 10;
if (new_field->length > DECIMAL_MAX_PRECISION)
{
@@ -6146,14 +6192,12 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
{
ptr->db= thd->db;
ptr->db_length= thd->db_length;
- ptr->current_db_used= 1;
}
else
{
/* The following can't be "" as we may do 'casedn_str()' on it */
ptr->db= empty_c_string;
ptr->db_length= 0;
- ptr->current_db_used= 1;
}
if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
ptr->db= thd->strdup(ptr->db);
@@ -6168,8 +6212,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->force_index= test(table_options & TL_OPTION_FORCE_INDEX);
ptr->ignore_leaves= test(table_options & TL_OPTION_IGNORE_LEAVES);
ptr->derived= table->sel;
- if (!my_strcasecmp(system_charset_info, ptr->db,
- information_schema_name.str))
+ if (!ptr->derived && !my_strcasecmp(system_charset_info, ptr->db,
+ information_schema_name.str))
{
ST_SCHEMA_TABLE *schema_table= find_schema_table(thd, ptr->table_name);
if (!schema_table ||
@@ -6916,57 +6960,6 @@ bool check_simple_select()
return 0;
}
-/*
- Setup locking for multi-table updates. Used by the replication slave.
- Replication slave SQL thread examines (all_tables_not_ok()) the
- locking state of referenced tables to determine if the query has to
- be executed or ignored. Since in multi-table update, the
- 'default' lock is read-only, this lock is corrected early enough by
- calling this function, before the slave decides to execute/ignore.
-
- SYNOPSIS
- check_multi_update_lock()
- thd Current thread
-
- RETURN VALUES
- 0 ok
- 1 error
-*/
-static bool check_multi_update_lock(THD *thd)
-{
- bool res= 1;
- LEX *lex= thd->lex;
- TABLE_LIST *table, *tables= lex->query_tables;
- DBUG_ENTER("check_multi_update_lock");
-
- if (check_db_used(thd, tables))
- goto error;
-
- /*
- Ensure that we have UPDATE or SELECT privilege for each table
- The exact privilege is checked in mysql_multi_update()
- */
- for (table= tables ; table ; table= table->next_local)
- {
- TABLE_LIST *save= table->next_local;
- table->next_local= 0;
- if ((check_access(thd, UPDATE_ACL, table->db,
- &table->grant.privilege,0,1, test(table->schema_table)) ||
- (grant_option && check_grant(thd, UPDATE_ACL, table,0,1,1))) &&
- check_one_table_access(thd, SELECT_ACL, table))
- goto error;
- table->next_local= save;
- }
-
- if (mysql_multi_update_prepare(thd))
- goto error;
-
- res= 0;
-
-error:
- DBUG_RETURN(res);
-}
-
Comp_creator *comp_eq_creator(bool invert)
{
@@ -7453,9 +7446,9 @@ Item *negate_expression(THD *thd, Item *expr)
Assign as view definer current user
SYNOPSIS
- default_definer()
- Secytity_context current decurity context
- definer structure where it should be assigned
+ default_view_definer()
+ sctx current security context
+ definer structure where it should be assigned
RETURN
FALSE OK
@@ -7466,15 +7459,14 @@ bool default_view_definer(Security_context *sctx, st_lex_user *definer)
{
definer->user.str= sctx->priv_user;
definer->user.length= strlen(sctx->priv_user);
- if (*sctx->priv_host != 0)
- {
- definer->host.str= sctx->priv_host;
- definer->host.length= strlen(sctx->priv_host);
- }
- else
+
+ if (!*sctx->priv_host)
{
my_error(ER_NO_VIEW_USER, MYF(0));
return TRUE;
}
+
+ definer->host.str= sctx->priv_host;
+ definer->host.length= strlen(sctx->priv_host);
return FALSE;
}
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 16433e42e3c..6e6961080cd 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -101,6 +101,11 @@ public:
class Prepared_statement: public Statement
{
public:
+ enum flag_values
+ {
+ IS_IN_USE= 1
+ };
+
THD *thd;
Select_fetch_protocol_prep result;
Protocol *protocol;
@@ -131,19 +136,8 @@ public:
bool execute(String *expanded_query, bool open_cursor);
/* Destroy this statement */
bool deallocate();
-
- /* Possible values of flags */
-#if defined(_MSC_VER) && _MSC_VER < 1300
- static const int IS_IN_USE;
-#else
- static const int IS_IN_USE= 1;
-#endif
};
-/* VC6 can't handle initializing in declaration */
-#if defined(_MSC_VER) && _MSC_VER < 1300
-const int Prepared_statement::IS_IN_USE= 1;
-#endif
/******************************************************************************
Implementation
@@ -1164,6 +1158,7 @@ static int mysql_test_update(Prepared_statement *stmt,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
table_list->grant.want_privilege= want_privilege;
table_list->table->grant.want_privilege= want_privilege;
+ table_list->register_want_access(want_privilege);
#endif
thd->lex->select_lex.no_wrap_view_item= TRUE;
res= setup_fields(thd, 0, select->item_list, 1, 0, 0);
@@ -1175,6 +1170,7 @@ static int mysql_test_update(Prepared_statement *stmt,
table_list->grant.want_privilege=
table_list->table->grant.want_privilege=
(SELECT_ACL & ~table_list->table->grant.privilege);
+ table_list->register_want_access(SELECT_ACL);
#endif
if (setup_fields(thd, 0, stmt->lex->value_list, 0, 0, 0))
goto error;
@@ -1748,6 +1744,8 @@ static bool check_prepared_statement(Prepared_statement *stmt,
case SQLCOM_ROLLBACK:
case SQLCOM_TRUNCATE:
case SQLCOM_CALL:
+ case SQLCOM_CREATE_VIEW:
+ case SQLCOM_DROP_VIEW:
break;
default:
@@ -1830,7 +1828,7 @@ static bool init_param_array(Prepared_statement *stmt)
void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
{
Prepared_statement *stmt= new Prepared_statement(thd, &thd->protocol_prep);
- bool rc;
+ bool error;
DBUG_ENTER("mysql_stmt_prepare");
DBUG_PRINT("prep_query", ("%s", packet));
@@ -1853,12 +1851,12 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);
- rc= stmt->prepare(packet, packet_length);
+ error= stmt->prepare(packet, packet_length);
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),WAIT_PRIOR);
- if (rc)
+ if (error)
{
/* Statement map deletes statement on erase */
thd->stmt_map.erase(stmt);
@@ -1900,7 +1898,7 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len)
CHARSET_INFO *to_cs= thd->variables.collation_connection;
bool needs_conversion;
user_var_entry *entry;
- String *pstr= &str;
+ String *var_value= &str;
uint32 unused, len;
/*
Convert @var contents to string in connection character set. Although
@@ -1914,13 +1912,13 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len)
&& entry->value)
{
my_bool is_var_null;
- pstr= entry->val_str(&is_var_null, &str, NOT_FIXED_DEC);
+ var_value= entry->val_str(&is_var_null, &str, NOT_FIXED_DEC);
/*
NULL value of variable checked early as entry->value so here
we can't get NULL in normal conditions
*/
DBUG_ASSERT(!is_var_null);
- if (!pstr)
+ if (!var_value)
goto end;
}
else
@@ -1932,22 +1930,25 @@ static const char *get_dynamic_sql_string(LEX *lex, uint *query_len)
str.set("NULL", 4, &my_charset_latin1);
}
- needs_conversion= String::needs_conversion(pstr->length(),
- pstr->charset(), to_cs, &unused);
+ needs_conversion= String::needs_conversion(var_value->length(),
+ var_value->charset(), to_cs,
+ &unused);
- len= needs_conversion ? pstr->length() * to_cs->mbmaxlen : pstr->length();
+ len= (needs_conversion ? var_value->length() * to_cs->mbmaxlen :
+ var_value->length());
if (!(query_str= alloc_root(thd->mem_root, len+1)))
goto end;
if (needs_conversion)
{
uint dummy_errors;
- len= copy_and_convert(query_str, len, to_cs, pstr->ptr(), pstr->length(),
- pstr->charset(), &dummy_errors);
+ len= copy_and_convert(query_str, len, to_cs, var_value->ptr(),
+ var_value->length(), var_value->charset(),
+ &dummy_errors);
}
else
- memcpy(query_str, pstr->ptr(), pstr->length());
- query_str[len]= '\0';
+ memcpy(query_str, var_value->ptr(), var_value->length());
+ query_str[len]= '\0'; // Safety (mostly for debug)
*query_len= len;
}
else
@@ -1997,10 +1998,9 @@ void mysql_sql_stmt_prepare(THD *thd)
Prepared_statement *stmt;
const char *query;
uint query_len;
-
DBUG_ENTER("mysql_sql_stmt_prepare");
-
DBUG_ASSERT(thd->protocol == &thd->protocol_simple);
+
if ((stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
{
/*
@@ -2172,8 +2172,9 @@ static void reset_stmt_params(Prepared_statement *stmt)
client, otherwise an error message is set in THD.
*/
-void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
+void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
{
+ uchar *packet= (uchar*)packet_arg; // GCC 4.0.1 workaround
ulong stmt_id= uint4korr(packet);
ulong flags= (ulong) ((uchar) packet[4]);
/* Query text for binary, general or slow log, if any of them is open */
@@ -2182,7 +2183,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
uchar *packet_end= (uchar *) packet + packet_length - 1;
#endif
Prepared_statement *stmt;
- bool rc;
+ bool error;
DBUG_ENTER("mysql_stmt_execute");
packet+= 9; /* stmt_id + 5 bytes of flags */
@@ -2217,12 +2218,11 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
#endif
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);
- rc= stmt->execute(&expanded_query,
- test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
+ error= stmt->execute(&expanded_query,
+ test(flags & (ulong) CURSOR_TYPE_READ_ONLY));
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
-
- if (rc == 0)
+ if (error == 0)
mysql_log.write(thd, COM_STMT_EXECUTE, "[%lu] %s", stmt->id, thd->query);
DBUG_VOID_RETURN;
@@ -2261,9 +2261,7 @@ void mysql_sql_stmt_execute(THD *thd)
LEX_STRING *name= &lex->prepared_stmt_name;
/* Query text for binary, general or slow log, if any of them is open */
String expanded_query;
-
DBUG_ENTER("mysql_sql_stmt_execute");
-
DBUG_PRINT("info", ("EXECUTE: %.*s\n", name->length, name->str));
if (!(stmt= (Prepared_statement*) thd->stmt_map.find_by_name(name)))
@@ -2408,7 +2406,6 @@ void mysql_stmt_close(THD *thd, char *packet)
/* There is always space for 4 bytes in packet buffer */
ulong stmt_id= uint4korr(packet);
Prepared_statement *stmt;
-
DBUG_ENTER("mysql_stmt_close");
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_close")))
@@ -2418,7 +2415,7 @@ void mysql_stmt_close(THD *thd, char *packet)
The only way currently a statement can be deallocated when it's
in use is from within Dynamic SQL.
*/
- DBUG_ASSERT(! (stmt->flags & Prepared_statement::IS_IN_USE));
+ DBUG_ASSERT(! (stmt->flags & (uint) Prepared_statement::IS_IN_USE));
(void) stmt->deallocate();
DBUG_VOID_RETURN;
@@ -2462,7 +2459,7 @@ void mysql_sql_stmt_close(THD *thd)
mysql_stmt_get_longdata()
thd Thread handle
packet String to append
- packet_length Length of string
+ packet_length Length of string (including end \0)
DESCRIPTION
Get a part of a long data. To make the protocol efficient, we are
@@ -2479,13 +2476,12 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
Prepared_statement *stmt;
Item_param *param;
char *packet_end= packet + packet_length - 1;
-
DBUG_ENTER("mysql_stmt_get_longdata");
statistic_increment(thd->status_var.com_stmt_send_long_data, &LOCK_status);
#ifndef EMBEDDED_LIBRARY
/* Minimal size of long data packet is 6 bytes */
- if ((ulong) (packet_end - packet) < MYSQL_LONG_DATA_HEADER)
+ if (packet_length <= MYSQL_LONG_DATA_HEADER)
{
my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_send_long_data");
DBUG_VOID_RETURN;
@@ -2592,7 +2588,7 @@ Prepared_statement::Prepared_statement(THD *thd_arg, Protocol *protocol_arg)
param_array(0),
param_count(0),
last_errno(0),
- flags(IS_IN_USE)
+ flags((uint) IS_IN_USE)
{
*last_error= '\0';
}
@@ -2709,7 +2705,7 @@ bool Prepared_statement::set_name(LEX_STRING *name_arg)
bool Prepared_statement::prepare(const char *packet, uint packet_len)
{
- bool rc;
+ bool error;
Statement stmt_backup;
Query_arena *old_stmt_arena;
DBUG_ENTER("Prepared_statement::prepare");
@@ -2739,7 +2735,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
lex_start(thd, (uchar*) thd->query, thd->query_length);
lex->stmt_prepare_mode= TRUE;
- rc= yyparse((void *)thd) || thd->is_fatal_error ||
+ error= yyparse((void *)thd) || thd->is_fatal_error ||
thd->net.report_error || init_param_array(this);
lex->safe_to_cache_query= FALSE;
/*
@@ -2764,10 +2760,10 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
*/
DBUG_ASSERT(thd->free_list == NULL);
- if (rc == 0)
- rc= check_prepared_statement(this, name.str != 0);
+ if (error == 0)
+ error= check_prepared_statement(this, name.str != 0);
- if (rc && lex->sphead)
+ if (error && lex->sphead)
{
delete lex->sphead;
lex->sphead= NULL;
@@ -2777,14 +2773,14 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
thd->restore_backup_statement(this, &stmt_backup);
thd->stmt_arena= old_stmt_arena;
- if (rc == 0)
+ if (error == 0)
{
setup_set_params();
init_stmt_after_parse(lex);
state= Query_arena::PREPARED;
- flags&= ~IS_IN_USE;
+ flags&= ~ (uint) IS_IN_USE;
}
- DBUG_RETURN(rc);
+ DBUG_RETURN(error);
}
/*
@@ -2806,6 +2802,10 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
Preconditions, postconditions.
------------------------------
See the comment for Prepared_statement::prepare().
+
+ RETURN
+ FALSE ok
+ TRUE Error
*/
bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
@@ -2813,7 +2813,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
Statement stmt_backup;
Query_arena *old_stmt_arena;
Item *old_free_list;
- bool rc= TRUE;
+ bool error= TRUE;
statistic_increment(thd->status_var.com_stmt_execute, &LOCK_status);
@@ -2823,7 +2823,7 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
my_message(last_errno, last_error, MYF(0));
return TRUE;
}
- if (flags & IS_IN_USE)
+ if (flags & (uint) IS_IN_USE)
{
my_error(ER_PS_NO_RECURSION, MYF(0));
return TRUE;
@@ -2885,13 +2885,14 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
reinit_stmt_before_use(thd, lex);
thd->protocol= protocol; /* activate stmt protocol */
- rc= open_cursor ? mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR,
- &result, &cursor) :
- mysql_execute_command(thd);
+ error= (open_cursor ?
+ mysql_open_cursor(thd, (uint) ALWAYS_MATERIALIZED_CURSOR,
+ &result, &cursor) :
+ mysql_execute_command(thd));
thd->protocol= &thd->protocol_simple; /* use normal protocol */
/* Assert that if an error, no cursor is open */
- DBUG_ASSERT(! (rc && cursor));
+ DBUG_ASSERT(! (error && cursor));
if (! cursor)
{
@@ -2906,8 +2907,8 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
state= Query_arena::EXECUTED;
error:
- flags&= ~IS_IN_USE;
- return rc;
+ flags&= ~ (uint) IS_IN_USE;
+ return error;
}
@@ -2917,7 +2918,7 @@ bool Prepared_statement::deallocate()
{
/* We account deallocate in the same manner as mysql_stmt_close */
statistic_increment(thd->status_var.com_stmt_close, &LOCK_status);
- if (flags & IS_IN_USE)
+ if (flags & (uint) IS_IN_USE)
{
my_error(ER_PS_NO_RECURSION, MYF(0));
return TRUE;
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 154e828b47e..80fcb973028 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -134,6 +134,8 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
{
TABLE_LIST *ren_table,*new_table;
frm_type_enum frm_type;
+ db_type table_type;
+
DBUG_ENTER("rename_tables");
for (ren_table= table_list; ren_table; ren_table= new_table->next_local)
@@ -166,13 +168,12 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
reg_ext);
unpack_filename(name, name);
- frm_type= mysql_frm_type(name);
+ frm_type= mysql_frm_type(thd, name, &table_type);
switch (frm_type)
{
case FRMTYPE_TABLE:
{
- db_type table_type;
- if ((table_type= get_table_type(thd, name)) == DB_TYPE_UNKNOWN)
+ if (table_type == DB_TYPE_UNKNOWN)
my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno);
else
rc= mysql_rename_table(table_type, ren_table->db, old_alias,
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 28b0ae8c78e..b5d12c0d2d2 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -373,6 +373,11 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
goto err;
}
+ /*
+ Call readers_addref before opening log to track count
+ of binlog readers
+ */
+ mysql_bin_log.readers_addref();
if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0)
{
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
@@ -570,7 +575,8 @@ impossible position";
goto err;
if (!(flags & BINLOG_DUMP_NON_BLOCK) &&
- mysql_bin_log.is_active(log_file_name))
+ mysql_bin_log.is_active(log_file_name) &&
+ !mysql_bin_log.is_reset_pending())
{
/*
Block until there is more data in the log
@@ -684,6 +690,13 @@ impossible position";
{
bool loop_breaker = 0;
// need this to break out of the for loop from switch
+
+ // if we are going to switch log file anyway, close current log first
+ end_io_cache(&log);
+ (void) my_close(file, MYF(MY_WME));
+ // decrease reference count of binlog readers
+ mysql_bin_log.readers_release();
+
thd->proc_info = "Finished reading one binlog; switching to next binlog";
switch (mysql_bin_log.find_next_log(&linfo, 1)) {
case LOG_INFO_EOF:
@@ -692,16 +705,25 @@ impossible position";
case 0:
break;
default:
+ // need following call to do release on err label
+ mysql_bin_log.readers_addref();
errmsg = "could not find next log";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
- if (loop_breaker)
- break;
+ if (loop_breaker)
+ {
+ // need following call to do release on end label
+ mysql_bin_log.readers_addref();
+ break;
+ }
- end_io_cache(&log);
- (void) my_close(file, MYF(MY_WME));
+ /*
+ Call readers_addref before opening log to track count
+ of binlog readers
+ */
+ mysql_bin_log.readers_addref();
/*
Call fake_rotate_event() in case the previous log (the one which
@@ -734,6 +756,8 @@ end:
end_io_cache(&log);
(void)my_close(file, MYF(MY_WME));
+ // decrease reference count of binlog readers
+ mysql_bin_log.readers_release();
send_eof(thd);
thd->proc_info = "Waiting to finalize termination";
@@ -760,6 +784,9 @@ err:
pthread_mutex_unlock(&LOCK_thread_count);
if (file >= 0)
(void) my_close(file, MYF(MY_WME));
+ // decrease reference count of binlog readers
+ mysql_bin_log.readers_release();
+
my_message(my_errno, errmsg, MYF(0));
DBUG_VOID_RETURN;
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a02a61b7a86..360b161a78a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -102,8 +102,6 @@ static COND *optimize_cond(JOIN *join, COND *conds,
List<TABLE_LIST> *join_list,
Item::cond_result *cond_value);
static bool resolve_nested_join (TABLE_LIST *table);
-static COND *remove_eq_conds(THD *thd, COND *cond,
- Item::cond_result *cond_value);
static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
static bool open_tmp_table(TABLE *table);
static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
@@ -537,6 +535,9 @@ JOIN::optimize()
DBUG_RETURN(0);
optimized= 1;
+ if (thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS)
+ thd->status_var.last_query_cost= 0.0;
+
row_limit= ((select_distinct || order || group_list) ? HA_POS_ERROR :
unit->select_limit_cnt);
/* select_limit is used to decide if we are likely to scan the whole table */
@@ -822,6 +823,7 @@ JOIN::optimize()
{
order=0; // The output has only one row
simple_order=1;
+ select_distinct= 0; // No need in distinct for 1 row
}
calc_group_buffer(this, group_list);
@@ -1167,18 +1169,21 @@ JOIN::save_join_tab()
void
JOIN::exec()
{
+ List<Item> *columns_list= &fields_list;
int tmp_error;
DBUG_ENTER("JOIN::exec");
error= 0;
if (procedure)
{
- if (procedure->change_columns(fields_list) ||
- result->prepare(fields_list, unit))
+ procedure_fields_list= fields_list;
+ if (procedure->change_columns(procedure_fields_list) ||
+ result->prepare(procedure_fields_list, unit))
{
thd->limit_found_rows= thd->examined_row_count= 0;
DBUG_VOID_RETURN;
}
+ columns_list= &procedure_fields_list;
}
(void) result->prepare2(); // Currently, this cannot fail.
@@ -1189,7 +1194,7 @@ JOIN::exec()
(zero_result_cause?zero_result_cause:"No tables used"));
else
{
- result->send_fields(fields_list,
+ result->send_fields(*columns_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
/*
We have to test for 'conds' here as the WHERE may not be constant
@@ -1200,9 +1205,9 @@ JOIN::exec()
(!conds || conds->val_int()) &&
(!having || having->val_int()))
{
- if (do_send_rows && (procedure ? (procedure->send_row(fields_list) ||
- procedure->end_of_records())
- : result->send_data(fields_list)))
+ if (do_send_rows &&
+ (procedure ? (procedure->send_row(procedure_fields_list) ||
+ procedure->end_of_records()) : result->send_data(fields_list)))
error= 1;
else
{
@@ -1226,7 +1231,8 @@ JOIN::exec()
if (zero_result_cause)
{
- (void) return_zero_rows(this, result, select_lex->leaf_tables, fields_list,
+ (void) return_zero_rows(this, result, select_lex->leaf_tables,
+ *columns_list,
send_row_on_empty_set(),
select_options,
zero_result_cause,
@@ -1376,7 +1382,7 @@ JOIN::exec()
DBUG_PRINT("info",("Creating group table"));
/* Free first data from old join */
- curr_join->join_free(0);
+ curr_join->join_free();
if (make_simple_join(curr_join, curr_tmp_table))
DBUG_VOID_RETURN;
calc_group_buffer(curr_join, group_list);
@@ -1477,7 +1483,7 @@ JOIN::exec()
if (curr_tmp_table->distinct)
curr_join->select_distinct=0; /* Each row is unique */
- curr_join->join_free(0); /* Free quick selects */
+ curr_join->join_free(); /* Free quick selects */
if (curr_join->select_distinct && ! curr_join->group_list)
{
thd->proc_info="Removing duplicates";
@@ -1676,7 +1682,8 @@ JOIN::exec()
{
thd->proc_info="Sending data";
DBUG_PRINT("info", ("%s", thd->proc_info));
- result->send_fields(*curr_fields_list,
+ result->send_fields((procedure ? curr_join->procedure_fields_list :
+ *curr_fields_list),
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);
error= do_select(curr_join, curr_fields_list, NULL, procedure);
thd->limit_found_rows= curr_join->send_records;
@@ -2486,11 +2493,11 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
and use them in equality propagation process (see details in
OptimizerKBAndTodo)
*/
- if ((cond->functype() == Item_func::BETWEEN) &&
- value[0]->eq(value[1], field->binary()))
- eq_func= TRUE;
- else
+ if ((cond->functype() != Item_func::BETWEEN) ||
+ ((Item_func_between*) cond)->negated ||
+ !value[0]->eq(value[1], field->binary()))
return;
+ eq_func= TRUE;
}
if (field->result_type() == STRING_RESULT)
@@ -5734,33 +5741,88 @@ void JOIN_TAB::cleanup()
}
-void JOIN::join_free(bool full)
+/*
+ Partially cleanup JOIN after it has executed: close index or rnd read
+ (table cursors), free quick selects.
+
+ DESCRIPTION
+ This function is called in the end of execution of a JOIN, before the used
+ tables are unlocked and closed.
+
+ For a join that is resolved using a temporary table, the first sweep is
+ performed against actual tables and an intermediate result is inserted
+ into the temprorary table.
+ The last sweep is performed against the temporary table. Therefore,
+ the base tables and associated buffers used to fill the temporary table
+ are no longer needed, and this function is called to free them.
+
+ For a join that is performed without a temporary table, this function
+ is called after all rows are sent, but before EOF packet is sent.
+
+ For a simple SELECT with no subqueries this function performs a full
+ cleanup of the JOIN and calls mysql_unlock_read_tables to free used base
+ tables.
+
+ If a JOIN is executed for a subquery or if it has a subquery, we can't
+ do the full cleanup and need to do a partial cleanup only.
+ o If a JOIN is not the top level join, we must not unlock the tables
+ because the outer select may not have been evaluated yet, and we
+ can't unlock only selected tables of a query.
+
+ o Additionally, if this JOIN corresponds to a correlated subquery, we
+ should not free quick selects and join buffers because they will be
+ needed for the next execution of the correlated subquery.
+
+ o However, if this is a JOIN for a [sub]select, which is not
+ a correlated subquery itself, but has subqueries, we can free it
+ fully and also free JOINs of all its subqueries. The exception
+ is a subquery in SELECT list, e.g:
+ SELECT a, (select max(b) from t1) group by c
+ This subquery will not be evaluated at first sweep and its value will
+ not be inserted into the temporary table. Instead, it's evaluated
+ when selecting from the temporary table. Therefore, it can't be freed
+ here even though it's not correlated.
+*/
+
+void JOIN::join_free()
{
SELECT_LEX_UNIT *unit;
SELECT_LEX *sl;
- DBUG_ENTER("JOIN::join_free");
-
/*
Optimization: if not EXPLAIN and we are done with the JOIN,
free all tables.
*/
- full= full || (!select_lex->uncacheable && !thd->lex->describe);
+ bool full= (!select_lex->uncacheable && !thd->lex->describe);
+ bool can_unlock= full;
+ DBUG_ENTER("JOIN::join_free");
cleanup(full);
for (unit= select_lex->first_inner_unit(); unit; unit= unit->next_unit())
for (sl= unit->first_select(); sl; sl= sl->next_select())
{
- JOIN *join= sl->join;
- if (join)
- join->join_free(full);
+ Item_subselect *subselect= sl->master_unit()->item;
+ bool full_local= full && (!subselect || subselect->is_evaluated());
+ /*
+ If this join is evaluated, we can fully clean it up and clean up all
+ its underlying joins even if they are correlated -- they will not be
+ used any more anyway.
+ If this join is not yet evaluated, we still must clean it up to
+ close its table cursors -- it may never get evaluated, as in case of
+ ... HAVING FALSE OR a IN (SELECT ...))
+ but all table cursors must be closed before the unlock.
+ */
+ sl->cleanup_all_joins(full_local);
+ /* Can't unlock if at least one JOIN is still needed */
+ can_unlock= can_unlock && full_local;
}
/*
We are not using tables anymore
Unlock all tables. We may be in an INSERT .... SELECT statement.
*/
- if (full && lock && thd->lock && !(select_options & SELECT_NO_UNLOCK) &&
+ if (can_unlock && lock && thd->lock &&
+ !(select_options & SELECT_NO_UNLOCK) &&
!select_lex->subquery_in_having &&
(select_lex == (thd->lex->unit.fake_select_lex ?
thd->lex->unit.fake_select_lex : &thd->lex->select_lex)))
@@ -5866,7 +5928,7 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab)
tab->cached_eq_ref_table=1;
if (tab->type == JT_CONST) // We can skip const tables
return (tab->eq_ref_table=1); /* purecov: inspected */
- if (tab->type != JT_EQ_REF)
+ if (tab->type != JT_EQ_REF || tab->table->maybe_null)
return (tab->eq_ref_table=0); // We must use this
Item **ref_item=tab->ref.items;
Item **end=ref_item+tab->ref.key_parts;
@@ -6074,7 +6136,7 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
DBUG_RETURN(0);
}
- join->join_free(0);
+ join->join_free();
if (send_row)
{
@@ -6269,6 +6331,21 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal)
{
Item *left_item= ((Item_func*) item)->arguments()[0];
Item *right_item= ((Item_func*) item)->arguments()[1];
+
+ if (left_item->type() == Item::REF_ITEM &&
+ ((Item_ref*)left_item)->ref_type() == Item_ref::VIEW_REF)
+ {
+ if (((Item_ref*)left_item)->depended_from)
+ return FALSE;
+ left_item= left_item->real_item();
+ }
+ if (right_item->type() == Item::REF_ITEM &&
+ ((Item_ref*)right_item)->ref_type() == Item_ref::VIEW_REF)
+ {
+ if (((Item_ref*)right_item)->depended_from)
+ return FALSE;
+ right_item= right_item->real_item();
+ }
if (left_item->type() == Item::FIELD_ITEM &&
right_item->type() == Item::FIELD_ITEM &&
!((Item_field*)left_item)->depended_from &&
@@ -7410,7 +7487,7 @@ optimize_cond(JOIN *join, COND *conds, List<TABLE_LIST> *join_list,
COND_FALSE always false ( 1 = 2 )
*/
-static COND *
+COND *
remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
{
if (cond->type() == Item::COND_ITEM)
@@ -7967,7 +8044,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
statistic_increment(thd->status_var.created_tmp_tables, &LOCK_status);
- if (use_temp_pool)
+ if (use_temp_pool && !(test_flags & TEST_KEEP_TMP_TABLES))
temp_pool_slot = bitmap_lock_set_next(&temp_pool);
if (temp_pool_slot != MY_BIT_NONE) // we got a slot
@@ -8221,7 +8298,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
(select_options & (OPTION_BIG_TABLES | SELECT_SMALL_RESULT)) ==
OPTION_BIG_TABLES || (select_options & TMP_TABLE_FORCE_MYISAM))
{
- table->file=get_new_handler(table,table->s->db_type= DB_TYPE_MYISAM);
+ table->file= get_new_handler(table, &table->mem_root,
+ table->s->db_type= DB_TYPE_MYISAM);
if (group &&
(param->group_parts > table->file->max_key_parts() ||
param->group_length > table->file->max_key_length()))
@@ -8229,7 +8307,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
}
else
{
- table->file=get_new_handler(table,table->s->db_type= DB_TYPE_HEAP);
+ table->file= get_new_handler(table, &table->mem_root,
+ table->s->db_type= DB_TYPE_HEAP);
}
if (table->s->fields)
{
@@ -8816,7 +8895,8 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
new_table= *table;
new_table.s= &new_table.share_not_to_be_used;
new_table.s->db_type= DB_TYPE_MYISAM;
- if (!(new_table.file= get_new_handler(&new_table,DB_TYPE_MYISAM)))
+ if (!(new_table.file= get_new_handler(&new_table, &new_table.mem_root,
+ DB_TYPE_MYISAM)))
DBUG_RETURN(1); // End of memory
save_proc_info=thd->proc_info;
@@ -9006,7 +9086,11 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
error= (*end_select)(join,join_tab,1);
}
else if (join->send_row_on_empty_set())
- rc= join->result->send_data(*join->fields);
+ {
+ List<Item> *columns_list= (procedure ? &join->procedure_fields_list :
+ fields);
+ rc= join->result->send_data(*columns_list);
+ }
}
else
{
@@ -9031,7 +9115,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
The following will unlock all cursors if the command wasn't an
update command
*/
- join->join_free(0); // Unlock all cursors
+ join->join_free(); // Unlock all cursors
if (join->result->send_eof())
rc= 1; // Don't send error
}
@@ -10039,7 +10123,7 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
DBUG_RETURN(NESTED_LOOP_OK); // Didn't match having
error=0;
if (join->procedure)
- error=join->procedure->send_row(*join->fields);
+ error=join->procedure->send_row(join->procedure_fields_list);
else if (join->do_send_rows)
error=join->result->send_data(*join->fields);
if (error)
@@ -11371,7 +11455,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
ulong total_length= 0;
for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++)
{
- uint length= (*ptr)->pack_length();
+ uint length= (*ptr)->sort_length();
(*field_length++)= length;
total_length+= length;
}
@@ -11911,11 +11995,16 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
We check order_item->fixed because Item_func_group_concat can put
arguments for which fix_fields already was called.
*/
+ thd->lex->current_select->is_item_list_lookup= 1;
if (!order_item->fixed &&
(order_item->fix_fields(thd, order->item) ||
(order_item= *order->item)->check_cols(1) ||
thd->is_fatal_error))
+ {
+ thd->lex->current_select->is_item_list_lookup= 0;
return TRUE; /* Wrong field. */
+ }
+ thd->lex->current_select->is_item_list_lookup= 0;
uint el= all_fields.elements;
all_fields.push_front(order_item); /* Add new field to field list. */
diff --git a/sql/sql_select.h b/sql/sql_select.h
index be51851e760..ec969e51c8d 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -245,6 +245,7 @@ class JOIN :public Sql_alloc
//Part, shared with list above, emulate following list
List<Item> tmp_fields_list1, tmp_fields_list2, tmp_fields_list3;
List<Item> &fields_list; // hold field list passed to mysql_select
+ List<Item> procedure_fields_list;
int error;
ORDER *order, *group_list, *proc_param; //hold parameters of mysql_select
@@ -359,7 +360,7 @@ class JOIN :public Sql_alloc
the end of execution in order to increase concurrency and reduce
memory consumption.
*/
- void join_free(bool full);
+ void join_free();
/* Cleanup this JOIN, possibly for reuse */
void cleanup(bool full);
void clear();
@@ -524,3 +525,4 @@ bool cp_buffer_from_ref(THD *thd, TABLE_REF *ref);
bool error_if_full_join(JOIN *join);
int report_error(TABLE *table, int error);
int safe_index_read(JOIN_TAB *tab);
+COND *remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 24acb1fb6d1..d06b09f9793 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1031,6 +1031,11 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
packet->append(" COMMENT=", 9);
append_unescaped(packet, share->comment, strlen(share->comment));
}
+ if (share->connect_string.length)
+ {
+ packet->append(" CONNECTION=", 12);
+ append_unescaped(packet, share->connect_string.str, share->connect_string.length);
+ }
if (file->raid_type)
{
uint length;
@@ -1283,9 +1288,6 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
VOID(pthread_mutex_unlock(&LOCK_thread_count));
thread_info *thd_info;
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- Security_context *sctx;
-#endif
time_t now= time(0);
while ((thd_info=thread_infos.get()))
{
@@ -1665,6 +1667,9 @@ static bool show_status_array(THD *thd, const char *wild,
value= (value-(char*) &dflt_key_cache_var)+ (char*) dflt_key_cache;
end= longlong10_to_str(*(longlong*) value, buff, 10);
break;
+ case SHOW_NET_COMPRESSION:
+ end= strmov(buff, thd->net.compress ? "ON" : "OFF");
+ break;
case SHOW_UNDEF: // Show never happen
case SHOW_SYS:
break; // Return empty string
@@ -2026,6 +2031,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
Security_context *sctx= thd->security_ctx;
uint derived_tables= lex->derived_tables;
int error= 1;
+ db_type not_used;
Open_tables_state open_tables_state_backup;
DBUG_ENTER("get_all_tables");
@@ -2137,7 +2143,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
else
{
my_snprintf(end, len, "/%s%s", file_name, reg_ext);
- switch (mysql_frm_type(path)) {
+ switch (mysql_frm_type(thd, path, &not_used)) {
case FRMTYPE_ERROR:
table->field[3]->store("ERROR", 5, system_charset_info);
break;
@@ -2356,14 +2362,14 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables,
table->field[7]->store((longlong) file->records, TRUE);
table->field[7]->set_notnull();
}
- table->field[8]->store((longlong) file->mean_rec_length);
- table->field[9]->store((longlong) file->data_file_length);
+ table->field[8]->store((longlong) file->mean_rec_length, TRUE);
+ table->field[9]->store((longlong) file->data_file_length, TRUE);
if (file->max_data_file_length)
{
- table->field[10]->store((longlong) file->max_data_file_length);
+ table->field[10]->store((longlong) file->max_data_file_length, TRUE);
}
- table->field[11]->store((longlong) file->index_file_length);
- table->field[12]->store((longlong) file->delete_length);
+ table->field[11]->store((longlong) file->index_file_length, TRUE);
+ table->field[12]->store((longlong) file->delete_length, TRUE);
if (show_table->found_next_number_field)
{
table->field[13]->store((longlong) file->auto_increment_value, TRUE);
@@ -2582,11 +2588,12 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
is_blob= (field->type() == FIELD_TYPE_BLOB);
if (field->has_charset() || is_blob)
{
- longlong c_octet_len= is_blob ? (longlong) field->max_length() :
- (longlong) field->max_length()/field->charset()->mbmaxlen;
- table->field[8]->store(c_octet_len, TRUE);
+ longlong char_max_len= is_blob ?
+ (longlong) field->max_length() / field->charset()->mbminlen :
+ (longlong) field->max_length() / field->charset()->mbmaxlen;
+ table->field[8]->store(char_max_len, TRUE);
table->field[8]->set_notnull();
- table->field[9]->store((longlong) field->max_length());
+ table->field[9]->store((longlong) field->max_length(), TRUE);
table->field[9]->set_notnull();
}
@@ -2627,7 +2634,7 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
if (field_length >= 0)
{
- table->field[10]->store((longlong) field_length);
+ table->field[10]->store((longlong) field_length, TRUE);
table->field[10]->set_notnull();
}
if (decimals >= 0)
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index a1f2be7e11c..a990cf777d6 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -277,6 +277,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
String wrong_tables;
int error;
bool some_tables_deleted=0, tmp_table_deleted=0, foreign_key_error=0;
+
DBUG_ENTER("mysql_rm_table_part2");
if (lock_table_names(thd, tables))
@@ -288,6 +289,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
for (table= tables; table; table= table->next_local)
{
char *db=table->db;
+ db_type table_type= DB_TYPE_UNKNOWN;
+
mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL);
if (!close_temporary_table(thd, db, table->table_name))
{
@@ -315,7 +318,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (drop_temporary ||
(access(path,F_OK) &&
ha_create_table_from_engine(thd,db,alias)) ||
- (!drop_view && mysql_frm_type(path) != FRMTYPE_TABLE))
+ (!drop_view &&
+ mysql_frm_type(thd, path, &table_type) != FRMTYPE_TABLE))
{
// Table was not found on disk and table can't be created from engine
if (if_exists)
@@ -328,11 +332,13 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
else
{
char *end;
- db_type table_type= get_table_type(thd, path);
+ if (table_type == DB_TYPE_UNKNOWN)
+ mysql_frm_type(thd, path, &table_type);
*(end=fn_ext(path))=0; // Remove extension for delete
error= ha_delete_table(thd, table_type, path, table->table_name,
!dont_log_query);
- if ((error == ENOENT || error == HA_ERR_NO_SUCH_TABLE) && if_exists)
+ if ((error == ENOENT || error == HA_ERR_NO_SUCH_TABLE) &&
+ (if_exists || table_type == DB_TYPE_UNKNOWN))
error= 0;
if (error == HA_ERR_ROW_IS_REFERENCED)
{
@@ -897,8 +903,8 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
sql_field->charset= (dup_field->charset ?
dup_field->charset :
create_info->default_table_charset);
- sql_field->length= dup_field->length;
- sql_field->pack_length= dup_field->pack_length;
+ sql_field->length= dup_field->chars_length;
+ sql_field->pack_length= dup_field->pack_length;
sql_field->key_length= dup_field->key_length;
sql_field->create_length_to_internal_length();
sql_field->decimals= dup_field->decimals;
@@ -1207,13 +1213,17 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
{
column->length*= sql_field->charset->mbmaxlen;
- if (f_is_blob(sql_field->pack_flag))
+ if (f_is_blob(sql_field->pack_flag) ||
+ (f_is_geom(sql_field->pack_flag) && key->type != Key::SPATIAL))
{
if (!(file->table_flags() & HA_CAN_INDEX_BLOBS))
{
my_error(ER_BLOB_USED_AS_KEY, MYF(0), column->field_name);
DBUG_RETURN(-1);
}
+ if (f_is_geom(sql_field->pack_flag) && sql_field->geom_type ==
+ Field::GEOM_POINT)
+ column->length= 21;
if (!column->length)
{
my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), column->field_name);
@@ -1590,7 +1600,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
if (create_info->row_type == ROW_TYPE_DYNAMIC)
db_options|=HA_OPTION_PACK_RECORD;
alias= table_case_name(create_info, table_name);
- if (!(file=get_new_handler((TABLE*) 0, create_info->db_type)))
+ if (!(file=get_new_handler((TABLE*) 0, thd->mem_root, create_info->db_type)))
{
my_error(ER_OUTOFMEMORY, MYF(0), 128);//128 bytes invented
DBUG_RETURN(TRUE);
@@ -1626,7 +1636,8 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
}
if (check_partition_info(part_info, part_engine_type,
file, create_info->max_rows))
- DBUG_RETURN(TRUE);
+ goto err;
+
/*
We reverse the partitioning parser and generate a standard format
for syntax stored in frm file.
@@ -1634,7 +1645,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
if (!(part_syntax_buf= generate_partition_syntax(part_info,
&syntax_len,
TRUE,TRUE)))
- DBUG_RETURN(TRUE);
+ goto err;
part_info->part_info_string= part_syntax_buf;
part_info->part_info_len= syntax_len;
if ((!(file->partition_flags() & HA_CAN_PARTITION)) ||
@@ -1644,7 +1655,8 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
The handler assigned to the table cannot handle partitioning.
Assign the partition handler as the handler of the table.
*/
- DBUG_PRINT("info", ("db_type= %d, part_flag= %d", create_info->db_type,file->partition_flags()));
+ DBUG_PRINT("info", ("db_type: %d part_flag: %d",
+ create_info->db_type,file->partition_flags()));
delete file;
create_info->db_type= DB_TYPE_PARTITION_DB;
if (!(file= get_ha_partition(part_info)))
@@ -1702,7 +1714,8 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
alias);
- goto no_err;
+ error= 0;
+ goto err;
}
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias);
goto err;
@@ -1717,7 +1730,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
goto warn;
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
- goto end;
+ goto unlock_and_end;
}
}
@@ -1741,7 +1754,7 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
if (create_if_not_exists)
goto warn;
my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
- goto end;
+ goto unlock_and_end;
}
}
@@ -1755,14 +1768,14 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
if (rea_create_table(thd, path, db, table_name,
create_info, fields, key_count,
key_info_buffer, file))
- goto end;
+ goto unlock_and_end;
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
{
/* Open table and put in temporary table list */
if (!(open_temporary_table(thd, path, db, table_name, 1)))
{
(void) rm_temporary_table(create_info->db_type, path);
- goto end;
+ goto unlock_and_end;
}
thd->tmp_table_used= 1;
}
@@ -1772,29 +1785,24 @@ bool mysql_create_table(THD *thd,const char *db, const char *table_name,
Query_log_event qinfo(thd, thd->query, thd->query_length, FALSE, FALSE);
mysql_bin_log.write(&qinfo);
}
+
error= FALSE;
- goto end;
+unlock_and_end:
+ VOID(pthread_mutex_unlock(&LOCK_open));
+ start_waiting_global_read_lock(thd);
+
+err:
+ thd->proc_info="After create";
+ delete file;
+ DBUG_RETURN(error);
warn:
- error= 0;
+ error= FALSE;
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_TABLE_EXISTS_ERROR, ER(ER_TABLE_EXISTS_ERROR),
alias);
create_info->table_existed= 1; // Mark that table existed
-
-end:
- VOID(pthread_mutex_unlock(&LOCK_open));
- start_waiting_global_read_lock(thd);
- delete file;
- thd->proc_info="After create";
- DBUG_RETURN(error);
-
-err:
- delete file;
- DBUG_RETURN(TRUE);
-no_err:
- delete file;
- DBUG_RETURN(FALSE);
+ goto unlock_and_end;
}
/*
@@ -1946,10 +1954,12 @@ mysql_rename_table(enum db_type base,
const char *new_db,
const char *new_name)
{
+ THD *thd= current_thd;
char from[FN_REFLEN], to[FN_REFLEN], lc_from[FN_REFLEN], lc_to[FN_REFLEN];
char *from_base= from, *to_base= to;
char tmp_name[NAME_LEN+1];
- handler *file=(base == DB_TYPE_UNKNOWN ? 0 : get_new_handler((TABLE*) 0, base));
+ handler *file= (base == DB_TYPE_UNKNOWN ? 0 :
+ get_new_handler((TABLE*) 0, thd->mem_root, base));
int error=0;
DBUG_ENTER("mysql_rename_table");
@@ -2095,8 +2105,8 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
{
char* backup_dir= thd->lex->backup_dir;
char src_path[FN_REFLEN], dst_path[FN_REFLEN];
- char* table_name = table->table_name;
- char* db = thd->db ? thd->db : table->db;
+ char* table_name= table->table_name;
+ char* db= table->db;
if (fn_format_relative_to_data_home(src_path, table_name, backup_dir,
reg_ext))
@@ -2132,12 +2142,15 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
Now we should be able to open the partially restored table
to finish the restore in the handler later on
*/
- if (!(table->table = reopen_name_locked_table(thd, table)))
+ pthread_mutex_lock(&LOCK_open);
+ if (reopen_name_locked_table(thd, table))
{
- pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd, table);
pthread_mutex_unlock(&LOCK_open);
+ DBUG_RETURN(send_check_errmsg(thd, table, "restore",
+ "Failed to open partially restored table"));
}
+ pthread_mutex_unlock(&LOCK_open);
DBUG_RETURN(0);
}
@@ -2234,12 +2247,16 @@ static int prepare_for_repair(THD* thd, TABLE_LIST *table_list,
Now we should be able to open the partially repaired table
to finish the repair in the handler later on.
*/
- if (!(table_list->table = reopen_name_locked_table(thd, table_list)))
+ pthread_mutex_lock(&LOCK_open);
+ if (reopen_name_locked_table(thd, table_list))
{
- pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd, table_list);
pthread_mutex_unlock(&LOCK_open);
+ error= send_check_errmsg(thd, table_list, "repair",
+ "Failed to open partially repaired table");
+ goto end;
}
+ pthread_mutex_unlock(&LOCK_open);
end:
if (table == &tmp_table)
@@ -2748,6 +2765,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
char *src_table= table_ident->table.str;
int err;
bool res= TRUE;
+ db_type not_used;
+
TABLE_LIST src_tables_list;
DBUG_ENTER("mysql_create_like_table");
src_db= table_ident->db.str ? table_ident->db.str : thd->db;
@@ -2795,7 +2814,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table,
/*
create like should be not allowed for Views, Triggers, ...
*/
- if (mysql_frm_type(src_path) != FRMTYPE_TABLE)
+ if (mysql_frm_type(thd, src_path, &not_used) != FRMTYPE_TABLE)
{
my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "BASE TABLE");
goto err;
@@ -3867,15 +3886,14 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (create_info->row_type == ROW_TYPE_NOT_USED)
create_info->row_type= table->s->row_type;
- DBUG_PRINT("info", ("old type: %d new type: %d", old_db_type, new_db_type));
- if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED)
- || ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED))
+ DBUG_PRINT("info", ("old type: %d new type: %d", old_db_type, new_db_type));
+ if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED) ||
+ ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED))
{
DBUG_PRINT("info", ("doesn't support alter"));
my_error(ER_ILLEGAL_HA, MYF(0), table_name);
DBUG_RETURN(TRUE);
}
- DBUG_PRINT("info", ("supports alter"));
thd->proc_info="setup";
if (!(alter_info->flags & ~(ALTER_RENAME | ALTER_KEYS_ONOFF)) &&
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index df8de59508d..dbad8dcffb5 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -103,8 +103,7 @@ static TABLE_LIST *add_table_for_trigger(THD *thd, sp_name *trig);
bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
{
TABLE *table;
- bool result= 0;
-
+ bool result= TRUE;
DBUG_ENTER("mysql_create_or_drop_trigger");
/*
@@ -119,9 +118,6 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
/* We should have only one table in table list. */
DBUG_ASSERT(tables->next_global == 0);
- if (!(table= open_ltable(thd, tables, tables->lock_type)))
- DBUG_RETURN(TRUE);
-
/*
TODO: We should check if user has TRIGGER privilege for table here.
Now we just require SUPER privilege for creating/dropping because
@@ -131,28 +127,24 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
DBUG_RETURN(TRUE);
/*
- We do not allow creation of triggers on temporary tables. We also don't
- allow creation of triggers on views but fulfilment of this restriction
- is guaranteed by open_ltable(). It is better to have this check here
- than do it in Table_triggers_list::create_trigger() and mess with table
- cache.
+ There is no DETERMINISTIC clause for triggers, so can't check it.
+ But a trigger can in theory be used to do nasty things (if it supported
+ DROP for example) so we do the check for privileges. For now there is
+ already a stronger test right above; but when this stronger test will
+ be removed, the test below will hold.
*/
- if (table->s->tmp_table != NO_TMP_TABLE)
+ if (!trust_routine_creators && mysql_bin_log.is_open() &&
+ !(thd->security_ctx->master_access & SUPER_ACL))
{
- my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias);
+ my_error(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, MYF(0));
DBUG_RETURN(TRUE);
}
- if (!table->triggers)
+ /* We do not allow creation of triggers on temporary tables. */
+ if (create && find_temporary_table(thd, tables->db, tables->table_name))
{
- if (!create)
- {
- my_message(ER_TRG_DOES_NOT_EXIST, ER(ER_TRG_DOES_NOT_EXIST), MYF(0));
- DBUG_RETURN(TRUE);
- }
-
- if (!(table->triggers= new (&table->mem_root) Table_triggers_list(table)))
- DBUG_RETURN(TRUE);
+ my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias);
+ DBUG_RETURN(TRUE);
}
/*
@@ -161,31 +153,41 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
again until we are done. (Acquiring LOCK_open is not enough because
global read lock is held without helding LOCK_open).
*/
- if (wait_if_global_read_lock(thd, 0, 0))
+ if (wait_if_global_read_lock(thd, 0, 1))
DBUG_RETURN(TRUE);
- /*
- There is no DETERMINISTIC clause for triggers, so can't check it.
- But a trigger can in theory be used to do nasty things (if it supported
- DROP for example) so we do the check for privileges. For now there is
- already a stronger test above (see start of the function); but when this
- stronger test will be removed, the test below will hold.
- */
- if (!trust_routine_creators && mysql_bin_log.is_open() &&
- !(thd->security_ctx->master_access & SUPER_ACL))
+ VOID(pthread_mutex_lock(&LOCK_open));
+
+ if (lock_table_names(thd, tables))
+ goto end;
+
+ /* We also don't allow creation of triggers on views. */
+ tables->required_type= FRMTYPE_TABLE;
+
+ if (reopen_name_locked_table(thd, tables))
{
- my_message(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER,
- ER(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER), MYF(0));
- DBUG_RETURN(TRUE);
+ unlock_table_name(thd, tables);
+ goto end;
+ }
+ table= tables->table;
+
+ if (!table->triggers)
+ {
+ if (!create)
+ {
+ my_error(ER_TRG_DOES_NOT_EXIST, MYF(0));
+ goto end;
+ }
+
+ if (!(table->triggers= new (&table->mem_root) Table_triggers_list(table)))
+ goto end;
}
- VOID(pthread_mutex_lock(&LOCK_open));
result= (create ?
table->triggers->create_trigger(thd, tables):
table->triggers->drop_trigger(thd, tables));
- /* It is sensible to invalidate table in any case */
- close_cached_table(thd, table);
+end:
VOID(pthread_mutex_unlock(&LOCK_open));
start_waiting_global_read_lock(thd);
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 951248e8cd8..dee88af7d83 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -720,3 +720,17 @@ bool st_select_lex::cleanup()
DBUG_RETURN(error);
}
+
+void st_select_lex::cleanup_all_joins(bool full)
+{
+ SELECT_LEX_UNIT *unit;
+ SELECT_LEX *sl;
+
+ if (join)
+ join->cleanup(full);
+
+ for (unit= first_inner_unit(); unit; unit= unit->next_unit())
+ for (sl= unit->first_select(); sl; sl= sl->next_select())
+ sl->cleanup_all_joins(full);
+}
+
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 72a8eef9a55..41961b66f0f 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -121,8 +121,9 @@ int mysql_update(THD *thd,
bool safe_update= thd->options & OPTION_SAFE_UPDATES;
bool used_key_is_modified, transactional_table, will_batch;
int res;
- int error=0, loc_error;
- uint used_index, dup_key_found;
+ int error, loc_error;
+ uint used_index= MAX_KEY, dup_key_found;
+ bool need_sort= TRUE;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint want_privilege;
#endif
@@ -194,6 +195,7 @@ int mysql_update(THD *thd,
/* Check the fields we are going to modify */
#ifndef NO_EMBEDDED_ACCESS_CHECKS
table_list->grant.want_privilege= table->grant.want_privilege= want_privilege;
+ table_list->register_want_access(want_privilege);
#endif
/*
Indicate that the set of fields is to be updated by passing 2 for
@@ -233,11 +235,18 @@ int mysql_update(THD *thd,
DBUG_RETURN(1); /* purecov: inspected */
}
+ if (conds)
+ {
+ Item::cond_result cond_value;
+ conds= remove_eq_conds(thd, conds, &cond_value);
+ if (cond_value == Item::COND_FALSE)
+ limit= 0; // Impossible WHERE
+ }
// Don't count on usage of 'only index' when calculating which key to use
table->used_keys.clear_all();
select= make_select(table, 0, 0, conds, 0, &error);
- if (error ||
- (select && select->check_quick(thd, safe_update, limit)) || !limit)
+ if (error || !limit ||
+ (select && select->check_quick(thd, safe_update, limit)))
{
delete select;
free_underlaid_joins(thd, select_lex);
@@ -248,6 +257,11 @@ int mysql_update(THD *thd,
send_ok(thd); // No matching records
DBUG_RETURN(0);
}
+ if (!select && limit != HA_POS_ERROR)
+ {
+ if ((used_index= get_index_for_order(table, order, limit)) != MAX_KEY)
+ need_sort= FALSE;
+ }
/* If running in safe sql mode, don't allow updates without keys */
if (table->quick_keys.is_clear_all())
{
@@ -268,10 +282,14 @@ int mysql_update(THD *thd,
used_key_is_modified= (!select->quick->unique_key_range() &&
select->quick->check_if_keys_used(&fields));
}
- else if ((used_index=table->file->key_used_on_scan) < MAX_KEY)
- used_key_is_modified=check_if_key_used(table, used_index, fields);
else
- used_key_is_modified=0;
+ {
+ used_key_is_modified= 0;
+ if (used_index == MAX_KEY) // no index for sort order
+ used_index= table->file->key_used_on_scan;
+ if (used_index != MAX_KEY)
+ used_key_is_modified= check_if_key_used(table, used_index, fields);
+ }
#ifdef HAVE_PARTITION_DB
if (used_key_is_modified || order ||
@@ -291,7 +309,8 @@ int mysql_update(THD *thd,
table->file->extra(HA_EXTRA_KEYREAD);
}
- if (order)
+ /* note: can actually avoid sorting below.. */
+ if (order && (need_sort || used_key_is_modified))
{
/*
Doing an ORDER BY; Let filesort find and sort the rows we are going
@@ -301,6 +320,7 @@ int mysql_update(THD *thd,
SORT_FIELD *sortorder;
ha_rows examined_rows;
+ used_index= MAX_KEY; // For call to init_read_record()
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
MYF(MY_FAE | MY_ZEROFILL));
if (!(sortorder=make_unireg_sortorder(order, &length)) ||
@@ -335,7 +355,10 @@ int mysql_update(THD *thd,
/* If quick select is used, initialize it before retrieving rows. */
if (select && select->quick && select->quick->reset())
goto err;
- init_read_record(&info,thd,table,select,0,1);
+ if (used_index == MAX_KEY || (select && select->quick))
+ init_read_record(&info,thd,table,select,0,1);
+ else
+ init_read_record_idx(&info, thd, table, 1, used_index);
thd->proc_info="Searching rows for update";
uint tmp_limit= limit;
@@ -364,6 +387,7 @@ int mysql_update(THD *thd,
error= 1; // Aborted
limit= tmp_limit;
end_read_record(&info);
+
/* Change select to use tempfile */
if (select)
{
@@ -671,6 +695,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
#ifndef NO_EMBEDDED_ACCESS_CHECKS
table_list->grant.want_privilege= table->grant.want_privilege=
(SELECT_ACL & ~table->grant.privilege);
+ table_list->register_want_access(SELECT_ACL);
#endif
bzero((char*) &tables,sizeof(tables)); // For ORDER BY
@@ -946,9 +971,6 @@ bool mysql_multi_update(THD *thd,
multi_update *result;
DBUG_ENTER("mysql_multi_update");
- if (mysql_multi_update_prepare(thd))
- DBUG_RETURN(TRUE);
-
if (!(result= new multi_update(table_list,
thd->lex->select_lex.leaf_tables,
fields, values,
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index f956d9d4928..71c5d198b27 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -643,7 +643,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view->query.length= str.length()-1; // we do not need last \0
view->source.str= thd->lex->create_view_select_start;
view->source.length= (thd->query_length -
- (thd->lex->create_view_select_start - thd->query));
+ (thd->lex->create_view_select_start -
+ thd->lex->create_view_start));
view->file_version= 1;
view->calc_md5(md5);
view->md5.str= md5;
@@ -721,44 +722,59 @@ loop_out:
}
+
/*
read VIEW .frm and create structures
SYNOPSIS
mysql_make_view()
- parser - parser object;
- table - TABLE_LIST structure for filling
+ thd Thread handler
+ parser parser object
+ table TABLE_LIST structure for filling
RETURN
0 ok
1 error
*/
-my_bool
-mysql_make_view(File_parser *parser, TABLE_LIST *table)
+bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
{
+ SELECT_LEX *end, *view_select;
+ LEX *old_lex, *lex;
+ Query_arena *arena, backup;
+ int res;
+ bool result;
DBUG_ENTER("mysql_make_view");
- DBUG_PRINT("info", ("table=%p (%s)", table, table->table_name));
+ DBUG_PRINT("info", ("table: 0x%lx (%s)", (ulong) table, table->table_name));
if (table->view)
{
+ /*
+ It's an execution of a PS/SP and the view has already been unfolded
+ into a list of used tables. Now we only need to update the information
+ about granted privileges in the view tables with the actual data
+ stored in MySQL privilege system. We don't need to restore the
+ required privileges (by calling register_want_access) because they has
+ not changed since PREPARE or the previous execution: the only case
+ when this information is changed is execution of UPDATE on a view, but
+ the original want_access is restored in its end.
+ */
+ if (!table->prelocking_placeholder && table->prepare_security(thd))
+ {
+ DBUG_RETURN(1);
+ }
DBUG_PRINT("info",
("VIEW %s.%s is already processed on previous PS/SP execution",
table->view_db.str, table->view_name.str));
DBUG_RETURN(0);
}
- SELECT_LEX *end;
- THD *thd= current_thd;
- LEX *old_lex= thd->lex, *lex;
- SELECT_LEX *view_select;
- int res= 0;
-
/*
For now we assume that tables will not be changed during PS life (it
will be TRUE as far as we make new table cache).
*/
- Query_arena *arena= thd->stmt_arena, backup;
+ old_lex= thd->lex;
+ arena= thd->stmt_arena;
if (arena->is_conventional())
arena= 0;
else
@@ -768,7 +784,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
if (!table->timestamp.str)
table->timestamp.str= table->timestamp_buffer;
/* prepare default values for old format */
- table->view_suid= 1;
+ table->view_suid= TRUE;
table->definer.user.str= table->definer.host.str= 0;
table->definer.user.length= table->definer.host.length= 0;
@@ -879,6 +895,10 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
goto err;
}
+
+ if (!(table->view_tables=
+ (List<TABLE_LIST>*) new(thd->mem_root) List<TABLE_LIST>))
+ goto err;
/*
mark to avoid temporary table using and put view reference and find
last view table
@@ -889,6 +909,22 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
{
tbl->skip_temporary= 1;
tbl->belong_to_view= top_view;
+ tbl->referencing_view= table;
+ /*
+ First we fill want_privilege with SELECT_ACL (this is needed for the
+ tables which belongs to view subqueries and temporary table views,
+ then for the merged view underlying tables we will set wanted
+ privileges of top_view
+ */
+ tbl->grant.want_privilege= SELECT_ACL;
+ /*
+ After unfolding the view we lose the list of tables referenced in it
+ (we will have only a list of underlying tables in case of MERGE
+ algorithm, which does not include the tables referenced from
+ subqueries used in view definition).
+ Let's build a list of all tables referenced in the view.
+ */
+ table->view_tables->push_back(tbl);
}
/*
@@ -914,16 +950,6 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
}
/*
- Let us set proper lock type for tables of the view's main select
- since we may want to perform update or insert on view. This won't
- work for view containing union. But this is ok since we don't
- allow insert and update on such views anyway.
- */
- if (!lex->select_lex.next_select())
- for (tbl= lex->select_lex.get_table_list(); tbl; tbl= tbl->next_local)
- tbl->lock_type= table->lock_type;
-
- /*
If we are opening this view as part of implicit LOCK TABLES, then
this view serves as simple placeholder and we should not continue
further processing.
@@ -931,7 +957,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
if (table->prelocking_placeholder)
goto ok2;
- old_lex->derived_tables|= DERIVED_VIEW;
+ old_lex->derived_tables|= (DERIVED_VIEW | lex->derived_tables);
/* move SQL_NO_CACHE & Co to whole query */
old_lex->safe_to_cache_query= (old_lex->safe_to_cache_query &&
@@ -940,6 +966,37 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
if (view_select->options & OPTION_TO_QUERY_CACHE)
old_lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
+ if (table->view_suid)
+ {
+ /*
+ Prepare a security context to check underlying objects of the view
+ */
+ Security_context *save_security_ctx= thd->security_ctx;
+ if (!(table->view_sctx= (Security_context *)
+ thd->stmt_arena->alloc(sizeof(Security_context))))
+ goto err;
+ /* Assign the context to the tables referenced in the view */
+ for (tbl= view_tables; tbl; tbl= tbl->next_global)
+ tbl->security_ctx= table->view_sctx;
+ /* assign security context to SELECT name resolution contexts of view */
+ for(SELECT_LEX *sl= lex->all_selects_list;
+ sl;
+ sl= sl->next_select_in_list())
+ sl->context.security_ctx= table->view_sctx;
+ }
+
+ /*
+ Setup an error processor to hide error messages issued by stored
+ routines referenced in the view
+ */
+ for (SELECT_LEX *sl= lex->all_selects_list;
+ sl;
+ sl= sl->next_select_in_list())
+ {
+ sl->context.error_processor= &view_error_processor;
+ sl->context.error_processor_data= (void *)table;
+ }
+
/*
check MERGE algorithm ability
- algorithm is not explicit TEMPORARY TABLE
@@ -961,24 +1018,28 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
table->updatable= (table->updatable_view != 0);
table->effective_with_check=
old_lex->get_effective_with_check(table);
+ table->merge_underlying_list= view_tables;
+ /*
+ Let us set proper lock type for tables of the view's main select
+ since we may want to perform update or insert on view. This won't
+ work for view containing union. But this is ok since we don't
+ allow insert and update on such views anyway.
+
+ Also we fill correct wanted privileges.
+ */
+ for (tbl= table->merge_underlying_list; tbl; tbl= tbl->next_local)
+ {
+ tbl->lock_type= table->lock_type;
+ tbl->grant.want_privilege= top_view->grant.orig_want_privilege;
+ }
/* prepare view context */
- lex->select_lex.context.resolve_in_table_list_only(table->ancestor=
- view_tables);
+ lex->select_lex.context.resolve_in_table_list_only(view_tables);
lex->select_lex.context.outer_context= 0;
lex->select_lex.context.select_lex= table->select_lex;
lex->select_lex.select_n_having_items+=
table->select_lex->select_n_having_items;
- /* do not check privileges & hide errors for view underlyings */
- for (SELECT_LEX *sl= lex->all_selects_list;
- sl;
- sl= sl->next_select_in_list())
- {
- sl->context.check_privileges= FALSE;
- sl->context.error_processor= &view_error_processor;
- sl->context.error_processor_data= (void *)table;
- }
/*
Tables of the main select of the view should be marked as belonging
to the same select as original view (again we can use LEX::select_lex
@@ -1011,7 +1072,7 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
}
}
- /* Store WHERE clause for post-processing in setup_ancestor */
+ /* Store WHERE clause for post-processing in setup_underlying */
table->where= view_select->where;
/*
Add subqueries units to SELECT into which we merging current view.
@@ -1072,20 +1133,21 @@ ok:
(st_select_lex_node**)&old_lex->all_selects_list;
ok2:
- if (arena)
- thd->restore_active_arena(arena, &backup);
if (!old_lex->time_zone_tables_used && thd->lex->time_zone_tables_used)
old_lex->time_zone_tables_used= thd->lex->time_zone_tables_used;
- thd->lex= old_lex;
- DBUG_RETURN(0);
+ result= !table->prelocking_placeholder && table->prepare_security(thd);
-err:
+end:
if (arena)
thd->restore_active_arena(arena, &backup);
+ thd->lex= old_lex;
+ DBUG_RETURN(result);
+
+err:
delete table->view;
table->view= 0; // now it is not VIEW placeholder
- thd->lex= old_lex;
- DBUG_RETURN(1);
+ result= 1;
+ goto end;
}
@@ -1109,6 +1171,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
char path[FN_REFLEN];
TABLE_LIST *view;
bool type= 0;
+ db_type not_used;
for (view= views; view; view= view->next_local)
{
@@ -1116,7 +1179,8 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
view->table_name, reg_ext, NullS);
(void) unpack_filename(path, path);
VOID(pthread_mutex_lock(&LOCK_open));
- if (access(path, F_OK) || (type= (mysql_frm_type(path) != FRMTYPE_VIEW)))
+ if (access(path, F_OK) ||
+ (type= (mysql_frm_type(thd, path, &not_used) != FRMTYPE_VIEW)))
{
char name[FN_REFLEN];
my_snprintf(name, sizeof(name), "%s.%s", view->db, view->table_name);
@@ -1163,24 +1227,36 @@ err:
FRMTYPE_VIEW view
*/
-frm_type_enum mysql_frm_type(char *path)
+frm_type_enum mysql_frm_type(THD *thd, char *path, db_type *dbt)
{
File file;
- char header[10]; //"TYPE=VIEW\n" it is 10 characters
- int length;
+ uchar header[10]; //"TYPE=VIEW\n" it is 10 characters
+ int error;
DBUG_ENTER("mysql_frm_type");
+ *dbt= DB_TYPE_UNKNOWN;
+
if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)
- {
DBUG_RETURN(FRMTYPE_ERROR);
- }
- length= my_read(file, (byte*) header, sizeof(header), MYF(MY_WME));
+ error= my_read(file, (byte*) header, sizeof(header), MYF(MY_WME | MY_NABP));
my_close(file, MYF(MY_WME));
- if (length == (int) MY_FILE_ERROR)
+
+ if (error)
DBUG_RETURN(FRMTYPE_ERROR);
- if (length < (int) sizeof(header) ||
- !strncmp(header, "TYPE=VIEW\n", sizeof(header)))
+ if (!strncmp((char*) header, "TYPE=VIEW\n", sizeof(header)))
DBUG_RETURN(FRMTYPE_VIEW);
+
+ /*
+ This is just a check for DB_TYPE. We'll return default unknown type
+ if the following test is true (arg #3). This should not have effect
+ on return value from this function (default FRMTYPE_TABLE)
+ */
+ if (header[0] != (uchar) 254 || header[1] != 1 ||
+ (header[2] != FRM_VER && header[2] != FRM_VER+1 &&
+ (header[2] < FRM_VER+3 || header[2] > FRM_VER+4)))
+ DBUG_RETURN(FRMTYPE_TABLE);
+
+ *dbt= ha_checktype(thd, (enum db_type) (uint) *(header + 3), 0, 0);
DBUG_RETURN(FRMTYPE_TABLE); // Is probably a .frm table
}
@@ -1427,7 +1503,7 @@ mysql_rename_view(THD *thd,
/* get view definition and source */
if (parser->parse((gptr)&view_def, thd->mem_root, view_parameters,
- sizeof(view_parameters)/sizeof(view_parameters[0])-1))
+ array_elements(view_parameters)-1))
goto err;
/* rename view and it's backups */
diff --git a/sql/sql_view.h b/sql/sql_view.h
index 4cc9eb454fb..cd61d7e9e71 100644
--- a/sql/sql_view.h
+++ b/sql/sql_view.h
@@ -19,7 +19,7 @@
bool mysql_create_view(THD *thd,
enum_view_create_mode mode);
-my_bool mysql_make_view(File_parser *parser, TABLE_LIST *table);
+bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table);
bool mysql_drop_view(THD *thd, TABLE_LIST *view, enum_drop_mode drop_mode);
@@ -27,7 +27,7 @@ bool check_key_in_view(THD *thd, TABLE_LIST * view);
bool insert_view_fields(THD *thd, List<Item> *list, TABLE_LIST *view);
-frm_type_enum mysql_frm_type(char *path);
+frm_type_enum mysql_frm_type(THD *thd, char *path, db_type *dbt);
int view_checksum(THD *thd, TABLE_LIST *view);
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 77c1a37e16e..e6c0216ef3a 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -670,7 +670,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token YEAR_SYM
%token ZEROFILL
-%left JOIN_SYM
+%left JOIN_SYM INNER_SYM STRAIGHT_JOIN CROSS LEFT RIGHT
/* A dummy token to force the priority of table_ref production in a join. */
%left TABLE_REF_PRIORITY
%left SET_VAR
@@ -1279,6 +1279,7 @@ create:
THD *thd= YYTHD;
LEX *lex= thd->lex;
lex->sql_command= SQLCOM_CREATE_VIEW;
+ lex->create_view_start= thd->query;
/* first table in list is target VIEW name */
if (!lex->select_lex.add_table_to_list(thd, $7, NULL, 0))
YYABORT;
@@ -3169,9 +3170,21 @@ create_table_option:
| CHECKSUM_SYM opt_equal ulong_num { Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; Lex->create_info.used_fields|= HA_CREATE_USED_CHECKSUM; }
| DELAY_KEY_WRITE_SYM opt_equal ulong_num { Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; Lex->create_info.used_fields|= HA_CREATE_USED_DELAY_KEY_WRITE; }
| ROW_FORMAT_SYM opt_equal row_types { Lex->create_info.row_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT; }
- | RAID_TYPE opt_equal raid_types { Lex->create_info.raid_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
- | RAID_CHUNKS opt_equal ulong_num { Lex->create_info.raid_chunks= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
- | RAID_CHUNKSIZE opt_equal ulong_num { Lex->create_info.raid_chunksize= $3*RAID_BLOCK_SIZE; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
+ | RAID_TYPE opt_equal raid_types
+ {
+ my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_TYPE", "PARTITION");
+ YYABORT;
+ }
+ | RAID_CHUNKS opt_equal ulong_num
+ {
+ my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_CHUNKS", "PARTITION");
+ YYABORT;
+ }
+ | RAID_CHUNKSIZE opt_equal ulong_num
+ {
+ my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_CHUNKSIZE", "PARTITION");
+ YYABORT;
+ }
| UNION_SYM opt_equal '(' table_list ')'
{
/* Move the union list to the merge_list */
@@ -3469,7 +3482,9 @@ type:
spatial_type:
GEOMETRY_SYM { $$= Field::GEOM_GEOMETRY; }
| GEOMETRYCOLLECTION { $$= Field::GEOM_GEOMETRYCOLLECTION; }
- | POINT_SYM { $$= Field::GEOM_POINT; }
+ | POINT_SYM { Lex->length= (char*)"21";
+ $$= Field::GEOM_POINT;
+ }
| MULTIPOINT { $$= Field::GEOM_MULTIPOINT; }
| LINESTRING { $$= Field::GEOM_LINESTRING; }
| MULTILINESTRING { $$= Field::GEOM_MULTILINESTRING; }
@@ -3925,6 +3940,7 @@ alter:
THD *thd= YYTHD;
LEX *lex= thd->lex;
lex->sql_command= SQLCOM_CREATE_VIEW;
+ lex->create_view_start= thd->query;
lex->create_view_mode= VIEW_ALTER;
/* first table in list is target VIEW name */
lex->select_lex.add_table_to_list(thd, $6, NULL, 0);
@@ -4905,9 +4921,9 @@ predicate:
{ $$= new Item_func_eq(new Item_func_soundex($1),
new Item_func_soundex($4)); }
| bit_expr LIKE simple_expr opt_escape
- { $$= new Item_func_like($1,$3,$4); }
+ { $$= new Item_func_like($1,$3,$4,Lex->escape_used); }
| bit_expr not LIKE simple_expr opt_escape
- { $$= new Item_func_not(new Item_func_like($1,$4,$5)); }
+ { $$= new Item_func_not(new Item_func_like($1,$4,$5, Lex->escape_used)); }
| bit_expr REGEXP bit_expr { $$= new Item_func_regex($1,$3); }
| bit_expr not REGEXP bit_expr
{ $$= negate_expression(YYTHD, new Item_func_regex($1,$4)); }
@@ -5127,6 +5143,8 @@ simple_expr:
{ $$= new Item_func_atan($3,$5); }
| CHAR_SYM '(' expr_list ')'
{ $$= new Item_func_char(*$3); }
+ | CHAR_SYM '(' expr_list USING charset_name ')'
+ { $$= new Item_func_char(*$3, $5); }
| CHARSET '(' expr ')'
{ $$= new Item_func_charset($3); }
| COALESCE '(' expr_list ')'
@@ -5814,14 +5832,22 @@ derived_table_list:
}
;
+/*
+ Notice that JOIN is a left-associative operation, and it must be parsed
+ as such, that is, the parser must process first the left join operand
+ then the right one. Such order of processing ensures that the parser
+ produces correct join trees which is essential for semantic analysis
+ and subsequent optimization phases.
+*/
join_table:
+/* INNER JOIN variants */
/*
- Evaluate production 'table_ref' before 'normal_join' so that
- [INNER | CROSS] JOIN is properly nested as other left-associative
- joins.
+ Use %prec to evaluate production 'table_ref' before 'normal_join'
+ so that [INNER | CROSS] JOIN is properly nested as other
+ left-associative joins.
*/
table_ref %prec TABLE_REF_PRIORITY normal_join table_ref
- { YYERROR_UNLESS($1 && ($$=$3)); }
+ { YYERROR_UNLESS($1 && ($$=$3)); }
| table_ref STRAIGHT_JOIN table_factor
{ YYERROR_UNLESS($1 && ($$=$3)); $3->straight=1; }
| table_ref normal_join table_ref
@@ -5863,6 +5889,13 @@ join_table:
}
'(' using_list ')'
{ add_join_natural($1,$3,$7); $$=$3; }
+ | table_ref NATURAL JOIN_SYM table_factor
+ {
+ YYERROR_UNLESS($1 && ($$=$4));
+ add_join_natural($1,$4,NULL);
+ }
+
+/* LEFT JOIN variants */
| table_ref LEFT opt_outer JOIN_SYM table_ref
ON
{
@@ -5894,6 +5927,8 @@ join_table:
$6->outer_join|=JOIN_TYPE_LEFT;
$$=$6;
}
+
+/* RIGHT JOIN variants */
| table_ref RIGHT opt_outer JOIN_SYM table_ref
ON
{
@@ -5931,10 +5966,7 @@ join_table:
LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join()))
YYABORT;
- }
- | table_ref NATURAL JOIN_SYM table_factor
- { YYERROR_UNLESS($1 && ($$=$4)); add_join_natural($1,$4,NULL); };
-
+ };
normal_join:
JOIN_SYM {}
@@ -6267,10 +6299,14 @@ having_clause:
;
opt_escape:
- ESCAPE_SYM simple_expr { $$= $2; }
+ ESCAPE_SYM simple_expr
+ {
+ Lex->escape_used= TRUE;
+ $$= $2;
+ }
| /* empty */
{
-
+ Lex->escape_used= FALSE;
$$= ((YYTHD->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ?
new Item_string("", 0, &my_charset_latin1) :
new Item_string("\\", 1, &my_charset_latin1));
@@ -8594,6 +8630,18 @@ option_value:
$2= $2 ? $2: global_system_variables.character_set_client;
lex->var_list.push_back(new set_var_collation_client($2,thd->variables.collation_database,$2));
}
+ | NAMES_SYM equal expr
+ {
+ LEX *lex= Lex;
+ sp_pcontext *spc= lex->spcont;
+ LEX_STRING names;
+
+ names.str= (char *)"names";
+ names.length= 5;
+ if (spc && spc->find_pvar(&names))
+ my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), names.str);
+ YYABORT;
+ }
| NAMES_SYM charset_name_or_default opt_collate
{
LEX *lex= Lex;
@@ -8611,6 +8659,17 @@ option_value:
{
THD *thd=YYTHD;
LEX_USER *user;
+ LEX *lex= Lex;
+ sp_pcontext *spc= lex->spcont;
+ LEX_STRING pw;
+
+ pw.str= (char *)"password";
+ pw.length= 8;
+ if (spc && spc->find_pvar(&pw))
+ {
+ my_error(ER_SP_BAD_VAR_SHADOW, MYF(0), pw.str);
+ YYABORT;
+ }
if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER))))
YYABORT;
user->host=null_lex_str;
@@ -9569,8 +9628,7 @@ view_user:
(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
YYABORT;
view_user->user = $3; view_user->host=$5;
- if (strchr(view_user->host.str, wild_many) ||
- strchr(view_user->host.str, wild_one))
+ if (view_user->host.length == 0)
{
my_error(ER_NO_VIEW_USER, MYF(0));
YYABORT;
diff --git a/sql/structs.h b/sql/structs.h
index e490a2de60c..3c651c491d3 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -20,7 +20,7 @@
struct st_table;
class Field;
-#define STRING_WITH_LEN(X) X, (sizeof(X)-1)
+#define STRING_WITH_LEN(X) ((char*) X), (sizeof(X)-1)
typedef struct st_lex_string
{
@@ -185,6 +185,7 @@ enum SHOW_TYPE
SHOW_SSL_CTX_SESS_TIMEOUTS, SHOW_SSL_CTX_SESS_CACHE_FULL,
SHOW_SSL_GET_CIPHER_LIST,
#endif /* HAVE_OPENSSL */
+ SHOW_NET_COMPRESSION,
SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS,
SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG,
SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS, SHOW_SLAVE_SKIP_ERRORS
diff --git a/sql/table.cc b/sql/table.cc
index d3f7d2b3b9f..776dcdf66fe 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -303,6 +303,44 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
}
#endif
+ record_offset= (ulong) (uint2korr(head+6)+
+ ((uint2korr(head+14) == 0xffff ?
+ uint4korr(head+47) : uint2korr(head+14))));
+
+ if ((n_length= uint2korr(head+55)))
+ {
+ /* Read extra data segment */
+ char *buff, *next_chunk, *buff_end;
+ if (!(next_chunk= buff= my_malloc(n_length, MYF(MY_WME))))
+ goto err;
+ buff_end= buff + n_length;
+ if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength,
+ MYF(MY_NABP)))
+ {
+ my_free(buff, MYF(0));
+ goto err;
+ }
+ share->connect_string.length= uint2korr(buff);
+ if (! (share->connect_string.str= strmake_root(&outparam->mem_root,
+ next_chunk + 2, share->connect_string.length)))
+ {
+ my_free(buff, MYF(0));
+ goto err;
+ }
+ next_chunk+= share->connect_string.length + 2;
+ if (next_chunk + 2 < buff_end)
+ {
+ uint str_db_type_length= uint2korr(next_chunk);
+ share->db_type= ha_resolve_by_name(next_chunk + 2, str_db_type_length);
+ DBUG_PRINT("enter", ("Setting dbtype to: %d - %d - '%.*s'\n",
+ share->db_type,
+ str_db_type_length, str_db_type_length,
+ next_chunk + 2));
+ next_chunk+= str_db_type_length + 2;
+ }
+ my_free(buff, MYF(0));
+ }
+
error=4;
outparam->reginfo.lock_type= TL_UNLOCK;
outparam->current_lock=F_UNLCK;
@@ -322,9 +360,6 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
goto err; /* purecov: inspected */
share->default_values= (byte *) record;
- record_offset= (ulong) (uint2korr(head+6)+
- ((uint2korr(head+14) == 0xffff ?
- uint4korr(head+47) : uint2korr(head+14))));
if (my_pread(file,(byte*) record, (uint) share->reclength,
record_offset, MYF(MY_NABP)))
goto err; /* purecov: inspected */
@@ -342,20 +377,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
else
outparam->record[1]= outparam->record[0]; // Safety
}
-
- if ((n_length= uint2korr(head+55)))
- {
- /* Read extra block information */
- char *buff;
- if (!(buff= alloc_root(&outparam->mem_root, n_length)))
- goto err;
- if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength,
- MYF(MY_NABP)))
- goto err;
- share->connect_string.length= uint2korr(buff);
- share->connect_string.str= buff+2;
- }
-
+
#ifdef HAVE_purify
/*
We need this because when we read var-length rows, we are not updating
@@ -463,7 +485,8 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
file= -1;
/* Allocate handler */
- if (!(outparam->file= get_new_handler(outparam, share->db_type)))
+ if (!(outparam->file= get_new_handler(outparam, &outparam->mem_root,
+ share->db_type)))
goto err;
record= (char*) outparam->record[0]-1; /* Fieldstart = 1 */
@@ -471,9 +494,11 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
{
outparam->null_flags=null_pos=(uchar*) record+1;
null_bit_pos= (db_create_options & HA_OPTION_PACK_RECORD) ? 0 : 1;
- /* null_bytes below is only correct under the condition that
- there are no bit fields. Correct values is set below after the
- table struct is initialized */
+ /*
+ null_bytes below is only correct under the condition that
+ there are no bit fields. Correct values is set below after the
+ table struct is initialized
+ */
share->null_bytes= (share->null_fields + null_bit_pos + 7) / 8;
}
else
@@ -897,8 +922,12 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
#endif
goto err;
- /* the correct null_bytes can now be set, since bitfields have been taken into account */
- share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8;
+ /*
+ the correct null_bytes can now be set, since bitfields have been taken
+ into account
+ */
+ share->null_bytes= (null_pos - (uchar*) outparam->null_flags +
+ (null_bit_pos + 7) / 8);
share->last_null_bit_pos= null_bit_pos;
/* The table struct is now initialized; Open the table */
@@ -1410,15 +1439,10 @@ File create_frm(THD *thd, my_string name, const char *db,
ulong length;
char fill[IO_SIZE];
int create_flags= O_RDWR | O_TRUNC;
- uint extra_size;
if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
create_flags|= O_EXCL | O_NOFOLLOW;
- extra_size= 0;
- if (create_info->connect_string.length)
- extra_size= 2+create_info->connect_string.length;
-
#if SIZEOF_OFF_T > 4
/* Fix this when we have new .frm files; Current limit is 4G rows (QQ) */
if (create_info->max_rows > ~(ulong) 0)
@@ -1446,7 +1470,8 @@ File create_frm(THD *thd, my_string name, const char *db,
fileinfo[4]=1;
int2store(fileinfo+6,IO_SIZE); /* Next block starts here */
key_length=keys*(7+NAME_LEN+MAX_REF_PARTS*9)+16;
- length= next_io_size((ulong) (IO_SIZE+key_length+reclength+extra_size));
+ length= next_io_size((ulong) (IO_SIZE+key_length+reclength+
+ create_info->extra_size));
int4store(fileinfo+10,length);
tmp_key_length= (key_length < 0xffff) ? key_length : 0xffff;
int2store(fileinfo+14,tmp_key_length);
@@ -1468,7 +1493,7 @@ File create_frm(THD *thd, my_string name, const char *db,
int4store(fileinfo+47, key_length);
tmp= MYSQL_VERSION_ID; // Store to avoid warning from int4store
int4store(fileinfo+51, tmp);
- int2store(fileinfo+55, extra_size);
+ int2store(fileinfo+55, create_info->extra_size);
bzero(fill,IO_SIZE);
for (; length > IO_SIZE ; length-= IO_SIZE)
{
@@ -1709,29 +1734,6 @@ bool check_column_name(const char *name)
}
/*
-** Get type of table from .frm file
-*/
-
-db_type get_table_type(THD *thd, const char *name)
-{
- File file;
- uchar head[4];
- int error;
- DBUG_ENTER("get_table_type");
- DBUG_PRINT("enter",("name: '%s'",name));
-
- if ((file=my_open(name,O_RDONLY, MYF(0))) < 0)
- DBUG_RETURN(DB_TYPE_UNKNOWN);
- error=my_read(file,(byte*) head,4,MYF(MY_NABP));
- my_close(file,MYF(0));
- if (error || head[0] != (uchar) 254 || head[1] != 1 ||
- (head[2] != FRM_VER && head[2] != FRM_VER+1 &&
- (head[2] < FRM_VER+3 || head[2] > FRM_VER+4)))
- DBUG_RETURN(DB_TYPE_UNKNOWN);
- DBUG_RETURN(ha_checktype(thd,(enum db_type) (uint) *(head+3),0,0));
-}
-
-/*
Create Item_field for each column in the table.
SYNPOSIS
@@ -1814,41 +1816,43 @@ void st_table_list::calc_md5(char *buffer)
/*
- set ancestor TABLE for table place holder of VIEW
+ set underlying TABLE for table place holder of VIEW
DESCRIPTION
Replace all views that only uses one table with the table itself.
This allows us to treat the view as a simple table and even update
- it
+ it (it is a kind of optimisation)
SYNOPSIS
- st_table_list::set_ancestor()
+ st_table_list::set_underlying_merge()
*/
-void st_table_list::set_ancestor()
+void st_table_list::set_underlying_merge()
{
TABLE_LIST *tbl;
- if ((tbl= ancestor))
+ if ((tbl= merge_underlying_list))
{
/* This is a view. Process all tables of view */
- DBUG_ASSERT(view);
+ DBUG_ASSERT(view && effective_algorithm == VIEW_ALGORITHM_MERGE);
do
{
- if (tbl->ancestor) // This is a view
+ if (tbl->merge_underlying_list) // This is a view
{
+ DBUG_ASSERT(tbl->view &&
+ tbl->effective_algorithm == VIEW_ALGORITHM_MERGE);
/*
This is the only case where set_ancestor is called on an object
that may not be a view (in which case ancestor is 0)
*/
- tbl->ancestor->set_ancestor();
+ tbl->merge_underlying_list->set_underlying_merge();
}
} while ((tbl= tbl->next_local));
if (!multitable_view)
{
- table= ancestor->table;
- schema_table= ancestor->schema_table;
+ table= merge_underlying_list->table;
+ schema_table= merge_underlying_list->schema_table;
}
}
}
@@ -1858,12 +1862,9 @@ void st_table_list::set_ancestor()
setup fields of placeholder of merged VIEW
SYNOPSIS
- st_table_list::setup_ancestor()
+ st_table_list::setup_underlying()
thd - thread handler
- NOTES
- ancestor is list of tables and views used by view (underlying tables/views)
-
DESCRIPTION
It is:
- preparing translation table for view columns
@@ -1874,10 +1875,11 @@ void st_table_list::set_ancestor()
TRUE - error
*/
-bool st_table_list::setup_ancestor(THD *thd)
+bool st_table_list::setup_underlying(THD *thd)
{
- DBUG_ENTER("st_table_list::setup_ancestor");
- if (!field_translation)
+ DBUG_ENTER("st_table_list::setup_underlying");
+
+ if (!field_translation && merge_underlying_list)
{
Field_translator *transl;
SELECT_LEX *select= &view->select_lex;
@@ -1891,10 +1893,10 @@ bool st_table_list::setup_ancestor(THD *thd)
DBUG_RETURN(TRUE);
}
- for (tbl= ancestor; tbl; tbl= tbl->next_local)
+ for (tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
- if (tbl->ancestor &&
- tbl->setup_ancestor(thd))
+ if (tbl->merge_underlying_list &&
+ tbl->setup_underlying(thd))
{
DBUG_RETURN(TRUE);
}
@@ -1957,7 +1959,7 @@ bool st_table_list::prep_where(THD *thd, Item **conds,
{
DBUG_ENTER("st_table_list::prep_where");
- for (TABLE_LIST *tbl= ancestor; tbl; tbl= tbl->next_local)
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
if (tbl->view && tbl->prep_where(thd, conds, no_where_clause))
{
@@ -2039,7 +2041,7 @@ bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type)
{
DBUG_ENTER("st_table_list::prep_check_option");
- for (TABLE_LIST *tbl= ancestor; tbl; tbl= tbl->next_local)
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
/* see comment of check_opt_type parameter */
if (tbl->view &&
@@ -2062,7 +2064,7 @@ bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type)
}
if (check_opt_type == VIEW_CHECK_CASCADED)
{
- for (TABLE_LIST *tbl= ancestor; tbl; tbl= tbl->next_local)
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
if (tbl->check_option)
item= and_conds(item, tbl->check_option);
@@ -2101,16 +2103,21 @@ void st_table_list::hide_view_error(THD *thd)
{
/* Hide "Unknown column" or "Unknown function" error */
if (thd->net.last_errno == ER_BAD_FIELD_ERROR ||
- thd->net.last_errno == ER_SP_DOES_NOT_EXIST)
+ thd->net.last_errno == ER_SP_DOES_NOT_EXIST ||
+ thd->net.last_errno == ER_PROCACCESS_DENIED_ERROR ||
+ thd->net.last_errno == ER_COLUMNACCESS_DENIED_ERROR)
{
+ TABLE_LIST *top= top_table();
thd->clear_error();
- my_error(ER_VIEW_INVALID, MYF(0), view_db.str, view_name.str);
+ my_error(ER_VIEW_INVALID, MYF(0), top->view_db.str, top->view_name.str);
}
else if (thd->net.last_errno == ER_NO_DEFAULT_FOR_FIELD)
{
+ TABLE_LIST *top= top_table();
thd->clear_error();
// TODO: make correct error message
- my_error(ER_NO_DEFAULT_FOR_VIEW_FIELD, MYF(0), view_db.str, view_name.str);
+ my_error(ER_NO_DEFAULT_FOR_VIEW_FIELD, MYF(0),
+ top->view_db.str, top->view_name.str);
}
}
@@ -2131,10 +2138,10 @@ void st_table_list::hide_view_error(THD *thd)
st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find)
{
/* is this real table and table which we are looking for? */
- if (table == table_to_find && ancestor == 0)
+ if (table == table_to_find && merge_underlying_list == 0)
return this;
- for (TABLE_LIST *tbl= ancestor; tbl; tbl= tbl->next_local)
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
TABLE_LIST *result;
if ((result= tbl->find_underlying_table(table_to_find)))
@@ -2217,7 +2224,7 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure)
bool st_table_list::check_single_table(st_table_list **table, table_map map,
st_table_list *view)
{
- for (TABLE_LIST *tbl= ancestor; tbl; tbl= tbl->next_local)
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
{
if (tbl->table)
{
@@ -2259,8 +2266,8 @@ bool st_table_list::set_insert_values(MEM_ROOT *mem_root)
}
else
{
- DBUG_ASSERT(view && ancestor);
- for (TABLE_LIST *tbl= ancestor; tbl; tbl= tbl->next_local)
+ DBUG_ASSERT(view && merge_underlying_list);
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
if (tbl->set_insert_values(mem_root))
return TRUE;
}
@@ -2406,6 +2413,157 @@ TABLE_LIST *st_table_list::last_leaf_for_name_resolution()
}
+/*
+ Register access mode which we need for underlying tables
+
+ SYNOPSIS
+ register_want_access()
+ want_access Acess which we require
+*/
+
+void st_table_list::register_want_access(ulong want_access)
+{
+ /* Remove SHOW_VIEW_ACL, because it will be checked during making view */
+ want_access&= ~SHOW_VIEW_ACL;
+ if (belong_to_view)
+ {
+ grant.want_privilege= want_access;
+ if (table)
+ table->grant.want_privilege= want_access;
+ }
+ for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local)
+ tbl->register_want_access(want_access);
+}
+
+
+/*
+ Load security context information for this view
+
+ SYNOPSIS
+ st_table_list::prepare_view_securety_context()
+ thd [in] thread handler
+
+ RETURN
+ FALSE OK
+ TRUE Error
+*/
+
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+bool st_table_list::prepare_view_securety_context(THD *thd)
+{
+ DBUG_ENTER("st_table_list::prepare_view_securety_context");
+ DBUG_PRINT("enter", ("table: %s", alias));
+
+ DBUG_ASSERT(!prelocking_placeholder && view);
+ if (view_suid)
+ {
+ DBUG_PRINT("info", ("This table is suid view => load contest"));
+ DBUG_ASSERT(view && view_sctx);
+ if (acl_getroot_no_password(view_sctx,
+ definer.user.str,
+ definer.host.str,
+ definer.host.str,
+ thd->db))
+ {
+ my_error(ER_NO_SUCH_USER, MYF(0), definer.user.str, definer.host.str);
+ DBUG_RETURN(TRUE);
+ }
+ }
+ DBUG_RETURN(FALSE);
+}
+#endif
+
+
+/*
+ Find security context of current view
+
+ SYNOPSIS
+ st_table_list::find_view_security_context()
+ thd [in] thread handler
+
+*/
+
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+Security_context *st_table_list::find_view_security_context(THD *thd)
+{
+ Security_context *sctx;
+ TABLE_LIST *upper_view= this;
+ DBUG_ENTER("st_table_list::find_view_security_context");
+
+ DBUG_ASSERT(view);
+ while (upper_view && !upper_view->view_suid)
+ {
+ DBUG_ASSERT(!upper_view->prelocking_placeholder);
+ upper_view= upper_view->referencing_view;
+ }
+ if (upper_view)
+ {
+ DBUG_PRINT("info", ("Securety context of view %s will be used",
+ upper_view->alias));
+ sctx= upper_view->view_sctx;
+ DBUG_ASSERT(sctx);
+ }
+ else
+ {
+ DBUG_PRINT("info", ("Current global context will be used"));
+ sctx= thd->security_ctx;
+ }
+ DBUG_RETURN(sctx);
+}
+#endif
+
+
+/*
+ Prepare security context and load underlying tables priveleges for view
+
+ SYNOPSIS
+ st_table_list::prepare_security()
+ thd [in] thread handler
+
+ RETURN
+ FALSE OK
+ TRUE Error
+*/
+
+bool st_table_list::prepare_security(THD *thd)
+{
+ List_iterator_fast<TABLE_LIST> tb(*view_tables);
+ TABLE_LIST *tbl;
+ DBUG_ENTER("st_table_list::prepare_security");
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ Security_context *save_security_ctx= thd->security_ctx;
+
+ DBUG_ASSERT(!prelocking_placeholder);
+ if (prepare_view_securety_context(thd))
+ DBUG_RETURN(TRUE);
+ thd->security_ctx= find_view_security_context(thd);
+ while ((tbl= tb++))
+ {
+ DBUG_ASSERT(tbl->referencing_view);
+ char *db, *table_name;
+ if (tbl->view)
+ {
+ db= tbl->view_db.str;
+ table_name= tbl->view_name.str;
+ }
+ else
+ {
+ db= tbl->db;
+ table_name= tbl->table_name;
+ }
+ fill_effective_table_privileges(thd, &tbl->grant, db, table_name);
+ if (tbl->table)
+ tbl->table->grant= grant;
+ }
+ thd->security_ctx= save_security_ctx;
+#else
+ while ((tbl= tb++))
+ tbl->grant.privilege= ~NO_ACCESS;
+#endif
+ DBUG_RETURN(FALSE);
+}
+
+
Natural_join_column::Natural_join_column(Field_translator *field_param,
TABLE_LIST *tab)
{
@@ -2514,6 +2672,9 @@ Natural_join_column::check_grants(THD *thd, const char *name, uint length)
GRANT_INFO *grant;
const char *db_name;
const char *table_name;
+ Security_context *save_security_ctx= thd->security_ctx;
+ Security_context *new_sctx= table_ref->security_ctx;
+ bool res;
if (view_field)
{
@@ -2530,7 +2691,11 @@ Natural_join_column::check_grants(THD *thd, const char *name, uint length)
table_name= table_ref->table->s->table_name;
}
- return check_grant_column(thd, grant, db_name, table_name, name, length);
+ if (new_sctx)
+ thd->security_ctx= new_sctx;
+ res= check_grant_column(thd, grant, db_name, table_name, name, length);
+ thd->security_ctx= save_security_ctx;
+ return res;
}
#endif
diff --git a/sql/table.h b/sql/table.h
index c1de61ef273..40c01a1c051 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -23,6 +23,7 @@ class st_select_lex_unit;
class st_select_lex;
class partition_info;
class COND_EQUAL;
+class Security_context;
/* Order clause list element */
@@ -48,6 +49,11 @@ typedef struct st_grant_info
uint version;
ulong privilege;
ulong want_privilege;
+ /*
+ Stores the requested access acl of top level tables list. Is used to
+ check access rights to the underlying tables of a view.
+ */
+ ulong orig_want_privilege;
} GRANT_INFO;
enum tmp_table_type {NO_TMP_TABLE=0, TMP_TABLE=1, TRANSACTIONAL_TMP_TABLE=2,
@@ -366,7 +372,6 @@ typedef struct st_schema_table
#define VIEW_CHECK_SKIP 2
struct st_lex;
-struct st_table_list;
class select_union;
class TMP_TABLE_PARAM;
@@ -532,11 +537,36 @@ typedef struct st_table_list
Field_translator *field_translation; /* array of VIEW fields */
/* pointer to element after last one in translation table above */
Field_translator *field_translation_end;
- /* list of ancestor(s) of this table (underlying table(s)/view(s) */
- st_table_list *ancestor;
+ /*
+ List (based on next_local) of underlying tables of this view. I.e. it
+ does not include the tables of subqueries used in the view. Is set only
+ for merged views.
+ */
+ st_table_list *merge_underlying_list;
+ /*
+ - 0 for base tables
+ - in case of the view it is the list of all (not only underlying
+ tables but also used in subquery ones) tables of the view.
+ */
+ List<st_table_list> *view_tables;
/* most upper view this table belongs to */
st_table_list *belong_to_view;
/*
+ The view directly referencing this table
+ (non-zero only for merged underlying tables of a view).
+ */
+ st_table_list *referencing_view;
+ /*
+ Security context (non-zero only for tables which belong
+ to view with SQL SECURITY DEFINER)
+ */
+ Security_context *security_ctx;
+ /*
+ This view security context (non-zero only for views with
+ SQL SECURITY DEFINER)
+ */
+ Security_context *view_sctx;
+ /*
List of all base tables local to a subquery including all view
tables. Unlike 'next_local', this in this list views are *not*
leaves. Created in setup_tables() -> make_leaves_list().
@@ -592,8 +622,6 @@ typedef struct st_table_list
bool compact_view_format; /* Use compact format for SHOW CREATE VIEW */
/* view where processed */
bool where_processed;
- /* db part was not defined in table definition */
- bool current_db_used;
/* FRMTYPE_ERROR if any type is acceptable */
enum frm_type_enum required_type;
char timestamp_buffer[20]; /* buffer for timestamp (19+1) */
@@ -604,9 +632,9 @@ typedef struct st_table_list
bool prelocking_placeholder;
void calc_md5(char *buffer);
- void set_ancestor();
+ void set_underlying_merge();
int view_check_option(THD *thd, bool ignore_failure);
- bool setup_ancestor(THD *thd);
+ bool setup_underlying(THD *thd);
void cleanup_items();
bool placeholder() {return derived || view; }
void print(THD *thd, String *str);
@@ -634,6 +662,14 @@ typedef struct st_table_list
return prep_where(thd, conds, no_where_clause);
return FALSE;
}
+
+ void register_want_access(ulong want_access);
+ bool prepare_security(THD *thd);
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ Security_context *find_view_security_context(THD *thd);
+ bool prepare_view_securety_context(THD *thd);
+#endif
+
private:
bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause);
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 592093350f1..86f4b49292a 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -76,6 +76,7 @@ bool mysql_create_frm(THD *thd, my_string file_name,
uint keys, KEY *key_info,
handler *db_file)
{
+ LEX_STRING str_db_type;
uint reclength,info_length,screens,key_info_length,maxlength;
ulong key_buff_length;
File file;
@@ -83,6 +84,7 @@ bool mysql_create_frm(THD *thd, my_string file_name,
uchar fileinfo[64],forminfo[288],*keybuff;
TYPELIB formnames;
uchar *screen_buff;
+ char buff[2];
#ifdef HAVE_PARTITION_DB
partition_info *part_info= thd->lex->part_info;
#endif
@@ -122,6 +124,12 @@ bool mysql_create_frm(THD *thd, my_string file_name,
}
reclength=uint2korr(forminfo+266);
+ /* Calculate extra data segment length */
+ str_db_type.str= (char *) ha_get_storage_engine(create_info->db_type);
+ str_db_type.length= strlen(str_db_type.str);
+ create_info->extra_size= (2 + str_db_type.length +
+ 2 + create_info->connect_string.length);
+
if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo,
create_info, keys)) < 0)
{
@@ -163,16 +171,19 @@ bool mysql_create_frm(THD *thd, my_string file_name,
if (make_empty_rec(thd,file,create_info->db_type,create_info->table_options,
create_fields,reclength, data_offset, db_file))
goto err;
- if (create_info->connect_string.length)
- {
- char buff[2];
- int2store(buff,create_info->connect_string.length);
- if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) ||
- my_write(file, (const byte*)create_info->connect_string.str,
- create_info->connect_string.length, MYF(MY_NABP)))
+
+ int2store(buff, create_info->connect_string.length);
+ if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) ||
+ my_write(file, (const byte*)create_info->connect_string.str,
+ create_info->connect_string.length, MYF(MY_NABP)))
goto err;
- }
+ int2store(buff, str_db_type.length);
+ if (my_write(file, (const byte*)buff, sizeof(buff), MYF(MY_NABP)) ||
+ my_write(file, (const byte*)str_db_type.str,
+ str_db_type.length, MYF(MY_NABP)))
+ goto err;
+
VOID(my_seek(file,filepos,MY_SEEK_SET,MYF(0)));
if (my_write(file,(byte*) forminfo,288,MYF_RW) ||
my_write(file,(byte*) screen_buff,info_length,MYF_RW) ||
@@ -497,16 +508,10 @@ static bool pack_header(uchar *forminfo, enum db_type table_type,
char *dst;
uint length= field->interval->type_lengths[pos], hex_length;
const char *src= field->interval->type_names[pos];
- const char *srcend= src + length;
hex_length= length * 2;
field->interval->type_lengths[pos]= hex_length;
field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1);
- for ( ; src < srcend; src++)
- {
- *dst++= _dig_vec_upper[((uchar) *src) >> 4];
- *dst++= _dig_vec_upper[((uchar) *src) & 15];
- }
- *dst= '\0';
+ octet2hex(dst, src, length);
}
}
diff --git a/storage/heap/_check.c b/storage/heap/_check.c
index 4316a9926f7..cc832f8ed5b 100644
--- a/storage/heap/_check.c
+++ b/storage/heap/_check.c
@@ -167,7 +167,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
ulong found= 0;
byte *key, *recpos;
uint key_length;
- uint not_used;
+ uint not_used[2];
if ((key= tree_search_edge(&keydef->rb_tree, info->parents,
&info->last_pos, offsetof(TREE_ELEMENT, left))))
@@ -177,7 +177,7 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
memcpy(&recpos, key + (*keydef->get_key_length)(keydef,key), sizeof(byte*));
key_length= hp_rb_make_key(keydef, info->recbuf, recpos, 0);
if (ha_key_cmp(keydef->seg, (uchar*) info->recbuf, (uchar*) key,
- key_length, SEARCH_FIND | SEARCH_SAME, &not_used))
+ key_length, SEARCH_FIND | SEARCH_SAME, not_used))
{
error= 1;
DBUG_PRINT("error",("Record in wrong link: key: %d Record: 0x%lx\n",
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index 8fcf7dde000..47dcb00278a 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -203,9 +203,9 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
static int keys_compare(heap_rb_param *param, uchar *key1, uchar *key2)
{
- uint not_used;
+ uint not_used[2];
return ha_key_cmp(param->keyseg, key1, key2, param->key_length,
- param->search_flag, &not_used);
+ param->search_flag, not_used);
}
static void init_block(HP_BLOCK *block, uint reclength, ulong min_records,
diff --git a/storage/innobase/btr/makefilewin b/storage/innobase/btr/makefilewin
deleted file mode 100644
index a5806b74a51..00000000000
--- a/storage/innobase/btr/makefilewin
+++ /dev/null
@@ -1,16 +0,0 @@
-include ..\include\makefile.i
-
-btr.lib: btr0cur.obj btr0btr.obj btr0pcur.obj btr0sea.obj
- lib -out:..\libs\btr.lib btr0cur.obj btr0btr.obj btr0pcur.obj btr0sea.obj
-
-btr0cur.obj: btr0cur.c
- $(CCOM) $(CFL) -c btr0cur.c
-
-btr0btr.obj: btr0btr.c
- $(CCOM) $(CFL) -c btr0btr.c
-
-btr0sea.obj: btr0sea.c
- $(CCOM) $(CFL) -c btr0sea.c
-
-btr0pcur.obj: btr0pcur.c
- $(CCOM) $(CFL) -c btr0pcur.c
diff --git a/storage/innobase/buf/makefilewin b/storage/innobase/buf/makefilewin
deleted file mode 100644
index ce62cb95958..00000000000
--- a/storage/innobase/buf/makefilewin
+++ /dev/null
@@ -1,20 +0,0 @@
-include ..\include\makefile.i
-
-buf.lib: buf0buf.obj buf0lru.obj buf0flu.obj buf0rea.obj
- lib -out:..\libs\buf.lib buf0buf.obj buf0lru.obj buf0flu.obj buf0rea.obj
-
-buf0buf.obj: buf0buf.c
- $(CCOM) $(CFL) -c buf0buf.c
-
-buf0lru.obj: buf0lru.c
- $(CCOM) $(CFL) -c buf0lru.c
-
-buf0flu.obj: buf0flu.c
- $(CCOM) $(CFL) -c buf0flu.c
-
-buf0rea.obj: buf0rea.c
- $(CCOM) $(CFL) -c buf0rea.c
-
-
-
-
diff --git a/storage/innobase/data/makefilewin b/storage/innobase/data/makefilewin
deleted file mode 100644
index 785b75fbb2b..00000000000
--- a/storage/innobase/data/makefilewin
+++ /dev/null
@@ -1,11 +0,0 @@
-include ..\include\makefile.i
-
-data.lib: data0type.obj data0data.obj
- lib -out:..\libs\data.lib data0type.obj data0data.obj
-
-data0type.obj: data0type.c
- $(CCOM) $(CFL) -c data0type.c
-
-data0data.obj: data0data.c
- $(CCOM) $(CFL) -c data0data.c
-
diff --git a/storage/innobase/dict/makefilewin b/storage/innobase/dict/makefilewin
deleted file mode 100644
index e828d06943c..00000000000
--- a/storage/innobase/dict/makefilewin
+++ /dev/null
@@ -1,21 +0,0 @@
-include ..\include\makefile.i
-
-dict.lib: dict0dict.obj dict0boot.obj dict0load.obj dict0mem.obj dict0crea.obj
- lib -out:..\libs\dict.lib dict0dict.obj dict0boot.obj dict0load.obj dict0mem.obj dict0crea.obj
-
-dict0dict.obj: dict0dict.c
- $(CCOM) $(CFL) -c dict0dict.c
-
-dict0boot.obj: dict0boot.c
- $(CCOM) $(CFL) -c dict0boot.c
-
-dict0mem.obj: dict0mem.c
- $(CCOM) $(CFL) -c dict0mem.c
-
-dict0crea.obj: dict0crea.c
- $(CCOM) $(CFL) -c dict0crea.c
-
-dict0load.obj: dict0load.c
- $(CCOM) $(CFL) -c dict0load.c
-
-
diff --git a/storage/innobase/dyn/makefilewin b/storage/innobase/dyn/makefilewin
deleted file mode 100644
index 71a58a756c1..00000000000
--- a/storage/innobase/dyn/makefilewin
+++ /dev/null
@@ -1,9 +0,0 @@
-include ..\include\makefile.i
-
-dyn.lib: dyn0dyn.obj makefile
- lib -out:..\libs\dyn.lib dyn0dyn.obj
-
-dyn0dyn.obj: dyn0dyn.c
- $(CCOM) $(CFL) -c dyn0dyn.c
-
-
diff --git a/storage/innobase/eval/makefilewin b/storage/innobase/eval/makefilewin
deleted file mode 100644
index f587f2a05a6..00000000000
--- a/storage/innobase/eval/makefilewin
+++ /dev/null
@@ -1,10 +0,0 @@
-include ..\include\makefile.i
-
-eval.lib: eval0eval.obj eval0proc.obj
- lib -out:..\libs\eval.lib eval0eval.obj eval0proc.obj
-
-eval0eval.obj: eval0eval.c
- $(CCOM) $(CFL) -c eval0eval.c
-
-eval0proc.obj: eval0proc.c
- $(CCOM) $(CFL) -c eval0proc.c
diff --git a/storage/innobase/fil/makefilewin b/storage/innobase/fil/makefilewin
deleted file mode 100644
index 1b2d6ab2dbb..00000000000
--- a/storage/innobase/fil/makefilewin
+++ /dev/null
@@ -1,10 +0,0 @@
-include ..\include\makefile.i
-
-fil.lib: fil0fil.obj
- lib -out:..\libs\fil.lib fil0fil.obj
-
-fil0fil.obj: fil0fil.c
- $(CCOM) $(CFL) -c fil0fil.c
-
-
-
diff --git a/storage/innobase/fsp/makefilewin b/storage/innobase/fsp/makefilewin
deleted file mode 100644
index 503cf27f490..00000000000
--- a/storage/innobase/fsp/makefilewin
+++ /dev/null
@@ -1,9 +0,0 @@
-include ..\include\makefile.i
-
-fsp.lib: fsp0fsp.obj
- lib -out:..\libs\fsp.lib fsp0fsp.obj
-
-fsp0fsp.obj: fsp0fsp.c
- $(CCOM) $(CFL) -c fsp0fsp.c
-
-
diff --git a/storage/innobase/fut/makefilewin b/storage/innobase/fut/makefilewin
deleted file mode 100644
index 40f3161015c..00000000000
--- a/storage/innobase/fut/makefilewin
+++ /dev/null
@@ -1,12 +0,0 @@
-include ..\include\makefile.i
-
-fut.lib: fut0lst.obj fut0fut.obj
- lib -out:..\libs\fut.lib fut0lst.obj fut0fut.obj
-
-fut0lst.obj: fut0lst.c
- $(CCOM) $(CFL) -c fut0lst.c
-
-fut0fut.obj: fut0fut.c
- $(CCOM) $(CFL) -c fut0fut.c
-
-
diff --git a/storage/innobase/ha/makefilewin b/storage/innobase/ha/makefilewin
deleted file mode 100644
index c7cd130ceea..00000000000
--- a/storage/innobase/ha/makefilewin
+++ /dev/null
@@ -1,10 +0,0 @@
-include ..\include\makefile.i
-
-ha.lib: ha0ha.obj hash0hash.obj
- lib -out:..\libs\ha.lib ha0ha.obj hash0hash.obj
-
-ha0ha.obj: ha0ha.c
- $(CCOM) $(CFL) -c ha0ha.c
-
-hash0hash.obj: hash0hash.c
- $(CCOM) $(CFL) -c hash0hash.c
diff --git a/storage/innobase/ibuf/makefilewin b/storage/innobase/ibuf/makefilewin
deleted file mode 100644
index 86bf9794520..00000000000
--- a/storage/innobase/ibuf/makefilewin
+++ /dev/null
@@ -1,7 +0,0 @@
-include ..\include\makefile.i
-
-ibuf.lib: ibuf0ibuf.obj
- lib -out:..\libs\ibuf.lib ibuf0ibuf.obj
-
-ibuf0ibuf.obj: ibuf0ibuf.c
- $(CCOM) $(CFL) -c ibuf0ibuf.c
diff --git a/storage/innobase/include/Makefile.am b/storage/innobase/include/Makefile.am
index eb1e3b72877..b83aee06680 100644
--- a/storage/innobase/include/Makefile.am
+++ b/storage/innobase/include/Makefile.am
@@ -28,7 +28,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
ha0ha.h ha0ha.ic hash0hash.h hash0hash.ic \
ibuf0ibuf.h ibuf0ibuf.ic ibuf0types.h lock0lock.h \
lock0lock.ic lock0types.h log0log.h log0log.ic log0recv.h \
- log0recv.ic mach0data.h mach0data.ic makefilewin.i \
+ log0recv.ic mach0data.h mach0data.ic \
mem0dbg.h mem0dbg.ic mem0mem.h mem0mem.ic mem0pool.h \
mem0pool.ic mtr0log.h mtr0log.ic mtr0mtr.h mtr0mtr.ic \
mtr0types.h os0file.h os0proc.h os0proc.ic \
diff --git a/storage/innobase/include/makefilewin.i b/storage/innobase/include/makefilewin.i
deleted file mode 100644
index f756cf2ea3a..00000000000
--- a/storage/innobase/include/makefilewin.i
+++ /dev/null
@@ -1,34 +0,0 @@
-# File included in all makefiles of the database
-# (c) Innobase Oy 1995 - 2000
-
-CCOM=cl
-
-# Flags for the debug version
-#CFL= -MTd -Za -Zi -W4 -WX -F8192 -D "WIN32"
-#CFLN = -MTd -Zi -W4 -F8192 -D "WIN32"
-#CFLW = -MTd -Zi -W3 -WX -F8192 -D "WIN32"
-#LFL =
-
-# Flags for the fast version
-#CFL= -MT -Zi -Og -O2 -W3 -WX -D "WIN32"
-#CFLN = -MT -Zi -Og -O2 -W3 -D "WIN32"
-#CFLW = -MT -Zi -Og -O2 -W3 -WX -D "WIN32"
-#LFL =
-
-# Flags for the fast debug version
-CFL= -MTd -Zi -W3 -WX -F8192 -D "WIN32"
-CFLN = -MTd -Zi -W3 -F8192 -D "WIN32"
-CFLW = -MTd -Zi -W3 -WX -F8192 -D "WIN32"
-LFL = /link/NODEFAULTLIB:LIBCMT
-
-# Flags for the profiler version
-#CFL= -MT -Zi -Og -O2 -W3 -WX -D "WIN32"
-#CFLN = -MT -Zi -Og -O2 -WX -D "WIN32"
-#CFLW = -MT -Zi -Og -O2 -W3 -WX -D "WIN32"
-#LFL= -link -PROFILE
-
-# Flags for the fast version without debug info (= the production version)
-#CFL= -MT -Og -O2 -G6 -W3 -WX -D "WIN32"
-#CFLN = -MT -Og -O2 -G6 -W3 -D "WIN32"
-#CFLW = -MT -Og -O2 -G6 -W3 -WX -D "WIN32"
-#LFL =
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 1d15b8d1c77..69b397c9682 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -312,6 +312,15 @@ rec_offs_nth_extern(
const ulint* offsets,/* in: array returned by rec_get_offsets() */
ulint n); /* in: nth field */
/**********************************************************
+Returns nonzero if the SQL NULL bit is set in nth field of rec. */
+UNIV_INLINE
+ulint
+rec_offs_nth_sql_null(
+/*==================*/
+ /* out: nonzero if SQL NULL */
+ const ulint* offsets,/* in: array returned by rec_get_offsets() */
+ ulint n); /* in: nth field */
+/**********************************************************
Gets the physical size of a field. */
UNIV_INLINE
ulint
diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic
index e2dceb6bae5..9c24f385f4f 100644
--- a/storage/innobase/include/rem0rec.ic
+++ b/storage/innobase/include/rem0rec.ic
@@ -955,6 +955,22 @@ rec_offs_nth_extern(
}
/**********************************************************
+Returns nonzero if the SQL NULL bit is set in nth field of rec. */
+UNIV_INLINE
+ulint
+rec_offs_nth_sql_null(
+/*==================*/
+ /* out: nonzero if SQL NULL */
+ const ulint* offsets,/* in: array returned by rec_get_offsets() */
+ ulint n) /* in: nth field */
+{
+ ut_ad(rec_offs_validate(NULL, NULL, offsets));
+ ut_ad(n < rec_offs_n_fields(offsets));
+ return(UNIV_UNLIKELY(rec_offs_base(offsets)[1 + n]
+ & REC_OFFS_SQL_NULL));
+}
+
+/**********************************************************
Gets the physical size of a field. */
UNIV_INLINE
ulint
diff --git a/storage/innobase/lock/makefilewin b/storage/innobase/lock/makefilewin
deleted file mode 100644
index 149b0a2fed6..00000000000
--- a/storage/innobase/lock/makefilewin
+++ /dev/null
@@ -1,7 +0,0 @@
-include ..\include\makefile.i
-
-lock.lib: lock0lock.obj
- lib -out:..\libs\lock.lib lock0lock.obj
-
-lock0lock.obj: lock0lock.c
- $(CCOM) $(CFL) -c lock0lock.c
diff --git a/storage/innobase/log/makefilewin b/storage/innobase/log/makefilewin
deleted file mode 100644
index a690af3bb35..00000000000
--- a/storage/innobase/log/makefilewin
+++ /dev/null
@@ -1,10 +0,0 @@
-include ..\include\makefile.i
-
-log.lib: log0log.obj log0recv.obj
- lib -out:..\libs\log.lib log0log.obj log0recv.obj
-
-log0log.obj: log0log.c
- $(CCOM) $(CFL) -c log0log.c
-
-log0recv.obj: log0recv.c
- $(CCOM) $(CFL) -c log0recv.c
diff --git a/storage/innobase/mach/makefilewin b/storage/innobase/mach/makefilewin
deleted file mode 100644
index 5306b0fe14c..00000000000
--- a/storage/innobase/mach/makefilewin
+++ /dev/null
@@ -1,9 +0,0 @@
-include ..\include\makefile.i
-
-mach.lib: mach0data.obj
- lib -out:..\libs\mach.lib mach0data.obj
-
-mach0data.obj: mach0data.c
- $(CCOM) $(CFLN) -c mach0data.c
-
-
diff --git a/storage/innobase/makefilewin b/storage/innobase/makefilewin
deleted file mode 100644
index 1bd8d96e5e7..00000000000
--- a/storage/innobase/makefilewin
+++ /dev/null
@@ -1,164 +0,0 @@
-doall: del_libs pb_all os.lib ut.lib mach.lib sync.lib mem.lib dyn.lib ha.lib com.lib thr.lib srv.lib fil.lib buf.lib log.lib mtr.lib log.lib fut.lib fsp.lib dict.lib data.lib rem.lib page.lib btr.lib ibuf.lib usr.lib que.lib trx.lib lock.lib read.lib row.lib pars.lib eval.lib ib_odbc.lib
-
-del_libs:
- cd libs
- del *.lib
- cd ..
-
-pb_all:
- pb_all
-
-os.lib:
- cd os
- remake
- cd ..
-
-ut.lib:
- cd ut
- remake
- cd ..
-
-mach.lib:
- cd mach
- remake
- cd ..
-
-sync.lib:
- cd sync
- remake
- cd ..
-
-mem.lib:
- cd mem
- remake
- cd ..
-
-dyn.lib:
- cd dyn
- remake
- cd ..
-
-ha.lib:
- cd ha
- remake
- cd ..
-
-com.lib:
- cd com
- remake
- cd ..
-
-thr.lib:
- cd thr
- remake
- cd ..
-
-srv.lib:
- cd srv
- remake
- cd ..
-
-fil.lib:
- cd fil
- remake
- cd ..
-
-buf.lib:
- cd buf
- remake
- cd ..
-
-log.lib:
- cd log
- remake
- cd ..
-
-mtr.lib:
- cd mtr
- remake
- cd ..
-
-fut.lib:
- cd fut
- remake
- cd ..
-
-fsp.lib:
- cd fsp
- remake
- cd ..
-
-dict.lib:
- cd dict
- remake
- cd ..
-
-data.lib:
- cd data
- remake
- cd ..
-
-rem.lib:
- cd rem
- remake
- cd ..
-
-page.lib:
- cd page
- remake
- cd ..
-
-btr.lib:
- cd btr
- remake
- cd ..
-
-ibuf.lib:
- cd ibuf
- remake
- cd ..
-
-usr.lib:
- cd usr
- remake
- cd ..
-
-que.lib:
- cd que
- remake
- cd ..
-
-trx.lib:
- cd trx
- remake
- cd ..
-
-lock.lib:
- cd lock
- remake
- cd ..
-
-read.lib:
- cd read
- remake
- cd ..
-
-row.lib:
- cd row
- remake
- cd ..
-
-pars.lib:
- cd pars
- remake
- cd ..
-
-eval.lib:
- cd eval
- remake
- cd ..
-
-ib_odbc.lib:
- cd odbc
- remake
- cd ..
diff --git a/storage/innobase/mem/makefilewin b/storage/innobase/mem/makefilewin
deleted file mode 100644
index 8a30f8a6e71..00000000000
--- a/storage/innobase/mem/makefilewin
+++ /dev/null
@@ -1,10 +0,0 @@
-include ..\include\makefile.i
-
-mem.lib: mem0mem.obj mem0pool.obj makefile
- lib -out:..\libs\mem.lib mem0mem.obj mem0pool.obj
-
-mem0mem.obj: mem0mem.c mem0dbg.c
- $(CCOM) $(CFL) -c mem0mem.c
-
-mem0pool.obj: mem0pool.c
- $(CCOM) $(CFL) -c mem0pool.c
diff --git a/storage/innobase/mtr/makefilewin b/storage/innobase/mtr/makefilewin
deleted file mode 100644
index 9da0863bd28..00000000000
--- a/storage/innobase/mtr/makefilewin
+++ /dev/null
@@ -1,14 +0,0 @@
-include ..\include\makefile.i
-
-mtr.lib: mtr0mtr.obj mtr0log.obj
- lib -out:..\libs\mtr.lib mtr0mtr.obj mtr0log.obj
-
-mtr0mtr.obj: mtr0mtr.c
- $(CCOM) $(CFL) -c mtr0mtr.c
-
-mtr0log.obj: mtr0log.c
- $(CCOM) $(CFL) -c mtr0log.c
-
-
-
-
diff --git a/storage/innobase/my_cnf b/storage/innobase/my_cnf
deleted file mode 100644
index 94365237841..00000000000
--- a/storage/innobase/my_cnf
+++ /dev/null
@@ -1,63 +0,0 @@
-# Example mysql config file.
-# Copy this file to c:\my.cnf to set global options
-#
-# One can use all long options that the program supports.
-# Run the program with --help to get a list of available options
-
-# This will be passed to all mysql clients
-[client]
-#password=my_password
-port=3306
-#socket=MySQL
-
-# Here is entries for some specific programs
-# The following values assume you have at least 32M ram
-
-# The MySQL server
-[mysqld]
-port=3306
-#socket=MySQL
-skip-locking
-default-character-set=latin1
-set-variable = key_buffer=2M
-set-variable = max_allowed_packet=1M
-set-variable = thread_stack=128K
-set-variable = flush_time=1800
-
-innobase_data_home_dir = e:\ibdata\
-innobase_data_file_path = ibdata1:25M;ibdata2:37M;ibdata3:100M;ibdata4:300M
-set-variable = innobase_mirrored_log_groups=1
-innobase_log_group_home_dir = e:\iblogs\
-set-variable = innobase_log_files_in_group=3
-set-variable = innobase_log_file_size=5M
-set-variable = innobase_log_buffer_size=8M
-innobase_flush_log_at_trx_commit=1
-innobase_log_arch_dir = e:\iblogs\
-innobase_log_archive=0
-set-variable = innobase_buffer_pool_size=16M
-set-variable = innobase_additional_mem_pool_size=2M
-set-variable = innobase_file_io_threads=4
-set-variable = innobase_lock_wait_timeout=50
-
-
-# Uncomment the following row if you move the MySQL distribution to another
-# location
-#basedir = d:/mysql/
-
-[mysqldump]
-quick
-set-variable = max_allowed_packet=16M
-
-[mysql]
-no-auto-rehash
-
-[isamchk]
-set-variable= key=16M
-
-[client_fltk]
-help_file= c:\mysql\sql_client\MySQL.help
-client_file= c:\mysql\MySQL.options
-history_length=20
-database = test
-queries_root= c:\mysql\queries
-last_database_file= c:\mysql\lastdb
diff --git a/storage/innobase/os/makefilewin b/storage/innobase/os/makefilewin
deleted file mode 100644
index 8bc8d08611b..00000000000
--- a/storage/innobase/os/makefilewin
+++ /dev/null
@@ -1,17 +0,0 @@
-include ..\include\makefile.i
-
-os.lib: os0sync.obj os0thread.obj os0proc.obj os0file.obj
- lib -out:..\libs\os.lib os0sync.obj os0thread.obj os0proc.obj os0file.obj
-
-os0sync.obj: os0sync.c
- $(CCOM) $(CFLW) -c os0sync.c
-
-os0thread.obj: os0thread.c
- $(CCOM) $(CFLW) -c os0thread.c
-
-os0proc.obj: os0proc.c
- $(CCOM) $(CFLW) -c os0proc.c
-
-os0file.obj: os0file.c
- $(CCOM) $(CFLW) -c os0file.c
-
diff --git a/storage/innobase/page/makefilewin b/storage/innobase/page/makefilewin
deleted file mode 100644
index 4a132cf828c..00000000000
--- a/storage/innobase/page/makefilewin
+++ /dev/null
@@ -1,12 +0,0 @@
-include ..\include\makefile.i
-
-page.lib: page0page.obj page0cur.obj
- lib -out:..\libs\page.lib page0page.obj page0cur.obj
-
-page0page.obj: page0page.c
- $(CCOM) $(CFL) -c page0page.c
-
-page0cur.obj: page0cur.c
- $(CCOM) $(CFL) -c page0cur.c
-
-
diff --git a/storage/innobase/pars/makefilewin b/storage/innobase/pars/makefilewin
deleted file mode 100644
index f183d89cbe2..00000000000
--- a/storage/innobase/pars/makefilewin
+++ /dev/null
@@ -1,26 +0,0 @@
-include ..\include\makefile.i
-
-pars.lib: pars0grm.obj lexyy.obj pars0pars.obj pars0opt.obj pars0sym.obj rename_and_copy
- lib -out:..\libs\pars.lib pars0grm.obj lexyy.obj pars0pars.obj pars0opt.obj pars0sym.obj
-
-pars0grm.obj: pars0grm.y
- bs pars0grm.y
- $(CCOM) $(CFLW) -c pars0grm.c
-
-rename_and_copy:
- ren pars0grm.h pars0grm.h
- copy pars0grm.h ..\include
-
-lexyy.obj: pars0lex.l
- fl pars0lex.l
- $(CCOM) $(CFLN) -c lexyy.c
-
-pars0pars.obj: pars0pars.c
- $(CCOM) $(CFL) -c pars0pars.c
-
-pars0opt.obj: pars0opt.c
- $(CCOM) $(CFL) -c pars0opt.c
-
-pars0sym.obj: pars0sym.c
- $(CCOM) $(CFL) -c pars0sym.c
-
diff --git a/storage/innobase/que/makefilewin b/storage/innobase/que/makefilewin
deleted file mode 100644
index 9661c716551..00000000000
--- a/storage/innobase/que/makefilewin
+++ /dev/null
@@ -1,7 +0,0 @@
-include ..\include\makefile.i
-
-que.lib: que0que.obj
- lib -out:..\libs\que.lib que0que.obj
-
-que0que.obj: que0que.c
- $(CCOM) $(CFL) -c que0que.c
diff --git a/storage/innobase/read/makefilewin b/storage/innobase/read/makefilewin
deleted file mode 100644
index 39593993a67..00000000000
--- a/storage/innobase/read/makefilewin
+++ /dev/null
@@ -1,7 +0,0 @@
-include ..\include\makefile.i
-
-read.lib: read0read.obj
- lib -out:..\libs\read.lib read0read.obj
-
-read0read.obj: read0read.c
- $(CCOM) $(CFL) -c read0read.c
diff --git a/storage/innobase/rem/makefilewin b/storage/innobase/rem/makefilewin
deleted file mode 100644
index 51ca4a92012..00000000000
--- a/storage/innobase/rem/makefilewin
+++ /dev/null
@@ -1,12 +0,0 @@
-include ..\include\makefile.i
-
-rem.lib: rem0rec.obj rem0cmp.obj
- lib -out:..\libs\rem.lib rem0rec.obj rem0cmp.obj
-
-rem0rec.obj: rem0rec.c
- $(CCOM) $(CFL) -c rem0rec.c
-
-rem0cmp.obj: rem0cmp.c
- $(CCOM) $(CFL) -c rem0cmp.c
-
-
diff --git a/storage/innobase/row/makefilewin b/storage/innobase/row/makefilewin
deleted file mode 100644
index c17240c6119..00000000000
--- a/storage/innobase/row/makefilewin
+++ /dev/null
@@ -1,34 +0,0 @@
-include ..\include\makefile.i
-
-row.lib: row0mysql.obj row0upd.obj row0sel.obj row0umod.obj row0uins.obj row0ins.obj row0upd.obj row0undo.obj row0purge.obj row0vers.obj row0row.obj
- lib -out:..\libs\row.lib row0mysql.obj row0sel.obj row0umod.obj row0uins.obj row0ins.obj row0upd.obj row0undo.obj row0purge.obj row0vers.obj row0row.obj
-
-row0mysql.obj: row0mysql.c
- $(CCOM) $(CFL) -c row0mysql.c
-
-row0ins.obj: row0ins.c
- $(CCOM) $(CFL) -c row0ins.c
-
-row0sel.obj: row0sel.c
- $(CCOM) $(CFL) -c row0sel.c
-
-row0upd.obj: row0upd.c
- $(CCOM) $(CFL) -c row0upd.c
-
-row0undo.obj: row0undo.c
- $(CCOM) $(CFL) -c row0undo.c
-
-row0purge.obj: row0purge.c
- $(CCOM) $(CFL) -c row0purge.c
-
-row0row.obj: row0row.c
- $(CCOM) $(CFL) -c row0row.c
-
-row0vers.obj: row0vers.c
- $(CCOM) $(CFL) -c row0vers.c
-
-row0umod.obj: row0umod.c
- $(CCOM) $(CFL) -c row0umod.c
-
-row0uins.obj: row0uins.c
- $(CCOM) $(CFL) -c row0uins.c
diff --git a/storage/innobase/row/row0upd.c b/storage/innobase/row/row0upd.c
index 4f44dbeae67..ff1ad1dfd05 100644
--- a/storage/innobase/row/row0upd.c
+++ b/storage/innobase/row/row0upd.c
@@ -395,6 +395,18 @@ row_upd_changes_field_size_or_external(
old_len = rec_offs_nth_size(offsets, upd_field->field_no);
+ if (rec_offs_comp(offsets)
+ && rec_offs_nth_sql_null(offsets, upd_field->field_no)) {
+ /* Note that in the compact table format, for a
+ variable length field, an SQL NULL will use zero
+ bytes in the offset array at the start of the physical
+ record, but a zero-length value (empty string) will
+ use one byte! Thus, we cannot use update-in-place
+ if we update an SQL NULL varchar to an empty string! */
+
+ old_len = UNIV_SQL_NULL;
+ }
+
if (old_len != new_len) {
return(TRUE);
diff --git a/storage/innobase/srv/makefilewin b/storage/innobase/srv/makefilewin
deleted file mode 100644
index 129c65ec220..00000000000
--- a/storage/innobase/srv/makefilewin
+++ /dev/null
@@ -1,15 +0,0 @@
-include ..\include\makefile.i
-
-srv.lib: srv0srv.obj srv0que.obj srv0start.obj
- lib -out:..\libs\srv.lib srv0srv.obj srv0que.obj srv0start.obj
-
-srv0srv.obj: srv0srv.c
- $(CCOM) $(CFL) -c srv0srv.c
-
-srv0que.obj: srv0que.c
- $(CCOM) $(CFL) -c srv0que.c
-
-srv0start.obj: srv0start.c
- $(CCOM) $(CFL) -c srv0start.c
-
-
diff --git a/storage/innobase/sync/makefilewin b/storage/innobase/sync/makefilewin
deleted file mode 100644
index 73cff40405a..00000000000
--- a/storage/innobase/sync/makefilewin
+++ /dev/null
@@ -1,14 +0,0 @@
-include ..\include\makefile.i
-
-sync.lib: sync0sync.obj sync0rw.obj sync0arr.obj
- lib -out:..\libs\sync.lib sync0sync.obj sync0rw.obj sync0arr.obj
-
-sync0sync.obj: sync0sync.c
- $(CCOM) $(CFLN) -c sync0sync.c
-
-sync0rw.obj: sync0rw.c
- $(CCOM) $(CFL) -c sync0rw.c
-
-sync0arr.obj: sync0arr.c
- $(CCOM) $(CFL) -c sync0arr.c
-
diff --git a/storage/innobase/thr/makefilewin b/storage/innobase/thr/makefilewin
deleted file mode 100644
index 3f29ea1d3e3..00000000000
--- a/storage/innobase/thr/makefilewin
+++ /dev/null
@@ -1,9 +0,0 @@
-include ..\include\makefile.i
-
-thr.lib: thr0loc.obj
- lib -out:..\libs\thr.lib thr0loc.obj
-
-thr0loc.obj: thr0loc.c
- $(CCOM) $(CFL) -c thr0loc.c
-
-
diff --git a/storage/innobase/trx/makefilewin b/storage/innobase/trx/makefilewin
deleted file mode 100644
index 35588779d66..00000000000
--- a/storage/innobase/trx/makefilewin
+++ /dev/null
@@ -1,26 +0,0 @@
-include ..\include\makefile.i
-
-trx.lib: trx0sys.obj trx0trx.obj trx0rseg.obj trx0undo.obj trx0rec.obj trx0roll.obj trx0purge.obj
- lib -out:..\libs\trx.lib trx0sys.obj trx0trx.obj trx0rseg.obj trx0undo.obj trx0rec.obj trx0roll.obj trx0purge.obj
-
-trx0trx.obj: trx0trx.c
- $(CCOM) $(CFL) -c -I.. trx0trx.c
-
-trx0sys.obj: trx0sys.c
- $(CCOM) $(CFL) -c -I.. trx0sys.c
-
-trx0rseg.obj: trx0rseg.c
- $(CCOM) $(CFL) -c -I.. trx0rseg.c
-
-trx0undo.obj: trx0undo.c
- $(CCOM) $(CFL) -c -I.. trx0undo.c
-
-trx0rec.obj: trx0rec.c
- $(CCOM) $(CFL) -c -I.. trx0rec.c
-
-trx0roll.obj: trx0roll.c
- $(CCOM) $(CFL) -c -I.. trx0roll.c
-
-trx0purge.obj: trx0purge.c
- $(CCOM) $(CFL) -c -I.. trx0purge.c
-
diff --git a/storage/innobase/usr/makefilewin b/storage/innobase/usr/makefilewin
deleted file mode 100644
index 66a77275e9b..00000000000
--- a/storage/innobase/usr/makefilewin
+++ /dev/null
@@ -1,7 +0,0 @@
-include ..\include\makefile.i
-
-usr.lib: usr0sess.obj
- lib -out:..\libs\usr.lib usr0sess.obj
-
-usr0sess.obj: usr0sess.c
- $(CCOM) $(CFL) -c usr0sess.c
diff --git a/storage/innobase/ut/makefilewin b/storage/innobase/ut/makefilewin
deleted file mode 100644
index 2fda190773b..00000000000
--- a/storage/innobase/ut/makefilewin
+++ /dev/null
@@ -1,21 +0,0 @@
-include ..\include\makefile.i
-
-ut.lib: ut0ut.obj ut0mem.obj ut0byte.obj ut0dbg.obj ut0rnd.obj
- lib -out:..\libs\ut.lib ut0ut.obj ut0mem.obj ut0byte.obj ut0dbg.obj ut0rnd.obj
-
-ut0ut.obj: ut0ut.c
- $(CCOM) $(CFL) -c ut0ut.c
-
-ut0mem.obj: ut0mem.c
- $(CCOM) $(CFL) -c ut0mem.c
-
-ut0byte.obj: ut0byte.c
- $(CCOM) $(CFL) -c ut0byte.c
-
-ut0dbg.obj: ut0dbg.c
- $(CCOM) $(CFL) -c ut0dbg.c
-
-ut0rnd.obj: ut0rnd.c
- $(CCOM) $(CFL) -c ut0rnd.c
-
-
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 074a1b23686..6296193d6b0 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -392,7 +392,10 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
found_keys++;
param->record_checksum=init_checksum;
+
bzero((char*) &param->unique_count,sizeof(param->unique_count));
+ bzero((char*) &param->notnull_count,sizeof(param->notnull_count));
+
if ((!(param->testflag & T_SILENT)))
printf ("- check data record references index: %d\n",key+1);
if (keyinfo->flag & HA_FULLTEXT)
@@ -497,7 +500,9 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
if (param->testflag & T_STATISTICS)
update_key_parts(keyinfo, rec_per_key_part, param->unique_count,
- (ulonglong) info->state->records);
+ param->stats_method == MI_STATS_METHOD_IGNORE_NULLS?
+ param->notnull_count: NULL,
+ (ulonglong)info->state->records);
}
if (param->testflag & T_INFO)
{
@@ -553,6 +558,96 @@ err:
return 1;
}
+
+/*
+ "Ignore NULLs" statistics collection method: process first index tuple.
+
+ SYNOPSIS
+ mi_collect_stats_nonulls_first()
+ keyseg IN Array of key part descriptions
+ notnull INOUT Array, notnull[i] = (number of {keypart1...keypart_i}
+ tuples that don't contain NULLs)
+ key IN Key values tuple
+
+ DESCRIPTION
+ Process the first index tuple - find out which prefix tuples don't
+ contain NULLs, and update the array of notnull counters accordingly.
+*/
+
+static
+void mi_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull,
+ uchar *key)
+{
+ uint first_null, kp;
+ first_null= ha_find_null(keyseg, key) - keyseg;
+ /*
+ All prefix tuples that don't include keypart_{first_null} are not-null
+ tuples (and all others aren't), increment counters for them.
+ */
+ for (kp= 0; kp < first_null; kp++)
+ notnull[kp]++;
+}
+
+
+/*
+ "Ignore NULLs" statistics collection method: process next index tuple.
+
+ SYNOPSIS
+ mi_collect_stats_nonulls_next()
+ keyseg IN Array of key part descriptions
+ notnull INOUT Array, notnull[i] = (number of {keypart1...keypart_i}
+ tuples that don't contain NULLs)
+ prev_key IN Previous key values tuple
+ last_key IN Next key values tuple
+
+ DESCRIPTION
+ Process the next index tuple:
+ 1. Find out which prefix tuples of last_key don't contain NULLs, and
+ update the array of notnull counters accordingly.
+ 2. Find the first keypart number where the prev_key and last_key tuples
+ are different(A), or last_key has NULL value(B), and return it, so the
+ caller can count number of unique tuples for each key prefix. We don't
+ need (B) to be counted, and that is compensated back in
+ update_key_parts().
+
+ RETURN
+ 1 + number of first keypart where values differ or last_key tuple has NULL
+*/
+
+static
+int mi_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull,
+ uchar *prev_key, uchar *last_key)
+{
+ uint diffs[2];
+ uint first_null_seg, kp;
+ HA_KEYSEG *seg;
+
+ /*
+ Find the first keypart where values are different or either of them is
+ NULL. We get results in diffs array:
+ diffs[0]= 1 + number of first different keypart
+ diffs[1]=offset: (last_key + diffs[1]) points to first value in
+ last_key that is NULL or different from corresponding
+ value in prev_key.
+ */
+ ha_key_cmp(keyseg, prev_key, last_key, USE_WHOLE_KEY,
+ SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, diffs);
+ seg= keyseg + diffs[0] - 1;
+
+ /* Find first NULL in last_key */
+ first_null_seg= ha_find_null(seg, last_key + diffs[1]) - keyseg;
+ for (kp= 0; kp < first_null_seg; kp++)
+ notnull[kp]++;
+
+ /*
+ Return 1+ number of first key part where values differ. Don't care if
+ these were NULLs and not .... We compensate for that in
+ update_key_parts.
+ */
+ return diffs[0];
+}
+
+
/* Check if index is ok */
static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
@@ -564,7 +659,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
uchar key[MI_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos;
my_off_t next_page,record;
char llbuff[22];
- uint diff_pos;
+ uint diff_pos[2];
DBUG_ENTER("chk_index");
DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
@@ -622,7 +717,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
}
if ((*keys)++ &&
(flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length,
- comp_flag, &diff_pos)) >=0)
+ comp_flag, diff_pos)) >=0)
{
DBUG_DUMP("old",(byte*) info->lastkey, info->lastkey_length);
DBUG_DUMP("new",(byte*) key, key_length);
@@ -641,8 +736,20 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
if (param->stats_method == MI_STATS_METHOD_NULLS_NOT_EQUAL)
ha_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY,
SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL,
- &diff_pos);
- param->unique_count[diff_pos-1]++;
+ diff_pos);
+ else if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS)
+ {
+ diff_pos[0]= mi_collect_stats_nonulls_next(keyinfo->seg,
+ param->notnull_count,
+ info->lastkey, key);
+ }
+ param->unique_count[diff_pos[0]-1]++;
+ }
+ else
+ {
+ if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS)
+ mi_collect_stats_nonulls_first(keyinfo->seg, param->notnull_count,
+ key);
}
}
(*key_checksum)+= mi_byte_checksum((byte*) key,
@@ -1047,9 +1154,12 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
/* We don't need to lock the key tree here as we don't allow
concurrent threads when running myisamchk
*/
- int search_result= (keyinfo->flag & HA_SPATIAL) ?
+ int search_result=
+#ifdef HAVE_RTREE_KEYS
+ (keyinfo->flag & HA_SPATIAL) ?
rtree_find_first(info, key, info->lastkey, key_length,
SEARCH_SAME) :
+#endif
_mi_search(info,keyinfo,info->lastkey,key_length,
SEARCH_SAME, info->s->state.key_root[key]);
if (search_result)
@@ -1291,25 +1401,30 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
param->calc_checksum=1;
info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
+
+ /*
+ Clear all keys. Note that all key blocks allocated until now remain
+ "dead" parts of the key file. (Bug #4692)
+ */
for (i=0 ; i < info->s->base.keys ; i++)
share->state.key_root[i]= HA_OFFSET_ERROR;
+
+ /* Drop the delete chain. */
for (i=0 ; i < share->state.header.max_block_size ; i++)
share->state.key_del[i]= HA_OFFSET_ERROR;
/*
- I think mi_repair and mi_repair_by_sort should do the same
- (according, e.g. to ha_myisam::repair), but as mi_repair doesn't
- touch key_map it cannot be used to T_CREATE_MISSING_KEYS.
- That is what the next line is for
+ If requested, activate (enable) all keys in key_map. In this case,
+ all indexes will be (re-)built.
*/
-
if (param->testflag & T_CREATE_MISSING_KEYS)
- mi_copy_keys_active(share->state.key_map, share->base.keys,
- param->keys_in_use);
+ mi_set_all_keys_active(share->state.key_map, share->base.keys);
info->state->key_file_length=share->base.keystart;
lock_memory(param); /* Everything is alloced */
+
+ /* Re-create all keys, which are set in key_map. */
while (!(error=sort_get_next_record(&sort_param)))
{
if (writekeys(param,info,(byte*)sort_param.record,sort_param.filepos))
@@ -1732,9 +1847,10 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
_mi_kpointer(info,keypos-nod_flag,param->new_file_pos); /* Save new pos */
if (sort_one_index(param,info,keyinfo,next_page,new_file))
{
- DBUG_PRINT("error",("From page: %ld, keyoffset: %d used_length: %d",
- (ulong) pagepos, (int) (keypos - buff),
- (int) used_length));
+ DBUG_PRINT("error",
+ ("From page: %ld, keyoffset: %lu used_length: %d",
+ (ulong) pagepos, (ulong) (keypos - buff),
+ (int) used_length));
DBUG_DUMP("buff",(byte*) buff,used_length);
goto err;
}
@@ -2089,7 +2205,8 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
if (param->testflag & T_STATISTICS)
update_key_parts(sort_param.keyinfo, rec_per_key_part, sort_param.unique,
- (ulonglong) info->state->records);
+ param->stats_method == MI_STATS_METHOD_IGNORE_NULLS?
+ sort_param.notnull: NULL,(ulonglong) info->state->records);
mi_set_key_active(share->state.key_map, sort_param.key);
if (sort_param.fix_datafile)
@@ -3233,15 +3350,15 @@ int sort_write_record(MI_SORT_PARAM *sort_param)
static int sort_key_cmp(MI_SORT_PARAM *sort_param, const void *a,
const void *b)
{
- uint not_used;
+ uint not_used[2];
return (ha_key_cmp(sort_param->seg, *((uchar**) a), *((uchar**) b),
- USE_WHOLE_KEY, SEARCH_SAME,&not_used));
+ USE_WHOLE_KEY, SEARCH_SAME, not_used));
} /* sort_key_cmp */
static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a)
{
- uint diff_pos;
+ uint diff_pos[2];
char llbuff[22],llbuff2[22];
SORT_INFO *sort_info=sort_param->sort_info;
MI_CHECK *param= sort_info->param;
@@ -3251,16 +3368,26 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a)
{
cmp=ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey,
(uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE,
- &diff_pos);
+ diff_pos);
if (param->stats_method == MI_STATS_METHOD_NULLS_NOT_EQUAL)
ha_key_cmp(sort_param->seg,sort_info->key_block->lastkey,
(uchar*) a, USE_WHOLE_KEY,
- SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, &diff_pos);
- sort_param->unique[diff_pos-1]++;
+ SEARCH_FIND | SEARCH_NULL_ARE_NOT_EQUAL, diff_pos);
+ else if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS)
+ {
+ diff_pos[0]= mi_collect_stats_nonulls_next(sort_param->seg,
+ sort_param->notnull,
+ sort_info->key_block->lastkey,
+ (uchar*)a);
+ }
+ sort_param->unique[diff_pos[0]-1]++;
}
else
{
cmp= -1;
+ if (param->stats_method == MI_STATS_METHOD_IGNORE_NULLS)
+ mi_collect_stats_nonulls_first(sort_param->seg, sort_param->notnull,
+ (uchar*)a);
}
if ((sort_param->keyinfo->flag & HA_NOSAME) && cmp == 0)
{
@@ -3978,24 +4105,34 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
/*
Update statistics for each part of an index
-
+
SYNOPSIS
update_key_parts()
- keyinfo Index information (only key->keysegs used)
+ keyinfo IN Index information (only key->keysegs used)
rec_per_key_part OUT Store statistics here
- unique IN Array of #distinct values collected over index
- run.
+ unique IN Array of (#distinct tuples)
+ notnull_tuples IN Array of (#tuples), or NULL
records Number of records in the table
-
- NOTES
+
+ DESCRIPTION
+ This function is called produce index statistics values from unique and
+ notnull_tuples arrays after these arrays were produced with sequential
+ index scan (the scan is done in two places: chk_index() and
+ sort_key_write()).
+
+ This function handles all 3 index statistics collection methods.
+
Unique is an array:
- unique[0]= (#different values of {keypart1}) - 1
- unique[1]= (#different values of {keypart2,keypart1} tuple) - unique[0] - 1
- ...
- The 'unique' array is collected in one sequential scan through the entire
- index. This is done in two places: in chk_index() and in sort_key_write().
- Statistics collection may consider NULLs as either equal or unequal (see
- SEARCH_NULL_ARE_NOT_EQUAL, MI_STATS_METHOD_*).
+ unique[0]= (#different values of {keypart1}) - 1
+ unique[1]= (#different values of {keypart1,keypart2} tuple)-unique[0]-1
+ ...
+
+ For MI_STATS_METHOD_IGNORE_NULLS method, notnull_tuples is an array too:
+ notnull_tuples[0]= (#of {keypart1} tuples such that keypart1 is not NULL)
+ notnull_tuples[1]= (#of {keypart1,keypart2} tuples such that all
+ keypart{i} are not NULL)
+ ...
+ For all other statistics collection methods notnull_tuples==NULL.
Output is an array:
rec_per_key_part[k] =
@@ -4007,25 +4144,53 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
index tuples}
= #tuples-in-the-index / #distinct-tuples-in-the-index.
+
+ The #tuples-in-the-index and #distinct-tuples-in-the-index have different
+ meaning depending on which statistics collection method is used:
+
+ MI_STATS_METHOD_* how are nulls compared? which tuples are counted?
+ NULLS_EQUAL NULL == NULL all tuples in table
+ NULLS_NOT_EQUAL NULL != NULL all tuples in table
+ IGNORE_NULLS n/a tuples that don't have NULLs
*/
void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
- ulonglong *unique, ulonglong records)
+ ulonglong *unique, ulonglong *notnull,
+ ulonglong records)
{
- ulonglong count=0,tmp;
+ ulonglong count=0,tmp, unique_tuples;
+ ulonglong tuples= records;
uint parts;
for (parts=0 ; parts < keyinfo->keysegs ; parts++)
{
count+=unique[parts];
- if (count == 0)
- tmp=records;
+ unique_tuples= count + 1;
+ if (notnull)
+ {
+ tuples= notnull[parts];
+ /*
+ #(unique_tuples not counting tuples with NULLs) =
+ #(unique_tuples counting tuples with NULLs as different) -
+ #(tuples with NULLs)
+ */
+ unique_tuples -= (records - notnull[parts]);
+ }
+
+ if (unique_tuples == 0)
+ tmp= 1;
+ else if (count == 0)
+ tmp= tuples; /* 1 unique tuple */
else
- tmp= (records + (count+1)/2) / (count+1);
- /* for some weird keys (e.g. FULLTEXT) tmp can be <1 here.
- let's ensure it is not */
+ tmp= (tuples + unique_tuples/2) / unique_tuples;
+
+ /*
+ for some weird keys (e.g. FULLTEXT) tmp can be <1 here.
+ let's ensure it is not
+ */
set_if_bigger(tmp,1);
if (tmp >= (ulonglong) ~(ulong) 0)
tmp=(ulonglong) ~(ulong) 0;
+
*rec_per_key_part=(ulong) tmp;
rec_per_key_part++;
}
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index 62ca7f8ff61..bf99830b37f 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -407,7 +407,8 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
MYISAM_SHARE *share=info->s;
MI_KEY_PARAM s_temp;
DBUG_ENTER("del");
- DBUG_PRINT("enter",("leaf_page: %ld keypos: %lx",leaf_page,keypos));
+ DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", leaf_page,
+ (ulong) keypos));
DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff));
endpos=leaf_buff+mi_getint(leaf_buff);
@@ -512,7 +513,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
MI_KEY_PARAM s_temp;
MYISAM_SHARE *share=info->s;
DBUG_ENTER("underflow");
- DBUG_PRINT("enter",("leaf_page: %ld keypos: %lx",(long) leaf_page,keypos));
+ DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx",(long) leaf_page,
+ (ulong) keypos));
DBUG_DUMP("anc_buff",(byte*) anc_buff,mi_getint(anc_buff));
DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff));
diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c
index 575a5e34488..e6f4d39ab49 100644
--- a/storage/myisam/mi_rkey.c
+++ b/storage/myisam/mi_rkey.c
@@ -31,8 +31,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
HA_KEYSEG *last_used_keyseg;
uint pack_key_length, use_key_length, nextflag;
DBUG_ENTER("mi_rkey");
- DBUG_PRINT("enter", ("base: %p buf: %p inx: %d search_flag: %d",
- info, buf, inx, search_flag));
+ DBUG_PRINT("enter", ("base: %lx buf: %lx inx: %d search_flag: %d",
+ (long) info, (long) buf, inx, search_flag));
if ((inx = _mi_check_index(info,inx)) < 0)
DBUG_RETURN(my_errno);
diff --git a/storage/myisam/mi_rnext_same.c b/storage/myisam/mi_rnext_same.c
index 4d770258a72..92692d0517f 100644
--- a/storage/myisam/mi_rnext_same.c
+++ b/storage/myisam/mi_rnext_same.c
@@ -28,7 +28,7 @@
int mi_rnext_same(MI_INFO *info, byte *buf)
{
int error;
- uint inx,not_used;
+ uint inx,not_used[2];
MI_KEYDEF *keyinfo;
DBUG_ENTER("mi_rnext_same");
@@ -69,7 +69,7 @@ int mi_rnext_same(MI_INFO *info, byte *buf)
info->s->state.key_root[inx])))
break;
if (ha_key_cmp(keyinfo->seg, info->lastkey, info->lastkey2,
- info->last_rkey_length, SEARCH_FIND, &not_used))
+ info->last_rkey_length, SEARCH_FIND, not_used))
{
error=1;
my_errno=HA_ERR_END_OF_FILE;
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index 185f196a814..a6c2cbd6082 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -128,13 +128,13 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if ((nextflag & (SEARCH_SMALLER | SEARCH_LAST)) && flag != 0)
{
- uint not_used;
+ uint not_used[2];
if (_mi_get_prev_key(info,keyinfo, buff, info->lastkey, keypos,
&info->lastkey_length))
goto err;
if (!(nextflag & SEARCH_SMALLER) &&
ha_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND,
- &not_used))
+ not_used))
{
my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */
goto err;
@@ -179,7 +179,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
{
reg4 int start,mid,end,save_end;
int flag;
- uint totlength,nod_flag,not_used;
+ uint totlength,nod_flag,not_used[2];
DBUG_ENTER("_mi_bin_search");
LINT_INIT(flag);
@@ -193,7 +193,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
{
mid= (start+end)/2;
if ((flag=ha_key_cmp(keyinfo->seg,page+(uint) mid*totlength,key,key_len,
- comp_flag,&not_used))
+ comp_flag, not_used))
>= 0)
end=mid;
else
@@ -201,7 +201,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
}
if (mid != start)
flag=ha_key_cmp(keyinfo->seg,page+(uint) start*totlength,key,key_len,
- comp_flag,&not_used);
+ comp_flag, not_used);
if (flag < 0)
start++; /* point at next, bigger key */
*ret_pos=page+(uint) start*totlength;
@@ -242,7 +242,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uchar *buff, my_bool *last_key)
{
int flag;
- uint nod_flag,length,not_used;
+ uint nod_flag,length,not_used[2];
uchar t_buff[MI_MAX_KEY_BUFF],*end;
DBUG_ENTER("_mi_seq_search");
@@ -259,15 +259,16 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
{
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
- DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p",
- length, page, end));
+ DBUG_PRINT("error",("Found wrong key: length: %u page: %lx end: %lx",
+ length, (long) page, (long) end));
DBUG_RETURN(MI_FOUND_WRONG_KEY);
}
if ((flag=ha_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag,
- &not_used)) >= 0)
+ not_used)) >= 0)
break;
#ifdef EXTRA_DEBUG
- DBUG_PRINT("loop",("page: %p key: '%s' flag: %d", page, t_buff, flag));
+ DBUG_PRINT("loop",("page: %lx key: '%s' flag: %d", (long) page, t_buff,
+ flag));
#endif
memcpy(buff,t_buff,length);
*ret_pos=page;
@@ -275,7 +276,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
if (flag == 0)
memcpy(buff,t_buff,length); /* Result is first key */
*last_key= page == end;
- DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos));
+ DBUG_PRINT("exit",("flag: %d ret_pos: %lx", flag, (long) *ret_pos));
DBUG_RETURN(flag);
} /* _mi_seq_search */
@@ -415,8 +416,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
{
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
- DBUG_PRINT("error",("Found wrong key: length: %u page: %p end: %p",
- length, page, end));
+ DBUG_PRINT("error",("Found wrong key: length: %u page: %lx end: %lx",
+ length, (long) page, (long) end));
DBUG_RETURN(MI_FOUND_WRONG_KEY);
}
@@ -506,9 +507,9 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
cmp_rest:
if (key_len_left>0)
{
- uint not_used;
+ uint not_used[2];
if ((flag = ha_key_cmp(keyinfo->seg+1,vseg,
- k,key_len_left,nextflag,&not_used)) >= 0)
+ k, key_len_left, nextflag, not_used)) >= 0)
break;
}
else
@@ -550,7 +551,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
*last_key= page == end;
- DBUG_PRINT("exit",("flag: %d ret_pos: %p", flag, *ret_pos));
+ DBUG_PRINT("exit",("flag: %d ret_pos: %lx", flag, (long) *ret_pos));
DBUG_RETURN(flag);
} /* _mi_prefix_search */
@@ -812,8 +813,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
if (length > keyseg->length)
{
DBUG_PRINT("error",
- ("Found too long null packed key: %u of %u at %p",
- length, keyseg->length, *page_pos));
+ ("Found too long null packed key: %u of %u at %lx",
+ length, keyseg->length, (long) *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16);
mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
@@ -869,8 +870,8 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
}
if (length > (uint) keyseg->length)
{
- DBUG_PRINT("error",("Found too long packed key: %u of %u at %p",
- length, keyseg->length, *page_pos));
+ DBUG_PRINT("error",("Found too long packed key: %u of %u at %lx",
+ length, keyseg->length, (long) *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16);
mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
@@ -935,8 +936,8 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
{
if (length > keyinfo->maxlength)
{
- DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %p",
- length, keyinfo->maxlength, *page_pos));
+ DBUG_PRINT("error",("Found too long binary packed key: %u of %u at %lx",
+ length, keyinfo->maxlength, (long) *page_pos));
DBUG_DUMP("key",(char*) *page_pos,16);
mi_print_error(keyinfo->share, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
@@ -983,9 +984,9 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag,
length-=tmp;
from=page; from_end=page_end;
}
- DBUG_PRINT("info",("key: %p from: %p length: %u",
- key, from, length));
- memcpy_overlap((byte*) key, (byte*) from, (size_t) length);
+ DBUG_PRINT("info",("key: %lx from: %lx length: %u",
+ (long) key, (long) from, length));
+ memmove((byte*) key, (byte*) from, (size_t) length);
key+=length;
from+=length;
}
@@ -1041,7 +1042,8 @@ uchar *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
}
}
}
- DBUG_PRINT("exit",("page: %p length: %u", page, *return_key_length));
+ DBUG_PRINT("exit",("page: %lx length: %u", (long) page,
+ *return_key_length));
DBUG_RETURN(page);
} /* _mi_get_key */
@@ -1093,7 +1095,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
uint nod_flag;
uchar *lastpos;
DBUG_ENTER("_mi_get_last_key");
- DBUG_PRINT("enter",("page: %p endpos: %p", page, endpos));
+ DBUG_PRINT("enter",("page: %lx endpos: %lx", (long) page, (long) endpos));
nod_flag=mi_test_if_nod(page);
if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
@@ -1113,14 +1115,16 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page,
*return_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&page,lastkey);
if (*return_key_length == 0)
{
- DBUG_PRINT("error",("Couldn't find last key: page: %p", page));
+ DBUG_PRINT("error",("Couldn't find last key: page: %lx",
+ (long) page));
mi_print_error(info->s, HA_ERR_CRASHED);
my_errno=HA_ERR_CRASHED;
DBUG_RETURN(0);
}
}
}
- DBUG_PRINT("exit",("lastpos: %p length: %u", lastpos, *return_key_length));
+ DBUG_PRINT("exit",("lastpos: %lx length: %u", (long) lastpos,
+ *return_key_length));
DBUG_RETURN(lastpos);
} /* _mi_get_last_key */
@@ -1659,7 +1663,8 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
ref_length=0;
next_length_pack=0;
}
- DBUG_PRINT("test",("length: %d next_key: %p", length, next_key));
+ DBUG_PRINT("test",("length: %d next_key: %lx", length,
+ (long) next_key));
{
uint tmp_length;
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 8785adae9a2..2dd84674bff 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -898,10 +898,10 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key,
static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
{
- uint not_used;
+ uint not_used[2];
return ha_key_cmp(param->info->s->keyinfo[param->keynr].seg,
- key1, key2, USE_WHOLE_KEY, SEARCH_SAME,
- &not_used);
+ key1, key2, USE_WHOLE_KEY, SEARCH_SAME,
+ not_used);
}
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index a90495e5fcb..b3d95d21eb7 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -339,7 +339,8 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"stats_method", OPT_STATS_METHOD,
"Specifies how index statistics collection code should threat NULLs. "
- "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), and \"nulls_equal\" (emulate 4.0 behavior).",
+ "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
+ "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
(gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
@@ -451,6 +452,10 @@ static void usage(void)
-a, --analyze Analyze distribution of keys. Will make some joins in\n\
MySQL faster. You can check the calculated distribution\n\
by using '--description --verbose table_name'.\n\
+ --stats_method=name Specifies how index statistics collection code should\n\
+ threat NULLs. Possible values of name are \"nulls_unequal\"\n\
+ (default for 4.1/5.0), \"nulls_equal\" (emulate 4.0), and \n\
+ \"nulls_ignored\".\n\
-d, --description Prints some information about table.\n\
-A, --set-auto-increment[=value]\n\
Force auto_increment to start at this or higher value\n\
@@ -472,7 +477,7 @@ static void usage(void)
#include <help_end.h>
const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal",
- NullS};
+ "nulls_ignored", NullS};
TYPELIB myisam_stats_method_typelib= {
array_elements(myisam_stats_method_names) - 1, "",
myisam_stats_method_names, NULL};
@@ -699,13 +704,25 @@ get_one_option(int optid,
case OPT_STATS_METHOD:
{
int method;
+ enum_mi_stats_method method_conv;
myisam_stats_method_str= argument;
if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
{
fprintf(stderr, "Invalid value of stats_method: %s.\n", argument);
exit(1);
}
- check_param.stats_method= (enum_mi_stats_method) (method-1);
+ switch (method-1) {
+ case 0:
+ method_conv= MI_STATS_METHOD_NULLS_EQUAL;
+ break;
+ case 1:
+ method_conv= MI_STATS_METHOD_NULLS_NOT_EQUAL;
+ break;
+ case 2:
+ method_conv= MI_STATS_METHOD_IGNORE_NULLS;
+ break;
+ }
+ check_param.stats_method= method_conv;
break;
}
#ifdef DEBUG /* Only useful if debugging */
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 36328c9d9f1..6ccb52aff22 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -298,7 +298,14 @@ typedef struct st_mi_sort_param
pthread_t thr;
IO_CACHE read_cache, tempfile, tempfile_for_exceptions;
DYNAMIC_ARRAY buffpek;
+
+ /*
+ The next two are used to collect statistics, see update_key_parts for
+ description.
+ */
ulonglong unique[MI_MAX_KEY_SEG+1];
+ ulonglong notnull[MI_MAX_KEY_SEG+1];
+
my_off_t pos,max_pos,filepos,start_recpos;
uint key, key_length,real_key_length,sortbuff_size;
uint maxbuffers, keys, find_length, sort_keys_length;
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 6c718a0d453..c3eaddb3e92 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -481,8 +481,12 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
{
mi_set_key_active(share->state.key_map, sinfo->key);
if (param->testflag & T_STATISTICS)
- update_key_parts(sinfo->keyinfo, rec_per_key_part,
- sinfo->unique, (ulonglong) info->state->records);
+ update_key_parts(sinfo->keyinfo, rec_per_key_part, sinfo->unique,
+ param->stats_method == MI_STATS_METHOD_IGNORE_NULLS?
+ sinfo->notnull: NULL,
+ (ulonglong) info->state->records);
+
+
if (!sinfo->buffpek.elements)
{
if (param->testflag & T_VERBOSE)
diff --git a/storage/myisammrg/myrg_queue.c b/storage/myisammrg/myrg_queue.c
index dfb434d6397..7172b9f0e2a 100644
--- a/storage/myisammrg/myrg_queue.c
+++ b/storage/myisammrg/myrg_queue.c
@@ -20,9 +20,9 @@ static int queue_key_cmp(void *keyseg, byte *a, byte *b)
{
MI_INFO *aa=((MYRG_TABLE *)a)->table;
MI_INFO *bb=((MYRG_TABLE *)b)->table;
- uint not_used;
+ uint not_used[2];
int ret= ha_key_cmp((HA_KEYSEG *)keyseg, aa->lastkey, bb->lastkey,
- USE_WHOLE_KEY, SEARCH_FIND, &not_used);
+ USE_WHOLE_KEY, SEARCH_FIND, not_used);
return ret < 0 ? -1 : ret > 0 ? 1 : 0;
} /* queue_key_cmp */
diff --git a/storage/ndb/config/type_ndbapi.mk.am b/storage/ndb/config/type_ndbapi.mk.am
index d4be0c40b36..29523e3378f 100644
--- a/storage/ndb/config/type_ndbapi.mk.am
+++ b/storage/ndb/config/type_ndbapi.mk.am
@@ -1,6 +1,8 @@
INCLUDES += \
- -I$(srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/storage/ndb/include \
+ -I$(srcdir) -I$(top_srcdir)/include \
+ -I$(top_srcdir)/mysys \
+ -I$(top_srcdir)/storage/ndb/include \
-I$(top_srcdir)/storage/ndb/include/kernel \
-I$(top_srcdir)/storage/ndb/include/transporter \
-I$(top_srcdir)/storage/ndb/include/debugger \
diff --git a/storage/ndb/config/type_util.mk.am b/storage/ndb/config/type_util.mk.am
index 5d7ad6e57b9..2b232d2010a 100644
--- a/storage/ndb/config/type_util.mk.am
+++ b/storage/ndb/config/type_util.mk.am
@@ -1,5 +1,7 @@
-INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \
+INCLUDES += -I$(srcdir) \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/mysys \
-I$(top_srcdir)/storage/ndb/include \
-I$(top_srcdir)/storage/ndb/include/util \
-I$(top_srcdir)/storage/ndb/include/portlib \
diff --git a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
index 7368a0ec40d..bde690e056d 100644
--- a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
+++ b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
@@ -98,6 +98,8 @@ public:
StartTcTimer = 2509,
StopTcTimer = 2510,
StartPeriodicTcTimer = 2511,
+ TcStartDumpIndexOpCount = 2512,
+ TcDumpIndexOpCount = 2513,
CmvmiDumpConnections = 2600,
CmvmiDumpLongSignalMemory = 2601,
CmvmiSetRestartOnErrorInsert = 2602,
diff --git a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
index 48edc6eaaa0..c257a61bcab 100644
--- a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
+++ b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h
@@ -115,6 +115,7 @@
#define CFG_CONNECTION_HOSTNAME_1 407
#define CFG_CONNECTION_HOSTNAME_2 408
#define CFG_CONNECTION_GROUP 409
+#define CFG_CONNECTION_NODE_ID_SERVER 410
#define CFG_TCP_SERVER 452
#define CFG_TCP_SEND_BUFFER_SIZE 454
diff --git a/storage/ndb/include/mgmapi/ndbd_exit_codes.h b/storage/ndb/include/mgmapi/ndbd_exit_codes.h
index 794329ce637..2a0802add02 100644
--- a/storage/ndb/include/mgmapi/ndbd_exit_codes.h
+++ b/storage/ndb/include/mgmapi/ndbd_exit_codes.h
@@ -100,9 +100,11 @@ typedef ndbd_exit_classification_enum ndbd_exit_classification;
#define NDBD_EXIT_SIGNAL_LOST 6051
#define NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL 6052
#define NDBD_EXIT_ILLEGAL_SIGNAL 6053
+#define NDBD_EXIT_CONNECTION_SETUP_FAILED 6054
/* NDBCNTR 6100-> */
#define NDBD_EXIT_RESTART_TIMEOUT 6100
+#define NDBD_EXIT_RESTART_DURING_SHUTDOWN 6101
/* TC 6200-> */
/* DIH 6300-> */
diff --git a/storage/ndb/include/transporter/TransporterCallback.hpp b/storage/ndb/include/transporter/TransporterCallback.hpp
index f2432edd394..ef9be8c5a69 100644
--- a/storage/ndb/include/transporter/TransporterCallback.hpp
+++ b/storage/ndb/include/transporter/TransporterCallback.hpp
@@ -81,7 +81,9 @@ reportConnect(void * callbackObj, NodeId nodeId);
void
reportDisconnect(void * callbackObj,
NodeId nodeId, Uint32 errNo);
-
+
+#define TE_DO_DISCONNECT 0x8000
+
enum TransporterError {
TE_NO_ERROR = 0,
/**
@@ -111,7 +113,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisconnect)
*/
- TE_INVALID_MESSAGE_LENGTH = 0x8003,
+ TE_INVALID_MESSAGE_LENGTH = 0x3 | TE_DO_DISCONNECT,
/**
* TE_INVALID_CHECKSUM
@@ -120,7 +122,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- TE_INVALID_CHECKSUM = 0x8004,
+ TE_INVALID_CHECKSUM = 0x4 | TE_DO_DISCONNECT,
/**
* TE_COULD_NOT_CREATE_SOCKET
@@ -129,7 +131,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- TE_COULD_NOT_CREATE_SOCKET = 0x8005,
+ TE_COULD_NOT_CREATE_SOCKET = 0x5,
/**
* TE_COULD_NOT_BIND_SOCKET
@@ -138,7 +140,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- TE_COULD_NOT_BIND_SOCKET = 0x8006,
+ TE_COULD_NOT_BIND_SOCKET = 0x6,
/**
* TE_LISTEN_FAILED
@@ -147,7 +149,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- TE_LISTEN_FAILED = 0x8007,
+ TE_LISTEN_FAILED = 0x7,
/**
* TE_ACCEPT_RETURN_ERROR
@@ -158,7 +160,7 @@ enum TransporterError {
* Recommended behavior: Ignore
* (or possible do setPerformState(PerformDisconnect)
*/
- TE_ACCEPT_RETURN_ERROR = 0x8008
+ TE_ACCEPT_RETURN_ERROR = 0x8
/**
* TE_SHM_DISCONNECT
@@ -167,7 +169,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SHM_DISCONNECT = 0x800b
+ ,TE_SHM_DISCONNECT = 0xb | TE_DO_DISCONNECT
/**
* TE_SHM_IPC_STAT
@@ -178,7 +180,12 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SHM_IPC_STAT = 0x800c
+ ,TE_SHM_IPC_STAT = 0xc | TE_DO_DISCONNECT
+
+ /**
+ * Permanent error
+ */
+ ,TE_SHM_IPC_PERMANENT = 0x21
/**
* TE_SHM_UNABLE_TO_CREATE_SEGMENT
@@ -188,7 +195,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0x800d
+ ,TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0xd
/**
* TE_SHM_UNABLE_TO_ATTACH_SEGMENT
@@ -198,7 +205,7 @@ enum TransporterError {
*
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0x800e
+ ,TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0xe
/**
* TE_SHM_UNABLE_TO_REMOVE_SEGMENT
@@ -208,12 +215,12 @@ enum TransporterError {
* Recommended behavior: Ignore (not much to do)
* Print warning to logfile
*/
- ,TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0x800f
+ ,TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0xf
- ,TE_TOO_SMALL_SIGID = 0x0010
- ,TE_TOO_LARGE_SIGID = 0x0011
- ,TE_WAIT_STACK_FULL = 0x8012
- ,TE_RECEIVE_BUFFER_FULL = 0x8013
+ ,TE_TOO_SMALL_SIGID = 0x10
+ ,TE_TOO_LARGE_SIGID = 0x11
+ ,TE_WAIT_STACK_FULL = 0x12 | TE_DO_DISCONNECT
+ ,TE_RECEIVE_BUFFER_FULL = 0x13 | TE_DO_DISCONNECT
/**
* TE_SIGNAL_LOST_SEND_BUFFER_FULL
@@ -222,7 +229,7 @@ enum TransporterError {
* a signal is dropped!! very bad very bad
*
*/
- ,TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x8014
+ ,TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x14 | TE_DO_DISCONNECT
/**
* TE_SIGNAL_LOST
@@ -231,14 +238,14 @@ enum TransporterError {
* a signal is dropped!! very bad very bad
*
*/
- ,TE_SIGNAL_LOST = 0x8015
+ ,TE_SIGNAL_LOST = 0x15
/**
* TE_SEND_BUFFER_FULL
*
* The send buffer was full, but sleeping for a while solved it
*/
- ,TE_SEND_BUFFER_FULL = 0x0016
+ ,TE_SEND_BUFFER_FULL = 0x16
/**
* TE_SCI_UNABLE_TO_CLOSE_CHANNEL
@@ -246,7 +253,7 @@ enum TransporterError {
* Unable to close the sci channel and the resources allocated by
* the sisci api.
*/
- ,TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x8016
+ ,TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x22
/**
* TE_SCI_LINK_ERROR
@@ -255,7 +262,7 @@ enum TransporterError {
* No point in continuing. Must check the connections.
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_LINK_ERROR = 0x8017
+ ,TE_SCI_LINK_ERROR = 0x0017
/**
* TE_SCI_UNABLE_TO_START_SEQUENCE
@@ -264,14 +271,14 @@ enum TransporterError {
* are exumed or no sequence has been created.
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_UNABLE_TO_START_SEQUENCE = 0x8018
+ ,TE_SCI_UNABLE_TO_START_SEQUENCE = 0x18 | TE_DO_DISCONNECT
/**
* TE_SCI_UNABLE_TO_REMOVE_SEQUENCE
*
* Could not remove a sequence
*/
- ,TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x8019
+ ,TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x19 | TE_DO_DISCONNECT
/**
* TE_SCI_UNABLE_TO_CREATE_SEQUENCE
@@ -280,7 +287,7 @@ enum TransporterError {
* exempted. Must reboot.
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x801a
+ ,TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x1a | TE_DO_DISCONNECT
/**
* TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR
@@ -288,7 +295,7 @@ enum TransporterError {
* Tried to send data on redundant link but failed.
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x801b
+ ,TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x1b | TE_DO_DISCONNECT
/**
* TE_SCI_CANNOT_INIT_LOCALSEGMENT
@@ -297,7 +304,7 @@ enum TransporterError {
* gone wrong (no system resources). Must reboot.
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x801c
+ ,TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x1c | TE_DO_DISCONNECT
/**
* TE_SCI_CANNOT_MAP_REMOTESEGMENT
@@ -306,7 +313,7 @@ enum TransporterError {
* Must reboot system.
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x801d
+ ,TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x1d | TE_DO_DISCONNECT
/**
* TE_SCI_UNABLE_TO_UNMAP_SEGMENT
@@ -314,7 +321,7 @@ enum TransporterError {
* Cannot free the resources used by this segment (step 1).
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x801e
+ ,TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x1e | TE_DO_DISCONNECT
/**
* TE_SCI_UNABLE_TO_REMOVE_SEGMENT
@@ -324,7 +331,7 @@ enum TransporterError {
* to map more segment
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x801f
+ ,TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x1f | TE_DO_DISCONNECT
/**
* TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT
@@ -332,15 +339,18 @@ enum TransporterError {
* Cannot disconnect from a remote segment.
* Recommended behavior: setPerformState(PerformDisonnect)
*/
- ,TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x8020
+ ,TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x20 | TE_DO_DISCONNECT
+ /* Used 0x21 */
+ /* Used 0x22 */
};
/**
* Report error
*/
void
-reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode);
+reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode,
+ const char *info = 0);
void
transporter_recv_from(void* callbackObj, NodeId node);
diff --git a/storage/ndb/src/common/mgmcommon/IPCConfig.cpp b/storage/ndb/src/common/mgmcommon/IPCConfig.cpp
index f935f8ffab4..bc442ffc3ef 100644
--- a/storage/ndb/src/common/mgmcommon/IPCConfig.cpp
+++ b/storage/ndb/src/common/mgmcommon/IPCConfig.cpp
@@ -231,8 +231,11 @@ IPCConfig::configureTransporters(Uint32 nodeId,
Uint32 server_port= 0;
if(iter.get(CFG_CONNECTION_SERVER_PORT, &server_port)) break;
+ Uint32 nodeIdServer= 0;
+ if(iter.get(CFG_CONNECTION_NODE_ID_SERVER, &nodeIdServer)) break;
+
/*
- We check the node type. MGM node becomes server.
+ We check the node type.
*/
Uint32 node1type, node2type;
ndb_mgm_configuration_iterator node1iter(config, CFG_SECTION_NODE);
@@ -242,20 +245,12 @@ IPCConfig::configureTransporters(Uint32 nodeId,
node1iter.get(CFG_TYPE_OF_SECTION,&node1type);
node2iter.get(CFG_TYPE_OF_SECTION,&node2type);
- conf.serverNodeId= (nodeId1 < nodeId2)? nodeId1:nodeId2;
-
- conf.isMgmConnection= false;
- if(node2type==NODE_TYPE_MGM)
- {
- conf.isMgmConnection= true;
- conf.serverNodeId= nodeId2;
- }
- else if(node1type==NODE_TYPE_MGM)
- {
+ if(node1type==NODE_TYPE_MGM || node2type==NODE_TYPE_MGM)
conf.isMgmConnection= true;
- conf.serverNodeId= nodeId1;
- }
- else if (nodeId == conf.serverNodeId) {
+ else
+ conf.isMgmConnection= false;
+
+ if (nodeId == nodeIdServer && !conf.isMgmConnection) {
tr.add_transporter_interface(remoteNodeId, localHostName, server_port);
}
@@ -279,6 +274,7 @@ IPCConfig::configureTransporters(Uint32 nodeId,
conf.s_port = server_port;
conf.localHostName = localHostName;
conf.remoteHostName = remoteHostName;
+ conf.serverNodeId = nodeIdServer;
switch(type){
case CONNECTION_TYPE_SHM:
diff --git a/storage/ndb/src/common/transporter/SHM_Transporter.cpp b/storage/ndb/src/common/transporter/SHM_Transporter.cpp
index a225988d37f..93d718b8713 100644
--- a/storage/ndb/src/common/transporter/SHM_Transporter.cpp
+++ b/storage/ndb/src/common/transporter/SHM_Transporter.cpp
@@ -47,6 +47,9 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg,
shmKey(_shmKey),
shmSize(_shmSize)
{
+#ifndef NDB_WIN32
+ shmId= 0;
+#endif
_shmSegCreated = false;
_attached = false;
@@ -202,7 +205,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
// Create
if(!_shmSegCreated){
if (!ndb_shm_create()) {
- report_error(TE_SHM_UNABLE_TO_CREATE_SEGMENT);
+ make_error_info(buf, sizeof(buf));
+ report_error(TE_SHM_UNABLE_TO_CREATE_SEGMENT, buf);
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
}
@@ -212,7 +216,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
// Attach
if(!_attached){
if (!ndb_shm_attach()) {
- report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT);
+ make_error_info(buf, sizeof(buf));
+ report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT, buf);
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
}
@@ -224,7 +229,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd)
m_transporter_registry.m_shm_own_pid);
// Wait for ok from client
- if (s_input.gets(buf, 256) == 0)
+ DBUG_PRINT("info", ("Wait for ok from client"));
+ if (s_input.gets(buf, sizeof(buf)) == 0)
{
NDB_CLOSE_SOCKET(sockfd);
DBUG_RETURN(false);
@@ -262,10 +268,8 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
SocketOutputStream s_output(sockfd);
char buf[256];
-#if 1
-#endif
-
// Wait for server to create and attach
+ DBUG_PRINT("info", ("Wait for server to create and attach"));
if (s_input.gets(buf, 256) == 0) {
NDB_CLOSE_SOCKET(sockfd);
DBUG_PRINT("error", ("Server id %d did not attach",
@@ -293,7 +297,8 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
// Attach
if(!_attached){
if (!ndb_shm_attach()) {
- report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT);
+ make_error_info(buf, sizeof(buf));
+ report_error(TE_SHM_UNABLE_TO_ATTACH_SEGMENT, buf);
NDB_CLOSE_SOCKET(sockfd);
DBUG_PRINT("error", ("Failed attach of shm seg to node %d",
remoteNodeId));
@@ -310,6 +315,7 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd)
if (r) {
// Wait for ok from server
+ DBUG_PRINT("info", ("Wait for ok from server"));
if (s_input.gets(buf, 256) == 0) {
NDB_CLOSE_SOCKET(sockfd);
DBUG_PRINT("error", ("No ok from server node %d",
@@ -330,8 +336,6 @@ bool
SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd)
{
if (!checkConnected()) {
- DBUG_PRINT("error", ("Already connected to node %d",
- remoteNodeId));
return false;
}
diff --git a/storage/ndb/src/common/transporter/SHM_Transporter.hpp b/storage/ndb/src/common/transporter/SHM_Transporter.hpp
index e7a76225471..b25f9e538db 100644
--- a/storage/ndb/src/common/transporter/SHM_Transporter.hpp
+++ b/storage/ndb/src/common/transporter/SHM_Transporter.hpp
@@ -170,6 +170,8 @@ private:
bool hasDataToRead() const {
return reader->empty() == false;
}
+
+ void make_error_info(char info[], int sz);
};
#endif
diff --git a/storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp b/storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp
index 28882324fc0..7277f9e13ef 100644
--- a/storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp
+++ b/storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp
@@ -26,6 +26,12 @@
#include <sys/ipc.h>
#include <sys/shm.h>
+void SHM_Transporter::make_error_info(char info[], int sz)
+{
+ snprintf(info,sz,"Shm key=%d sz=%d id=%d",
+ shmKey, shmSize, shmId);
+}
+
bool
SHM_Transporter::ndb_shm_create()
{
@@ -64,12 +70,30 @@ SHM_Transporter::checkConnected(){
struct shmid_ds info;
const int res = shmctl(shmId, IPC_STAT, &info);
if(res == -1){
- report_error(TE_SHM_IPC_STAT);
+ char buf[128];
+ int r= snprintf(buf, sizeof(buf),
+ "shmctl(%d, IPC_STAT) errno: %d(%s). ", shmId,
+ errno, strerror(errno));
+ make_error_info(buf+r, sizeof(buf)-r);
+ DBUG_PRINT("error",(buf));
+ switch (errno)
+ {
+ case EACCES:
+ report_error(TE_SHM_IPC_PERMANENT, buf);
+ break;
+ default:
+ report_error(TE_SHM_IPC_STAT, buf);
+ break;
+ }
return false;
}
if(info.shm_nattch != 2){
+ char buf[128];
+ make_error_info(buf, sizeof(buf));
report_error(TE_SHM_DISCONNECT);
+ DBUG_PRINT("error", ("Already connected to node %d",
+ remoteNodeId));
return false;
}
return true;
@@ -91,6 +115,8 @@ SHM_Transporter::disconnectImpl(){
if(isServer && _shmSegCreated){
const int res = shmctl(shmId, IPC_RMID, 0);
if(res == -1){
+ char buf[64];
+ make_error_info(buf, sizeof(buf));
report_error(TE_SHM_UNABLE_TO_REMOVE_SEGMENT);
return;
}
diff --git a/storage/ndb/src/common/transporter/SHM_Transporter.win32.cpp b/storage/ndb/src/common/transporter/SHM_Transporter.win32.cpp
index c289a85da0e..86029b17885 100644
--- a/storage/ndb/src/common/transporter/SHM_Transporter.win32.cpp
+++ b/storage/ndb/src/common/transporter/SHM_Transporter.win32.cpp
@@ -26,6 +26,12 @@
#include <windows.h>
+void SHM_Transporter::make_error_info(char info[], int sz)
+{
+ snprintf(info,sz,"Shm key=%d sz=%d",
+ shmKey, shmSize);
+}
+
bool
SHM_Transporter::connectServer(Uint32 timeOutMillis){
if(!_shmSegCreated)
diff --git a/storage/ndb/src/common/transporter/Transporter.hpp b/storage/ndb/src/common/transporter/Transporter.hpp
index c9f4e9bda42..9e8bbd687ee 100644
--- a/storage/ndb/src/common/transporter/Transporter.hpp
+++ b/storage/ndb/src/common/transporter/Transporter.hpp
@@ -161,7 +161,8 @@ protected:
TransporterRegistry &m_transporter_registry;
void *get_callback_obj() { return m_transporter_registry.callbackObj; };
void report_disconnect(int err){m_transporter_registry.report_disconnect(remoteNodeId,err);};
- void report_error(enum TransporterError err){reportError(get_callback_obj(),remoteNodeId,err);};
+ void report_error(enum TransporterError err, const char *info = 0)
+ { reportError(get_callback_obj(), remoteNodeId, err, info); };
};
inline
diff --git a/storage/ndb/src/common/transporter/TransporterRegistry.cpp b/storage/ndb/src/common/transporter/TransporterRegistry.cpp
index 23ab799094f..633cfeb0ac2 100644
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -1503,8 +1503,8 @@ TransporterRegistry::startReceiving()
{
DBUG_PRINT("error",("Install failed"));
g_eventLogger.error("Failed to install signal handler for"
- " SHM transporter errno: %d (%s)", errno,
- strerror(errno));
+ " SHM transporter, signum %d, errno: %d (%s)",
+ g_ndb_shm_signum, errno, strerror(errno));
}
}
#endif // NDB_SHM_TRANSPORTER
diff --git a/storage/ndb/src/common/util/Base64.cpp b/storage/ndb/src/common/util/Base64.cpp
deleted file mode 100644
index 3db911f481f..00000000000
--- a/storage/ndb/src/common/util/Base64.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-/* Copyright (C) 2003 MySQL AB
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#include <ndb_global.h>
-#include <Base64.hpp>
-
-static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789+/";
-
-int
-base64_encode(const UtilBuffer &src, BaseString &dst)
-{
- return base64_encode(src.get_data(), src.length(), dst);
-}
-
-int
-base64_encode(const void * _s, size_t src_len, BaseString &dst) {
- const unsigned char * s = (const unsigned char*)_s;
- size_t i = 0;
- size_t len = 0;
- while(i < src_len) {
- if(len == 76){
- len = 0;
- dst.append('\n');
- }
-
- unsigned c;
- c = s[i++];
- c <<= 8;
-
- if(i < src_len)
- c += s[i];
- c <<= 8;
- i++;
-
- if(i < src_len)
- c += s[i];
- i++;
-
- dst.append(base64_table[(c >> 18) & 0x3f]);
- dst.append(base64_table[(c >> 12) & 0x3f]);
-
- if(i > (src_len + 1))
- dst.append('=');
- else
- dst.append(base64_table[(c >> 6) & 0x3f]);
-
- if(i > src_len)
- dst.append('=');
- else
- dst.append(base64_table[(c >> 0) & 0x3f]);
-
- len += 4;
- }
- return 0;
-}
-
-static inline unsigned
-pos(unsigned char c) {
- return strchr(base64_table, c) - base64_table;
-}
-
-
-int
-base64_decode(const BaseString &src, UtilBuffer &dst) {
- return base64_decode(src.c_str(), src.length(), dst);
-}
-
-#define SKIP_SPACE(src, i, size){ \
- while(i < size && isspace(* src)){ \
- i++; \
- src++; \
- } \
- if(i == size){ \
- i = size + 1; \
- break; \
- } \
-}
-
-int
-base64_decode(const char * src, size_t size, UtilBuffer &dst) {
- size_t i = 0;
- while(i < size){
- unsigned c = 0;
- int mark = 0;
-
- SKIP_SPACE(src, i, size);
-
- c += pos(*src++);
- c <<= 6;
- i++;
-
- SKIP_SPACE(src, i, size);
-
- c += pos(*src++);
- c <<= 6;
- i++;
-
- SKIP_SPACE(src, i, size);
-
- if(* src != '=')
- c += pos(*src++);
- else {
- i = size;
- mark = 2;
- c <<= 6;
- goto end;
- }
- c <<= 6;
- i++;
-
- SKIP_SPACE(src, i, size);
-
- if(*src != '=')
- c += pos(*src++);
- else {
- i = size;
- mark = 1;
- goto end;
- }
- i++;
-
- end:
- char b[3];
- b[0] = (c >> 16) & 0xff;
- b[1] = (c >> 8) & 0xff;
- b[2] = (c >> 0) & 0xff;
-
- dst.append((void *)b, 3-mark);
- }
-
- if(i != size){
- abort();
- return -1;
- }
- return 0;
-}
-
-#ifdef __TEST__B64
-/**
- * USER_FLAGS="-D__TEST__B64" make Base64.o && g++ Base64.o BaseString.o
- */
-inline
-void
-require(bool b){
- if(!b)
- abort();
-}
-
-int
-main(void){
- for(int i = 0; i < 500; i++){
- const size_t len = rand() % 10000 + 1;
- UtilBuffer src;
- for(size_t j = 0; j<len; j++){
- char c = rand();
- src.append(&c, 1);
- }
- require(src.length() == len);
-
- BaseString str;
- require(base64_encode(src, str) == 0);
-
- if(str.length() == 3850){
- printf(">%s<\n", str.c_str());
- }
-
- UtilBuffer dst;
- require(base64_decode(str, dst) == 0);
- require(dst.length() == src.length());
-
- const char * c_src = (char*)src.get_data();
- const char * c_dst = (char*)dst.get_data();
- if(memcmp(src.get_data(), dst.get_data(), src.length()) != 0){
- printf("-- src --\n");
- for(int i2 = 0; i2<len; i2++){
- unsigned char c = c_src[i2];
- printf("%.2x ", (unsigned)c);
- if((i2 % 8) == 7)
- printf("\n");
- }
- printf("\n");
-
- printf("-- dst --\n");
- for(int i2 = 0; i2<len; i2++){
- unsigned char c = c_dst[i2];
- printf("%.2x ", (unsigned)c);
- if((i2 % 8) == 7)
- printf("\n");
- }
- printf("\n");
- abort();
- }
- }
- return 0;
-}
-
-#endif
diff --git a/storage/ndb/src/common/util/Makefile.am b/storage/ndb/src/common/util/Makefile.am
index 7ba3ef941c5..d9c43b2ace1 100644
--- a/storage/ndb/src/common/util/Makefile.am
+++ b/storage/ndb/src/common/util/Makefile.am
@@ -5,7 +5,7 @@ libgeneral_la_SOURCES = \
File.cpp md5_hash.cpp Properties.cpp socket_io.cpp \
SimpleProperties.cpp Parser.cpp InputStream.cpp \
SocketServer.cpp SocketClient.cpp SocketAuthenticator.cpp\
- OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \
+ OutputStream.cpp NdbOut.cpp BaseString.cpp \
NdbSqlUtil.cpp new.cpp \
uucode.c random.c version.c \
strdup.c \
diff --git a/storage/ndb/src/common/util/Parser.cpp b/storage/ndb/src/common/util/Parser.cpp
index d692aa18392..3a86ae8f318 100644
--- a/storage/ndb/src/common/util/Parser.cpp
+++ b/storage/ndb/src/common/util/Parser.cpp
@@ -20,7 +20,6 @@
#include "Parser.hpp"
#include <NdbOut.hpp>
#include <Properties.hpp>
-#include <Base64.hpp>
#undef DEBUG
#define DEBUG(x) ndbout << x << endl;
@@ -316,11 +315,7 @@ ParserImpl::parseArg(Context * ctx,
}
case DummyRow::Properties: {
- Properties *sp = new Properties();
- BaseString v(value);
- UtilBuffer b;
- base64_decode(v, b);
- sp->unpack((const Uint32 *)b.get_data(), b.length());
+ abort();
break;
}
default:
diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index 7292e5b0885..39f400de7d6 100644
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -4400,6 +4400,44 @@ Dbdict::createTab_dih(Signal* signal,
sendSignal(DBDIH_REF, GSN_DIADDTABREQ, signal,
DiAddTabReq::SignalLength, JBB);
+
+ /**
+ * Create KeyDescriptor
+ */
+ KeyDescriptor* desc= g_key_descriptor_pool.getPtr(tabPtr.i);
+ new (desc) KeyDescriptor();
+
+ Uint32 key = 0;
+ Uint32 tAttr = tabPtr.p->firstAttribute;
+ while (tAttr != RNIL)
+ {
+ jam();
+ AttributeRecord* aRec = c_attributeRecordPool.getPtr(tAttr);
+ if (aRec->tupleKey)
+ {
+ desc->noOfKeyAttr ++;
+ desc->keyAttr[key].attributeDescriptor = aRec->attributeDescriptor;
+
+ Uint32 csNumber = (aRec->extPrecision >> 16);
+ if(csNumber)
+ {
+ desc->keyAttr[key].charsetInfo = all_charsets[csNumber];
+ ndbrequire(all_charsets[csNumber]);
+ desc->hasCharAttr = 1;
+ }
+ else
+ {
+ desc->keyAttr[key].charsetInfo = 0;
+ }
+ if(AttributeDescriptor::getDKey(aRec->attributeDescriptor))
+ {
+ desc->noOfDistrKeys ++;
+ }
+ key++;
+ }
+ tAttr = aRec->nextAttrInTable;
+ }
+ ndbrequire(key == tabPtr.p->noOfPrimkey);
}
static
@@ -4502,44 +4540,6 @@ Dbdict::execADD_FRAGREQ(Signal* signal) {
sendSignal(DBLQH_REF, GSN_LQHFRAGREQ, signal,
LqhFragReq::SignalLength, JBB);
}
-
- /**
- * Create KeyDescriptor
- */
- KeyDescriptor* desc= g_key_descriptor_pool.getPtr(tabPtr.i);
- new (desc) KeyDescriptor();
-
- Uint32 key = 0;
- Uint32 tAttr = tabPtr.p->firstAttribute;
- while (tAttr != RNIL)
- {
- jam();
- AttributeRecord* aRec = c_attributeRecordPool.getPtr(tAttr);
- if (aRec->tupleKey)
- {
- desc->noOfKeyAttr ++;
- desc->keyAttr[key].attributeDescriptor = aRec->attributeDescriptor;
-
- Uint32 csNumber = (aRec->extPrecision >> 16);
- if(csNumber)
- {
- desc->keyAttr[key].charsetInfo = all_charsets[csNumber];
- ndbrequire(all_charsets[csNumber]);
- desc->hasCharAttr = 1;
- }
- else
- {
- desc->keyAttr[key].charsetInfo = 0;
- }
- if(AttributeDescriptor::getDKey(aRec->attributeDescriptor))
- {
- desc->noOfDistrKeys ++;
- }
- key++;
- }
- tAttr = aRec->nextAttrInTable;
- }
- ndbrequire(key == tabPtr.p->noOfPrimkey);
}
void
diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 6eb83b880cc..91fc8780fae 100644
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -4661,6 +4661,7 @@ void Dbtc::copyApi(Signal* signal)
regTmpApiPtr->commitAckMarker = RNIL;
regTmpApiPtr->firstTcConnect = RNIL;
regTmpApiPtr->lastTcConnect = RNIL;
+ releaseAllSeizedIndexOperations(regTmpApiPtr);
}//Dbtc::copyApi()
void Dbtc::unlinkApiConnect(Signal* signal)
@@ -10255,7 +10256,7 @@ void Dbtc::releaseAbortResources(Signal* signal)
// apiConnectptr.p->apiConnectstate = CS_CONNECTED;
apiConnectptr.p->apiConnectstate = CS_ABORTING;
apiConnectptr.p->abortState = AS_IDLE;
-
+ releaseAllSeizedIndexOperations(apiConnectptr.p);
if(apiConnectptr.p->m_exec_flag || apiConnectptr.p->apiFailState == ZTRUE){
jam();
bool ok = false;
@@ -10828,6 +10829,33 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal)
signal->theData[0] = TcContinueB::ZTRANS_EVENT_REP;
sendSignalWithDelay(cownref, GSN_CONTINUEB, signal, 5000, 1);
}
+
+ if (dumpState->args[0] == DumpStateOrd::TcStartDumpIndexOpCount)
+ {
+ static int frequency = 1;
+ if (signal->getLength() > 1)
+ frequency = signal->theData[1];
+ else
+ if (refToBlock(signal->getSendersBlockRef()) != DBTC)
+ frequency = 1;
+
+ if (frequency)
+ {
+ dumpState->args[0] = DumpStateOrd::TcDumpIndexOpCount;
+ execDUMP_STATE_ORD(signal);
+ dumpState->args[0] = DumpStateOrd::TcStartDumpIndexOpCount;
+
+ Uint32 delay = 1000 * (frequency > 25 ? 25 : frequency);
+ sendSignalWithDelay(cownref, GSN_DUMP_STATE_ORD, signal, delay, 1);
+ }
+ }
+
+ if (dumpState->args[0] == DumpStateOrd::TcDumpIndexOpCount)
+ {
+ infoEvent("IndexOpCount: pool: %d free: %d",
+ c_theIndexOperationPool.getSize(),
+ c_theIndexOperationPool.getNoOfFree());
+ }
}//Dbtc::execDUMP_STATE_ORD()
void Dbtc::execSET_VAR_REQ(Signal* signal)
diff --git a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
index d89adb10fc5..88c0da8b9ae 100644
--- a/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
+++ b/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
@@ -531,6 +531,9 @@ Ndbcntr::execCNTR_START_REF(Signal * signal){
cmasterNodeId = ref->masterNodeId;
sendCntrStartReq(signal);
return;
+ case CntrStartRef::StopInProgress:
+ jam();
+ progError(__LINE__, NDBD_EXIT_RESTART_DURING_SHUTDOWN);
}
ndbrequire(false);
}
@@ -2035,7 +2038,9 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
return;
}
- if(c_stopRec.stopReq.senderRef != 0){
+ if(c_stopRec.stopReq.senderRef != 0 ||
+ (cmasterNodeId == getOwnNodeId() && !c_start.m_starting.isclear()))
+ {
/**
* Requested a system shutdown
*/
@@ -2049,7 +2054,8 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
/**
* Requested a node shutdown
*/
- if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo))
+ if(c_stopRec.stopReq.senderRef &&
+ StopReq::getSystemStop(c_stopRec.stopReq.requestInfo))
ref->errorCode = StopRef::SystemShutdownInProgress;
else
ref->errorCode = StopRef::NodeShutdownInProgress;
diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
index 76281426eea..b5e54e8adad 100644
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
@@ -1823,11 +1823,14 @@ void Qmgr::execNDB_FAILCONF(Signal* signal)
/*******************************/
/* DISCONNECT_REP */
/*******************************/
+const char *lookupConnectionError(Uint32 err);
+
void Qmgr::execDISCONNECT_REP(Signal* signal)
{
jamEntry();
const DisconnectRep * const rep = (DisconnectRep *)&signal->theData[0];
const Uint32 nodeId = rep->nodeId;
+ const Uint32 err = rep->err;
c_connectedNodes.clear(nodeId);
NodeRecPtr nodePtr;
@@ -1838,10 +1841,17 @@ void Qmgr::execDISCONNECT_REP(Signal* signal)
jam();
break;
case ZINIT:
+ ndbrequire(false);
case ZSTARTING:
+ progError(__LINE__, NDBD_EXIT_CONNECTION_SETUP_FAILED,
+ lookupConnectionError(err));
+ ndbrequire(false);
case ZPREPARE_FAIL:
+ ndbrequire(false);
case ZFAIL_CLOSING:
+ ndbrequire(false);
case ZAPI_ACTIVE:
+ ndbrequire(false);
case ZAPI_INACTIVE:
ndbrequire(false);
}
diff --git a/storage/ndb/src/kernel/error/ndbd_exit_codes.c b/storage/ndb/src/kernel/error/ndbd_exit_codes.c
index 4d9a61d69d1..9b8c907cb7c 100644
--- a/storage/ndb/src/kernel/error/ndbd_exit_codes.c
+++ b/storage/ndb/src/kernel/error/ndbd_exit_codes.c
@@ -95,11 +95,15 @@ static const ErrStruct errArray[] =
{NDBD_EXIT_SIGNAL_LOST, XIE, "Signal lost (unknown reason)"},
{NDBD_EXIT_ILLEGAL_SIGNAL, XIE,
"Illegal signal (version mismatch a possibility)"},
+ {NDBD_EXIT_CONNECTION_SETUP_FAILED, XCE, "Connection setup failed"},
/* Ndbcntr */
{NDBD_EXIT_RESTART_TIMEOUT, XCE,
"Total restart time too long, consider increasing StartFailureTimeout "
"or investigate error(s) on other node(s)"},
+ {NDBD_EXIT_RESTART_DURING_SHUTDOWN, XRE,
+ "Node started while node shutdown in progress. "
+ "Please wait until shutdown complete before starting node"},
/* DIH */
{NDBD_EXIT_MAX_CRASHED_REPLICAS, XFL,
diff --git a/storage/ndb/src/kernel/vm/FastScheduler.cpp b/storage/ndb/src/kernel/vm/FastScheduler.cpp
index 5c68cbe6480..ad24a6795a4 100644
--- a/storage/ndb/src/kernel/vm/FastScheduler.cpp
+++ b/storage/ndb/src/kernel/vm/FastScheduler.cpp
@@ -394,7 +394,8 @@ void print_restart(FILE * output, Signal* signal, Uint32 aLevel);
void FastScheduler::dumpSignalMemory(FILE * output)
{
- Signal signal;
+ SignalT<25> signalT;
+ Signal &signal= *(Signal*)&signalT;
Uint32 ReadPtr[5];
Uint32 tJob;
Uint32 tLastJob;
@@ -483,17 +484,17 @@ print_restart(FILE * output, Signal* signal, Uint32 aLevel)
*/
void
FastScheduler::reportDoJobStatistics(Uint32 tMeanLoopCount) {
- Signal signal;
+ SignalT<2> signalT;
+ Signal &signal= *(Signal*)&signalT;
+
memset(&signal.header, 0, sizeof(signal.header));
+ signal.header.theLength = 2;
+ signal.header.theSendersSignalId = 0;
+ signal.header.theSendersBlockRef = numberToRef(0, 0);
signal.theData[0] = NDB_LE_JobStatistic;
signal.theData[1] = tMeanLoopCount;
- memset(&signal.header, 0, sizeof(SignalHeader));
- signal.header.theLength = 2;
- signal.header.theSendersSignalId = 0;
- signal.header.theSendersBlockRef = numberToRef(0, 0);
-
execute(&signal, JBA, CMVMI, GSN_EVENT_REP);
}
diff --git a/storage/ndb/src/kernel/vm/TransporterCallback.cpp b/storage/ndb/src/kernel/vm/TransporterCallback.cpp
index 0bdfcf16689..aab81957d07 100644
--- a/storage/ndb/src/kernel/vm/TransporterCallback.cpp
+++ b/storage/ndb/src/kernel/vm/TransporterCallback.cpp
@@ -39,6 +39,26 @@
*/
SectionSegmentPool g_sectionSegmentPool;
+struct ConnectionError
+{
+ enum TransporterError err;
+ const char *text;
+};
+
+static const ConnectionError connectionError[] =
+{
+ { TE_NO_ERROR, "No error"},
+ { TE_SHM_UNABLE_TO_CREATE_SEGMENT, "Unable to create shared memory segment"},
+ { (enum TransporterError) -1, "No connection error message available (please report a bug)"}
+};
+
+const char *lookupConnectionError(Uint32 err)
+{
+ int i= 0;
+ while ((Uint32)connectionError[i].err != err && (Uint32)connectionError[i].err != -1);
+ return connectionError[i].text;
+}
+
bool
import(Ptr<SectionSegment> & first, const Uint32 * src, Uint32 len){
/**
@@ -306,34 +326,58 @@ checkJobBuffer() {
}
void
-reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode){
+reportError(void * callbackObj, NodeId nodeId,
+ TransporterError errorCode, const char *info)
+{
#ifdef DEBUG_TRANSPORTER
- char buf[255];
- sprintf(buf, "reportError (%d, 0x%x)", nodeId, errorCode);
- ndbout << buf << endl;
+ ndbout_c("reportError (%d, 0x%x) %s", nodeId, errorCode, info ? info : "")
#endif
- if(errorCode == TE_SIGNAL_LOST_SEND_BUFFER_FULL){
+ DBUG_ENTER("reportError");
+ DBUG_PRINT("info",("nodeId %d errorCode: 0x%x info: %s",
+ nodeId, errorCode, info));
+
+ switch (errorCode)
+ {
+ case TE_SIGNAL_LOST_SEND_BUFFER_FULL:
+ {
+ char msg[64];
+ snprintf(msg, sizeof(msg), "Remote note id %d.%s%s", nodeId,
+ info ? " " : "", info ? info : "");
ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL,
- "", __FILE__,
- NST_ErrorHandler);
+ msg, __FILE__, NST_ErrorHandler);
}
-
- if(errorCode == TE_SIGNAL_LOST){
+ case TE_SIGNAL_LOST:
+ {
+ char msg[64];
+ snprintf(msg, sizeof(msg), "Remote node id %d,%s%s", nodeId,
+ info ? " " : "", info ? info : "");
ErrorReporter::handleError(NDBD_EXIT_SIGNAL_LOST,
- "", __FILE__,
- NST_ErrorHandler);
+ msg, __FILE__, NST_ErrorHandler);
}
-
- if(errorCode & 0x8000){
+ case TE_SHM_IPC_PERMANENT:
+ {
+ char msg[128];
+ snprintf(msg, sizeof(msg),
+ "Remote node id %d.%s%s",
+ nodeId, info ? " " : "", info ? info : "");
+ ErrorReporter::handleError(NDBD_EXIT_CONNECTION_SETUP_FAILED,
+ msg, __FILE__, NST_ErrorHandler);
+ }
+ default:
+ break;
+ }
+
+ if(errorCode & TE_DO_DISCONNECT){
reportDisconnect(callbackObj, nodeId, errorCode);
}
- Signal signal;
+ SignalT<3> signalT;
+ Signal &signal= *(Signal*)&signalT;
memset(&signal.header, 0, sizeof(signal.header));
- if(errorCode & 0x8000)
+ if(errorCode & TE_DO_DISCONNECT)
signal.theData[0] = NDB_LE_TransporterError;
else
signal.theData[0] = NDB_LE_TransporterWarning;
@@ -345,6 +389,8 @@ reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode){
signal.header.theSendersSignalId = 0;
signal.header.theSendersBlockRef = numberToRef(0, globalData.ownId);
globalScheduler.execute(&signal, JBA, CMVMI, GSN_EVENT_REP);
+
+ DBUG_VOID_RETURN;
}
/**
@@ -354,7 +400,8 @@ void
reportSendLen(void * callbackObj,
NodeId nodeId, Uint32 count, Uint64 bytes){
- Signal signal;
+ SignalT<3> signalT;
+ Signal &signal= *(Signal*)&signalT;
memset(&signal.header, 0, sizeof(signal.header));
signal.header.theLength = 3;
@@ -373,7 +420,8 @@ void
reportReceiveLen(void * callbackObj,
NodeId nodeId, Uint32 count, Uint64 bytes){
- Signal signal;
+ SignalT<3> signalT;
+ Signal &signal= *(Signal*)&signalT;
memset(&signal.header, 0, sizeof(signal.header));
signal.header.theLength = 3;
@@ -392,7 +440,8 @@ reportReceiveLen(void * callbackObj,
void
reportConnect(void * callbackObj, NodeId nodeId){
- Signal signal;
+ SignalT<1> signalT;
+ Signal &signal= *(Signal*)&signalT;
memset(&signal.header, 0, sizeof(signal.header));
signal.header.theLength = 1;
@@ -409,7 +458,10 @@ reportConnect(void * callbackObj, NodeId nodeId){
void
reportDisconnect(void * callbackObj, NodeId nodeId, Uint32 errNo){
- Signal signal;
+ DBUG_ENTER("reportDisconnect");
+
+ SignalT<sizeof(DisconnectRep)/4> signalT;
+ Signal &signal= *(Signal*)&signalT;
memset(&signal.header, 0, sizeof(signal.header));
signal.header.theLength = DisconnectRep::SignalLength;
@@ -422,6 +474,8 @@ reportDisconnect(void * callbackObj, NodeId nodeId, Uint32 errNo){
rep->err = errNo;
globalScheduler.execute(&signal, JBA, CMVMI, GSN_DISCONNECT_REP);
+
+ DBUG_VOID_RETURN;
}
void
diff --git a/storage/ndb/src/kernel/vm/VMSignal.hpp b/storage/ndb/src/kernel/vm/VMSignal.hpp
index 45543c5d174..33f8a9f25c0 100644
--- a/storage/ndb/src/kernel/vm/VMSignal.hpp
+++ b/storage/ndb/src/kernel/vm/VMSignal.hpp
@@ -42,6 +42,16 @@ struct NodeReceiverGroup {
NodeBitmask m_nodes;
};
+template <unsigned T> struct SignalT
+{
+ SignalHeader header;
+ SegmentedSectionPtr m_sectionPtr[3];
+ union {
+ Uint32 theData[T];
+ Uint64 dummyAlign;
+ };
+};
+
/**
* class used for passing argumentes to blocks
*/
diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp
index 9a874554955..2b31f0e638d 100644
--- a/storage/ndb/src/mgmapi/mgmapi.cpp
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp
@@ -34,8 +34,8 @@
#include <Parser.hpp>
#include <OutputStream.hpp>
#include <InputStream.hpp>
-#include <Base64.hpp>
+#include <base64.h>
#define MGM_CMD(name, fun, desc) \
{ name, \
@@ -1770,11 +1770,15 @@ ndb_mgm_get_configuration(NdbMgmHandle handle, unsigned int version) {
} while(start < len);
if(buf64 == 0)
break;
-
+
+ void *tmp_data = malloc(base64_needed_decoded_length((size_t) (len - 1)));
+ const int res = base64_decode(buf64, len-1, tmp_data);
+ delete[] buf64;
UtilBuffer tmp;
- const int res = base64_decode(buf64, len-1, tmp);
- delete[] buf64;
- if(res != 0){
+ tmp.append((void *) tmp_data, res);
+ free(tmp_data);
+ if (res < 0)
+ {
fprintf(handle->errstream, "Failed to decode buffer\n");
break;
}
diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
index a870c395bd2..817943f5e51 100644
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -57,7 +57,6 @@ ConfigInfo::m_sectionNameAliases[]={
const char*
ConfigInfo::m_sectionNames[]={
"SYSTEM",
- "EXTERNAL SYSTEM",
"COMPUTER",
DB_TOKEN,
@@ -78,9 +77,7 @@ sizeof(m_sectionNames)/sizeof(char*);
****************************************************************************/
static bool transformComputer(InitConfigFileParser::Context & ctx, const char *);
static bool transformSystem(InitConfigFileParser::Context & ctx, const char *);
-static bool transformExternalSystem(InitConfigFileParser::Context & ctx, const char *);
static bool transformNode(InitConfigFileParser::Context & ctx, const char *);
-static bool transformExtNode(InitConfigFileParser::Context & ctx, const char *);
static bool checkConnectionSupport(InitConfigFileParser::Context & ctx, const char *);
static bool transformConnection(InitConfigFileParser::Context & ctx, const char *);
static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *);
@@ -93,7 +90,6 @@ static bool checkTCPConstraints(InitConfigFileParser::Context &, const char *);
static bool fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data);
static bool fixHostname(InitConfigFileParser::Context & ctx, const char * data);
static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data);
-static bool fixExtConnection(InitConfigFileParser::Context & ctx, const char * data);
static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *);
static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *);
static bool fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data);
@@ -104,7 +100,6 @@ static bool checkLocalhostHostnameMix(InitConfigFileParser::Context & ctx, const
const ConfigInfo::SectionRule
ConfigInfo::m_SectionRules[] = {
{ "SYSTEM", transformSystem, 0 },
- { "EXTERNAL SYSTEM", transformExternalSystem, 0 },
{ "COMPUTER", transformComputer, 0 },
{ DB_TOKEN, transformNode, 0 },
@@ -150,20 +145,13 @@ ConfigInfo::m_SectionRules[] = {
{ "TCP", fixPortNumber, 0 }, // has to come after fixHostName
{ "SHM", fixPortNumber, 0 }, // has to come after fixHostName
{ "SCI", fixPortNumber, 0 }, // has to come after fixHostName
- { "SHM", fixShmKey, 0 },
- /**
- * fixExtConnection must be after fixNodeId
- */
- { "TCP", fixExtConnection, 0 },
- { "SHM", fixExtConnection, 0 },
- { "SCI", fixExtConnection, 0 },
- { "OSE", fixExtConnection, 0 },
-
{ "*", applyDefaultValues, "user" },
{ "*", fixDepricated, 0 },
{ "*", applyDefaultValues, "system" },
+ { "SHM", fixShmKey, 0 }, // has to come after apply default values
+
{ DB_TOKEN, checkLocalhostHostnameMix, 0 },
{ API_TOKEN, checkLocalhostHostnameMix, 0 },
{ MGM_TOKEN, checkLocalhostHostnameMix, 0 },
@@ -173,9 +161,6 @@ ConfigInfo::m_SectionRules[] = {
{ DB_TOKEN, checkDbConstraints, 0 },
- /**
- * checkConnectionConstraints must be after fixExtConnection
- */
{ "TCP", checkConnectionConstraints, 0 },
{ "SHM", checkConnectionConstraints, 0 },
{ "SCI", checkConnectionConstraints, 0 },
@@ -213,9 +198,6 @@ static bool add_node_connections(Vector<ConfigInfo::ConfigRuleSection>&sections,
static bool set_connection_priorities(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data);
-static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
- struct InitConfigFileParser::Context &ctx,
- const char * rule_data);
static bool check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
const char * rule_data);
@@ -225,7 +207,6 @@ ConfigInfo::m_ConfigRules[] = {
{ sanity_checks, 0 },
{ add_node_connections, 0 },
{ set_connection_priorities, 0 },
- { add_server_ports, 0 },
{ check_node_vs_replicas, 0 },
{ 0, 0 }
};
@@ -241,9 +222,9 @@ struct DepricationTransform {
static
const DepricationTransform f_deprication[] = {
{ DB_TOKEN, "Discless", "Diskless", 0, 1 },
- { DB_TOKEN, "Id", "nodeid", 0, 1 },
- { API_TOKEN, "Id", "nodeid", 0, 1 },
- { MGM_TOKEN, "Id", "nodeid", 0, 1 },
+ { DB_TOKEN, "Id", "NodeId", 0, 1 },
+ { API_TOKEN, "Id", "NodeId", 0, 1 },
+ { MGM_TOKEN, "Id", "NodeId", 0, 1 },
{ 0, 0, 0, 0, 0}
};
@@ -421,7 +402,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{
CFG_NODE_ID,
- "nodeid",
+ "NodeId",
DB_TOKEN,
"Number identifying the database node ("DB_TOKEN_PRINT")",
ConfigInfo::CI_USED,
@@ -1272,7 +1253,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{
CFG_NODE_ID,
- "nodeid",
+ "NodeId",
API_TOKEN,
"Number identifying application node ("API_TOKEN_PRINT")",
ConfigInfo::CI_USED,
@@ -1415,7 +1396,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{
CFG_NODE_ID,
- "nodeid",
+ "NodeId",
MGM_TOKEN,
"Number identifying the management server node ("MGM_TOKEN_PRINT")",
ConfigInfo::CI_USED,
@@ -1578,6 +1559,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0", "200" },
{
+ CFG_CONNECTION_NODE_ID_SERVER,
+ "NodeIdServer",
+ "TCP",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ MANDATORY,
+ "1", "63" },
+
+ {
CFG_CONNECTION_SEND_SIGNAL_ID,
"SendSignalId",
"TCP",
@@ -1766,6 +1758,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0", "200" },
{
+ CFG_CONNECTION_NODE_ID_SERVER,
+ "NodeIdServer",
+ "SHM",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ MANDATORY,
+ "1", "63" },
+
+ {
CFG_CONNECTION_SEND_SIGNAL_ID,
"SendSignalId",
"SHM",
@@ -1798,7 +1801,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
ConfigInfo::CI_USED,
false,
ConfigInfo::CI_INT,
- "0",
+ UNDEFINED,
"0",
STR_VALUE(MAX_INT_RNIL) },
@@ -1887,6 +1890,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
"0", "200" },
{
+ CFG_CONNECTION_NODE_ID_SERVER,
+ "NodeIdServer",
+ "SCI",
+ "",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_INT,
+ MANDATORY,
+ "1", "63" },
+
+ {
CFG_CONNECTION_HOSTNAME_1,
"HostName1",
"SCI",
@@ -2554,29 +2568,32 @@ void ConfigInfo::print(const Properties * section,
bool
transformNode(InitConfigFileParser::Context & ctx, const char * data){
- Uint32 id;
- if(!ctx.m_currentSection->get("nodeid", &id) && !ctx.m_currentSection->get("Id", &id)){
+ Uint32 id, line;
+ if(!ctx.m_currentSection->get("NodeId", &id) && !ctx.m_currentSection->get("Id", &id)){
Uint32 nextNodeId= 1;
ctx.m_userProperties.get("NextNodeId", &nextNodeId);
id= nextNodeId;
- while (ctx.m_userProperties.get("AllocatedNodeId_", id, &id))
+ while (ctx.m_userProperties.get("AllocatedNodeId_", id, &line))
id++;
- ctx.m_userProperties.put("NextNodeId", id+1, true);
- ctx.m_currentSection->put("nodeid", id);
-#if 0
- ctx.reportError("Mandatory parameter Id missing from section "
- "[%s] starting at line: %d",
- ctx.fname, ctx.m_sectionLineno);
- return false;
-#endif
- } else if(ctx.m_userProperties.get("AllocatedNodeId_", id, &id)) {
+ if (id != nextNodeId)
+ {
+ fprintf(stderr,"Cluster configuration warning line %d: "
+ "Could not use next node id %d for section [%s], "
+ "using next unused node id %d.\n",
+ ctx.m_sectionLineno, nextNodeId, ctx.fname, id);
+ }
+ ctx.m_currentSection->put("NodeId", id);
+ } else if(ctx.m_userProperties.get("AllocatedNodeId_", id, &line)) {
ctx.reportError("Duplicate nodeid in section "
- "[%s] starting at line: %d",
- ctx.fname, ctx.m_sectionLineno);
+ "[%s] starting at line: %d. Previously used on line %d.",
+ ctx.fname, ctx.m_sectionLineno, line);
return false;
}
- ctx.m_userProperties.put("AllocatedNodeId_", id, id);
+ // next node id _always_ next numbers after last used id
+ ctx.m_userProperties.put("NextNodeId", id+1, true);
+
+ ctx.m_userProperties.put("AllocatedNodeId_", id, ctx.m_sectionLineno);
BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "Node_%d", id);
ctx.m_currentSection->put("Type", ctx.fname);
@@ -2690,38 +2707,6 @@ fixBackupDataDir(InitConfigFileParser::Context & ctx, const char * data){
return false;
}
-bool
-transformExtNode(InitConfigFileParser::Context & ctx, const char * data){
-
- Uint32 id;
- const char * systemName;
-
- if(!ctx.m_currentSection->get("Id", &id)){
- ctx.reportError("Mandatory parameter 'Id' missing from section "
- "[%s] starting at line: %d",
- ctx.fname, ctx.m_sectionLineno);
- return false;
- }
-
- if(!ctx.m_currentSection->get("System", &systemName)){
- ctx.reportError("Mandatory parameter 'System' missing from section "
- "[%s] starting at line: %d",
- ctx.fname, ctx.m_sectionLineno);
- return false;
- }
-
- ctx.m_currentSection->put("Type", ctx.fname);
-
- Uint32 nodes = 0;
- ctx.m_userProperties.get("ExtNoOfNodes", &nodes);
- require(ctx.m_userProperties.put("ExtNoOfNodes",++nodes, true));
-
- BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "EXTERNAL SYSTEM_%s:Node_%d",
- systemName, id);
-
- return true;
-}
-
/**
* Connection rule: Check support of connection
*/
@@ -2798,23 +2783,6 @@ transformSystem(InitConfigFileParser::Context & ctx, const char * data){
}
/**
- * External system rule: Just add it
- */
-bool
-transformExternalSystem(InitConfigFileParser::Context & ctx, const char * data){
- const char * name;
- if(!ctx.m_currentSection->get("Name", &name)){
- ctx.reportError("Mandatory parameter Name missing from section "
- "[%s] starting at line: %d",
- ctx.fname, ctx.m_sectionLineno);
- return false;
- }
- BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "EXTERNAL SYSTEM_%s", name);
-
- return true;
-}
-
-/**
* Computer rule: Update "NoOfComputers", add "Type"
*/
bool
@@ -2990,87 +2958,6 @@ static bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data)
}
/**
- * @returns true if connection is external (one node is external)
- * Also returns:
- * - name of external system in parameter extSystemName, and
- * - nodeId of external node in parameter extSystemNodeId.
- */
-static bool
-isExtConnection(InitConfigFileParser::Context & ctx,
- const char **extSystemName, Uint32 * extSystemNodeId){
-
- Uint32 nodeId1, nodeId2;
-
- if (ctx.m_currentSection->contains("System1") &&
- ctx.m_currentSection->get("System1", extSystemName) &&
- ctx.m_currentSection->get("NodeId1", &nodeId1)) {
- *extSystemNodeId = nodeId1;
- return true;
- }
-
- if (ctx.m_currentSection->contains("System2") &&
- ctx.m_currentSection->get("System2", extSystemName) &&
- ctx.m_currentSection->get("NodeId2", &nodeId2)) {
- *extSystemNodeId = nodeId2;
- return true;
- }
-
- return false;
-}
-
-/**
- * External Connection Rule:
- * If connection is to an external system, then move connection into
- * external system configuration (i.e. a sub-property).
- */
-static bool
-fixExtConnection(InitConfigFileParser::Context & ctx, const char * data){
-
- const char * extSystemName;
- Uint32 extSystemNodeId;
-
- if (isExtConnection(ctx, &extSystemName, &extSystemNodeId)) {
-
- Uint32 connections = 0;
- ctx.m_userProperties.get("ExtNoOfConnections", &connections);
- require(ctx.m_userProperties.put("ExtNoOfConnections",++connections, true));
-
- char tmpLine1[MAX_LINE_LENGTH];
- BaseString::snprintf(tmpLine1, MAX_LINE_LENGTH, "Connection_%d", connections-1);
-
- /**
- * Section: EXTERNAL SYSTEM_<Ext System Name>
- */
- char extSystemPropName[MAX_LINE_LENGTH];
- strncpy(extSystemPropName, "EXTERNAL SYSTEM_", MAX_LINE_LENGTH);
- strncat(extSystemPropName, extSystemName, MAX_LINE_LENGTH);
- strncat(extSystemPropName, ":", MAX_LINE_LENGTH);
- strncat(extSystemPropName, tmpLine1, MAX_LINE_LENGTH);
-
- /**
- * Increase number of external connections for the system
- *
- * @todo Limitation: Only one external system is allowed
- */
- require(ctx.m_userProperties.put("ExtSystem", extSystemName, true));
-
- /**
- * Make sure section is stored in right place
- */
- strncpy(ctx.pname, extSystemPropName, MAX_LINE_LENGTH);
-
- /**
- * Since this is an external connection,
- * decrease number of internal connections
- */
- require(ctx.m_userProperties.get("NoOfConnections", &connections));
- require(ctx.m_userProperties.put("NoOfConnections", --connections, true));
- }
-
- return true;
-}
-
-/**
* Connection rule: Fix hostname
*
* Unless Hostname is not already specified, do steps:
@@ -3112,7 +2999,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
DBUG_ENTER("fixPortNumber");
- Uint32 id1= 0, id2= 0;
+ Uint32 id1, id2;
const char *hostName1;
const char *hostName2;
require(ctx.m_currentSection->get("NodeId1", &id1));
@@ -3122,17 +3009,46 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
DBUG_PRINT("info",("NodeId1=%d HostName1=\"%s\"",id1,hostName1));
DBUG_PRINT("info",("NodeId2=%d HostName2=\"%s\"",id2,hostName2));
- if (id1 > id2) {
- Uint32 tmp= id1;
- const char *tmp_name= hostName1;
- hostName1= hostName2;
- id1= id2;
- hostName2= tmp_name;
- id2= tmp;
- }
+ const Properties *node1, *node2;
+ require(ctx.m_config->get("Node", id1, &node1));
+ require(ctx.m_config->get("Node", id2, &node2));
- const Properties * node;
- require(ctx.m_config->get("Node", id1, &node));
+ const char *type1, *type2;
+ require(node1->get("Type", &type1));
+ require(node2->get("Type", &type2));
+
+ /* add NodeIdServer info */
+ {
+ Uint32 nodeIdServer = id1 < id2 ? id1 : id2;
+ if(strcmp(type1, API_TOKEN) == 0 || strcmp(type2, MGM_TOKEN) == 0)
+ nodeIdServer = id2;
+ else if(strcmp(type2, API_TOKEN) == 0 || strcmp(type1, MGM_TOKEN) == 0)
+ nodeIdServer = id1;
+ ctx.m_currentSection->put("NodeIdServer", nodeIdServer);
+
+ if (id2 == nodeIdServer) {
+ {
+ const char *tmp= hostName1;
+ hostName1= hostName2;
+ hostName2= tmp;
+ }
+ {
+ Uint32 tmp= id1;
+ id1= id2;
+ id2= tmp;
+ }
+ {
+ const Properties *tmp= node1;
+ node1= node2;
+ node2= tmp;
+ }
+ {
+ const char *tmp= type1;
+ type1= type2;
+ type2= tmp;
+ }
+ }
+ }
BaseString hostname(hostName1);
@@ -3143,21 +3059,13 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){
}
Uint32 port= 0;
- const char * type1;
- const char * type2;
- const Properties * node2;
-
- node->get("Type", &type1);
- ctx.m_config->get("Node", id2, &node2);
- node2->get("Type", &type2);
-
if(strcmp(type1, MGM_TOKEN)==0)
- node->get("PortNumber",&port);
+ node1->get("PortNumber",&port);
else if(strcmp(type2, MGM_TOKEN)==0)
node2->get("PortNumber",&port);
if (!port &&
- !node->get("ServerPort", &port) &&
+ !node1->get("ServerPort", &port) &&
!ctx.m_userProperties.get("ServerPort_", id1, &port))
{
Uint32 base= 0;
@@ -3308,11 +3216,6 @@ checkConnectionConstraints(InitConfigFileParser::Context & ctx, const char *){
ctx.m_currentSection->get("NodeId1", &id1);
ctx.m_currentSection->get("NodeId2", &id2);
- // If external connection, just accept it
- if (ctx.m_currentSection->contains("System1") ||
- ctx.m_currentSection->contains("System2"))
- return true;
-
if(id1 == id2){
ctx.reportError("Illegal connection from node to itself"
" - [%s] starting at line: %d",
@@ -3345,12 +3248,10 @@ checkConnectionConstraints(InitConfigFileParser::Context & ctx, const char *){
* Report error if the following are true
* -# None of the nodes is of type DB
* -# Not both of them are MGMs
- * -# None of them contain a "SystemX" name
*/
if((strcmp(type1, DB_TOKEN) != 0 && strcmp(type2, DB_TOKEN) != 0) &&
- !(strcmp(type1, MGM_TOKEN) == 0 && strcmp(type2, MGM_TOKEN) == 0) &&
- !ctx.m_currentSection->contains("System1") &&
- !ctx.m_currentSection->contains("System2")){
+ !(strcmp(type1, MGM_TOKEN) == 0 && strcmp(type2, MGM_TOKEN) == 0))
+ {
ctx.reportError("Invalid connection between node %d (%s) and node %d (%s)"
" - [%s] starting at line: %d",
id1, type1, id2, type2,
@@ -3440,11 +3341,11 @@ fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
if(strcmp(p->m_section, ctx.fname) == 0){
double mul = p->m_mul;
double add = p->m_add;
- if(strcmp(name, p->m_oldName) == 0){
+ if(strcasecmp(name, p->m_oldName) == 0){
if(!transform(ctx, tmp, name, p->m_newName, add, mul)){
return false;
}
- } else if(strcmp(name, p->m_newName) == 0) {
+ } else if(strcasecmp(name, p->m_newName) == 0) {
if(!transform(ctx, tmp, name, p->m_oldName, -add/mul,1.0/mul)){
return false;
}
@@ -3723,45 +3624,6 @@ static bool set_connection_priorities(Vector<ConfigInfo::ConfigRuleSection>&sect
DBUG_RETURN(true);
}
-static bool add_server_ports(Vector<ConfigInfo::ConfigRuleSection>&sections,
- struct InitConfigFileParser::Context &ctx,
- const char * rule_data)
-{
-#if 0
- Properties * props= ctx.m_config;
- Properties computers(true);
- Uint32 port_base = NDB_TCP_BASE_PORT;
-
- Uint32 nNodes;
- ctx.m_userProperties.get("NoOfNodes", &nNodes);
-
- for (Uint32 i= 0, n= 0; n < nNodes; i++){
- Properties * tmp;
- if(!props->get("Node", i, &tmp)) continue;
- n++;
-
- const char * type;
- if(!tmp->get("Type", &type)) continue;
-
- Uint32 port;
- if (tmp->get("ServerPort", &port)) continue;
-
- Uint32 computer;
- if (!tmp->get("ExecuteOnComputer", &computer)) continue;
-
- Uint32 adder= 0;
- computers.get("",computer, &adder);
-
- if (strcmp(type,DB_TOKEN) == 0) {
- adder++;
- tmp->put("ServerPort", port_base+adder);
- computers.put("",computer, adder);
- }
- }
-#endif
- return true;
-}
-
static bool
check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
struct InitConfigFileParser::Context &ctx,
diff --git a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
index 94f07ab0ca1..f937daf8620 100644
--- a/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
+++ b/storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
@@ -565,8 +565,12 @@ InitConfigFileParser::storeSection(Context& ctx){
}
}
}
- if(ctx.type == InitConfigFileParser::DefaultSection)
- require(ctx.m_defaults->put(ctx.pname, ctx.m_currentSection));
+ if(ctx.type == InitConfigFileParser::DefaultSection &&
+ !ctx.m_defaults->put(ctx.pname, ctx.m_currentSection))
+ {
+ ctx.reportError("Duplicate default section not allowed");
+ return false;
+ }
if(ctx.type == InitConfigFileParser::Section)
require(ctx.m_config->put(ctx.pname, ctx.m_currentSection));
delete ctx.m_currentSection; ctx.m_currentSection = NULL;
@@ -636,7 +640,7 @@ InitConfigFileParser::store_in_properties(Vector<struct my_option>& options,
value_int = *(Uint64*)options[i].value;
break;
case GET_STR:
- ctx.m_currentSection->put(options[i].name, (char*)options[i].value);
+ ctx.m_currentSection->put(options[i].name, *(char**)options[i].value);
continue;
default:
abort();
@@ -758,9 +762,6 @@ InitConfigFileParser::parse_mycnf()
Vector<struct my_option> options;
for(i = 0; i<ConfigInfo::m_NoOfParams; i++)
{
- if (strcmp(ConfigInfo::m_ParamInfo[i]._section, "DB") == 0 ||
- strcmp(ConfigInfo::m_ParamInfo[i]._section, "API") == 0 ||
- strcmp(ConfigInfo::m_ParamInfo[i]._section, "MGM") == 0)
{
struct my_option opt;
bzero(&opt, sizeof(opt));
@@ -851,6 +852,12 @@ InitConfigFileParser::parse_mycnf()
goto end;
if(!handle_mycnf_defaults(options, ctx, "MGM"))
goto end;
+ if(!handle_mycnf_defaults(options, ctx, "TCP"))
+ goto end;
+ if(!handle_mycnf_defaults(options, ctx, "SHM"))
+ goto end;
+ if(!handle_mycnf_defaults(options, ctx, "SCI"))
+ goto end;
{
struct sect { struct my_option* src; const char * name; } sections[] =
diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
index b6d091999dc..546110cc738 100644
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -276,15 +276,13 @@ static ErrorItem errorTable[] =
{MgmtSrvr::NOT_POSSIBLE_TO_SEND_CONFIG_UPDATE_TO_PROCESS_TYPE,
"It is not possible to send an update of a configuration variable "
"to this kind of process."},
- {5026, "Node shutdown in progress" },
- {5027, "System shutdown in progress" },
- {5028, "Node shutdown would cause system crash" },
- {5029, "Only one shutdown at a time is possible via mgm server" },
- {5060, "Operation not allowed in single user mode." },
- {5061, "DB is not in single user mode." },
- {5062, "The specified node is not an API node." },
- {5063,
- "Cannot enter single user mode. DB nodes in inconsistent startlevel."},
+ {MgmtSrvr::NODE_SHUTDOWN_IN_PROGESS, "Node shutdown in progress" },
+ {MgmtSrvr::SYSTEM_SHUTDOWN_IN_PROGRESS, "System shutdown in progress" },
+ {MgmtSrvr::NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH,
+ "Node shutdown would cause system crash" },
+ {MgmtSrvr::NODE_NOT_API_NODE, "The specified node is not an API node." },
+ {MgmtSrvr::OPERATION_NOT_ALLOWED_START_STOP,
+ "Operation not allowed while nodes are starting or stopping."},
{MgmtSrvr::NO_CONTACT_WITH_DB_NODES, "No contact with database nodes" }
};
@@ -292,13 +290,13 @@ int MgmtSrvr::translateStopRef(Uint32 errCode)
{
switch(errCode){
case StopRef::NodeShutdownInProgress:
- return 5026;
+ return NODE_SHUTDOWN_IN_PROGESS;
break;
case StopRef::SystemShutdownInProgress:
- return 5027;
+ return SYSTEM_SHUTDOWN_IN_PROGRESS;
break;
case StopRef::NodeShutdownWouldCauseSystemCrash:
- return 5028;
+ return NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH;
break;
}
return 4999;
@@ -984,6 +982,18 @@ int MgmtSrvr::sendSTOP_REQ(NodeId nodeId,
int MgmtSrvr::stopNode(int nodeId, bool abort)
{
+ if (!abort)
+ {
+ NodeId nodeId = 0;
+ ClusterMgr::Node node;
+ while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB))
+ {
+ node = theFacade->theClusterMgr->getNodeInfo(nodeId);
+ if((node.m_state.startLevel != NodeState::SL_STARTED) &&
+ (node.m_state.startLevel != NodeState::SL_NOTHING))
+ return OPERATION_NOT_ALLOWED_START_STOP;
+ }
+ }
NodeBitmask nodes;
return sendSTOP_REQ(nodeId,
nodes,
@@ -1022,7 +1032,7 @@ int MgmtSrvr::stop(int * stopCount, bool abort)
int MgmtSrvr::enterSingleUser(int * stopCount, Uint32 singleUserNodeId)
{
if (getNodeType(singleUserNodeId) != NDB_MGM_NODE_TYPE_API)
- return 5062;
+ return NODE_NOT_API_NODE;
NodeId nodeId = 0;
ClusterMgr::Node node;
while(getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB))
@@ -1030,7 +1040,7 @@ int MgmtSrvr::enterSingleUser(int * stopCount, Uint32 singleUserNodeId)
node = theFacade->theClusterMgr->getNodeInfo(nodeId);
if((node.m_state.startLevel != NodeState::SL_STARTED) &&
(node.m_state.startLevel != NodeState::SL_NOTHING))
- return 5063;
+ return OPERATION_NOT_ALLOWED_START_STOP;
}
NodeBitmask nodes;
int ret = sendSTOP_REQ(0,
diff --git a/storage/ndb/src/mgmsrv/MgmtSrvr.hpp b/storage/ndb/src/mgmsrv/MgmtSrvr.hpp
index d61c0ce8db7..0e2ebad8188 100644
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.hpp
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.hpp
@@ -174,10 +174,12 @@ public:
STATIC_CONST( NODE_SHUTDOWN_IN_PROGESS = 5026 );
STATIC_CONST( SYSTEM_SHUTDOWN_IN_PROGRESS = 5027 );
STATIC_CONST( NODE_SHUTDOWN_WOULD_CAUSE_SYSTEM_CRASH = 5028 );
- STATIC_CONST( NO_CONTACT_WITH_CLUSTER = 6666 );
- STATIC_CONST( OPERATION_IN_PROGRESS = 6667 );
-
+
STATIC_CONST( NO_CONTACT_WITH_DB_NODES = 5030 );
+
+ STATIC_CONST( NODE_NOT_API_NODE = 5062 );
+ STATIC_CONST( OPERATION_NOT_ALLOWED_START_STOP = 5063 );
+
/**
* This enum specifies the different signal loggig modes possible to set
* with the setSignalLoggingMode method.
diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp
index 9d87e33b47f..ee24cf18941 100644
--- a/storage/ndb/src/mgmsrv/Services.cpp
+++ b/storage/ndb/src/mgmsrv/Services.cpp
@@ -25,7 +25,6 @@
#include <signaldata/SetLogLevelOrd.hpp>
#include <LogLevel.hpp>
#include <BaseString.hpp>
-#include <Base64.hpp>
#include <ConfigValues.hpp>
#include <mgmapi_configuration.hpp>
@@ -33,6 +32,8 @@
#include "Services.hpp"
#include "../mgmapi/ndb_logevent.hpp"
+#include <base64.h>
+
extern bool g_StopServer;
static const unsigned int MAX_READ_TIMEOUT = 1000 ;
@@ -581,17 +582,18 @@ MgmApiSession::getConfig_common(Parser_t::Context &,
cfg->pack(src);
NdbMutex_Unlock(m_mgmsrv.m_configMutex);
- BaseString str;
- int res = base64_encode(src, str);
+ char *tmp_str = (char *) malloc(base64_needed_encoded_length(src.length()));
+ int res = base64_encode(src.get_data(), src.length(), tmp_str);
m_output->println("get config reply");
m_output->println("result: Ok");
- m_output->println("Content-Length: %d", str.length());
+ m_output->println("Content-Length: %d", strlen(tmp_str));
m_output->println("Content-Type: ndbconfig/octet-stream");
m_output->println("Content-Transfer-Encoding: base64");
m_output->println("");
- m_output->println(str.c_str());
+ m_output->println(tmp_str);
+ free(tmp_str);
return;
}
@@ -1574,4 +1576,3 @@ MgmApiSession::report_event(Parser_t::Context &ctx,
template class MutexVector<int>;
template class Vector<ParserRow<MgmApiSession> const*>;
-template class Vector<BaseString>;
diff --git a/storage/ndb/src/ndbapi/TransporterFacade.cpp b/storage/ndb/src/ndbapi/TransporterFacade.cpp
index 1f7096e67bd..14d76b42285 100644
--- a/storage/ndb/src/ndbapi/TransporterFacade.cpp
+++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp
@@ -64,13 +64,16 @@ TransporterFacade* TransporterFacade::theFacadeInstance = NULL;
*****************************************************************************/
void
-reportError(void * callbackObj, NodeId nodeId, TransporterError errorCode){
+reportError(void * callbackObj, NodeId nodeId,
+ TransporterError errorCode, const char *info)
+{
#ifdef REPORT_TRANSPORTER
- ndbout_c("REPORT_TRANSP: reportError (nodeId=%d, errorCode=%d)",
- (int)nodeId, (int)errorCode);
+ ndbout_c("REPORT_TRANSP: reportError (nodeId=%d, errorCode=%d) %s",
+ (int)nodeId, (int)errorCode, info ? info : "");
#endif
- if(errorCode & 0x8000) {
- ndbout_c("reportError (%d, %d)\n", (int)nodeId, (int)errorCode);
+ if(errorCode & TE_DO_DISCONNECT) {
+ ndbout_c("reportError (%d, %d) %s", (int)nodeId, (int)errorCode,
+ info ? info : "");
((TransporterFacade*)(callbackObj))->doDisconnect(nodeId);
}
}
diff --git a/storage/ndb/test/ndbapi/testBackup.cpp b/storage/ndb/test/ndbapi/testBackup.cpp
index 1ab348e735f..da3c52cf4d2 100644
--- a/storage/ndb/test/ndbapi/testBackup.cpp
+++ b/storage/ndb/test/ndbapi/testBackup.cpp
@@ -229,10 +229,13 @@ int runVerifyOne(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
int count = 0;
- ndbout << *(const NDBT_Table*)ctx->getTab() << endl;
-
- UtilTransactions utilTrans(*ctx->getTab());
- HugoTransactions hugoTrans(*ctx->getTab());
+ const NdbDictionary::Table* tab =
+ GETNDB(step)->getDictionary()->getTable(ctx->getTab()->getName());
+ if(tab == 0)
+ return NDBT_FAILED;
+
+ UtilTransactions utilTrans(* tab);
+ HugoTransactions hugoTrans(* tab);
do{
diff --git a/storage/ndb/test/ndbapi/testOperations.cpp b/storage/ndb/test/ndbapi/testOperations.cpp
index 726f35b01fb..505b1620900 100644
--- a/storage/ndb/test/ndbapi/testOperations.cpp
+++ b/storage/ndb/test/ndbapi/testOperations.cpp
@@ -659,6 +659,9 @@ main(int argc, const char** argv){
for(Uint32 i = 0; i < 12; i++)
{
+ if(i == 6 || i == 8 || i == 10)
+ continue;
+
BaseString name("bug_9749");
name.appfmt("_%d", i);
NDBT_TestCaseImpl1 *pt = new NDBT_TestCaseImpl1(&ts,
diff --git a/storage/ndb/test/src/HugoCalculator.cpp b/storage/ndb/test/src/HugoCalculator.cpp
index 8e01f6442bb..d4d7ca2f95f 100644
--- a/storage/ndb/test/src/HugoCalculator.cpp
+++ b/storage/ndb/test/src/HugoCalculator.cpp
@@ -17,7 +17,6 @@
#include <ndb_global.h>
#include "HugoCalculator.hpp"
#include <NDBT.hpp>
-#include <Base64.hpp>
static
Uint32
diff --git a/storage/ndb/tools/ndb_condig.cpp b/storage/ndb/tools/ndb_condig.cpp
index 1b9a771f243..27ab6a182bb 100644
--- a/storage/ndb/tools/ndb_condig.cpp
+++ b/storage/ndb/tools/ndb_condig.cpp
@@ -33,7 +33,7 @@
static int g_verbose = 0;
static int try_reconnect = 3;
-static int g_nodes = 1;
+static int g_nodes, g_connections, g_section;
static const char * g_connectstring = 0;
static const char * g_query = 0;
@@ -70,13 +70,19 @@ static struct my_option my_long_options[] =
"Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg",
(gptr*) &g_connectstring, (gptr*) &g_connectstring,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+ { "ndb-shm", 256, "Print nodes",
+ (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "nodes", 256, "Print nodes",
(gptr*) &g_nodes, (gptr*) &g_nodes,
- 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ { "connections", 256, "Print connections",
+ (gptr*) &g_connections, (gptr*) &g_connections,
+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{ "query", 'q', "Query option(s)",
(gptr*) &g_query, (gptr*) &g_query,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- { "host", 257, "Host",
+ { "host", 256, "Host",
(gptr*) &g_host, (gptr*) &g_host,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "type", 258, "Type of node/connection",
@@ -155,6 +161,11 @@ struct NodeTypeApply : public Apply
virtual int apply(const Iter&);
};
+struct ConnectionTypeApply : public Apply
+{
+ virtual int apply(const Iter&);
+};
+
static int parse_query(Vector<Apply*>&, int &argc, char**& argv);
static int parse_where(Vector<Match*>&, int &argc, char**& argv);
static int eval(const Iter&, const Vector<Match*>&);
@@ -172,6 +183,17 @@ main(int argc, char** argv){
ndb_std_get_one_option)))
return -1;
+ if (g_nodes && g_connections)
+ {
+ fprintf(stderr,
+ "Only one option of --nodes and --connections allowed\n");
+ return -1;
+ }
+
+ g_section = CFG_SECTION_NODE; //default
+ if (g_connections)
+ g_section = CFG_SECTION_CONNECTION;
+
ndb_mgm_configuration * conf = 0;
if (g_config_file || g_mycnf)
@@ -202,7 +224,7 @@ main(int argc, char** argv){
exit(0);
}
- Iter iter(* conf, CFG_SECTION_NODE);
+ Iter iter(* conf, g_section);
bool prev= false;
iter.first();
for(iter.first(); iter.valid(); iter.next())
@@ -231,13 +253,32 @@ parse_query(Vector<Apply*>& select, int &argc, char**& argv)
for(unsigned i = 0; i<list.size(); i++)
{
const char * str= list[i].c_str();
- if(strcasecmp(str, "id") == 0 || strcasecmp(str, "nodeid") == 0)
- select.push_back(new Apply(CFG_NODE_ID));
- else if(strncasecmp(str, "host", 4) == 0)
- select.push_back(new Apply(CFG_NODE_HOST));
- else if(strcasecmp(str, "type") == 0)
- select.push_back(new NodeTypeApply());
- else if(g_nodes)
+ if(g_section == CFG_SECTION_NODE)
+ {
+ if(strcasecmp(str, "id") == 0 || strcasecmp(str, "nodeid") == 0)
+ {
+ select.push_back(new Apply(CFG_NODE_ID));
+ continue;
+ }
+ else if(strncasecmp(str, "host", 4) == 0)
+ {
+ select.push_back(new Apply(CFG_NODE_HOST));
+ continue;
+ }
+ else if(strcasecmp(str, "type") == 0)
+ {
+ select.push_back(new NodeTypeApply());
+ continue;
+ }
+ }
+ else if (g_section == CFG_SECTION_CONNECTION)
+ {
+ if(strcasecmp(str, "type") == 0)
+ {
+ select.push_back(new ConnectionTypeApply());
+ continue;
+ }
+ }
{
bool found = false;
for(int p = 0; p<ConfigInfo::m_NoOfParams; p++)
@@ -245,9 +286,15 @@ parse_query(Vector<Apply*>& select, int &argc, char**& argv)
if(0)ndbout_c("%s %s",
ConfigInfo::m_ParamInfo[p]._section,
ConfigInfo::m_ParamInfo[p]._fname);
- if(strcmp(ConfigInfo::m_ParamInfo[p]._section, "DB") == 0 ||
- strcmp(ConfigInfo::m_ParamInfo[p]._section, "API") == 0 ||
- strcmp(ConfigInfo::m_ParamInfo[p]._section, "MGM") == 0)
+ if(g_section == CFG_SECTION_CONNECTION &&
+ (strcmp(ConfigInfo::m_ParamInfo[p]._section, "TCP") == 0 ||
+ strcmp(ConfigInfo::m_ParamInfo[p]._section, "SCI") == 0 ||
+ strcmp(ConfigInfo::m_ParamInfo[p]._section, "SHM") == 0)
+ ||
+ g_section == CFG_SECTION_NODE &&
+ (strcmp(ConfigInfo::m_ParamInfo[p]._section, "DB") == 0 ||
+ strcmp(ConfigInfo::m_ParamInfo[p]._section, "API") == 0 ||
+ strcmp(ConfigInfo::m_ParamInfo[p]._section, "MGM") == 0))
{
if(strcasecmp(ConfigInfo::m_ParamInfo[p]._fname, str) == 0)
{
@@ -263,11 +310,6 @@ parse_query(Vector<Apply*>& select, int &argc, char**& argv)
return 1;
}
}
- else
- {
- fprintf(stderr, "Unknown query option: %s\n", str);
- return 1;
- }
}
}
return 0;
@@ -425,6 +467,31 @@ NodeTypeApply::apply(const Iter& iter)
return 0;
}
+int
+ConnectionTypeApply::apply(const Iter& iter)
+{
+ Uint32 val32;
+ if (iter.get(CFG_TYPE_OF_SECTION, &val32) == 0)
+ {
+ switch (val32)
+ {
+ case CONNECTION_TYPE_TCP:
+ printf("tcp");
+ break;
+ case CONNECTION_TYPE_SCI:
+ printf("sci");
+ break;
+ case CONNECTION_TYPE_SHM:
+ printf("shm");
+ break;
+ default:
+ printf("<unknown>");
+ break;
+ }
+ }
+ return 0;
+}
+
ndb_mgm_configuration*
fetch_configuration()
{
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c
index 5a6adb398da..9ec2224ab62 100644
--- a/strings/conf_to_src.c
+++ b/strings/conf_to_src.c
@@ -171,50 +171,68 @@ static int my_read_charset_file(const char *filename)
return FALSE;
}
+static int
+is_case_sensitive(CHARSET_INFO *cs)
+{
+ return (cs->sort_order &&
+ cs->sort_order['A'] < cs->sort_order['a'] &&
+ cs->sort_order['a'] < cs->sort_order['B']) ? 1 : 0;
+}
+
void dispcset(FILE *f,CHARSET_INFO *cs)
{
fprintf(f,"{\n");
fprintf(f," %d,%d,%d,\n",cs->number,0,0);
- fprintf(f," MY_CS_COMPILED%s%s,\n",
+ fprintf(f," MY_CS_COMPILED%s%s%s,\n",
cs->state & MY_CS_BINSORT ? "|MY_CS_BINSORT" : "",
- cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "");
+ cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "",
+ is_case_sensitive(cs) ? "|MY_CS_CSSORT" : "");
if (cs->name)
{
- fprintf(f," \"%s\",\n",cs->csname);
- fprintf(f," \"%s\",\n",cs->name);
- fprintf(f," \"\",\n");
- fprintf(f," ctype_%s,\n",cs->name);
- fprintf(f," to_lower_%s,\n",cs->name);
- fprintf(f," to_upper_%s,\n",cs->name);
+ fprintf(f," \"%s\", /* cset name */\n",cs->csname);
+ fprintf(f," \"%s\", /* coll name */\n",cs->name);
+ fprintf(f," \"\", /* comment */\n");
+ fprintf(f," NULL, /* tailoring */\n");
+ fprintf(f," ctype_%s, /* ctype */\n",cs->name);
+ fprintf(f," to_lower_%s, /* lower */\n",cs->name);
+ fprintf(f," to_upper_%s, /* upper */\n",cs->name);
if (cs->sort_order)
- fprintf(f," sort_order_%s,\n",cs->name);
+ fprintf(f," sort_order_%s, /* sort_order */\n",cs->name);
else
- fprintf(f," NULL,\n");
- fprintf(f," to_uni_%s,\n",cs->name);
- fprintf(f," from_uni_%s,\n",cs->name);
+ fprintf(f," NULL, /* sort_order */\n");
+ fprintf(f," NULL, /* contractions */\n");
+ fprintf(f," NULL, /* sort_order_big*/\n");
+ fprintf(f," to_uni_%s, /* to_uni */\n",cs->name);
}
else
{
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
- fprintf(f," NULL,\n");
+ fprintf(f," NULL, /* cset name */\n");
+ fprintf(f," NULL, /* coll name */\n");
+ fprintf(f," NULL, /* comment */\n");
+ fprintf(f," NULL, /* tailoging */\n");
+ fprintf(f," NULL, /* ctype */\n");
+ fprintf(f," NULL, /* lower */\n");
+ fprintf(f," NULL, /* upper */\n");
+ fprintf(f," NULL, /* sort order */\n");
+ fprintf(f," NULL, /* contractions */\n");
+ fprintf(f," NULL, /* sort_order_big*/\n");
+ fprintf(f," NULL, /* to_uni */\n");
}
-
- fprintf(f," \"\",\n");
- fprintf(f," \"\",\n");
- fprintf(f," 0,\n");
- fprintf(f," 0,\n");
- fprintf(f," 0,\n");
+
+ fprintf(f," NULL, /* from_uni */\n");
+ fprintf(f," NULL, /* state map */\n");
+ fprintf(f," NULL, /* ident map */\n");
+ fprintf(f," 1, /* strxfrm_multiply*/\n");
+ fprintf(f," 1, /* mbminlen */\n");
+ fprintf(f," 1, /* mbmaxlen */\n");
+ fprintf(f," 0, /* min_sort_char */\n");
+ fprintf(f," 255, /* max_sort_char */\n");
+ fprintf(f," 0, /* escape_with_backslash_is_dangerous */\n");
+
fprintf(f," &my_charset_8bit_handler,\n");
if (cs->state & MY_CS_BINSORT)
- fprintf(f," &my_collation_bin_handler,\n");
+ fprintf(f," &my_collation_8bit_bin_handler,\n");
else
fprintf(f," &my_collation_8bit_simple_ci_handler,\n");
fprintf(f,"}\n");
@@ -253,6 +271,11 @@ main(int argc, char **argv __attribute__((unused)))
}
}
+
+ fprintf(f,"#include <my_global.h>\n");
+ fprintf(f,"#include <m_ctype.h>\n\n");
+
+
for (cs=all_charsets; cs < all_charsets+256; cs++)
{
if (simple_cs_is_full(cs))
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 8b50388e4ef..460215418f8 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -1711,7 +1711,7 @@ static uint16 tab_big5_uni0[]={
0x2467,0x2468,0x2469,0x2474,0x2475,0x2476,0x2477,0x2478,
0x2479,0x247A,0x247B,0x247C,0x247D};
-/* page 1 0xC940-0xF9D5 */
+/* page 1 0xC940-0xF9DC */
static uint16 tab_big5_uni1[]={
0x4E42,0x4E5C,0x51F5,0x531A,0x5382,0x4E07,0x4E0C,0x4E47,
0x4E8D,0x56D7,0xFA0C,0x5C6E,0x5F73,0x4E0F,0x5187,0x4E0E,
@@ -3267,12 +3267,13 @@ static uint16 tab_big5_uni1[]={
0x9E17,0x9F48,0x6207,0x6B1E,0x7227,0x864C,0x8EA8,0x9482,
0x9480,0x9481,0x9A69,0x9A68,0x9B2E,0x9E19,0x7229,0x864B,
0x8B9F,0x9483,0x9C79,0x9EB7,0x7675,0x9A6B,0x9C7A,0x9E1D,
-0x7069,0x706A,0x9EA4,0x9F7E,0x9F49,0x9F98};
+0x7069,0x706A,0x9EA4,0x9F7E,0x9F49,0x9F98,0x7881,0x92B9,
+0x88CF,0x58BB,0x6052,0x7CA7,0x5AFA};
static int func_big5_uni_onechar(int code){
if ((code>=0xA140)&&(code<=0xC7FC))
return(tab_big5_uni0[code-0xA140]);
- if ((code>=0xC940)&&(code<=0xF9D5))
+ if ((code>=0xC940)&&(code<=0xF9DC))
return(tab_big5_uni1[code-0xC940]);
return(0);
}
@@ -3901,7 +3902,7 @@ static uint16 tab_uni_big57[]={
0xE54D,0xE552, 0,0xE54E, 0,0xE551,0xBC5C, 0,
0xBEA5,0xBC5B, 0,0xE54A,0xE550, 0,0xBC5A,0xE54F,
0,0xE54C, 0,0xBC58, 0, 0, 0, 0,
- 0, 0,0xE94D, 0,0xE94F,0xE94A,0xBEC1,0xE94C,
+ 0, 0,0xE94D,0xF9D9,0xE94F,0xE94A,0xBEC1,0xE94C,
0,0xBEC0,0xE94E, 0, 0,0xBEC3,0xE950,0xBEC2,
0xE949,0xE94B, 0, 0, 0, 0,0xC0A5,0xECCC,
0,0xC0A4,0xECCD,0xC0A3,0xECCB,0xC0A2,0xECCA, 0,
@@ -3973,7 +3974,7 @@ static uint16 tab_uni_big57[]={
0xE175,0xB9DE,0xE174,0xB9E4, 0,0xE16D,0xB9DF, 0,
0xE17B,0xB9E0,0xE16F,0xE172,0xE177,0xE171,0xE16C, 0,
0, 0, 0,0xE173,0xE555,0xBC61,0xE558,0xE557,
-0xE55A,0xE55C, 0,0xBC5F, 0,0xE556, 0,0xE554,
+0xE55A,0xE55C,0xF9DC,0xBC5F, 0,0xE556, 0,0xE554,
0,0xE55D,0xE55B,0xE559, 0,0xE55F, 0,0xE55E,
0xBC63,0xBC5E, 0,0xBC60,0xBC62, 0, 0,0xE560,
0xE957, 0, 0,0xE956,0xE955, 0,0xE958,0xE951,
@@ -4144,7 +4145,7 @@ static uint16 tab_uni_big57[]={
0,0xCEC0, 0, 0, 0, 0, 0, 0,
0xCECA,0xD1A1,0xCECB,0xABEE,0xCECE,0xCEC4,0xABED,0xCEC6,
0,0xCEC7, 0, 0,0xCEC9,0xABE9, 0, 0,
-0xAEA3, 0, 0,0xCEC5,0xCEC1,0xAEA4, 0, 0,
+0xAEA3, 0,0xF9DA,0xCEC5,0xCEC1,0xAEA4, 0, 0,
0xCECF,0xAE7E,0xD17D,0xCEC8, 0,0xD17C,0xCEC3,0xCECC,
0, 0,0xABEC,0xAEA1,0xABF2,0xAEA2,0xCED0,0xD17E,
0xABEB,0xAEA6,0xABF1,0xABF0,0xABEF,0xAEA5,0xCED1,0xAEA7,
@@ -4918,7 +4919,7 @@ static uint16 tab_uni_big57[]={
0xDACF,0xDACE,0xDACB,0xB2B8,0xB577,0xDAC9,0xDACC,0xB578,
0xDACD,0xDACA, 0, 0, 0, 0, 0, 0,
0,0xDEEE, 0,0xDEF2,0xB84E, 0,0xE2F0,0xB851,
-0xDEF0, 0, 0,0xDEED,0xDEE8,0xDEEA,0xDEEB,0xDEE4,
+0xDEF0,0xF9D6, 0,0xDEED,0xDEE8,0xDEEA,0xDEEB,0xDEE4,
0,0xB84D, 0, 0,0xB84C, 0,0xB848,0xDEE7,
0,0xB84F, 0,0xB850,0xDEE6,0xDEE9,0xDEF1,0xB84A,
0xB84B,0xDEEF,0xDEE5, 0, 0, 0,0xE2F2,0xBAD0,
@@ -5050,7 +5051,7 @@ static uint16 tab_uni_big57[]={
0xD34D,0xAFBB,0xD34B, 0,0xD34C,0xD34E, 0, 0,
0,0xD34A,0xB2C9, 0,0xD6DE,0xB2CB,0xD6E0,0xB2CA,
0xD6DF, 0, 0, 0, 0, 0,0xDAE8,0xB5AF,
- 0,0xDAEA,0xDAE7,0xD6E1, 0,0xB5B0, 0, 0,
+ 0,0xDAEA,0xDAE7,0xD6E1, 0,0xB5B0, 0,0xF9DB,
0xDAE9, 0, 0, 0, 0, 0, 0,0xDF56,
0,0xB864,0xDF54,0xB865,0xDF55,0xB866, 0, 0,
0,0xBAE9,0xE361,0xE35E,0xE360,0xBAEA,0xBAEB,0xE35F,
@@ -5439,7 +5440,7 @@ static uint16 tab_uni_big57[]={
0,0xB5F6,0xDBCD, 0, 0, 0,0xDBC9,0xDBCB,
0xDBC6,0xDBC5,0xDBC3, 0,0xDBCA,0xDBCC,0xDBC8, 0,
0xDBC7,0xB5F4,0xB5F5, 0, 0, 0, 0, 0,
- 0,0xDBCF,0xB8CD,0xDFF2,0xDFF8,0xDFF3,0xDFF4, 0,
+ 0,0xDBCF,0xB8CD,0xDFF2,0xDFF8,0xDFF3,0xDFF4,0xF9D8,
0xDFF9, 0,0xB8CF, 0,0xB8C7,0xB8CE,0xDFF1,0xDBC4,
0xB8CA,0xB8C8,0xDFF7,0xDFF6,0xB8C9,0xB8CB,0xDFF5,0xB8C6,
0,0xB8CC, 0, 0, 0, 0, 0,0xE3F6,
@@ -5757,7 +5758,7 @@ static uint16 tab_uni_big57[]={
0xE47B,0xE4AF,0xE4AC,0xE4A7,0xE477,0xE476,0xE4A1,0xE4B4,
0xBBCF,0xE4B7,0xE47D,0xE4A3,0xBE52, 0, 0, 0,
0, 0,0xBE5A,0xBE55,0xE8A4,0xE8A1,0xE867,0xBE50,
- 0, 0, 0,0xBE4F,0xBE56, 0, 0, 0,
+ 0,0xF9D7, 0,0xBE4F,0xBE56, 0, 0, 0,
0xE865,0xBE54,0xE871,0xE863,0xE864,0xBE4E,0xE8A3,0xBE58,
0xE874,0xE879,0xE873,0xEBEE,0xE86F,0xE877,0xE875,0xE868,
0xE862,0xE87D,0xBE57,0xE87E, 0,0xE878, 0,0xE86D,
@@ -6398,6 +6399,7 @@ CHARSET_INFO my_charset_big5_chinese_ci=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_big5_handler,
&my_collation_big5_chinese_ci_handler
@@ -6430,6 +6432,7 @@ CHARSET_INFO my_charset_big5_bin=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_big5_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index 0fcd9021c4b..973a6ebf12a 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -86,6 +86,14 @@ static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
}
+uint my_lengthsp_binary(CHARSET_INFO *cs __attribute__((unused)),
+ const char *ptr __attribute__((unused)),
+ uint length)
+{
+ return length;
+}
+
+
/*
Compare two strings. Result is sign(first_argument - second_argument)
@@ -491,7 +499,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_numchars_8bit,
my_charpos_8bit,
my_well_formed_len_8bit,
- my_lengthsp_8bit,
+ my_lengthsp_binary,
my_numcells_8bit,
my_mb_wc_bin,
my_wc_mb_bin,
@@ -516,7 +524,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
CHARSET_INFO my_charset_bin =
{
63,0,0, /* number */
- MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */
+ MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY,/* state */
"binary", /* cs name */
"binary", /* name */
"", /* comment */
@@ -539,6 +547,7 @@ CHARSET_INFO my_charset_bin =
1, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ 0, /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_binary_handler
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index b5f36c030bd..1e3126865f3 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -5417,7 +5417,7 @@ uint my_well_formed_len_cp932(CHARSET_INFO *cs __attribute__((unused)),
{
const char *b0= b;
*error= 0;
- while (pos && b < e)
+ while (pos-- && b < e)
{
/*
Cast to int8 for extra safety.
@@ -5522,6 +5522,7 @@ CHARSET_INFO my_charset_cp932_japanese_ci=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -5553,6 +5554,7 @@ CHARSET_INFO my_charset_cp932_bin=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index bdafc5c94b6..fa3a3bf53fe 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -628,6 +628,7 @@ CHARSET_INFO my_charset_latin2_czech_ci =
1, /* mbmaxlen */
0, /* min_sort_char */
0, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_8bit_handler,
&my_collation_latin2_czech_ci_handler
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index b529bbb0308..97fea517c1b 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -8706,6 +8706,7 @@ CHARSET_INFO my_charset_euckr_korean_ci=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -8738,6 +8739,7 @@ CHARSET_INFO my_charset_euckr_bin=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index ccdca2ba595..f9210fcb10e 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -8708,6 +8708,7 @@ CHARSET_INFO my_charset_eucjpms_japanese_ci=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -8740,6 +8741,7 @@ CHARSET_INFO my_charset_eucjpms_bin=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index e9a9598abdf..9fa4873c5d3 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -43,6 +43,7 @@ CHARSET_INFO compiled_charsets[] = {
0, /* mbmaxlen */
0, /* min_sort_ord */
0, /* max_sort_ord */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
NULL, /* cset handler */
NULL /* coll handler */
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 3d9a17205cd..f5d9b2627cd 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -5757,6 +5757,7 @@ CHARSET_INFO my_charset_gb2312_chinese_ci=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -5788,6 +5789,7 @@ CHARSET_INFO my_charset_gb2312_bin=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index e3a76359eaa..edc595875d7 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -10045,6 +10045,7 @@ CHARSET_INFO my_charset_gbk_chinese_ci=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -10076,6 +10077,7 @@ CHARSET_INFO my_charset_gbk_bin=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index 9075710610b..746cb5a4003 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -28,8 +28,8 @@ static uchar ctype_latin1[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16,
16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 16, 0, 16, 2, 16, 16, 16, 16, 16, 16, 1, 16, 1, 0, 1, 0,
+ 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 16, 2, 0, 2, 1,
72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -441,6 +441,7 @@ CHARSET_INFO my_charset_latin1=
1, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_8bit_simple_ci_handler
@@ -740,6 +741,7 @@ CHARSET_INFO my_charset_latin1_german2_ci=
1, /* mbmaxlen */
0, /* min_sort_char */
247, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_german2_ci_handler
@@ -772,6 +774,7 @@ CHARSET_INFO my_charset_latin1_bin=
1, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_8bit_bin_handler
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index d25b9e4d9cf..d6f2f0e5fe5 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -904,7 +904,7 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
while (long_val != 0)
{
long quo= long_val/10;
- *--p = '0' + (char)(long_val - quo*10);
+ *--p = (char) ('0' + (long_val - quo*10));
long_val= quo;
}
@@ -1316,6 +1316,7 @@ static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(uint))
{
cs->caseup_multiply= 1;
cs->casedn_multiply= 1;
+ cs->pad_char= ' ';
return create_fromuni(cs, alloc);
}
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 2ed21a40edd..398aea08b05 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -4693,6 +4693,7 @@ CHARSET_INFO my_charset_sjis_japanese_ci=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -4724,6 +4725,7 @@ CHARSET_INFO my_charset_sjis_bin=
2, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 762f6d2dfb6..1200644de3c 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -498,7 +498,7 @@ static uint thai2sortable(uchar *tstr, uint len)
l2bias use to control position weight of l2char
example (*=l2char) XX*X must come before X*XX
*/
- memcpy_overlap((char*) p, (char*) (p+1), tlen-1);
+ memmove((char*) p, (char*) (p+1), tlen-1);
tstr[len-1]= l2bias + t_ctype0[1]- L2_GARAN +1;
p--;
continue;
@@ -922,6 +922,7 @@ CHARSET_INFO my_charset_tis620_thai_ci=
1, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -953,6 +954,7 @@ CHARSET_INFO my_charset_tis620_bin=
1, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_8bit_bin_handler
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index a280ed59352..4768e42a0b0 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -7954,6 +7954,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(uint))
{
+ cs->pad_char= ' ';
return create_tailoring(cs, alloc);
}
@@ -8071,6 +8072,7 @@ CHARSET_INFO my_charset_ucs2_general_uca=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8102,6 +8104,7 @@ CHARSET_INFO my_charset_ucs2_icelandic_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8133,6 +8136,7 @@ CHARSET_INFO my_charset_ucs2_latvian_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8164,6 +8168,7 @@ CHARSET_INFO my_charset_ucs2_romanian_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8195,6 +8200,7 @@ CHARSET_INFO my_charset_ucs2_slovenian_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8226,6 +8232,7 @@ CHARSET_INFO my_charset_ucs2_polish_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8257,6 +8264,7 @@ CHARSET_INFO my_charset_ucs2_estonian_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8288,6 +8296,7 @@ CHARSET_INFO my_charset_ucs2_spanish_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8319,6 +8328,7 @@ CHARSET_INFO my_charset_ucs2_swedish_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8350,6 +8360,7 @@ CHARSET_INFO my_charset_ucs2_turkish_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8381,6 +8392,7 @@ CHARSET_INFO my_charset_ucs2_czech_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8413,6 +8425,7 @@ CHARSET_INFO my_charset_ucs2_danish_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8444,6 +8457,7 @@ CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8475,6 +8489,7 @@ CHARSET_INFO my_charset_ucs2_slovak_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8506,6 +8521,7 @@ CHARSET_INFO my_charset_ucs2_spanish2_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8538,6 +8554,7 @@ CHARSET_INFO my_charset_ucs2_roman_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8570,6 +8587,7 @@ CHARSET_INFO my_charset_ucs2_persian_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8602,6 +8620,7 @@ CHARSET_INFO my_charset_ucs2_esperanto_uca_ci=
2, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_uca_handler
@@ -8681,6 +8700,7 @@ CHARSET_INFO my_charset_utf8_general_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8713,6 +8733,7 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8744,6 +8765,7 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8775,6 +8797,7 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8806,6 +8829,7 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8837,6 +8861,7 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8868,6 +8893,7 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8899,6 +8925,7 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8930,6 +8957,7 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8961,6 +8989,7 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -8992,6 +9021,7 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -9024,6 +9054,7 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -9055,6 +9086,7 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -9086,6 +9118,7 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -9117,6 +9150,7 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -9148,6 +9182,7 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -9179,6 +9214,7 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
@@ -9210,6 +9246,7 @@ CHARSET_INFO my_charset_utf8_esperanto_uca_ci=
3, /* mbmaxlen */
9, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_any_uca_handler
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index c389f2e7f75..80a7bd84601 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -1063,7 +1063,7 @@ int my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)),
while (long_val != 0)
{
long quo= long_val/10;
- *--p = '0' + (char)(long_val - quo*10);
+ *--p = (char) ('0' + (long_val - quo*10));
long_val= quo;
}
@@ -1623,6 +1623,7 @@ CHARSET_INFO my_charset_ucs2_general_ci=
2, /* mbmaxlen */
0, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_general_ci_handler
@@ -1654,6 +1655,7 @@ CHARSET_INFO my_charset_ucs2_bin=
2, /* mbmaxlen */
0, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_ucs2_handler,
&my_collation_ucs2_bin_handler
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 57ca2de2852..696eecaa794 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8576,6 +8576,7 @@ CHARSET_INFO my_charset_ujis_japanese_ci=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_ci_handler
@@ -8608,6 +8609,7 @@ CHARSET_INFO my_charset_ujis_bin=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
&my_collation_mb_bin_handler
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index 88b6b7d5c86..e1bb746fd9a 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2579,6 +2579,7 @@ CHARSET_INFO my_charset_utf8_general_ci=
3, /* mbmaxlen */
0, /* min_sort_char */
0xFFFF, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_ci_handler
@@ -2611,6 +2612,7 @@ CHARSET_INFO my_charset_utf8_bin=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_mb_bin_handler
@@ -2781,6 +2783,7 @@ CHARSET_INFO my_charset_utf8_general_cs=
3, /* mbmaxlen */
0, /* min_sort_char */
255, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_utf8_handler,
&my_collation_cs_handler
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index c6b396658d4..0bc465f16ea 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -514,42 +514,84 @@ static int my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)),
#ifdef REAL_MYSQL
-static uchar NEAR like_range_prefix_min_win1250ch[] =
+static uchar NEAR like_range_prefix_min_win1250ch[]=
{
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
-96, 54, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 165, 124, 125, 126, 0,
-0, 0, 130, 0, 132, 133, 134, 135, 0, 137, 138, 139, 83, 84, 142, 90,
-0, 145, 146, 147, 148, 149, 150, 151, 0, 153, 138, 155, 83, 84, 142, 90,
-32, 161, 162, 76, 164, 165, 166, 167, 168, 65, 83, 171, 172, 173, 174, 90,
-176, 177, 178, 76, 180, 181, 0, 183, 184, 65, 83, 187, 76, 189, 76, 90,
-82, 65, 65, 65, 65, 76, 67, 67, 200, 69, 69, 69, 69, 73, 73, 68,
-68, 78, 78, 79, 79, 79, 79, 215, 216, 85, 85, 85, 85, 89, 84, 223,
-82, 65, 65, 65, 65, 76, 67, 67, 200, 69, 69, 69, 69, 73, 73, 68,
-68, 78, 78, 79, 79, 79, 79, 247, 216, 85, 85, 85, 85, 89, 84, 255,
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
+ 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
+ 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
+ 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
+ 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
+ 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
+ 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
+ 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
+ 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
+ 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
+ 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
+ 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
+ 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
};
-static uchar NEAR like_range_prefix_max_win1250ch[] = {
-182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
-182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
-160, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
-48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-64, 185, 98, 73, 240, 234, 102, 103, 104, 238, 106, 107, 179, 109, 242, 245,
-112, 113, 224, 186, 254, 251, 118, 119, 120, 253, 159, 91, 92, 93, 94, 95,
-96, 54, 98, 73, 240, 234, 102, 103, 104, 238, 106, 107, 179, 109, 242, 245,
-112, 113, 224, 186, 254, 251, 118, 119, 120, 253, 159, 165, 124, 125, 126, 182,
-182, 182, 130, 182, 132, 133, 134, 135, 182, 137, 154, 139, 186, 254, 158, 159,
-182, 145, 146, 147, 148, 149, 150, 151, 182, 153, 154, 155, 186, 254, 158, 159,
-32, 161, 162, 179, 164, 165, 166, 167, 168, 185, 186, 171, 172, 173, 174, 159,
-176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 179, 189, 179, 159,
-224, 185, 185, 185, 185, 179, 238, 238, 200, 234, 234, 234, 234, 238, 238, 240,
-240, 242, 242, 245, 245, 245, 245, 215, 248, 251, 251, 251, 251, 253, 254, 223,
-224, 185, 185, 185, 185, 179, 238, 238, 200, 234, 234, 234, 234, 238, 238, 240,
-240, 242, 242, 245, 245, 245, 245, 247, 248, 251, 251, 251, 251, 253, 254, 255,
+
+/*
+ The letter "C" is a special case:
+ "CH" is sorted between "H" and "I".
+ prefix_max for "C" is "I": prefix_max[0x43] == 0x49
+ prefix_max for "c" is "i": prefix_max[0x63] == 0x69
+ For all other characters: prefix_max[i] == i
+*/
+
+static uchar NEAR like_range_prefix_max_win1250ch[]=
+{
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+ 0x40, 0x41, 0x42, 0x49, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
+ 0x60, 0x61, 0x62, 0x69, 0x64, 0x65, 0x66, 0x67,
+ 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
+ 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
+ 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7,
+ 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
+ 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7,
+ 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
+ 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
+ 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
+ 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
+ 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
+ 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
+ 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
+ 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
+ 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
};
#define min_sort_char '\x20'
@@ -662,6 +704,7 @@ CHARSET_INFO my_charset_cp1250_czech_ci =
1, /* mbmaxlen */
0, /* min_sort_char */
0, /* max_sort_char */
+ ' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_8bit_handler,
&my_collation_czech_ci_handler
diff --git a/strings/decimal.c b/strings/decimal.c
index ce00b9770b3..f536bdb1d6b 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1986,7 +1986,11 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
carry+=hi;
}
for (; carry; buf0--)
+ {
+ if (buf0 < to->buf)
+ return E_DEC_OVERFLOW;
ADD(*buf0, *buf0, 0, carry);
+ }
}
/* Now we have to check for -0.000 case */
@@ -2018,7 +2022,7 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
if (to->buf < buf1)
{
dec1 *cur_d= to->buf;
- for (; d_to_move; d_to_move--, cur_d++, buf1++)
+ for (; d_to_move--; cur_d++, buf1++)
*cur_d= *buf1;
}
return error;
diff --git a/strings/longlong2str-x86.s b/strings/longlong2str-x86.s
index 1840bab3f47..168dab38a85 100644
--- a/strings/longlong2str-x86.s
+++ b/strings/longlong2str-x86.s
@@ -26,95 +26,88 @@
.type longlong2str_with_dig_vector,@function
longlong2str_with_dig_vector:
- subl $80,%esp
+ subl $80,%esp # Temporary buffer for up to 64 radix-2 digits
pushl %ebp
pushl %esi
pushl %edi
pushl %ebx
- movl 100(%esp),%esi # Lower part of val
- movl 112(%esp),%ebx # Radix
- movl 104(%esp),%ebp # Higher part of val
- movl %ebx,%eax
- movl 108(%esp),%edi # get dst
- testl %eax,%eax
- jge .L144
+ movl 100(%esp),%esi # esi = Lower part of val
+ movl 112(%esp),%ebx # ebx = Radix
+ movl 104(%esp),%ebp # ebp = Higher part of val
+ movl 108(%esp),%edi # edi = dst
- addl $36,%eax
- cmpl $34,%eax
- ja .Lerror # Wrong radix
- testl %ebp,%ebp
- jge .L146
+ testl %ebx,%ebx
+ jge .L144 # Radix was positive
+ negl %ebx # Change radix to positive
+ testl %ebp,%ebp # Test if given value is negative
+ jge .L144
movb $45,(%edi) # Add sign
incl %edi # Change sign of val
negl %esi
adcl $0,%ebp
negl %ebp
-.L146:
- negl %ebx # Change radix to positive
- jmp .L148
- .align 4
-.L144:
- addl $-2,%eax
+
+.L144: # Test that radix is between 2 and 36
+ movl %ebx, %eax
+ addl $-2,%eax # Test that radix is between 2 and 36
cmpl $34,%eax
- ja .Lerror # Radix in range
-
-.L148:
- movl %esi,%eax # Test if zero (for easy loop)
- orl %ebp,%eax
- jne .L150
- movb $48,(%edi)
- incl %edi
- jmp .L10_end
- .align 4
+ ja .Lerror # Radix was not in range
-.L150:
leal 92(%esp),%ecx # End of buffer
movl %edi, 108(%esp) # Store possible modified dest
movl 116(%esp), %edi # dig_vec_upper
- jmp .L155
- .align 4
-
-.L153:
- # val is stored in in ebp:esi
+ testl %ebp,%ebp # Test if value > 0xFFFFFFFF
+ jne .Llongdiv
+ cmpl %ebx, %esi # Test if <= radix, for easy loop
+ movl %esi, %eax # Value in eax (for Llow)
+ jae .Llow
+
+ # Value is one digit (negative or positive)
+ movb (%eax,%edi),%bl
+ movl 108(%esp),%edi # get dst
+ movb %bl,(%edi)
+ incl %edi # End null here
+ jmp .L10_end
- movl %ebp,%eax # High part of value
+.Llongdiv:
+ # Value in ebp:esi. div the high part by the radix,
+ # then div remainder + low part by the radix.
+ movl %ebp,%eax # edx=0,eax=high(from ebp)
xorl %edx,%edx
+ decl %ecx
divl %ebx
- movl %eax,%ebp
+ movl %eax,%ebp # edx=result of last, eax=low(from esi)
movl %esi,%eax
divl %ebx
- decl %ecx
- movl %eax,%esi # quotent in ebp:esi
- movb (%edx,%edi),%al # al is faster than dl
- movb %al,(%ecx) # store value in buff
- .align 4
-.L155:
+ movl %eax,%esi # ebp:esi = quotient
+ movb (%edx,%edi),%dl # Store result number in temporary buffer
testl %ebp,%ebp
- ja .L153
- testl %esi,%esi # rest value
- jl .L153
- je .L160 # Ready
- movl %esi,%eax
+ movb %dl,(%ecx) # store value in buff
+ ja .Llongdiv # (Higher part of val still > 0)
+
.align 4
-
-.L154: # Do rest with integer precision
- cltd
- divl %ebx
+.Llow: # Do rest with integer precision
+ # Value in 0:eax. div 0 + low part by the radix.
+ xorl %edx,%edx
decl %ecx
+ divl %ebx
movb (%edx,%edi),%dl # bh is always zero as ebx=radix < 36
testl %eax,%eax
movb %dl,(%ecx)
- jne .L154
+ jne .Llow
.L160:
movl 108(%esp),%edi # get dst
-
-.L10_mov:
- movl %ecx,%esi
- leal 92(%esp),%ecx # End of buffer
- subl %esi,%ecx
- rep
- movsb
+
+.Lcopy_end:
+ leal 92(%esp),%esi # End of buffer
+.Lmov: # mov temporary buffer to result (%ecx -> %edi)
+ movb (%ecx), %al
+ movb %al, (%edi)
+ incl %ecx
+ incl %edi
+ cmpl %ecx,%esi
+ jne .Lmov
.L10_end:
movl %edi,%eax # Pointer to end null
@@ -166,21 +159,23 @@ longlong10_to_str:
negl %esi # Change sign of val (ebp:esi)
adcl $0,%ebp
negl %ebp
- .align 4
.L10_10:
leal 92(%esp),%ecx # End of buffer
- movl %esi,%eax # Test if zero (for easy loop)
- orl %ebp,%eax
- jne .L10_30 # Not zero
-
- # Here when value is zero
- movb $48,(%edi)
+ testl %ebp,%ebp # Test if value > 0xFFFFFFFF
+ jne .L10_longdiv
+ cmpl $10, %esi # Test if <= radix, for easy loop
+ movl %esi, %ebx # Value in eax (for L10_low)
+ jae .L10_low
+
+ # Value is one digit (negative or positive)
+ addb $48, %bl
+ movb %bl,(%edi)
incl %edi
jmp .L10_end
.align 4
-.L10_20:
+.L10_longdiv:
# val is stored in in ebp:esi
movl %ebp,%eax # High part of value
xorl %edx,%edx
@@ -195,17 +190,15 @@ longlong10_to_str:
.L10_30:
testl %ebp,%ebp
- ja .L10_20
- testl %esi,%esi # rest value
- jl .L10_20 # Unsigned, do ulonglong div once more
- je .L10_mov # Ready
+ ja .L10_longdiv
movl %esi,%ebx # Move val to %ebx
+.L10_low:
# The following code uses some tricks to change division by 10 to
# multiplication and shifts
movl $0xcccccccd,%esi
-.L10_40:
+.L10_40: # Divide %ebx with 10
movl %ebx,%eax
mull %esi
decl %ecx
@@ -218,7 +211,7 @@ longlong10_to_str:
movl %edx,%ebx
testl %ebx,%ebx
jne .L10_40
- jmp .L10_mov # Shared end with longlong10_to_str
+ jmp .Lcopy_end # Shared end with longlong2str
.L10end:
.size longlong10_to_str,.L10end-longlong10_to_str
diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c
index 1f4cf1435fe..b9b09810c51 100644
--- a/strings/my_strtoll10.c
+++ b/strings/my_strtoll10.c
@@ -19,10 +19,13 @@
#include <m_string.h>
#undef ULONGLONG_MAX
-/* Needed under MetroWerks Compiler, since MetroWerks compiler does not properly handle a constant expression containing a mod operator */
+/*
+ Needed under MetroWerks Compiler, since MetroWerks compiler does not
+ properly handle a constant expression containing a mod operator
+*/
#if defined(__NETWARE__) && defined(__MWERKS__)
-ulonglong tmp;
-#define ULONGLONG_MAX (tmp =(~(ulonglong) 0))
+static ulonglong ulonglong_max= ~(ulonglong) 0;
+#define ULONGLONG_MAX ulonglong_max
#else
#define ULONGLONG_MAX (~(ulonglong) 0)
#endif /* __NETWARE__ && __MWERKS__ */
diff --git a/strings/xml.c b/strings/xml.c
index 02ca3932c39..767cb004d34 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -81,7 +81,7 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
a->beg=p->cur;
a->end=p->cur;
- if (!bcmp(p->cur,"<!--",4))
+ if ((p->end - p->cur > 3) && !bcmp(p->cur,"<!--",4))
{
for( ; (p->cur < p->end) && bcmp(p->cur, "-->", 3); p->cur++)
{}
diff --git a/support-files/MacOSX/make_mysql_pkg.pl b/support-files/MacOSX/make_mysql_pkg.pl
deleted file mode 100644
index 22283d57098..00000000000
--- a/support-files/MacOSX/make_mysql_pkg.pl
+++ /dev/null
@@ -1,475 +0,0 @@
-#!/usr/bin/perl -w
-#
-#
-# make_mysql_pkg.pl
-#
-# This script creates a Mac OS X installation package
-# of MySQL for Apple's Installer application.
-#
-# To use it:
-#
-# 1.) Unpack the mysql source tarball and cd into the directory
-# 2.) execute this script
-#
-#
-# Written by Marc Liyanage (http://www.entropy.ch)
-#
-# History:
-#
-# When Who What
-# ------------------------------------------------------------------
-# 2001-09-16 Marc Liyanage First version
-# 2001-11-18 Marc Liyanage Improved configure directory options
-#
-
-use strict;
-use DirHandle;
-
-my $data = {};
-
-$data->{PREFIX_DIR} = "/usr/local/mysql";
-$data->{CONFIG} = join(" ",
- "--prefix=$data->{PREFIX_DIR}",
- "--localstatedir=$data->{PREFIX_DIR}/data",
- "--libdir=$data->{PREFIX_DIR}/lib",
- "--includedir=$data->{PREFIX_DIR}/include",
- "--with-named-z-libs=/usr/local/libz.a",
- "--with-innodb",
- "--with-server-suffix='-entropy.ch'",
- "--with-comment='http://www.entropy.ch/software/macosx/mysql/'",
- "--with-mysqld-user=mysql",
- "--enable-assembler",
- "CFLAGS=\"-DHAVE_BROKEN_REALPATH -lncurses\"",
-);
-
-
-
-
-
-prepare($data);
-configure_source($data);
-make($data);
-make_binary_distribution($data);
-create_pax_root($data);
-create_package($data);
-cleanup($data);
-
-print "Package $data->{PACKAGE_TARBALL_FILENAME} created\n";
-
-
-
-
-
-
-# Subroutines follow here...
-
-
-
-
-# Prepares data in the global $data hash, like version numbers,
-# directory names etc. Also makes sure that no old stuff
-# is in our way.
-#
-sub prepare {
-
- my ($data) = @_;
-
- # Keep the current wd for reference
- #
- $data->{OLDWD} = `pwd`;
- chomp($data->{OLDWD});
-
- # Look for configure script
- #
- unless (-f "configure") {
- abort($data, "Unable to find 'configure', make sure you're in the MySQL source toplevel directory!");
- }
-
- # Try to find version number there
- #
- my $mysql_version_h = `cat configure`;
- ($data->{VERSION}) = $mysql_version_h =~ /^VERSION=(.+?)$/m;
-
- unless ($data->{VERSION} =~ /\d+/) {
- abort($data, "Unable to find MySQL version number!");
- }
-
- debug($data, "found MySQL version number $data->{VERSION}");
-
-
- # PAXROOT_DIR is where we will build our own little
- # fake /usr/local directory. Make sure it doesn't exist,
- # then try to create it.
- #
- $data->{PAXROOT_DIR} = "/tmp/mysql-$data->{VERSION}-paxroot";
-
- if (-e $data->{PAXROOT_DIR}) {
- abort($data, "$data->{PAXROOT_DIR} exists, please remove first");
- }
-
- if (system("mkdir $data->{PAXROOT_DIR}")) {
- abort($data, "Unable to mkdir $data->{PAXROOT_DIR}, please make sure you have the right permissions!");
- }
-
-
- # PACKAGE_DIR is where we will build the package directory
- # hierarchy, according to the standard .pkg layout.
- #
- $data->{PACKAGE_NAME} = "mysql-$data->{VERSION}.pkg";
- $data->{PACKAGE_DIR} = "/tmp/$data->{PACKAGE_NAME}";
-
- if (-e $data->{PACKAGE_DIR}) {
- abort($data, "$data->{PACKAGE_DIR} exists, please remove first");
- }
-
- if (system("mkdir $data->{PACKAGE_DIR}")) {
- abort($data, "Unable to mkdir $data->{PACKAGE_DIR}, please make sure you have the right permissions!");
- }
-
-
-}
-
-
-
-# Configure the MySQL source with our options
-#
-sub configure_source {
-
- my ($data) = @_;
-
- if (system("./configure $data->{CONFIG}")) {
- abort($data, "Unable to configure!");
- }
-
-}
-
-
-
-
-# Build the software
-#
-sub make {
-
- my ($data) = @_;
-
- if (system("make")) {
- abort($data, "Unable to make!");
- }
-
-}
-
-
-
-# We don't ever install the software, but instead we use an
-# included script to create a binary distribution
-# tarball.
-#
-sub make_binary_distribution {
-
- my ($data) = @_;
-
- if (system("./scripts/make_binary_distribution > make_binary_distribution.out")) {
- abort($data, "Unable to make_binary_distribution!");
- }
-
- my @output = `cat make_binary_distribution.out`;
- my $last_line = $output[-1];
- unlink("make_binary_distribution.out");
-
- my ($tarball_filename, $tarball_directory) = $last_line =~ /^((.+)\.tar\.gz) created/i;
-
- unless ($tarball_filename and -f $tarball_filename) {
- abort($data, "Unable determine the output filename of scripts/make_binary_distribution!");
- }
-
- $data->{BINARY_TARBALL_FILENAME} = $tarball_filename;
- $data->{BINARY_TARBALL_DIRECTORY} = $tarball_directory;
-
-}
-
-
-
-
-# Now we build a fake /usr/local directory hierarchy.
-# This will be fed to the pax tool to create the archive.
-#
-sub create_pax_root {
-
- my ($data) = @_;
-
- # Go there and try to extract the binary distribution
- # tarball which we created in the previous step.
- #
- chdir($data->{PAXROOT_DIR});
- my $tarfile = "$data->{OLDWD}/$data->{BINARY_TARBALL_FILENAME}";
-
- if (system("tar -xzf $tarfile")) {
- abort($data, "Unable to extract $tarfile inside $data->{PAXROOT_DIR}");
- }
-
- # Rename it to what we want it to be in the
- # installed /usr/local directory later on, i.e.
- # mysql-<version>. Then create a symlink from
- # mysql to mysql-<version>
- #
- rename($data->{BINARY_TARBALL_DIRECTORY}, "mysql-$data->{VERSION}");
- symlink("mysql-$data->{VERSION}", "mysql");
-
-
- # We create a bunch of symlinks in /usr/local/bin and
- # /usr/local/share/man so that the end-user will not
- # have to adjust PATH and MANPATH to include the
- # /usr/local/mysql/bin and man directories.
- #
- system("mkdir -p $_") foreach qw(bin share/man);
-
-
- # First create the symlinks in the bin directory
- #
- # 2001-02-13: we no longer use symlinks for the binaries, we
- # use small dummy scripts instead because the
- # mysql scripts do a lot of guesswork with their
- # own path and that will not work when called via the symlink
- #
-# symlink("../mysql/bin/$_", "$_") foreach (grep {$_ !~ /^\.+$/} DirHandle->new("../mysql/bin")->read());
-
- chdir("bin");
-
- foreach my $command (grep {$_ !~ /^\.+$/} DirHandle->new("../mysql/bin")->read()) {
-
- my $scriptcode = qq+#!/bin/sh\n# Part of the entropy.ch mysql package\ncd /usr/local/mysql/\nexec ./bin/$command "\$\@"\n+;
- open(SCRIPTFILE, ">$command") or die "Unable to write open $command\n";
- print SCRIPTFILE $scriptcode;
- close(SCRIPTFILE);
- chmod(0755, $command);
-
- }
-
-
-
-
-
-
-
- # Now include the man pages. Two problems here:
- # 1.) the make_binary_distribution script does not seem
- # to include the man pages, so we have to copy them over
- # now. [outdated, was fixed by MySQL!]
- # 2.) The man pages could be in different sections, so
- # we have to recursively copy *and* symlink them.
- #
-
- # First find out what's there in the source distribution.
- # Store the names of the manpages in anonymous
- # arrays which in turn will be stored in a hash, using
- # the section numbers as hash keys.
- #
- chdir("$data->{PAXROOT_DIR}/mysql");
- my %man_sections;
- foreach my $manpage (grep {$_ =~ /^.+\.(\d+)$/} DirHandle->new("man")->read()) {
-
- my ($section) = $manpage =~ /\.(\d+)$/;
-
- $man_sections{$section} ||= [];
- push @{$man_sections{$section}}, "$manpage";
-
- }
-
-
- # Now iterate through the sections and man pages,
- # and copy/symlink the man pages
- #
- chdir("$data->{PAXROOT_DIR}/share/man/");
-
- foreach my $section (keys(%man_sections)) {
-
- system("mkdir -p man$section");
- chdir("man$section");
-
- foreach my $manpage (@{$man_sections{$section}}) {
-
- symlink("../../../mysql/man/$manpage", $manpage)
-
- }
-
- chdir("..");
-
- }
-
-
-
- # Fix up the library and lib directories. They are packed up wrong in the
- # binary distribution tarball.
- #
- # (no longer needed as of 3.23.47)
- # (oops, still needed because 3.23.47 is broken...)
- #
-# if (-d "$data->{PAXROOT_DIR}/mysql/lib/mysql") {
-# abort($data, "$data->{PAXROOT_DIR}/mysql/lib/mysql exists, layout has changed!");
-# }
-# chdir("$data->{PAXROOT_DIR}/mysql/lib/");
-# system("mkdir -p mysql");
-# system("mv * mysql");
-
-# if (-d "$data->{PAXROOT_DIR}/mysql/include/mysql") {
-# abort($data, "$data->{PAXROOT_DIR}/mysql/include/mysql exists, layout has changed!");
-# }
-# chdir("$data->{PAXROOT_DIR}/mysql/include/");
-# system("mkdir -p mysql");
-# system("mv * mysql");
-
-
-
-
-
-
-
-
-
-}
-
-
-
-# Take the pax root directory, create a few auxiliary
-# files and then pack everything up into a tarball
-#
-sub create_package {
-
- my ($data) = @_;
-
- # Create the resources directory in which all
- # interesting files for this package will be stored
- #
- $data->{PKG_RESOURCES_DIR} = "$data->{PACKAGE_DIR}/Contents/Resources";
-
- if (system("mkdir -p $data->{PKG_RESOURCES_DIR}")) {
- abort("Unable to create package resources dir $data->{PKG_RESOURCES_DIR}");
- }
-
-
- # Create the big archive with all the files using
- # the pax tool
- #
- chdir($data->{PAXROOT_DIR});
- if(system("pax -w . | gzip -c > $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.pax.gz")) {
- abort("Unable to create package pax file");
- }
-
-
- # Create the "Bill Of Materials" (bom) file.
- #
- if(system("mkbom . $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.bom")) {
- abort("Unable to create package bom file");
- }
-
-
- # Create the ".sizes" file with some information about the package
- #
- my $size_uncompressed = `du -sk $data->{PAXROOT_DIR} | cut -f 1`;
- chomp($size_uncompressed);
-
- my $size_compressed = `du -sk $data->{PACKAGE_DIR} | cut -f 1`;
- chomp($size_compressed);
-
- my $numfiles = `find /tmp/mysql-$data->{VERSION}-paxroot | wc -l`;
- $numfiles--;
-
- open(SIZESFILE, ">$data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.sizes") or abort("Unable to write open sizes file $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.sizes");
- print SIZESFILE "NumFiles $numfiles\n";
- print SIZESFILE "InstalledSize $size_uncompressed\n";
- print SIZESFILE "CompressedSize $size_compressed\n";
- close(SIZESFILE);
-
-
- # Create the ".info" file with more information abou the package.
- #
- open(INFOFILE, ">$data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.info") or abort("Unable to write open sizes file $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.info");
- my $infodata = join("", <DATA>);
- $infodata =~ s/<%(.+?)%>/$data->{$1}/eg;
- abort("Unable to get info file data from __DATA__!") unless ($infodata =~ /\w+/);
- print INFOFILE $infodata;
- close(INFOFILE);
-
-
-
- # Finally, create the .tar.gz file for the package,
- # this is our end result
- #
- chdir($data->{PACKAGE_DIR});
- chdir("..");
-
- $data->{PACKAGE_TARBALL_FILENAME} = "$data->{PACKAGE_NAME}.tar.gz";
-
- if(system("tar -czf $data->{OLDWD}/$data->{PACKAGE_TARBALL_FILENAME} $data->{PACKAGE_NAME}")) {
- abort("Unable to create package tar file $data->{OLDWD}/$data->{PACKAGE_TARBALL_FILENAME}");
- }
-
-
-
-}
-
-
-# Abort with an error message
-#
-sub abort {
-
- my ($data, $errormessage) = @_;
-
- my ($caller) = (caller(1))[3];
- $caller =~ s/^main:://;
-
- print "*** Error: $caller(): $errormessage\n";
-
- exit 1;
-
-}
-
-
-# Output informative messages
-#
-sub debug {
-
- my ($data, $message) = @_;
-
- my ($caller) = (caller(1))[3];
- $caller =~ s/^main:://;
-
- print "*** Info: $caller(): $message\n";
-
-}
-
-
-
-# Remove temporary items
-#
-sub cleanup {
-
- my ($data) = @_;
-
- chdir($data->{OLDWD});
-
- system("rm -rf $data->{PACKAGE_DIR}");
- system("rm -rf $data->{PAXROOT_DIR}");
- system("rm $data->{BINARY_TARBALL_FILENAME}");
-
-}
-
-
-
-
-__DATA__
-Title MySQL
-Version <%VERSION%>
-Description The MySQL database server in a convenient Mac OS X package. Some additional configuration is necessary, please see http://www.entropy.ch/software/macosx/mysql/
-DefaultLocation /usr/local
-Diskname (null)
-DeleteWarning
-NeedsAuthorization YES
-DisableStop NO
-UseUserMask NO
-Application NO
-Relocatable NO
-Required NO
-InstallOnly NO
-RequiresReboot NO
-InstallFat NO
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index f7a47054658..5dc3e5a1900 100644
--- a/support-files/my-huge.cnf.sh
+++ b/support-files/my-huge.cnf.sh
@@ -33,7 +33,7 @@ sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
-thread_cache = 8
+thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index b3f43272a7d..77c6cea56d5 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -128,7 +128,7 @@ join_buffer_size = 8M
# the amount of thread creations needed if you have a lot of new
# connections. (Normally this doesn't give a notable performance
# improvement if you have a good thread implementation.)
-thread_cache = 8
+thread_cache_size = 8
# This permits the application to give the threads system a hint for the
# desired number of threads that should be run at the same time. This
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index 1e7d9f7aade..4dc3f929c48 100644
--- a/support-files/my-large.cnf.sh
+++ b/support-files/my-large.cnf.sh
@@ -33,7 +33,7 @@ sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
-thread_cache = 8
+thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 9ad8e2f20ff..27aa05ebf27 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -1,8 +1,15 @@
%define mysql_version @VERSION@
+
# use "rpmbuild --with static" or "rpm --define '_with_static 1'" (for RPM 3.x)
# to enable static linking (off by default)
%{?_with_static:%define STATIC_BUILD 1}
%{!?_with_static:%define STATIC_BUILD 0}
+
+# use "rpmbuild --with yassl" or "rpm --define '_with_yassl 1'" (for RPM 3.x)
+# to build with yaSSL support (off by default)
+%{?_with_yassl:%define YASSL_BUILD 1}
+%{!?_with_yassl:%define YASSL_BUILD 0}
+
%if %{STATIC_BUILD}
%define release 0
%else
@@ -10,6 +17,7 @@
%endif
%define license GPL
%define mysqld_user mysql
+%define mysqld_group mysql
%define server_suffix -standard
%define mysqldatadir /var/lib/mysql
@@ -238,6 +246,9 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--prefix=/ \
--with-extra-charsets=complex \
+%if %{YASSL_BUILD}
+ --with-yassl \
+%endif
--exec-prefix=%{_exec_prefix} \
--libexecdir=%{_sbindir} \
--libdir=%{_libdir} \
@@ -248,11 +259,9 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--includedir=%{_includedir} \
--mandir=%{_mandir} \
--enable-thread-safe-client \
- --with-readline ;
+ --with-readline ; \
# Add this for more debugging support
# --with-debug
- # Add this for MyISAM RAID support:
- # --with-raid
"
# benchdir does not fit in above model. Maybe a separate bench distribution
@@ -295,7 +304,6 @@ then
fi
BuildMySQL "--enable-shared \
- --without-openssl \
--with-berkeley-db \
--with-innodb \
--with-ndbcluster \
@@ -304,24 +312,29 @@ BuildMySQL "--enable-shared \
--with-example-storage-engine \
--with-blackhole-storage-engine \
--with-federated-storage-engine \
- --with-embedded-server \
- --with-comment=\"MySQL Community Edition - Max (GPL)\" \
- --with-server-suffix='-Max'"
+ --with-big-tables \
+ --with-comment=\"MySQL Community Edition - Experimental (GPL)\" \
+ --with-server-suffix='-max'"
+
+# We might want to save the config log file
+if test -n "$MYSQL_MAXCONFLOG_DEST"
+then
+ cp -fp config.log "$MYSQL_MAXCONFLOG_DEST"
+fi
make test-force || true
# Save mysqld-max
mv sql/mysqld sql/mysqld-max
nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym
+# Save the perror binary so it supports the NDB error codes (BUG#13740)
+mv extra/perror extra/perror.ndb
# Install the ndb binaries
(cd ndb; make install DESTDIR=$RBR)
-# Install embedded server library in the build root
-install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
-
# Include libgcc.a in the devel subpackage (BUG 4921)
-if [ "$CC" = gcc ]
+if expr "$CC" : ".*gcc.*" > /dev/null ;
then
libgcc=`$CC --print-libgcc-file`
if [ -f $libgcc ]
@@ -353,13 +366,17 @@ BuildMySQL "--disable-shared \
%endif
--with-comment=\"MySQL Community Edition - Standard (GPL)\" \
--with-server-suffix='%{server_suffix}' \
- --without-embedded-server \
- --without-berkeley-db \
+ --with-archive-storage-engine \
--with-innodb \
- --without-vio \
- --without-openssl"
+ --with-big-tables"
nm --numeric-sort sql/mysqld > sql/mysqld.sym
+# We might want to save the config log file
+if test -n "$MYSQL_CONFLOG_DEST"
+then
+ cp -fp config.log "$MYSQL_CONFLOG_DEST"
+fi
+
make test-force || true
%install
@@ -383,15 +400,22 @@ make install-strip DESTDIR=$RBR benchdir_root=%{_datadir}
(cd $RBR%{_libdir}; tar xf $RBR/shared-libs.tar; rm -f $RBR/shared-libs.tar)
# install saved mysqld-max
-install -s -m755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max
+install -s -m 755 $MBD/sql/mysqld-max $RBR%{_sbindir}/mysqld-max
+
+# install saved perror binary with NDB support (BUG#13740)
+install -s -m 755 $MBD/extra/perror.ndb $RBR%{_bindir}/perror
# install symbol files ( for stack trace resolution)
-install -m644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym
-install -m644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym
+install -m 644 $MBD/sql/mysqld-max.sym $RBR%{_libdir}/mysql/mysqld-max.sym
+install -m 644 $MBD/sql/mysqld.sym $RBR%{_libdir}/mysql/mysqld.sym
# Install logrotate and autostart
-install -m644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
-install -m755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
+install -m 644 $MBD/support-files/mysql-log-rotate $RBR%{_sysconfdir}/logrotate.d/mysql
+install -m 755 $MBD/support-files/mysql.server $RBR%{_sysconfdir}/init.d/mysql
+
+# Install embedded server library in the build root
+# FIXME No libmysqld on 5.0 yet
+#install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/
# Create a symlink "rcmysql", pointing to the init.script. SuSE users
# will appreciate that, as all services usually offer this.
@@ -425,7 +449,7 @@ fi
mysql_datadir=%{mysqldatadir}
# Create data directory if needed
-if test ! -d $mysql_datadir; then mkdir -m755 $mysql_datadir; fi
+if test ! -d $mysql_datadir; then mkdir -m 755 $mysql_datadir; fi
if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi
if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi
@@ -442,18 +466,20 @@ fi
# Create a MySQL user and group. Do not report any problems if it already
# exists.
-groupadd -r %{mysqld_user} 2> /dev/null || true
-useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_user} %{mysqld_user} 2> /dev/null || true
+groupadd -r %{mysqld_group} 2> /dev/null || true
+useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
+# The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
+usermod -g %{mysqld_group} %{mysqld_user} 2> /dev/null || true
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
-chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir
+chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
# Initiate databases
%{_bindir}/mysql_install_db --rpm --user=%{mysqld_user}
# Change permissions again to fix any new files.
-chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir
+chown -R %{mysqld_user}:%{mysqld_group} $mysql_datadir
# Fix permissions for the permission database so that only the user
# can read them.
@@ -470,7 +496,7 @@ sleep 2
mysql_clusterdir=/var/lib/mysql-cluster
# Create cluster directory if needed
-if test ! -d $mysql_clusterdir; then mkdir -m755 $mysql_clusterdir; fi
+if test ! -d $mysql_clusterdir; then mkdir -m 755 $mysql_clusterdir; fi
%post Max
@@ -515,41 +541,48 @@ fi
%doc %attr(644, root, root) %{_infodir}/mysql.info*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
+%doc %attr(644, root, man) %{_mandir}/man1/myisamchk.1*
+%doc %attr(644, root, man) %{_mandir}/man1/myisamlog.1*
+%doc %attr(644, root, man) %{_mandir}/man1/myisampack.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld.1*
-%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_multi.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqld_safe.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_fix_privilege_tables.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqlhotcopy.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqlmanager.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql.server.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_zap.1*
%doc %attr(644, root, man) %{_mandir}/man1/perror.1*
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*
+%doc %attr(644, root, man) %{_mandir}/man1/safe_mysqld.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
%ghost %config(noreplace,missingok) %{_sysconfdir}/mysqlmanager.passwd
-%attr(755, root, root) %{_bindir}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisamchk
%attr(755, root, root) %{_bindir}/myisam_ftdump
%attr(755, root, root) %{_bindir}/myisamlog
%attr(755, root, root) %{_bindir}/myisampack
+%attr(755, root, root) %{_bindir}/my_print_defaults
+%attr(755, root, root) %{_bindir}/mysqlbug
%attr(755, root, root) %{_bindir}/mysql_convert_table_format
%attr(755, root, root) %{_bindir}/mysql_create_system_tables
+%attr(755, root, root) %{_bindir}/mysqld_multi
+%attr(755, root, root) %{_bindir}/mysqld_safe
%attr(755, root, root) %{_bindir}/mysql_explain_log
%attr(755, root, root) %{_bindir}/mysql_fix_extensions
%attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables
+%attr(755, root, root) %{_bindir}/mysqlhotcopy
%attr(755, root, root) %{_bindir}/mysql_install_db
%attr(755, root, root) %{_bindir}/mysql_secure_installation
%attr(755, root, root) %{_bindir}/mysql_setpermission
+%attr(755, root, root) %{_bindir}/mysqltest
%attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
%attr(755, root, root) %{_bindir}/mysql_zap
-%attr(755, root, root) %{_bindir}/mysqlbug
-%attr(755, root, root) %{_bindir}/mysqld_multi
-%attr(755, root, root) %{_bindir}/mysqld_safe
-%attr(755, root, root) %{_bindir}/mysqlhotcopy
-%attr(755, root, root) %{_bindir}/mysqltest
%attr(755, root, root) %{_bindir}/perror
%attr(755, root, root) %{_bindir}/replace
-%attr(755, root, root) %{_bindir}/resolve_stack_dump
%attr(755, root, root) %{_bindir}/resolveip
+%attr(755, root, root) %{_bindir}/resolve_stack_dump
%attr(755, root, root) %{_bindir}/safe_mysqld
%attr(755, root, root) %{_sbindir}/mysqld
@@ -577,10 +610,14 @@ fi
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
+%doc %attr(644, root, man) %{_mandir}/man1/msql2mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysql.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlaccess.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqladmin.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqlbinlog.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqlcheck.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqldump.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysqlimport.1*
%doc %attr(644, root, man) %{_mandir}/man1/mysqlshow.1*
%post shared
@@ -618,6 +655,7 @@ fi
%files devel
%defattr(-, root, root, 0755)
%doc EXCEPTIONS-CLIENT
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_config.1*
%attr(755, root, root) %{_bindir}/comp_err
%attr(755, root, root) %{_bindir}/mysql_config
%dir %attr(755, root, root) %{_includedir}/mysql
@@ -661,12 +699,53 @@ fi
%files embedded
%defattr(-, root, root, 0755)
-%attr(644, root, root) %{_libdir}/mysql/libmysqld.a
+# %attr(644, root, root) %{_libdir}/mysql/libmysqld.a
# The spec file changelog only includes changes made to the spec file
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog
+* Thu Oct 27 2005 Lenz Grimmer <lenz@grimmer.com>
+
+- added more man pages
+
+* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
+
+- Made yaSSL support an option (off by default)
+
+* Wed Oct 19 2005 Kent Boortz <kent@mysql.com>
+
+- Enabled yaSSL support
+
+* Sat Oct 15 2005 Kent Boortz <kent@mysql.com>
+
+- Give mode arguments the same way in all places
+- Moved copy of mysqld.a to "standard" build, but
+ disabled it as we don't do embedded yet in 5.0
+
+* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
+
+- For 5.x, always compile with --with-big-tables
+- Copy the config.log file to location outside
+ the build tree
+
+* Fri Oct 14 2005 Kent Boortz <kent@mysql.com>
+
+- Removed unneeded/obsolete configure options
+- Added archive engine to standard server
+- Removed the embedded server from experimental server
+- Changed suffix "-Max" => "-max"
+- Changed comment string "Max" => "Experimental"
+
+* Thu Oct 13 2005 Lenz Grimmer <lenz@mysql.com>
+
+- added a usermod call to assign a potential existing mysql user to the
+ correct user group (BUG#12823)
+- Save the perror binary built during Max build so it supports the NDB
+ error codes (BUG#13740)
+- added a separate macro "mysqld_group" to be able to define the
+ user group of the mysql user seperately, if desired.
+
* Thu Sep 29 2005 Lenz Grimmer <lenz@mysql.com>
- fixed the removing of the RPM_BUILD_ROOT in the %clean section (the
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 65a4617445c..949c3d5bf1c 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -59,6 +59,8 @@ static my_bool have_innodb= FALSE;
static const char *opt_basedir= "./";
+static longlong opt_getopt_ll_test= 0;
+
static int embedded_server_arg_count= 0;
static char *embedded_server_args[MAX_SERVER_ARGS];
@@ -14317,6 +14319,7 @@ static void test_bug12243()
mysql_autocommit(mysql, TRUE); /* restore default */
}
+
/*
Bug#11718: query with function, join and order by returns wrong type
*/
@@ -14351,6 +14354,71 @@ static void test_bug11718()
rc= mysql_query(mysql, "drop table t1, t2");
myquery(rc);
}
+
+
+/*
+ Bug #12925: Bad handling of maximum values in getopt
+*/
+static void test_bug12925()
+{
+ myheader("test_bug12925");
+ if (opt_getopt_ll_test)
+ DIE_UNLESS(opt_getopt_ll_test == LL(25600*1024*1024));
+}
+
+
+/*
+ Bug#14210 "Simple query with > operator on large table gives server
+ crash"
+*/
+
+static void test_bug14210()
+{
+ MYSQL_STMT *stmt;
+ int rc, i;
+ const char *stmt_text;
+ ulong type;
+
+ myheader("test_bug14210");
+
+ mysql_query(mysql, "drop table if exists t1");
+ /*
+ To trigger the problem the table must be InnoDB, although the problem
+ itself is not InnoDB related. In case the table is MyISAM this test
+ is harmless.
+ */
+ mysql_query(mysql, "create table t1 (a varchar(255)) type=InnoDB");
+ rc= mysql_query(mysql, "insert into t1 (a) values (repeat('a', 256))");
+ myquery(rc);
+ rc= mysql_query(mysql, "set @@session.max_heap_table_size=16384");
+ /* Create a big enough table (more than max_heap_table_size) */
+ for (i= 0; i < 8; i++)
+ {
+ rc= mysql_query(mysql, "insert into t1 (a) select a from t1");
+ myquery(rc);
+ }
+ /* create statement */
+ stmt= mysql_stmt_init(mysql);
+ type= (ulong) CURSOR_TYPE_READ_ONLY;
+ mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*) &type);
+
+ stmt_text= "select a from t1";
+
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+ rc= mysql_stmt_execute(stmt);
+ while ((rc= mysql_stmt_fetch(stmt)) == 0)
+ ;
+ DIE_UNLESS(rc == MYSQL_NO_DATA);
+
+ rc= mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "drop table t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "set @@session.max_heap_table_size=default");
+ myquery(rc);
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -14393,6 +14461,9 @@ static struct my_option client_test_long_options[] =
{"user", 'u', "User for login if not current user", (char **) &opt_user,
(char **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
+ {"getopt-ll-test", 'g', "Option for testing bug in getopt library",
+ (char **) &opt_getopt_ll_test, (char **) &opt_getopt_ll_test, 0,
+ GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -14598,10 +14669,12 @@ static struct my_tests_st my_tests[]= {
{ "test_bug10760", test_bug10760 },
{ "test_bug12001", test_bug12001 },
{ "test_bug11718", test_bug11718 },
+ { "test_bug12925", test_bug12925 },
{ "test_bug11909", test_bug11909 },
{ "test_bug11901", test_bug11901 },
{ "test_bug11904", test_bug11904 },
{ "test_bug12243", test_bug12243 },
+ { "test_bug14210", test_bug14210 },
{ 0, 0 }
};
diff --git a/vio/Makefile.am b/vio/Makefile.am
index 0d4f052b30a..544639139de 100644
--- a/vio/Makefile.am
+++ b/vio/Makefile.am
@@ -20,23 +20,23 @@ else
yassl_dummy_link_fix=
endif
INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
- $(openssl_includes)
-LDADD= @CLIENT_EXTRA_LDFLAGS@ $(openssl_libs)
+ $(openssl_includes) $(yassl_includes)
+LDADD= @CLIENT_EXTRA_LDFLAGS@ $(openssl_libs) $(yassl_libs)
pkglib_LIBRARIES= libvio.a
noinst_PROGRAMS = test-ssl test-sslserver test-sslclient
noinst_HEADERS= vio_priv.h
test_ssl_SOURCES= test-ssl.c $(yassl_dummy_link_fix)
test_ssl_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \
- $(openssl_libs)
+ $(openssl_libs) $(yassl_libs)
test_sslserver_SOURCES= test-sslserver.c $(yassl_dummy_link_fix)
test_sslserver_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \
- $(openssl_libs)
+ $(openssl_libs) $(yassl_libs)
test_sslclient_SOURCES= test-sslclient.c $(yassl_dummy_link_fix)
test_sslclient_LDADD= @CLIENT_EXTRA_LDFLAGS@ ../dbug/libdbug.a libvio.a \
../mysys/libmysys.a ../strings/libmystrings.a \
- $(openssl_libs)
+ $(openssl_libs) $(yassl_libs)
libvio_a_SOURCES= vio.c viosocket.c viossl.c viosslfactories.c
# Don't update the files from bitkeeper
diff --git a/vio/vio.c b/vio/vio.c
index e444c634c96..ff93cff959f 100644
--- a/vio/vio.c
+++ b/vio/vio.c
@@ -149,10 +149,18 @@ Vio *vio_new(my_socket sd, enum enum_vio_type type, uint flags)
vio->sd);
#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
#if !defined(NO_FCNTL_NONBLOCK)
-#if defined(__FreeBSD__)
- fcntl(sd, F_SETFL, vio->fcntl_mode); /* Yahoo! FreeBSD patch */
-#endif
- vio->fcntl_mode = fcntl(sd, F_GETFL);
+ /*
+ We call fcntl() to set the flags and then immediately read them back
+ to make sure that we and the system are in agreement on the state of
+ things.
+
+ An example of why we need to do this is FreeBSD (and apparently some
+ other BSD-derived systems, like Mac OS X), where the system sometimes
+ reports that the socket is set for non-blocking when it really will
+ block.
+ */
+ fcntl(sd, F_SETFL, 0);
+ vio->fcntl_mode= fcntl(sd, F_GETFL);
#elif defined(HAVE_SYS_IOCTL_H) /* hpux */
/* Non blocking sockets doesn't work good on HPUX 11.0 */
(void) ioctl(sd,FIOSNBIO,0);
diff --git a/vio/viosocket.c b/vio/viosocket.c
index ea45d7ce5a7..5e0ed20b039 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -138,7 +138,14 @@ int vio_blocking(Vio * vio __attribute__((unused)), my_bool set_blocking_mode,
else
vio->fcntl_mode |= O_NONBLOCK; /* set bit */
if (old_fcntl != vio->fcntl_mode)
- r = fcntl(vio->sd, F_SETFL, vio->fcntl_mode);
+ {
+ r= fcntl(vio->sd, F_SETFL, vio->fcntl_mode);
+ if (r == -1)
+ {
+ DBUG_PRINT("info", ("fcntl failed, errno %d", errno));
+ vio->fcntl_mode= old_fcntl;
+ }
+ }
}
#else
r= set_blocking_mode ? 0 : 1;