diff options
-rw-r--r-- | .bzrignore | 267 | ||||
-rwxr-xr-x | BUILD/compile-pentium-max | 2 | ||||
-rw-r--r-- | BitKeeper/etc/logging_ok | 5 | ||||
-rwxr-xr-x | Build-tools/Do-compile | 23 | ||||
-rwxr-xr-x | Build-tools/mysql-copyright | 79 | ||||
-rwxr-xr-x | Build-tools/mysql-copyright-2 | 1 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl | 72 | ||||
-rwxr-xr-x | VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl | 72 | ||||
-rwxr-xr-x | VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl | 72 | ||||
-rw-r--r-- | VC++Files/examples/udf_example/udf_example.def | 19 | ||||
-rw-r--r-- | VC++Files/winmysqladmin/main.cpp | 2 | ||||
-rw-r--r-- | VC++Files/winmysqladmin/mysql.h | 4 | ||||
-rw-r--r-- | VC++Files/winmysqladmin/mysql_com.h | 26 | ||||
-rw-r--r-- | acconfig.h | 10 | ||||
-rw-r--r-- | acinclude.m4 | 50 | ||||
-rw-r--r-- | client/mysqladmin.c | 2 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 1 | ||||
-rw-r--r-- | client/mysqldump.c | 11 | ||||
-rw-r--r-- | client/mysqltest.c | 54 | ||||
-rw-r--r-- | configure.in | 85 | ||||
-rw-r--r-- | extra/Makefile.am | 3 | ||||
-rw-r--r-- | extra/perror.c | 2 | ||||
-rw-r--r-- | heap/hp_hash.c | 1 | ||||
-rw-r--r-- | include/m_ctype.h | 11 | ||||
-rw-r--r-- | include/m_string.h | 1 | ||||
-rw-r--r-- | include/my_dbug.h | 4 | ||||
-rw-r--r-- | include/my_global.h | 18 | ||||
-rw-r--r-- | include/mysql.h | 7 | ||||
-rw-r--r-- | include/mysql_com.h | 26 | ||||
-rw-r--r-- | include/mysqld_error.h | 4 | ||||
-rw-r--r-- | include/sql_state.h | 6 | ||||
-rw-r--r-- | include/violite.h | 8 | ||||
-rw-r--r-- | innobase/btr/btr0btr.c | 2 | ||||
-rw-r--r-- | innobase/buf/buf0buf.c | 14 | ||||
-rw-r--r-- | innobase/buf/buf0flu.c | 10 | ||||
-rw-r--r-- | innobase/buf/buf0lru.c | 4 | ||||
-rw-r--r-- | innobase/buf/buf0rea.c | 8 | ||||
-rw-r--r-- | innobase/data/data0type.c | 2 | ||||
-rw-r--r-- | innobase/dict/dict0dict.c | 6 | ||||
-rw-r--r-- | innobase/dict/dict0mem.c | 6 | ||||
-rw-r--r-- | innobase/fil/fil0fil.c | 15 | ||||
-rw-r--r-- | innobase/fsp/fsp0fsp.c | 6 | ||||
-rw-r--r-- | innobase/fut/fut0lst.c | 2 | ||||
-rw-r--r-- | innobase/ha/hash0hash.c | 38 | ||||
-rw-r--r-- | innobase/ibuf/ibuf0ibuf.c | 9 | ||||
-rw-r--r-- | innobase/include/Makefile.am | 2 | ||||
-rw-r--r-- | innobase/include/btr0btr.h | 2 | ||||
-rw-r--r-- | innobase/include/buf0buf.h | 10 | ||||
-rw-r--r-- | innobase/include/buf0buf.ic | 4 | ||||
-rw-r--r-- | innobase/include/buf0flu.h | 2 | ||||
-rw-r--r-- | innobase/include/buf0lru.h | 2 | ||||
-rw-r--r-- | innobase/include/data0data.h | 6 | ||||
-rw-r--r-- | innobase/include/data0type.h | 3 | ||||
-rw-r--r-- | innobase/include/dict0dict.h | 14 | ||||
-rw-r--r-- | innobase/include/dict0mem.h | 17 | ||||
-rw-r--r-- | innobase/include/fsp0fsp.h | 2 | ||||
-rw-r--r-- | innobase/include/fut0lst.h | 3 | ||||
-rw-r--r-- | innobase/include/hash0hash.h | 20 | ||||
-rw-r--r-- | innobase/include/hash0hash.ic | 8 | ||||
-rw-r--r-- | innobase/include/lock0lock.h | 6 | ||||
-rw-r--r-- | innobase/include/log0log.h | 4 | ||||
-rw-r--r-- | innobase/include/log0log.ic | 2 | ||||
-rw-r--r-- | innobase/include/mem0dbg.h | 17 | ||||
-rw-r--r-- | innobase/include/mem0dbg.ic | 3 | ||||
-rw-r--r-- | innobase/include/mem0mem.h | 12 | ||||
-rw-r--r-- | innobase/include/mem0mem.ic | 18 | ||||
-rw-r--r-- | innobase/include/mem0pool.h | 3 | ||||
-rw-r--r-- | innobase/include/mtr0mtr.h | 16 | ||||
-rw-r--r-- | innobase/include/pars0opt.h | 2 | ||||
-rw-r--r-- | innobase/include/que0que.h | 38 | ||||
-rw-r--r-- | innobase/include/que0que.ic | 18 | ||||
-rw-r--r-- | innobase/include/row0ins.h | 5 | ||||
-rw-r--r-- | innobase/include/row0upd.h | 5 | ||||
-rw-r--r-- | innobase/include/srv0que.h | 53 | ||||
-rw-r--r-- | innobase/include/sync0rw.h | 2 | ||||
-rw-r--r-- | innobase/include/sync0sync.h | 2 | ||||
-rw-r--r-- | innobase/include/trx0roll.h | 21 | ||||
-rw-r--r-- | innobase/include/trx0trx.h | 31 | ||||
-rw-r--r-- | innobase/include/usr0sess.h | 6 | ||||
-rw-r--r-- | innobase/include/ut0mem.h | 31 | ||||
-rw-r--r-- | innobase/lock/lock0lock.c | 14 | ||||
-rw-r--r-- | innobase/log/log0log.c | 34 | ||||
-rw-r--r-- | innobase/log/log0recv.c | 26 | ||||
-rw-r--r-- | innobase/mem/mem0dbg.c | 127 | ||||
-rw-r--r-- | innobase/mem/mem0pool.c | 2 | ||||
-rw-r--r-- | innobase/mtr/mtr0mtr.c | 2 | ||||
-rw-r--r-- | innobase/os/os0file.c | 2 | ||||
-rw-r--r-- | innobase/pars/lexyy.c | 18 | ||||
-rw-r--r-- | innobase/pars/pars0lex.l | 18 | ||||
-rw-r--r-- | innobase/pars/pars0opt.c | 2 | ||||
-rw-r--r-- | innobase/que/que0que.c | 115 | ||||
-rw-r--r-- | innobase/rem/rem0cmp.c | 8 | ||||
-rw-r--r-- | innobase/row/row0ins.c | 44 | ||||
-rw-r--r-- | innobase/row/row0mysql.c | 50 | ||||
-rw-r--r-- | innobase/row/row0upd.c | 6 | ||||
-rw-r--r-- | innobase/srv/Makefile.am | 2 | ||||
-rw-r--r-- | innobase/srv/srv0que.c | 113 | ||||
-rw-r--r-- | innobase/srv/srv0srv.c | 1 | ||||
-rw-r--r-- | innobase/srv/srv0start.c | 2 | ||||
-rw-r--r-- | innobase/sync/sync0rw.c | 2 | ||||
-rw-r--r-- | innobase/sync/sync0sync.c | 10 | ||||
-rw-r--r-- | innobase/thr/thr0loc.c | 10 | ||||
-rw-r--r-- | innobase/trx/trx0purge.c | 3 | ||||
-rw-r--r-- | innobase/trx/trx0roll.c | 79 | ||||
-rw-r--r-- | innobase/trx/trx0sys.c | 2 | ||||
-rw-r--r-- | innobase/trx/trx0trx.c | 165 | ||||
-rw-r--r-- | innobase/usr/usr0sess.c | 2 | ||||
-rw-r--r-- | innobase/ut/ut0mem.c | 75 | ||||
-rw-r--r-- | libmysql/libmysql.c | 823 | ||||
-rw-r--r-- | libmysql/libmysql.def | 1 | ||||
-rw-r--r-- | libmysqld/Makefile.am | 2 | ||||
-rw-r--r-- | libmysqld/lib_sql.cc | 13 | ||||
-rw-r--r-- | myisam/ft_boolean_search.c | 9 | ||||
-rw-r--r-- | myisam/ftdefs.h | 1 | ||||
-rw-r--r-- | myisam/mi_check.c | 2 | ||||
-rw-r--r-- | myisam/mi_delete.c | 1 | ||||
-rw-r--r-- | myisam/mi_dynrec.c | 1 | ||||
-rw-r--r-- | myisam/mi_key.c | 1 | ||||
-rw-r--r-- | myisam/mi_open.c | 1 | ||||
-rw-r--r-- | myisam/mi_search.c | 1 | ||||
-rw-r--r-- | myisam/mi_unique.c | 10 | ||||
-rw-r--r-- | myisam/mi_write.c | 1 | ||||
-rw-r--r-- | myisam/myisamchk.c | 8 | ||||
-rw-r--r-- | mysql-test/Makefile.am | 1 | ||||
-rw-r--r-- | mysql-test/include/have_archive.inc | 4 | ||||
-rw-r--r-- | mysql-test/mysql-test-run.sh | 6 | ||||
-rw-r--r-- | mysql-test/ndb/Makefile.am | 4 | ||||
-rw-r--r-- | mysql-test/ndb/ndb_config_2_node.ini | 67 | ||||
-rw-r--r--[-rwxr-xr-x] | mysql-test/ndb/ndbcluster.sh | 44 | ||||
-rw-r--r-- | mysql-test/r/alter_table.result | 4 | ||||
-rw-r--r-- | mysql-test/r/archive.result | 1396 | ||||
-rw-r--r-- | mysql-test/r/auto_increment.result | 7 | ||||
-rw-r--r-- | mysql-test/r/bdb-deadlock.result | 2 | ||||
-rw-r--r-- | mysql-test/r/connect.result | 15 | ||||
-rw-r--r-- | mysql-test/r/create.result | 12 | ||||
-rw-r--r-- | mysql-test/r/ctype_uca.result | 1657 | ||||
-rw-r--r-- | mysql-test/r/ctype_ucs.result | 9 | ||||
-rw-r--r-- | mysql-test/r/ctype_ujis.result | 15 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf8.result | 22 | ||||
-rw-r--r-- | mysql-test/r/date_formats.result | 16 | ||||
-rw-r--r-- | mysql-test/r/delete.result | 10 | ||||
-rw-r--r-- | mysql-test/r/derived.result | 10 | ||||
-rw-r--r-- | mysql-test/r/fulltext.result | 4 | ||||
-rw-r--r-- | mysql-test/r/func_compress.result | 2 | ||||
-rw-r--r-- | mysql-test/r/func_gconcat.result | 19 | ||||
-rw-r--r-- | mysql-test/r/func_group.result | 28 | ||||
-rw-r--r-- | mysql-test/r/func_if.result | 6 | ||||
-rw-r--r-- | mysql-test/r/func_like.result | 6 | ||||
-rw-r--r-- | mysql-test/r/func_regexp.result | 17 | ||||
-rw-r--r-- | mysql-test/r/func_sapdb.result | 6 | ||||
-rw-r--r-- | mysql-test/r/func_str.result | 9 | ||||
-rw-r--r-- | mysql-test/r/func_time.result | 10 | ||||
-rw-r--r-- | mysql-test/r/grant.result | 2 | ||||
-rw-r--r-- | mysql-test/r/grant2.result | 2 | ||||
-rw-r--r-- | mysql-test/r/grant_cache.result | 12 | ||||
-rw-r--r-- | mysql-test/r/handler.result | 8 | ||||
-rw-r--r-- | mysql-test/r/have_archive.require | 2 | ||||
-rw-r--r-- | mysql-test/r/innodb_handler.result | 4 | ||||
-rw-r--r-- | mysql-test/r/insert.result | 88 | ||||
-rw-r--r-- | mysql-test/r/insert_select.result | 4 | ||||
-rw-r--r-- | mysql-test/r/isam.result | 2 | ||||
-rw-r--r-- | mysql-test/r/join.result | 2 | ||||
-rw-r--r-- | mysql-test/r/join_outer.result | 8 | ||||
-rw-r--r-- | mysql-test/r/key.result | 4 | ||||
-rw-r--r-- | mysql-test/r/key_cache.result | 4 | ||||
-rw-r--r-- | mysql-test/r/loaddata.result | 4 | ||||
-rw-r--r-- | mysql-test/r/multi_update.result | 2 | ||||
-rw-r--r-- | mysql-test/r/mysqlbinlog.result | 6 | ||||
-rw-r--r-- | mysql-test/r/mysqldump.result | 35 | ||||
-rw-r--r-- | mysql-test/r/ndb_replace.result | 2 | ||||
-rw-r--r-- | mysql-test/r/null.result | 18 | ||||
-rw-r--r-- | mysql-test/r/null_key.result | 2 | ||||
-rw-r--r-- | mysql-test/r/openssl_1.result | 8 | ||||
-rw-r--r-- | mysql-test/r/packet.result | 2 | ||||
-rw-r--r-- | mysql-test/r/ps.result | 139 | ||||
-rw-r--r-- | mysql-test/r/query_cache.result | 8 | ||||
-rw-r--r-- | mysql-test/r/range.result | 21 | ||||
-rw-r--r-- | mysql-test/r/rpl_charset.result | 110 | ||||
-rw-r--r-- | mysql-test/r/rpl_delete_all.result | 31 | ||||
-rw-r--r-- | mysql-test/r/rpl_flush_log_loop.result | 2 | ||||
-rw-r--r-- | mysql-test/r/rpl_free_items.result | 10 | ||||
-rw-r--r-- | mysql-test/r/rpl_get_lock.result | 6 | ||||
-rw-r--r-- | mysql-test/r/rpl_ps.result | 28 | ||||
-rw-r--r-- | mysql-test/r/rpl_replicate_do.result | 2 | ||||
-rw-r--r-- | mysql-test/r/rpl_rotate_logs.result | 6 | ||||
-rw-r--r-- | mysql-test/r/rpl_temporary.result | 27 | ||||
-rw-r--r-- | mysql-test/r/rpl_timezone.result | 77 | ||||
-rw-r--r-- | mysql-test/r/rpl_until.result | 10 | ||||
-rw-r--r-- | mysql-test/r/rpl_user_variables.result | 12 | ||||
-rw-r--r-- | mysql-test/r/select.result | 9 | ||||
-rw-r--r-- | mysql-test/r/select_safe.result | 6 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 16 | ||||
-rw-r--r-- | mysql-test/r/subselect.result | 116 | ||||
-rw-r--r-- | mysql-test/r/system_mysql_db.result | 5 | ||||
-rw-r--r-- | mysql-test/r/timezone.result | 11 | ||||
-rw-r--r-- | mysql-test/r/timezone2.result | 246 | ||||
-rw-r--r-- | mysql-test/r/type_blob.result | 2 | ||||
-rw-r--r-- | mysql-test/r/type_date.result | 6 | ||||
-rw-r--r-- | mysql-test/r/type_datetime.result | 70 | ||||
-rw-r--r-- | mysql-test/r/type_decimal.result | 107 | ||||
-rw-r--r-- | mysql-test/r/type_float.result | 4 | ||||
-rw-r--r-- | mysql-test/r/type_ranges.result | 38 | ||||
-rw-r--r-- | mysql-test/r/type_time.result | 10 | ||||
-rw-r--r-- | mysql-test/r/type_timestamp.result | 80 | ||||
-rw-r--r-- | mysql-test/r/type_uint.result | 2 | ||||
-rw-r--r-- | mysql-test/r/union.result | 29 | ||||
-rw-r--r-- | mysql-test/r/user_var.result | 12 | ||||
-rw-r--r-- | mysql-test/r/varbinary.result | 2 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 12 | ||||
-rw-r--r-- | mysql-test/r/warnings.result | 24 | ||||
-rw-r--r-- | mysql-test/t/archive.test | 1300 | ||||
-rw-r--r-- | mysql-test/t/auto_increment.test | 1 | ||||
-rw-r--r-- | mysql-test/t/ctype_uca.test | 181 | ||||
-rw-r--r-- | mysql-test/t/ctype_ucs.test | 10 | ||||
-rw-r--r-- | mysql-test/t/ctype_ujis.test | 10 | ||||
-rw-r--r-- | mysql-test/t/ctype_utf8.test | 16 | ||||
-rw-r--r-- | mysql-test/t/delete.test | 11 | ||||
-rw-r--r-- | mysql-test/t/func_gconcat.test | 14 | ||||
-rw-r--r-- | mysql-test/t/func_group.test | 22 | ||||
-rw-r--r-- | mysql-test/t/func_if.test | 9 | ||||
-rw-r--r-- | mysql-test/t/func_like.test | 13 | ||||
-rw-r--r-- | mysql-test/t/func_regexp.test | 13 | ||||
-rw-r--r-- | mysql-test/t/func_str.test | 4 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 2 | ||||
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 7 | ||||
-rw-r--r-- | mysql-test/t/ps.test | 142 | ||||
-rw-r--r-- | mysql-test/t/range.test | 27 | ||||
-rw-r--r-- | mysql-test/t/rpl_delete_all.test | 40 | ||||
-rw-r--r-- | mysql-test/t/rpl_free_items-slave.opt | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl_free_items.test | 20 | ||||
-rw-r--r-- | mysql-test/t/rpl_get_lock.test | 2 | ||||
-rw-r--r-- | mysql-test/t/rpl_ps.test | 43 | ||||
-rw-r--r-- | mysql-test/t/rpl_timezone-master.opt | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl_timezone-slave.opt | 1 | ||||
-rw-r--r-- | mysql-test/t/rpl_timezone.test | 84 | ||||
-rw-r--r-- | mysql-test/t/select.test | 4 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 54 | ||||
-rw-r--r-- | mysql-test/t/timezone.test | 15 | ||||
-rw-r--r-- | mysql-test/t/timezone2.test | 189 | ||||
-rw-r--r-- | mysql-test/t/type_date.test | 9 | ||||
-rw-r--r-- | mysql-test/t/type_datetime.test | 19 | ||||
-rw-r--r-- | mysql-test/t/type_decimal.test | 3 | ||||
-rw-r--r-- | mysql-test/t/type_timestamp.test | 19 | ||||
-rw-r--r-- | mysql-test/t/union.test | 8 | ||||
-rw-r--r-- | mysys/charset-def.c | 65 | ||||
-rw-r--r-- | mysys/charset.c | 654 | ||||
-rw-r--r-- | mysys/mf_iocache.c | 1 | ||||
-rw-r--r-- | mysys/mf_iocache2.c | 1 | ||||
-rw-r--r-- | mysys/mf_keycache.c | 1 | ||||
-rw-r--r-- | mysys/mf_tempfile.c | 2 | ||||
-rw-r--r-- | mysys/my_bitmap.c | 1 | ||||
-rw-r--r-- | mysys/my_error.c | 70 | ||||
-rw-r--r-- | mysys/my_gethostbyname.c | 1 | ||||
-rw-r--r-- | mysys/my_getopt.c | 1 | ||||
-rw-r--r-- | mysys/my_pthread.c | 1 | ||||
-rw-r--r-- | mysys/my_seek.c | 1 | ||||
-rw-r--r-- | mysys/rijndael.c | 1 | ||||
-rw-r--r-- | mysys/thr_alarm.c | 1 | ||||
-rw-r--r-- | ndb/Makefile.am | 3 | ||||
-rwxr-xr-x | ndb/bin/mysqlcluster | 11 | ||||
-rwxr-xr-x | ndb/bin/mysqlcluster_install_db | 119 | ||||
-rwxr-xr-x | ndb/bin/mysqlclusterd | 34 | ||||
-rw-r--r-- | ndb/config/common.mk.am | 3 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.DEBUG.mk | 4 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.HPUX.HPPA.GCC.mk | 50 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.IBMAIX.POWERPC.GCC.mk | 49 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.LINUX.x86.GCC.mk | 60 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.LINUX.x86.ICC.mk | 54 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.LINUX.x86_64.GCC.mk | 54 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.MACOSX.POWERPC.GCC.mk | 58 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.OSE.PPC750.DIAB.mk | 47 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.RELEASE.mk | 3 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.RELEASE_TRACE.mk | 3 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.SIMCELLO.SOFTOSE.GCC.mk | 53 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.SOFTOSE.SPARC.GCC.mk | 57 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.SOLARIS.SPARC.FORTE6.mk | 54 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.SOLARIS.SPARC.GCC.mk | 54 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.SOLARIS.SPARC_64.GCC.mk | 53 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.SOLARIS6.SPARC.GCC.mk | 53 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.TRU64X.ALPHA.GCC.mk | 49 | ||||
-rw-r--r-- | ndb/config/old_files/Defs.WIN32.x86.VC7.mk | 61 | ||||
-rwxr-xr-x | ndb/config/old_files/GuessConfig.sh | 116 | ||||
-rw-r--r-- | ndb/config/old_files/Makefile.am | 31 | ||||
-rw-r--r-- | ndb/config/old_files/acinclude.m4 | 1513 | ||||
-rw-r--r-- | ndb/config/old_files/config.h.in | 993 | ||||
-rw-r--r-- | ndb/config/old_files/configure.in | 2085 | ||||
-rw-r--r-- | ndb/config/type_ndbapitest.mk.am | 4 | ||||
-rw-r--r-- | ndb/config/type_ndbapitools.mk.am | 3 | ||||
-rw-r--r-- | ndb/docs/Makefile | 97 | ||||
-rw-r--r-- | ndb/docs/Makefile.am | 102 | ||||
-rwxr-xr-x | ndb/docs/doxygen/postdoxy.pl | 1 | ||||
-rwxr-xr-x | ndb/docs/doxygen/predoxy.pl | 1 | ||||
-rw-r--r-- | ndb/include/Makefile.am | 3 | ||||
-rw-r--r-- | ndb/include/kernel/ndb_limits.h | 5 | ||||
-rw-r--r-- | ndb/include/kernel/signaldata/DictTabInfo.hpp | 11 | ||||
-rw-r--r-- | ndb/include/kernel/signaldata/TcKeyConf.hpp | 2 | ||||
-rw-r--r-- | ndb/include/kernel/signaldata/TupAccess.hpp | 2 | ||||
-rw-r--r-- | ndb/include/kernel/signaldata/TupFrag.hpp | 5 | ||||
-rw-r--r-- | ndb/include/kernel/signaldata/TuxMaint.hpp | 9 | ||||
-rw-r--r-- | ndb/include/mgmapi/mgmapi_config_parameters.h | 2 | ||||
-rw-r--r-- | ndb/include/ndb_global.h | 8 | ||||
-rw-r--r-- | ndb/include/ndb_types.h | 2 | ||||
-rw-r--r-- | ndb/include/ndb_version.h | 10 | ||||
-rw-r--r-- | ndb/include/ndbapi/Ndb.hpp | 6 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbApi.hpp | 1 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbBlob.hpp | 293 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbConnection.hpp | 14 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbDictionary.hpp | 36 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbOperation.hpp | 27 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbRecAttr.hpp | 7 | ||||
-rw-r--r-- | ndb/include/ndbapi/NdbScanOperation.hpp | 6 | ||||
-rw-r--r-- | ndb/include/util/BaseString.hpp | 4 | ||||
-rw-r--r-- | ndb/include/util/NdbSqlUtil.hpp | 36 | ||||
-rw-r--r-- | ndb/include/util/Parser.hpp | 1 | ||||
-rw-r--r-- | ndb/old_files/BinDist.sh | 120 | ||||
-rw-r--r-- | ndb/old_files/Defs.mk | 64 | ||||
-rw-r--r-- | ndb/old_files/Epilogue.mk | 878 | ||||
-rw-r--r-- | ndb/old_files/Makefile | 69 | ||||
-rw-r--r-- | ndb/old_files/README | 7 | ||||
-rw-r--r-- | ndb/old_files/SrcDist.sh | 87 | ||||
-rwxr-xr-x | ndb/old_files/configure | 33 | ||||
-rw-r--r-- | ndb/old_files/env.sh | 8 | ||||
-rw-r--r-- | ndb/old_files/mysqlclusterenv.sh | 51 | ||||
-rw-r--r-- | ndb/src/Makefile.am | 18 | ||||
-rw-r--r-- | ndb/src/common/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/src/common/debugger/signaldata/BackupImpl.cpp | 2 | ||||
-rw-r--r-- | ndb/src/common/debugger/signaldata/CreateTrig.cpp | 2 | ||||
-rw-r--r-- | ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp | 6 | ||||
-rw-r--r-- | ndb/src/common/debugger/signaldata/TuxMaint.cpp | 8 | ||||
-rw-r--r-- | ndb/src/common/mgmcommon/ConfigInfo.cpp | 138 | ||||
-rw-r--r-- | ndb/src/common/mgmcommon/ConfigInfo.hpp | 16 | ||||
-rw-r--r-- | ndb/src/common/mgmcommon/InitConfigFileParser.cpp | 38 | ||||
-rw-r--r-- | ndb/src/common/portlib/Makefile.am | 19 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbCondition.c (renamed from ndb/src/common/portlib/unix/NdbCondition.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbDaemon.c (renamed from ndb/src/common/portlib/unix/NdbDaemon.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbEnv.c (renamed from ndb/src/common/portlib/unix/NdbEnv.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbHost.c (renamed from ndb/src/common/portlib/unix/NdbHost.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbMem.c (renamed from ndb/src/common/portlib/unix/NdbMem.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbMutex.c (renamed from ndb/src/common/portlib/unix/NdbMutex.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbPortLibTest.cpp (renamed from ndb/src/common/portlib/test/NdbPortLibTest.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbSleep.c (renamed from ndb/src/common/portlib/unix/NdbSleep.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbTCP.c (renamed from ndb/src/common/portlib/unix/NdbTCP.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbThread.c (renamed from ndb/src/common/portlib/unix/NdbThread.c) | 2 | ||||
-rw-r--r-- | ndb/src/common/portlib/NdbTick.c (renamed from ndb/src/common/portlib/unix/NdbTick.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/memtest.c (renamed from ndb/src/common/portlib/memtest/memtest.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/mmslist.cpp (renamed from ndb/src/common/portlib/mmstest/mmslist.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/mmstest.cpp (renamed from ndb/src/common/portlib/mmstest/mmstest.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/munmaptest.cpp (renamed from ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/memtest/Makefile (renamed from ndb/src/common/portlib/memtest/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile (renamed from ndb/src/common/portlib/memtest/munmaptest/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/Makefile (renamed from ndb/src/common/portlib/ose/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbCondition.c (renamed from ndb/src/common/portlib/ose/NdbCondition.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h (renamed from ndb/src/common/portlib/ose/NdbConditionOSE.h) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbEnv.c (renamed from ndb/src/common/portlib/ose/NdbEnv.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbHost.c (renamed from ndb/src/common/portlib/ose/NdbHost.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbMem.c (renamed from ndb/src/common/portlib/ose/NdbMem.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp (renamed from ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbMutex.c (renamed from ndb/src/common/portlib/ose/NdbMutex.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp (renamed from ndb/src/common/portlib/ose/NdbOut.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbSleep.c (renamed from ndb/src/common/portlib/ose/NdbSleep.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbTCP.c (renamed from ndb/src/common/portlib/ose/NdbTCP.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbThread.c (renamed from ndb/src/common/portlib/ose/NdbThread.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/ose/NdbTick.c (renamed from ndb/src/common/portlib/ose/NdbTick.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/test/Makefile (renamed from ndb/src/common/portlib/test/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/unix/Makefile_old (renamed from ndb/src/common/portlib/unix/Makefile_old) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/Makefile (renamed from ndb/src/common/portlib/win32/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbCondition.c (renamed from ndb/src/common/portlib/win32/NdbCondition.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c (renamed from ndb/src/common/portlib/win32/NdbDaemon.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbEnv.c (renamed from ndb/src/common/portlib/win32/NdbEnv.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbHost.c (renamed from ndb/src/common/portlib/win32/NdbHost.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbMem.c (renamed from ndb/src/common/portlib/win32/NdbMem.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbMutex.c (renamed from ndb/src/common/portlib/win32/NdbMutex.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbSleep.c (renamed from ndb/src/common/portlib/win32/NdbSleep.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbTCP.c (renamed from ndb/src/common/portlib/win32/NdbTCP.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbThread.c (renamed from ndb/src/common/portlib/win32/NdbThread.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/old_dirs/win32/NdbTick.c (renamed from ndb/src/common/portlib/win32/NdbTick.c) | 0 | ||||
-rw-r--r-- | ndb/src/common/portlib/unix/Makefile.am | 13 | ||||
-rw-r--r-- | ndb/src/common/util/ConfigValues.cpp | 4 | ||||
-rw-r--r-- | ndb/src/common/util/NdbSqlUtil.cpp | 20 | ||||
-rw-r--r-- | ndb/src/cw/cpcd/Makefile.am | 4 | ||||
-rw-r--r-- | ndb/src/kernel/Makefile.am | 16 | ||||
-rw-r--r-- | ndb/src/kernel/SimBlockList.cpp | 11 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/Makefile.am | 6 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/Makefile_old | 20 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/Restore.cpp | 652 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/Restore.hpp | 159 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer.cpp | 107 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer.hpp | 34 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp | 55 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp | 50 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp | 516 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp | 75 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp | 652 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/main.cpp | 1291 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/backup/restore/myVector.hpp | 128 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 1 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 12 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 110 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 25 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp | 175 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp | 13 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/Dbtux.hpp | 647 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp | 97 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp | 80 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp | 92 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp | 159 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp | 19 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp | 491 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp | 135 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp | 480 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/dbtux/Times.txt | 52 | ||||
-rw-r--r-- | ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 6 | ||||
-rw-r--r-- | ndb/src/mgmapi/mgmapi.cpp | 4 | ||||
-rw-r--r-- | ndb/src/mgmclient/Makefile.am | 6 | ||||
-rw-r--r-- | ndb/src/mgmsrv/Makefile.am | 6 | ||||
-rw-r--r-- | ndb/src/ndbapi/Makefile.am | 5 | ||||
-rw-r--r-- | ndb/src/ndbapi/Makefile_old | 3 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndb.cpp | 4 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbBlob.cpp | 1349 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbConnection.cpp | 148 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbDictionary.cpp | 79 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.cpp | 81 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.hpp | 17 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbEventOperationImpl.cpp | 60 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbEventOperationImpl.hpp | 1 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbIndexOperation.cpp | 11 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperation.cpp | 33 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperationDefine.cpp | 28 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperationScan.cpp | 31 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbOperationSearch.cpp | 32 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbRecAttr.cpp | 97 | ||||
-rw-r--r-- | ndb/src/ndbapi/NdbScanOperation.cpp | 22 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndberr.cpp | 8 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndbinit.cpp | 3 | ||||
-rw-r--r-- | ndb/src/ndbapi/Ndblist.cpp | 30 | ||||
-rw-r--r-- | ndb/src/ndbapi/ndberror.c | 10 | ||||
-rw-r--r-- | ndb/src/old_files/Makefile | 33 | ||||
-rw-r--r-- | ndb/src/old_files/client/Makefile (renamed from ndb/src/client/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/Extra.mk (renamed from ndb/src/client/odbc/Extra.mk) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/Makefile (renamed from ndb/src/client/odbc/Makefile) | 0 | ||||
-rwxr-xr-x | ndb/src/old_files/client/odbc/NdbOdbc.cpp (renamed from ndb/src/client/odbc/NdbOdbc.cpp) | 0 | ||||
-rwxr-xr-x | ndb/src/old_files/client/odbc/NdbOdbc.def (renamed from ndb/src/client/odbc/NdbOdbc.def) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/CodeGen.cpp (renamed from ndb/src/client/odbc/codegen/CodeGen.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/CodeGen.hpp (renamed from ndb/src/client/odbc/codegen/CodeGen.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_base.cpp (renamed from ndb/src/client/odbc/codegen/Code_base.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_base.hpp (renamed from ndb/src/client/odbc/codegen/Code_base.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_column.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_column.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_comp_op.cpp (renamed from ndb/src/client/odbc/codegen/Code_comp_op.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_comp_op.hpp (renamed from ndb/src/client/odbc/codegen/Code_comp_op.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_create_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_create_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_create_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_create_index.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_create_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_create_row.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_create_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_create_row.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_create_table.cpp (renamed from ndb/src/client/odbc/codegen/Code_create_table.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_create_table.hpp (renamed from ndb/src/client/odbc/codegen/Code_create_table.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_data_type.cpp (renamed from ndb/src/client/odbc/codegen/Code_data_type.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_data_type.hpp (renamed from ndb/src/client/odbc/codegen/Code_data_type.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_column.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_column.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_constr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_constr.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_row.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_ddl_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_ddl_row.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete_index.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete_lookup.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete_lookup.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete_scan.cpp (renamed from ndb/src/client/odbc/codegen/Code_delete_scan.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_delete_scan.hpp (renamed from ndb/src/client/odbc/codegen/Code_delete_scan.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_dml.cpp (renamed from ndb/src/client/odbc/codegen/Code_dml.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_dml.hpp (renamed from ndb/src/client/odbc/codegen/Code_dml.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_dml_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_dml_column.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_dml_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_dml_column.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_dml_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_dml_row.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_dml_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_dml_row.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_drop_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_drop_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_drop_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_drop_index.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_drop_table.cpp (renamed from ndb/src/client/odbc/codegen/Code_drop_table.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_drop_table.hpp (renamed from ndb/src/client/odbc/codegen/Code_drop_table.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_column.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_column.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_const.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_const.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_const.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_const.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_conv.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_conv.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_conv.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_conv.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_func.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_func.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_func.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_func.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_op.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_op.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_op.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_op.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_param.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_param.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_param.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_param.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_expr_row.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_expr_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_expr_row.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_idx_column.cpp (renamed from ndb/src/client/odbc/codegen/Code_idx_column.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_idx_column.hpp (renamed from ndb/src/client/odbc/codegen/Code_idx_column.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_insert.cpp (renamed from ndb/src/client/odbc/codegen/Code_insert.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_insert.hpp (renamed from ndb/src/client/odbc/codegen/Code_insert.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_pred.cpp (renamed from ndb/src/client/odbc/codegen/Code_pred.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_pred.hpp (renamed from ndb/src/client/odbc/codegen/Code_pred.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_pred_op.cpp (renamed from ndb/src/client/odbc/codegen/Code_pred_op.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_pred_op.hpp (renamed from ndb/src/client/odbc/codegen/Code_pred_op.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query.cpp (renamed from ndb/src/client/odbc/codegen/Code_query.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query.hpp (renamed from ndb/src/client/odbc/codegen/Code_query.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_count.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_count.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_count.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_count.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_distinct.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_distinct.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_distinct.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_distinct.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_filter.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_filter.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_filter.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_filter.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_group.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_group.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_group.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_group.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_index.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_join.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_join.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_join.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_join.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_lookup.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_lookup.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_lookup.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_lookup.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_project.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_project.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_project.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_project.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_range.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_range.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_range.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_range.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_repeat.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_repeat.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_repeat.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_repeat.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_scan.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_scan.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_scan.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_scan.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_sort.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_sort.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_sort.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_sort.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_sys.cpp (renamed from ndb/src/client/odbc/codegen/Code_query_sys.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_query_sys.hpp (renamed from ndb/src/client/odbc/codegen/Code_query_sys.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_root.cpp (renamed from ndb/src/client/odbc/codegen/Code_root.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_root.hpp (renamed from ndb/src/client/odbc/codegen/Code_root.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_select.cpp (renamed from ndb/src/client/odbc/codegen/Code_select.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_select.hpp (renamed from ndb/src/client/odbc/codegen/Code_select.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_set_row.cpp (renamed from ndb/src/client/odbc/codegen/Code_set_row.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_set_row.hpp (renamed from ndb/src/client/odbc/codegen/Code_set_row.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_stmt.cpp (renamed from ndb/src/client/odbc/codegen/Code_stmt.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_stmt.hpp (renamed from ndb/src/client/odbc/codegen/Code_stmt.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_table.cpp (renamed from ndb/src/client/odbc/codegen/Code_table.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_table.hpp (renamed from ndb/src/client/odbc/codegen/Code_table.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_table_list.cpp (renamed from ndb/src/client/odbc/codegen/Code_table_list.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_table_list.hpp (renamed from ndb/src/client/odbc/codegen/Code_table_list.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update.cpp (renamed from ndb/src/client/odbc/codegen/Code_update.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update.hpp (renamed from ndb/src/client/odbc/codegen/Code_update.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update_index.cpp (renamed from ndb/src/client/odbc/codegen/Code_update_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update_index.hpp (renamed from ndb/src/client/odbc/codegen/Code_update_index.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update_lookup.cpp (renamed from ndb/src/client/odbc/codegen/Code_update_lookup.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update_lookup.hpp (renamed from ndb/src/client/odbc/codegen/Code_update_lookup.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update_scan.cpp (renamed from ndb/src/client/odbc/codegen/Code_update_scan.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Code_update_scan.hpp (renamed from ndb/src/client/odbc/codegen/Code_update_scan.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/Makefile (renamed from ndb/src/client/odbc/codegen/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/SimpleGram.ypp (renamed from ndb/src/client/odbc/codegen/SimpleGram.ypp) | 26 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/SimpleParser.cpp (renamed from ndb/src/client/odbc/codegen/SimpleParser.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/SimpleParser.hpp (renamed from ndb/src/client/odbc/codegen/SimpleParser.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/codegen/SimpleScan.lpp (renamed from ndb/src/client/odbc/codegen/SimpleScan.lpp) | 2 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/AttrArea.cpp (renamed from ndb/src/client/odbc/common/AttrArea.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/AttrArea.hpp (renamed from ndb/src/client/odbc/common/AttrArea.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/CodeTree.cpp (renamed from ndb/src/client/odbc/common/CodeTree.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/CodeTree.hpp (renamed from ndb/src/client/odbc/common/CodeTree.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/ConnArea.cpp (renamed from ndb/src/client/odbc/common/ConnArea.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/ConnArea.hpp (renamed from ndb/src/client/odbc/common/ConnArea.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/Ctx.cpp (renamed from ndb/src/client/odbc/common/Ctx.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/Ctx.hpp (renamed from ndb/src/client/odbc/common/Ctx.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DataField.cpp (renamed from ndb/src/client/odbc/common/DataField.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DataField.hpp (renamed from ndb/src/client/odbc/common/DataField.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DataRow.cpp (renamed from ndb/src/client/odbc/common/DataRow.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DataRow.hpp (renamed from ndb/src/client/odbc/common/DataRow.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DataType.cpp (renamed from ndb/src/client/odbc/common/DataType.cpp) | 6 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DataType.hpp (renamed from ndb/src/client/odbc/common/DataType.hpp) | 1 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DescArea.cpp (renamed from ndb/src/client/odbc/common/DescArea.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DescArea.hpp (renamed from ndb/src/client/odbc/common/DescArea.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DiagArea.cpp (renamed from ndb/src/client/odbc/common/DiagArea.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/DiagArea.hpp (renamed from ndb/src/client/odbc/common/DiagArea.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/Makefile (renamed from ndb/src/client/odbc/common/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/OdbcData.cpp (renamed from ndb/src/client/odbc/common/OdbcData.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/OdbcData.hpp (renamed from ndb/src/client/odbc/common/OdbcData.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/ResultArea.cpp (renamed from ndb/src/client/odbc/common/ResultArea.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/ResultArea.hpp (renamed from ndb/src/client/odbc/common/ResultArea.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/Sqlstate.cpp (renamed from ndb/src/client/odbc/common/Sqlstate.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/Sqlstate.hpp (renamed from ndb/src/client/odbc/common/Sqlstate.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/StmtArea.cpp (renamed from ndb/src/client/odbc/common/StmtArea.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/StmtArea.hpp (renamed from ndb/src/client/odbc/common/StmtArea.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/StmtInfo.cpp (renamed from ndb/src/client/odbc/common/StmtInfo.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/StmtInfo.hpp (renamed from ndb/src/client/odbc/common/StmtInfo.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/common.cpp (renamed from ndb/src/client/odbc/common/common.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/common/common.hpp (renamed from ndb/src/client/odbc/common/common.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictCatalog.cpp (renamed from ndb/src/client/odbc/dictionary/DictCatalog.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictCatalog.hpp (renamed from ndb/src/client/odbc/dictionary/DictCatalog.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictColumn.cpp (renamed from ndb/src/client/odbc/dictionary/DictColumn.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictColumn.hpp (renamed from ndb/src/client/odbc/dictionary/DictColumn.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictIndex.cpp (renamed from ndb/src/client/odbc/dictionary/DictIndex.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictIndex.hpp (renamed from ndb/src/client/odbc/dictionary/DictIndex.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictSchema.cpp (renamed from ndb/src/client/odbc/dictionary/DictSchema.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictSchema.hpp (renamed from ndb/src/client/odbc/dictionary/DictSchema.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictSys.cpp (renamed from ndb/src/client/odbc/dictionary/DictSys.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictSys.hpp (renamed from ndb/src/client/odbc/dictionary/DictSys.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictTable.cpp (renamed from ndb/src/client/odbc/dictionary/DictTable.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/DictTable.hpp (renamed from ndb/src/client/odbc/dictionary/DictTable.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/dictionary/Makefile (renamed from ndb/src/client/odbc/dictionary/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/class.fig (renamed from ndb/src/client/odbc/docs/class.fig) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/descfield.pl (renamed from ndb/src/client/odbc/docs/descfield.pl) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/diag.txt (renamed from ndb/src/client/odbc/docs/diag.txt) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/getinfo.pl (renamed from ndb/src/client/odbc/docs/getinfo.pl) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/gettypeinfo.pl (renamed from ndb/src/client/odbc/docs/gettypeinfo.pl) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/handleattr.pl (renamed from ndb/src/client/odbc/docs/handleattr.pl) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/main.hpp (renamed from ndb/src/client/odbc/docs/main.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/ndbodbc.html (renamed from ndb/src/client/odbc/docs/ndbodbc.html) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/select.fig (renamed from ndb/src/client/odbc/docs/select.fig) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/systables.pl (renamed from ndb/src/client/odbc/docs/systables.pl) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/docs/type.txt (renamed from ndb/src/client/odbc/docs/type.txt) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/Func.data (renamed from ndb/src/client/odbc/driver/Func.data) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/Func.pl (renamed from ndb/src/client/odbc/driver/Func.pl) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/Makefile (renamed from ndb/src/client/odbc/driver/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocConnect.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocEnv.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocHandle.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocHandleStd.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp (renamed from ndb/src/client/odbc/driver/SQLAllocStmt.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp (renamed from ndb/src/client/odbc/driver/SQLBindCol.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp (renamed from ndb/src/client/odbc/driver/SQLBindParam.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp (renamed from ndb/src/client/odbc/driver/SQLBindParameter.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLBrowseConnect.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp (renamed from ndb/src/client/odbc/driver/SQLBulkOperations.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLCancel.cpp (renamed from ndb/src/client/odbc/driver/SQLCancel.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp (renamed from ndb/src/client/odbc/driver/SQLCloseCursor.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp (renamed from ndb/src/client/odbc/driver/SQLColAttribute.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp (renamed from ndb/src/client/odbc/driver/SQLColAttributes.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp (renamed from ndb/src/client/odbc/driver/SQLColumnPrivileges.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLColumns.cpp (renamed from ndb/src/client/odbc/driver/SQLColumns.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLConnect.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp (renamed from ndb/src/client/odbc/driver/SQLCopyDesc.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp (renamed from ndb/src/client/odbc/driver/SQLDataSources.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp (renamed from ndb/src/client/odbc/driver/SQLDescribeCol.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp (renamed from ndb/src/client/odbc/driver/SQLDescribeParam.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp (renamed from ndb/src/client/odbc/driver/SQLDisconnect.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLDriverConnect.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp (renamed from ndb/src/client/odbc/driver/SQLDrivers.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp (renamed from ndb/src/client/odbc/driver/SQLEndTran.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLError.cpp (renamed from ndb/src/client/odbc/driver/SQLError.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp (renamed from ndb/src/client/odbc/driver/SQLExecDirect.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLExecute.cpp (renamed from ndb/src/client/odbc/driver/SQLExecute.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp (renamed from ndb/src/client/odbc/driver/SQLExtendedFetch.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLFetch.cpp (renamed from ndb/src/client/odbc/driver/SQLFetch.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp (renamed from ndb/src/client/odbc/driver/SQLFetchScroll.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp (renamed from ndb/src/client/odbc/driver/SQLForeignKeys.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeConnect.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeEnv.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeHandle.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp (renamed from ndb/src/client/odbc/driver/SQLFreeStmt.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLGetConnectAttr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp (renamed from ndb/src/client/odbc/driver/SQLGetConnectOption.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp (renamed from ndb/src/client/odbc/driver/SQLGetCursorName.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetData.cpp (renamed from ndb/src/client/odbc/driver/SQLGetData.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDescField.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDescRec.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDiagField.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp (renamed from ndb/src/client/odbc/driver/SQLGetDiagRec.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLGetEnvAttr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp (renamed from ndb/src/client/odbc/driver/SQLGetFunctions.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp (renamed from ndb/src/client/odbc/driver/SQLGetInfo.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLGetStmtAttr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp (renamed from ndb/src/client/odbc/driver/SQLGetStmtOption.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp (renamed from ndb/src/client/odbc/driver/SQLGetTypeInfo.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp (renamed from ndb/src/client/odbc/driver/SQLMoreResults.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp (renamed from ndb/src/client/odbc/driver/SQLNativeSql.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp (renamed from ndb/src/client/odbc/driver/SQLNumParams.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp (renamed from ndb/src/client/odbc/driver/SQLNumResultCols.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLParamData.cpp (renamed from ndb/src/client/odbc/driver/SQLParamData.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp (renamed from ndb/src/client/odbc/driver/SQLParamOptions.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp (renamed from ndb/src/client/odbc/driver/SQLPrepare.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp (renamed from ndb/src/client/odbc/driver/SQLPrimaryKeys.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp (renamed from ndb/src/client/odbc/driver/SQLProcedureColumns.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp (renamed from ndb/src/client/odbc/driver/SQLProcedures.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLPutData.cpp (renamed from ndb/src/client/odbc/driver/SQLPutData.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp (renamed from ndb/src/client/odbc/driver/SQLRowCount.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLSetConnectAttr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp (renamed from ndb/src/client/odbc/driver/SQLSetConnectOption.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp (renamed from ndb/src/client/odbc/driver/SQLSetCursorName.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp (renamed from ndb/src/client/odbc/driver/SQLSetDescField.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp (renamed from ndb/src/client/odbc/driver/SQLSetDescRec.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLSetEnvAttr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp (renamed from ndb/src/client/odbc/driver/SQLSetParam.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp (renamed from ndb/src/client/odbc/driver/SQLSetPos.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp (renamed from ndb/src/client/odbc/driver/SQLSetScrollOptions.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp (renamed from ndb/src/client/odbc/driver/SQLSetStmtAttr.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp (renamed from ndb/src/client/odbc/driver/SQLSetStmtOption.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp (renamed from ndb/src/client/odbc/driver/SQLSpecialColumns.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp (renamed from ndb/src/client/odbc/driver/SQLStatistics.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp (renamed from ndb/src/client/odbc/driver/SQLTablePrivileges.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLTables.cpp (renamed from ndb/src/client/odbc/driver/SQLTables.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/SQLTransact.cpp (renamed from ndb/src/client/odbc/driver/SQLTransact.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/driver.cpp (renamed from ndb/src/client/odbc/driver/driver.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/driver/driver.hpp (renamed from ndb/src/client/odbc/driver/driver.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_comp_op.cpp (renamed from ndb/src/client/odbc/executor/Exec_comp_op.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_create_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_create_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_create_table.cpp (renamed from ndb/src/client/odbc/executor/Exec_create_table.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_delete_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_delete_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_delete_lookup.cpp (renamed from ndb/src/client/odbc/executor/Exec_delete_lookup.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_delete_scan.cpp (renamed from ndb/src/client/odbc/executor/Exec_delete_scan.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_drop_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_drop_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_drop_table.cpp (renamed from ndb/src/client/odbc/executor/Exec_drop_table.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_expr_conv.cpp (renamed from ndb/src/client/odbc/executor/Exec_expr_conv.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_expr_func.cpp (renamed from ndb/src/client/odbc/executor/Exec_expr_func.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_expr_op.cpp (renamed from ndb/src/client/odbc/executor/Exec_expr_op.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_insert.cpp (renamed from ndb/src/client/odbc/executor/Exec_insert.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_pred_op.cpp (renamed from ndb/src/client/odbc/executor/Exec_pred_op.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_query_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_query_lookup.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_lookup.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_query_range.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_range.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_query_scan.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_scan.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_query_sys.cpp (renamed from ndb/src/client/odbc/executor/Exec_query_sys.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_update_index.cpp (renamed from ndb/src/client/odbc/executor/Exec_update_index.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_update_lookup.cpp (renamed from ndb/src/client/odbc/executor/Exec_update_lookup.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Exec_update_scan.cpp (renamed from ndb/src/client/odbc/executor/Exec_update_scan.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Executor.cpp (renamed from ndb/src/client/odbc/executor/Executor.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Executor.hpp (renamed from ndb/src/client/odbc/executor/Executor.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/executor/Makefile (renamed from ndb/src/client/odbc/executor/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/AttrDbc.cpp (renamed from ndb/src/client/odbc/handles/AttrDbc.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/AttrEnv.cpp (renamed from ndb/src/client/odbc/handles/AttrEnv.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/AttrRoot.cpp (renamed from ndb/src/client/odbc/handles/AttrRoot.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/AttrStmt.cpp (renamed from ndb/src/client/odbc/handles/AttrStmt.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/DescSpec.cpp (renamed from ndb/src/client/odbc/handles/DescSpec.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/FuncTab.cpp (renamed from ndb/src/client/odbc/handles/FuncTab.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleBase.cpp (renamed from ndb/src/client/odbc/handles/HandleBase.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleBase.hpp (renamed from ndb/src/client/odbc/handles/HandleBase.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleDbc.cpp (renamed from ndb/src/client/odbc/handles/HandleDbc.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleDbc.hpp (renamed from ndb/src/client/odbc/handles/HandleDbc.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleDesc.cpp (renamed from ndb/src/client/odbc/handles/HandleDesc.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleDesc.hpp (renamed from ndb/src/client/odbc/handles/HandleDesc.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleEnv.cpp (renamed from ndb/src/client/odbc/handles/HandleEnv.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleEnv.hpp (renamed from ndb/src/client/odbc/handles/HandleEnv.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleRoot.cpp (renamed from ndb/src/client/odbc/handles/HandleRoot.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleRoot.hpp (renamed from ndb/src/client/odbc/handles/HandleRoot.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleStmt.cpp (renamed from ndb/src/client/odbc/handles/HandleStmt.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/HandleStmt.hpp (renamed from ndb/src/client/odbc/handles/HandleStmt.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/InfoTab.cpp (renamed from ndb/src/client/odbc/handles/InfoTab.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/Makefile (renamed from ndb/src/client/odbc/handles/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/PoolNdb.cpp (renamed from ndb/src/client/odbc/handles/PoolNdb.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/PoolNdb.hpp (renamed from ndb/src/client/odbc/handles/PoolNdb.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/client/odbc/handles/handles.hpp (renamed from ndb/src/client/odbc/handles/handles.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/Makefile (renamed from ndb/src/newtonapi/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_binding.cpp (renamed from ndb/src/newtonapi/dba_binding.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_bulkread.cpp (renamed from ndb/src/newtonapi/dba_bulkread.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_config.cpp (renamed from ndb/src/newtonapi/dba_config.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_dac.cpp (renamed from ndb/src/newtonapi/dba_dac.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_error.cpp (renamed from ndb/src/newtonapi/dba_error.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_init.cpp (renamed from ndb/src/newtonapi/dba_init.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_internal.hpp (renamed from ndb/src/newtonapi/dba_internal.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_process.cpp (renamed from ndb/src/newtonapi/dba_process.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_process.hpp (renamed from ndb/src/newtonapi/dba_process.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/newtonapi/dba_schema.cpp (renamed from ndb/src/newtonapi/dba_schema.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/ExtSender.cpp (renamed from ndb/src/rep/ExtSender.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/ExtSender.hpp (renamed from ndb/src/rep/ExtSender.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/Makefile (renamed from ndb/src/rep/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/NodeConnectInfo.hpp (renamed from ndb/src/rep/NodeConnectInfo.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/README (renamed from ndb/src/rep/README) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepApiInterpreter.cpp (renamed from ndb/src/rep/RepApiInterpreter.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepApiInterpreter.hpp (renamed from ndb/src/rep/RepApiInterpreter.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepApiService.cpp (renamed from ndb/src/rep/RepApiService.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepApiService.hpp (renamed from ndb/src/rep/RepApiService.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepCommandInterpreter.cpp (renamed from ndb/src/rep/RepCommandInterpreter.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepCommandInterpreter.hpp (renamed from ndb/src/rep/RepCommandInterpreter.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepComponents.cpp (renamed from ndb/src/rep/RepComponents.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepComponents.hpp (renamed from ndb/src/rep/RepComponents.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RepMain.cpp (renamed from ndb/src/rep/RepMain.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/Requestor.cpp (renamed from ndb/src/rep/Requestor.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/Requestor.hpp (renamed from ndb/src/rep/Requestor.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/RequestorSubscriptions.cpp (renamed from ndb/src/rep/RequestorSubscriptions.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/SignalQueue.cpp (renamed from ndb/src/rep/SignalQueue.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/SignalQueue.hpp (renamed from ndb/src/rep/SignalQueue.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/TODO (renamed from ndb/src/rep/TODO) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/AppNDB.cpp (renamed from ndb/src/rep/adapters/AppNDB.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/AppNDB.hpp (renamed from ndb/src/rep/adapters/AppNDB.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/ExtAPI.cpp (renamed from ndb/src/rep/adapters/ExtAPI.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/ExtAPI.hpp (renamed from ndb/src/rep/adapters/ExtAPI.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/ExtNDB.cpp (renamed from ndb/src/rep/adapters/ExtNDB.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/ExtNDB.hpp (renamed from ndb/src/rep/adapters/ExtNDB.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/Makefile (renamed from ndb/src/rep/adapters/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/adapters/TableInfoPs.hpp (renamed from ndb/src/rep/adapters/TableInfoPs.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/dbug_hack.cpp (renamed from ndb/src/rep/dbug_hack.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/rep_version.hpp (renamed from ndb/src/rep/rep_version.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/repapi/Makefile (renamed from ndb/src/rep/repapi/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/repapi/repapi.cpp (renamed from ndb/src/rep/repapi/repapi.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/repapi/repapi.h (renamed from ndb/src/rep/repapi/repapi.h) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/Channel.cpp (renamed from ndb/src/rep/state/Channel.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/Channel.hpp (renamed from ndb/src/rep/state/Channel.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/Interval.cpp (renamed from ndb/src/rep/state/Interval.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/Interval.hpp (renamed from ndb/src/rep/state/Interval.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/Makefile (renamed from ndb/src/rep/state/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/RepState.cpp (renamed from ndb/src/rep/state/RepState.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/RepState.hpp (renamed from ndb/src/rep/state/RepState.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/RepStateEvent.cpp (renamed from ndb/src/rep/state/RepStateEvent.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/RepStateRequests.cpp (renamed from ndb/src/rep/state/RepStateRequests.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/testInterval/Makefile (renamed from ndb/src/rep/state/testInterval/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/testInterval/testInterval.cpp (renamed from ndb/src/rep/state/testInterval/testInterval.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/testRepState/Makefile (renamed from ndb/src/rep/state/testRepState/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/testRepState/testRequestor.cpp (renamed from ndb/src/rep/state/testRepState/testRequestor.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/state/testRepState/testRequestor.hpp (renamed from ndb/src/rep/state/testRepState/testRequestor.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIBuffer.cpp (renamed from ndb/src/rep/storage/GCIBuffer.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIBuffer.hpp (renamed from ndb/src/rep/storage/GCIBuffer.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIContainer.cpp (renamed from ndb/src/rep/storage/GCIContainer.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIContainer.hpp (renamed from ndb/src/rep/storage/GCIContainer.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIContainerPS.cpp (renamed from ndb/src/rep/storage/GCIContainerPS.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIContainerPS.hpp (renamed from ndb/src/rep/storage/GCIContainerPS.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIPage.cpp (renamed from ndb/src/rep/storage/GCIPage.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/GCIPage.hpp (renamed from ndb/src/rep/storage/GCIPage.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/LogRecord.hpp (renamed from ndb/src/rep/storage/LogRecord.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/Makefile (renamed from ndb/src/rep/storage/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/NodeConnectInfo.hpp (renamed from ndb/src/rep/storage/NodeConnectInfo.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/NodeGroup.cpp (renamed from ndb/src/rep/storage/NodeGroup.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/NodeGroup.hpp (renamed from ndb/src/rep/storage/NodeGroup.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/NodeGroupInfo.cpp (renamed from ndb/src/rep/storage/NodeGroupInfo.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/storage/NodeGroupInfo.hpp (renamed from ndb/src/rep/storage/NodeGroupInfo.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/transfer/Makefile (renamed from ndb/src/rep/transfer/Makefile) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/transfer/TransPS.cpp (renamed from ndb/src/rep/transfer/TransPS.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/transfer/TransPS.hpp (renamed from ndb/src/rep/transfer/TransPS.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/transfer/TransSS.cpp (renamed from ndb/src/rep/transfer/TransSS.cpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/transfer/TransSS.hpp (renamed from ndb/src/rep/transfer/TransSS.hpp) | 0 | ||||
-rw-r--r-- | ndb/src/old_files/rep/transfer/TransSSSubscriptions.cpp (renamed from ndb/src/rep/transfer/TransSSSubscriptions.cpp) | 0 | ||||
-rw-r--r-- | ndb/test/Makefile.am | 3 | ||||
-rw-r--r-- | ndb/test/Makefile_old | 19 | ||||
-rw-r--r-- | ndb/test/include/NdbSchemaCon.hpp (renamed from ndb/include/ndbapi/NdbSchemaCon.hpp) | 0 | ||||
-rw-r--r-- | ndb/test/include/NdbSchemaOp.hpp (renamed from ndb/include/ndbapi/NdbSchemaOp.hpp) | 0 | ||||
-rw-r--r-- | ndb/test/ndbapi/Makefile.am | 4 | ||||
-rw-r--r-- | ndb/test/ndbapi/Makefile_old | 3 | ||||
-rw-r--r-- | ndb/test/ndbapi/bank/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/test/ndbapi/testBlobs.cpp | 1279 | ||||
-rw-r--r-- | ndb/test/ndbapi/testOIBasic.cpp | 61 | ||||
-rw-r--r-- | ndb/test/newtonapi/Makefile | 8 | ||||
-rw-r--r-- | ndb/test/odbc/Makefile | 13 | ||||
-rw-r--r-- | ndb/test/run-test/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/test/run-test/README | 43 | ||||
-rw-r--r-- | ndb/test/run-test/atrt-example.tgz | bin | 0 -> 2196 bytes | |||
-rw-r--r-- | ndb/test/run-test/basic.txt | 763 | ||||
-rw-r--r-- | ndb/test/run-test/main.cpp | 116 | ||||
-rwxr-xr-x | ndb/test/run-test/make-html-reports.sh | 406 | ||||
-rw-r--r-- | ndb/test/src/Makefile.am | 3 | ||||
-rw-r--r-- | ndb/test/src/NDBT_ResultRow.cpp | 80 | ||||
-rw-r--r-- | ndb/test/src/NDBT_Table.cpp | 96 | ||||
-rw-r--r-- | ndb/test/src/NdbBackup.cpp | 12 | ||||
-rw-r--r-- | ndb/test/src/NdbSchemaCon.cpp (renamed from ndb/src/ndbapi/NdbSchemaCon.cpp) | 37 | ||||
-rw-r--r-- | ndb/test/src/NdbSchemaOp.cpp (renamed from ndb/src/ndbapi/NdbSchemaOp.cpp) | 8 | ||||
-rw-r--r-- | ndb/test/tools/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/tools/Makefile.am | 27 | ||||
-rw-r--r-- | ndb/tools/delete_all.cpp | 118 | ||||
-rw-r--r-- | ndb/tools/ndbsql.cpp | 12 | ||||
-rw-r--r-- | ndb/tools/select_count.cpp | 115 | ||||
-rw-r--r-- | ndb/tools/waiter.cpp | 253 | ||||
-rwxr-xr-x | netware/BUILD/mwenv | 6 | ||||
-rwxr-xr-x | netware/BUILD/nwbootstrap | 5 | ||||
-rw-r--r-- | netware/Makefile.am | 2 | ||||
-rw-r--r-- | netware/mysql_test_run.c | 10 | ||||
-rw-r--r-- | netware/mysqld_safe.c | 534 | ||||
-rw-r--r-- | regex/regcomp.c | 2 | ||||
-rw-r--r-- | scripts/mysql_create_system_tables.sh | 339 | ||||
-rw-r--r-- | scripts/mysql_fix_privilege_tables.sql | 39 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 13 | ||||
-rw-r--r-- | scripts/mysqld_safe.sh | 8 | ||||
-rw-r--r-- | sql-common/client.c | 55 | ||||
-rw-r--r-- | sql/Makefile.am | 15 | ||||
-rw-r--r-- | sql/examples/ha_archive.cc | 586 | ||||
-rw-r--r-- | sql/examples/ha_archive.h | 123 | ||||
-rw-r--r-- | sql/examples/ha_example.cc | 8 | ||||
-rw-r--r-- | sql/examples/ha_example.h | 5 | ||||
-rw-r--r-- | sql/field.cc | 745 | ||||
-rw-r--r-- | sql/field.h | 29 | ||||
-rw-r--r-- | sql/field_conv.cc | 12 | ||||
-rw-r--r-- | sql/ha_berkeley.cc | 8 | ||||
-rw-r--r-- | sql/ha_innodb.cc | 98 | ||||
-rw-r--r-- | sql/ha_innodb.h | 2 | ||||
-rw-r--r-- | sql/handler.cc | 9 | ||||
-rw-r--r-- | sql/handler.h | 3 | ||||
-rw-r--r-- | sql/item.cc | 123 | ||||
-rw-r--r-- | sql/item.h | 26 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 97 | ||||
-rw-r--r-- | sql/item_cmpfunc.h | 8 | ||||
-rw-r--r-- | sql/item_create.cc | 9 | ||||
-rw-r--r-- | sql/item_create.h | 1 | ||||
-rw-r--r-- | sql/item_func.cc | 89 | ||||
-rw-r--r-- | sql/item_func.h | 10 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 23 | ||||
-rw-r--r-- | sql/item_subselect.cc | 1 | ||||
-rw-r--r-- | sql/item_sum.cc | 39 | ||||
-rw-r--r-- | sql/item_sum.h | 3 | ||||
-rw-r--r-- | sql/item_timefunc.cc | 292 | ||||
-rw-r--r-- | sql/item_timefunc.h | 56 | ||||
-rw-r--r-- | sql/lex.h | 3 | ||||
-rw-r--r-- | sql/log.cc | 33 | ||||
-rw-r--r-- | sql/log_event.cc | 59 | ||||
-rw-r--r-- | sql/mysql_priv.h | 44 | ||||
-rw-r--r-- | sql/mysqld.cc | 71 | ||||
-rw-r--r-- | sql/net_serv.cc | 12 | ||||
-rw-r--r-- | sql/opt_range.cc | 30 | ||||
-rw-r--r-- | sql/protocol.cc | 24 | ||||
-rw-r--r-- | sql/protocol.h | 5 | ||||
-rw-r--r-- | sql/repl_failsafe.cc | 5 | ||||
-rw-r--r-- | sql/set_var.cc | 105 | ||||
-rw-r--r-- | sql/set_var.h | 34 | ||||
-rw-r--r-- | sql/share/czech/errmsg.txt | 74 | ||||
-rw-r--r-- | sql/share/danish/errmsg.txt | 62 | ||||
-rw-r--r-- | sql/share/dutch/errmsg.txt | 46 | ||||
-rw-r--r-- | sql/share/english/errmsg.txt | 148 | ||||
-rw-r--r-- | sql/share/estonian/errmsg.txt | 60 | ||||
-rw-r--r-- | sql/share/french/errmsg.txt | 54 | ||||
-rw-r--r-- | sql/share/german/errmsg.txt | 18 | ||||
-rw-r--r-- | sql/share/greek/errmsg.txt | 86 | ||||
-rw-r--r-- | sql/share/hungarian/errmsg.txt | 74 | ||||
-rw-r--r-- | sql/share/italian/errmsg.txt | 46 | ||||
-rw-r--r-- | sql/share/japanese/errmsg.txt | 98 | ||||
-rw-r--r-- | sql/share/korean/errmsg.txt | 80 | ||||
-rw-r--r-- | sql/share/norwegian-ny/errmsg.txt | 100 | ||||
-rw-r--r-- | sql/share/norwegian/errmsg.txt | 100 | ||||
-rw-r--r-- | sql/share/polish/errmsg.txt | 108 | ||||
-rw-r--r-- | sql/share/portuguese/errmsg.txt | 22 | ||||
-rw-r--r-- | sql/share/romanian/errmsg.txt | 74 | ||||
-rw-r--r-- | sql/share/russian/errmsg.txt | 42 | ||||
-rw-r--r-- | sql/share/serbian/errmsg.txt | 46 | ||||
-rw-r--r-- | sql/share/slovak/errmsg.txt | 84 | ||||
-rw-r--r-- | sql/share/spanish/errmsg.txt | 18 | ||||
-rw-r--r-- | sql/share/swedish/errmsg.txt | 36 | ||||
-rw-r--r-- | sql/share/ukrainian/errmsg.txt | 56 | ||||
-rw-r--r-- | sql/slave.cc | 27 | ||||
-rw-r--r-- | sql/sql_acl.cc | 4 | ||||
-rw-r--r-- | sql/sql_base.cc | 16 | ||||
-rw-r--r-- | sql/sql_cache.cc | 7 | ||||
-rw-r--r-- | sql/sql_class.cc | 48 | ||||
-rw-r--r-- | sql/sql_class.h | 41 | ||||
-rw-r--r-- | sql/sql_db.cc | 72 | ||||
-rw-r--r-- | sql/sql_delete.cc | 12 | ||||
-rw-r--r-- | sql/sql_derived.cc | 1 | ||||
-rw-r--r-- | sql/sql_help.cc | 2 | ||||
-rw-r--r-- | sql/sql_insert.cc | 4 | ||||
-rw-r--r-- | sql/sql_lex.cc | 40 | ||||
-rw-r--r-- | sql/sql_lex.h | 16 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 171 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 439 | ||||
-rw-r--r-- | sql/sql_select.cc | 51 | ||||
-rw-r--r-- | sql/sql_show.cc | 12 | ||||
-rw-r--r-- | sql/sql_string.cc | 3 | ||||
-rw-r--r-- | sql/sql_table.cc | 93 | ||||
-rw-r--r-- | sql/sql_update.cc | 6 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 106 | ||||
-rw-r--r-- | sql/table.cc | 2 | ||||
-rw-r--r-- | sql/time.cc | 301 | ||||
-rw-r--r-- | sql/tzfile.h | 137 | ||||
-rw-r--r-- | sql/tztime.cc | 2560 | ||||
-rw-r--r-- | sql/tztime.h | 71 | ||||
-rw-r--r-- | sql/unireg.cc | 1 | ||||
-rw-r--r-- | strings/ctype-big5.c | 19 | ||||
-rw-r--r-- | strings/ctype-bin.c | 10 | ||||
-rw-r--r-- | strings/ctype-czech.c | 6 | ||||
-rw-r--r-- | strings/ctype-euc_kr.c | 18 | ||||
-rw-r--r-- | strings/ctype-extra.c | 27 | ||||
-rw-r--r-- | strings/ctype-gb2312.c | 22 | ||||
-rw-r--r-- | strings/ctype-gbk.c | 22 | ||||
-rw-r--r-- | strings/ctype-latin1.c | 24 | ||||
-rw-r--r-- | strings/ctype-mb.c | 1 | ||||
-rw-r--r-- | strings/ctype-simple.c | 127 | ||||
-rw-r--r-- | strings/ctype-sjis.c | 22 | ||||
-rw-r--r-- | strings/ctype-tis620.c | 18 | ||||
-rw-r--r-- | strings/ctype-uca.c | 1780 | ||||
-rw-r--r-- | strings/ctype-ucs2.c | 22 | ||||
-rw-r--r-- | strings/ctype-ujis.c | 26 | ||||
-rw-r--r-- | strings/ctype-utf8.c | 51 | ||||
-rw-r--r-- | strings/ctype-win1250ch.c | 6 | ||||
-rw-r--r-- | strings/ctype.c | 14 | ||||
-rw-r--r-- | strings/my_vsnprintf.c | 1 | ||||
-rw-r--r-- | support-files/my-huge.cnf.sh | 8 | ||||
-rw-r--r-- | support-files/my-innodb-heavy-4G.cnf.sh | 4 | ||||
-rw-r--r-- | support-files/my-large.cnf.sh | 8 | ||||
-rw-r--r-- | support-files/my-medium.cnf.sh | 6 | ||||
-rw-r--r-- | support-files/my-small.cnf.sh | 6 | ||||
-rw-r--r-- | support-files/mysql.spec.sh | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/client_test.c | 493 | ||||
-rw-r--r-- | tools/mysqlmanager.c | 2 |
985 files changed, 27770 insertions, 15922 deletions
diff --git a/.bzrignore b/.bzrignore index 338bc04fabc..2bc1daf45ca 100644 --- a/.bzrignore +++ b/.bzrignore @@ -2,6 +2,7 @@ *.bb *.bbg *.core +*.d *.da *.gcov *.la @@ -13,10 +14,10 @@ */.pure *~ .*.swp -.deps +.defs.mk .depend .depend.mk -.defs.mk +.deps .gdb_history .gdbinit .libs @@ -287,6 +288,7 @@ help.h include/my_config.h include/my_global.h include/mysql_version.h +include/readline include/readline/*.h include/readline/readline.h include/widec.h @@ -328,7 +330,9 @@ libmysqld/client.c libmysqld/client_settings.h libmysqld/convert.cc libmysqld/derror.cc +libmysqld/discover.cc libmysqld/errmsg.c +libmysqld/examples/client_test.c libmysqld/examples/completion_hash.cc libmysqld/examples/completion_hash.h libmysqld/examples/link_sources @@ -432,6 +436,7 @@ libmysqld/strfunc.cc libmysqld/table.cc libmysqld/thr_malloc.cc libmysqld/time.cc +libmysqld/tztime.cc libmysqld/uniques.cc libmysqld/unireg.cc libtool @@ -485,6 +490,7 @@ mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz mysql-test/gmon.out mysql-test/install_test_db mysql-test/mysql-test-run +mysql-test/ndb/ndbcluster mysql-test/r/*.reject mysql-test/r/rpl000001.eval mysql-test/r/rpl000002.eval @@ -515,6 +521,130 @@ mysys/test_thr_alarm mysys/test_thr_lock mysys/test_vsnprintf mysys/testhash +ndb/bin/DbAsyncGenerator +ndb/bin/DbCreate +ndb/bin/acid +ndb/bin/async-lmc-bench-l-p10.sh +ndb/bin/async-lmc-bench-l.sh +ndb/bin/async-lmc-bench-p10.sh +ndb/bin/async-lmc-bench.sh +ndb/bin/atrt +ndb/bin/atrt-analyze-result.sh +ndb/bin/atrt-clear-result.sh +ndb/bin/atrt-gather-result.sh +ndb/bin/atrt-setup.sh +ndb/bin/bankCreator +ndb/bin/bankMakeGL +ndb/bin/bankSumAccounts +ndb/bin/bankTimer +ndb/bin/bankTransactionMaker +ndb/bin/bankValidateAllGLs +ndb/bin/basicTransporterTest +ndb/bin/benchronja +ndb/bin/bulk_copy +ndb/bin/copy_tab +ndb/bin/create_all_tabs +ndb/bin/create_index +ndb/bin/create_tab +ndb/bin/delete_all +ndb/bin/desc +ndb/bin/drop_all_tabs +ndb/bin/drop_index +ndb/bin/drop_tab +ndb/bin/flexAsynch +ndb/bin/flexBench +ndb/bin/flexHammer +ndb/bin/flexScan +ndb/bin/flexTT +ndb/bin/hugoCalculator +ndb/bin/hugoFill +ndb/bin/hugoLoad +ndb/bin/hugoLockRecords +ndb/bin/hugoPkDelete +ndb/bin/hugoPkRead +ndb/bin/hugoPkReadRecord +ndb/bin/hugoPkUpdate +ndb/bin/hugoScanRead +ndb/bin/hugoScanUpdate +ndb/bin/index +ndb/bin/index2 +ndb/bin/initronja +ndb/bin/interpreterInTup +ndb/bin/list_tables +ndb/bin/make-config.sh +ndb/bin/mgmtclient +ndb/bin/mgmtsrvr +ndb/bin/mkconfig +ndb/bin/ndb +ndb/bin/ndb_cpcc +ndb/bin/ndb_cpcd +ndb/bin/ndb_rep +ndb/bin/ndbsql +ndb/bin/newton_basic +ndb/bin/newton_br +ndb/bin/newton_pb +ndb/bin/newton_perf +ndb/bin/perfTransporterTest +ndb/bin/printConfig +ndb/bin/printSchemafile +ndb/bin/printSysfile +ndb/bin/redoLogFileReader +ndb/bin/restart +ndb/bin/restarter +ndb/bin/restarter2 +ndb/bin/restarts +ndb/bin/restore +ndb/bin/select_all +ndb/bin/select_count +ndb/bin/telco +ndb/bin/testBackup +ndb/bin/testBank +ndb/bin/testBasic +ndb/bin/testBasicAsynch +ndb/bin/testCopy +ndb/bin/testDataBuffers +ndb/bin/testDict +ndb/bin/testGrep +ndb/bin/testGrepVerify +ndb/bin/testIndex +ndb/bin/testInterpreter +ndb/bin/testKernelDataBuffer +ndb/bin/testLongSig +ndb/bin/testMgm +ndb/bin/testMgmapi +ndb/bin/testNdbApi +ndb/bin/testNodeRestart +ndb/bin/testOIBasic +ndb/bin/testOdbcDriver +ndb/bin/testOperations +ndb/bin/testRestartGci +ndb/bin/testScan +ndb/bin/testScanInterpreter +ndb/bin/testSimplePropertiesSection +ndb/bin/testSystemRestart +ndb/bin/testTimeout +ndb/bin/testTransactions +ndb/bin/test_cpcd +ndb/bin/test_event +ndb/bin/verify_index +ndb/bin/waiter +ndb/config/autom4te.cache/* +ndb/config/config.mk +ndb/examples/ndbapi_example1/ndbapi_example1 +ndb/examples/ndbapi_example2/ndbapi_example2 +ndb/examples/ndbapi_example3/ndbapi_example3 +ndb/examples/ndbapi_example5/ndbapi_example5 +ndb/examples/select_all/select_all +ndb/lib/libMGM_API.so +ndb/lib/libNDB_API.so +ndb/lib/libNDB_ODBC.so +ndb/lib/libNEWTON_API.so +ndb/lib/libNEWTON_BASICTEST_COMMON.so +ndb/lib/libREP_API.so +ndb/lib/libndbclient.so +ndb/lib/libndbclient_extra.so +ndb/src/common/mgmcommon/printConfig/*.d +ndb/src/mgmclient/test_cpcd/*.d pull.log regex/re repl-tests/test-repl-ts/repl-timestamp.master.reject @@ -585,6 +715,7 @@ sql/gen_lex_hash sql/gmon.out sql/lex_hash.h sql/mini_client_errors.c +sql/mysql_tzinfo_to_sql sql/mysqlbinlog sql/mysqld sql/mysqld-purecov @@ -604,6 +735,7 @@ sql/sql_yacc.cc sql/sql_yacc.h sql/sql_yacc.output sql/sql_yacc.yy.orig +sql/test_time sql/udf_example.so sql_error.cc sql_prepare.cc @@ -652,131 +784,6 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl -ndb/bin/DbAsyncGenerator -ndb/bin/DbCreate -ndb/bin/acid -ndb/bin/async-lmc-bench-l-p10.sh -ndb/bin/async-lmc-bench-l.sh -ndb/bin/async-lmc-bench-p10.sh -ndb/bin/async-lmc-bench.sh -ndb/bin/atrt -ndb/bin/atrt-analyze-result.sh -ndb/bin/atrt-clear-result.sh -ndb/bin/atrt-gather-result.sh -ndb/bin/atrt-setup.sh -ndb/bin/bankCreator -ndb/bin/bankMakeGL -ndb/bin/bankSumAccounts -ndb/bin/bankTimer -ndb/bin/bankTransactionMaker -ndb/bin/bankValidateAllGLs -ndb/bin/basicTransporterTest -ndb/bin/benchronja -ndb/bin/bulk_copy -ndb/bin/copy_tab -ndb/bin/create_all_tabs -ndb/bin/create_index -ndb/bin/create_tab -ndb/bin/delete_all -ndb/bin/desc -ndb/bin/drop_all_tabs -ndb/bin/drop_index -ndb/bin/drop_tab -ndb/bin/flexAsynch -ndb/bin/flexBench -ndb/bin/flexHammer -ndb/bin/flexScan -ndb/bin/flexTT -ndb/bin/hugoCalculator -ndb/bin/hugoFill -ndb/bin/hugoLoad -ndb/bin/hugoLockRecords -ndb/bin/hugoPkDelete -ndb/bin/hugoPkRead -ndb/bin/hugoPkReadRecord -ndb/bin/hugoPkUpdate -ndb/bin/hugoScanRead -ndb/bin/hugoScanUpdate -ndb/bin/index -ndb/bin/index2 -ndb/bin/initronja -ndb/bin/interpreterInTup -ndb/bin/list_tables -ndb/bin/make-config.sh -ndb/bin/mgmtclient -ndb/bin/mgmtsrvr -ndb/bin/mkconfig -ndb/bin/ndb -ndb/bin/ndb_cpcc -ndb/bin/ndb_cpcd -ndb/bin/ndb_rep -ndb/bin/ndbsql -ndb/bin/newton_basic -ndb/bin/newton_br -ndb/bin/newton_pb -ndb/bin/newton_perf -ndb/bin/perfTransporterTest -ndb/bin/printConfig -ndb/bin/printSchemafile -ndb/bin/printSysfile -ndb/bin/redoLogFileReader -ndb/bin/restart -ndb/bin/restarter -ndb/bin/restarter2 -ndb/bin/restarts -ndb/bin/restore -ndb/bin/select_all -ndb/bin/select_count -ndb/bin/telco -ndb/bin/testBackup -ndb/bin/testBank -ndb/bin/testBasic -ndb/bin/testBasicAsynch -ndb/bin/testCopy -ndb/bin/testDataBuffers -ndb/bin/testDict -ndb/bin/testGrep -ndb/bin/testGrepVerify -ndb/bin/testIndex -ndb/bin/testInterpreter -ndb/bin/testKernelDataBuffer -ndb/bin/testLongSig -ndb/bin/testMgm -ndb/bin/testMgmapi -ndb/bin/testNdbApi -ndb/bin/testNodeRestart -ndb/bin/testOIBasic -ndb/bin/testOdbcDriver -ndb/bin/testOperations -ndb/bin/testRestartGci -ndb/bin/testScan -ndb/bin/testScanInterpreter -ndb/bin/testSimplePropertiesSection -ndb/bin/testSystemRestart -ndb/bin/testTimeout -ndb/bin/testTransactions -ndb/bin/test_cpcd -ndb/bin/test_event -ndb/bin/verify_index -ndb/bin/waiter -ndb/examples/ndbapi_example1/ndbapi_example1 -ndb/examples/ndbapi_example2/ndbapi_example2 -ndb/examples/ndbapi_example3/ndbapi_example3 -ndb/examples/ndbapi_example5/ndbapi_example5 -ndb/examples/select_all/select_all -ndb/lib/libMGM_API.so -ndb/lib/libNDB_API.so -ndb/lib/libNDB_ODBC.so -ndb/lib/libNEWTON_API.so -ndb/lib/libNEWTON_BASICTEST_COMMON.so -ndb/lib/libREP_API.so -ndb/lib/libndbclient.so -ndb/lib/libndbclient_extra.so -libmysqld/discover.cc -include/readline -ndb/config/autom4te.cache/* -ndb/config/config.mk -ndb/src/common/mgmcommon/printConfig/*.d -ndb/src/mgmclient/test_cpcd/*.d -*.d -libmysqld/examples/client_test.c +extra/tztime.cc +extra/mysql_tzinfo_to_sql +sql/mysql_tzinfo_to_sql_tztime.cc diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max index 5deedf7ac37..6eb71fcebb6 100755 --- a/BUILD/compile-pentium-max +++ b/BUILD/compile-pentium-max @@ -14,6 +14,6 @@ extra_configs="$pentium_configs" # fail extra_configs="$extra_configs --with-innodb --with-berkeley-db \ --with-embedded-server --enable-thread-safe-client \ - --with-openssl --with-vio --with-raid --without-ndbcluster" + --with-openssl --with-vio --with-raid --with-ndbcluster" . "$path/FINISH.sh" diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index d55a451a1ba..bcc5b0130a7 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -22,10 +22,12 @@ bar@bar.mysql.r18.ru bar@bar.udmsearch.izhnet.ru bar@deer.(none) bar@gw.udmsearch.izhnet.ru +bar@mysql.com bell@laptop.sanja.is.com.ua bell@sanja.is.com.ua bk@admin.bk bk@mysql.r18.ru +brian@avenger.(none) brian@brian-akers-computer.local carsten@tsort.bitbybit.dk davida@isil.mysql.com @@ -77,6 +79,7 @@ jcole@sarvik.tfr.cafe.ee jcole@tetra.spaceapes.com joreland@mysql.com jorge@linux.jorge.mysql.com +jplindst@t41.(none) kaj@work.mysql.com konstantin@mysql.com kostja@oak.local @@ -90,6 +93,7 @@ miguel@hegel.local miguel@light. miguel@light.local miguel@sartre.local +mikron@mikael-ronstr-ms-dator.local mmatthew@markslaptop. monty@bitch.mysql.fi monty@butch. @@ -169,6 +173,7 @@ tom@basil-firewall.home.com tomas@mc05.(none) tomas@poseidon.(none) tomas@poseidon.bredbandsbolaget.se +tomas@poseidon.elisa-laajakaista.fi tomas@poseidon.ndb.mysql.com tonu@hundin.mysql.fi tonu@volk.internalnet diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 5d4a1bdb987..0a89c6a8dd2 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; $opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; -$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0; +$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( "bdb", @@ -57,8 +57,7 @@ GetOptions( "with-other-libc=s", "with-small-disk", "without-embedded", - "clearlogs", - "without-ndbcluster", + "clearlogs", ) || usage(); usage() if ($opt_help); @@ -250,9 +249,15 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-low-memory" if ($opt_with_low_memory); $opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server); $opt_config_options.= " --with-raid" if ($opt_raid); - $opt_config_options.= " --with-readline" if ($opt_readline); + if ($opt_readline) + { + $opt_config_options.= " --with-readline"; + } + else + { + $opt_config_options.= " --without-readline --with-libedit"; + } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); - $opt_config_options.= " --without-ndbcluster" if ($opt_without_ndbcluster); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); # Only enable InnoDB when requested (required to be able to @@ -308,7 +313,7 @@ if ($opt_stage <= 3) } $flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug); - $flags.= " --with-ndbcluster" if ($opt__with_ndbcluster); + $flags.= " --with-ndbcluster" if ($opt_with_cluster); check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created"); safe_system("mv mysql*.t*gz $pwd/$host"); if (-f "client/.libs/mysqladmin") @@ -347,10 +352,12 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" . # if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) { + my $flags= ""; + $flags.= " --with-ndbcluster" if ($opt_with_cluster); log_timestamp(); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); - check_system("./mysql-test-run --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + check_system("./mysql-test-run $flags --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); } # @@ -571,7 +578,7 @@ If user is empty then no mail is sent. Set name suffix (e.g. 'com' or '-max') for a distribution --with cluster -Compile with NDB Cluster +Compile and test with NDB Cluster enabled --with-debug Build binaries with debug information (implies "--no-strip") diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright index 004476ff92c..adc4ae34a50 100755 --- a/Build-tools/mysql-copyright +++ b/Build-tools/mysql-copyright @@ -12,15 +12,17 @@ use Getopt::Long; $opt_help = 0; $opt_version = 0; +$opt_verbose = 0; $opt_target = "mysql-copyright-target-"; $opt_target .= `date +%d%m%y-%H%M%S`; chop $opt_target; -GetOptions("help","version","target=s") || error(); +GetOptions("help","version","target=s", "verbose") || error(); # fix the directory prefix for target dir $WD= cwd(); +my $win_flag = 0; $opt_target= $WD . '/' . $opt_target; &main(); @@ -50,6 +52,7 @@ sub main for ($i=0; $ARGV[$i]; $i++) { my $distfile= $ARGV[$i]; + $win_flag = ($distfile =~ /win-src/) ? 1 : 0; my $dir; $dir= "mysql-copyright-"; @@ -66,20 +69,19 @@ sub main } # if the distfile is mysql-3.22.22-alpha.tar.gz, then # distname is 'mysql-3.22.22-alpha' and suffix '.tar.gz' - if ($distfile =~ m/^($REG_BASENAME)([\-\_]) - ($REG_VERSION){1}([\.\-\+]) - (.*)?$/xo) + if ($distfile =~ + m/^($REG_BASENAME)([\-\_])($REG_VERSION){1}([\.\-\+]\w+\-\w+)?[\.\-\+](.*)?$/xo) { $distname= $1.$2.$3; - $suffix= $5.$6; + $suffix= $5; + $fileext = $6; $newdistname= $1."com".$2.$3; + $newdistname .= $suffix if $win_flag; } # find out the extract path (should be same as distname!) chomp($destdir= `tar ztf ../$distfile | head -1`); # remove slash from the end $destdir= substr($destdir, 0, -1); - print "destdir: $destdir\n"; - print "distname: $distname\n"; if ("$destdir" ne "$distname") { @@ -103,26 +105,51 @@ sub main # remove readline subdir and update configure accordingly system("rm -rf $destdir/cmd-line-utils/readline"); - unlink ("$destdir/configure") or die "Can't delete $destdir/configure: $!\n"; - `(cd $destdir ; sed -e 's!\ cmd-line-utils\/readline\/Makefile\ dnl!!g' < configure.in > configure.in.new)`; - rename ("$destdir/configure.in.new","$destdir/configure.in") or die "Can't rename $destdir/configure.in.new: $!\n";; - `(cd $destdir ; autoconf)`; + if ($win_flag) { + chdir("$destdir") or (print "$! Unable to change directory to $desdir!\n" && exit(0)); + } else { + chdir("$destdir"); + unlink ("configure") or die "Can't delete $destdir/configure: $!\n"; + open(CONFIGURE,"<configure.in") or die "$! Unable to open configure.in to read from!\n"; + undef $/; + my $configure = <CONFIGURE>; + close(CONFIGURE); + $configure =~ s|cmd\-line\-utils/readline/Makefile dnl\n?||g; + open(CONFIGURE,">configure.in") or die "$! Unable to open configure.in to write to!\n"; + print CONFIGURE $configure; + close(CONFIGURE); + `autoconf`; + if (! -f "configure") { + print "\"./configure\" was not produced, exiting!\n"; + exit(0); + } + } # fix file copyrights &fix_usage_copyright(); &add_copyright(); # rename the directory with new distribution name + chdir("$WD/$dir"); + print "renaming $destdir $newdistname\n" if $opt_verbose; rename($destdir, $newdistname); # tar the new distribution - `tar cz -f $opt_target/$newdistname.tar.gz *`; + `tar cz -f $WD/$newdistname.tar.gz $newdistname`; $pec= $? >> 8; abort($dir, "Making new tar archive failed!\n") if ($pec); # remove temporary directory - chdir ".."; - `rm -rf $dir/`; + chdir($WD) or print "$! Unable to move up one dir\n"; + `cd $WD`; + my $cwd = getcwd(); + print "current dir is $cwd\n" if $opt_verbose ; + if (-e $dir) { + print "Trying to delete $dir\n" if $opt_verbose; + if ( system("rm -rf $dir")){ + print "$! Unable to delete $dir!\n"; + } + } } exit(0); } @@ -131,14 +158,17 @@ sub main #### mysqld and MySQL client programs have a usage printed with --help. #### This usage includes a copyright, which needs to be modified #### - sub fix_usage_copyright { - my @Cfiles = `find . -type f -name \"*.c*\"`; - foreach my $Cfile (@Cfiles) + my $findlist = `find . -type f -name \"*.c*\"`; + my @files = split("\n", $findlist); + my $cwd = getcwd(); + + foreach my $file (@files) { - chop $Cfile; - `replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- $Cfile`; + next if ! -f $file; + print "processing file $file in cwd $cwd\n" if $opt_verbose; + `replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- "$file"` ; } } @@ -148,11 +178,16 @@ sub fix_usage_copyright sub add_copyright { - my @files = `find . -type f -name "*"`; + my $findlist = `find . -type f -name "*"`; + my @files = split("\n", $findlist); + my $cwd = getcwd(); + foreach my $file (@files) { - chop $file; - `$WD/Build-tools/mysql-copyright-2 $file`; + next if ! -f $file; + next if -B $file; + print "processing file $file in cwd $cwd\n" if $opt_verbose; + `$WD/Build-tools/mysql-copyright-2 "$file"`; } } diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index e946ed217d1..a1a870526da 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -89,6 +89,7 @@ sub add_copyright elsif ($ARGV =~ /\.c$/ || $ARGV =~ /\.cc$/ || $ARGV =~ /\.h$/ || + $ARGV =~ /\.cpp$/ || $ARGV =~ /\.yy$/) { $start_copyright="/* "; diff --git a/Makefile.am b/Makefile.am index aca5d4bade7..6d69ea85eb2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,7 @@ linked_sources = linked_client_sources linked_server_sources \ CLEANFILES = $(linked_sources) # This is just so that the linking is done early. -config.h: $(linked_sources) +all-local: $(linked_sources) linked_include_sources: cd include; $(MAKE) link_sources diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl index 8a626c56253..b51c37f8db2 100755 --- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl +++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl @@ -41,31 +41,55 @@ file1=C:\mysql\share\korean\errmsg.txt fulldirectory= [share\charsets] -file15=C:\mysql\share\charsets\latin1.conf -file16=C:\mysql\share\charsets\latin2.conf -file0=C:\mysql\share\charsets\win1251ukr.conf -file17=C:\mysql\share\charsets\latin5.conf +file0=C:\mysql\share\charsets\cp1250.xml +file1=C:\mysql\share\charsets\cp1251.conf +file2=C:\mysql\share\charsets\cp1251.xml +file3=C:\mysql\share\charsets\cp1256.xml file1=C:\mysql\share\charsets\cp1257.conf -file18=C:\mysql\share\charsets\Readme -file2=C:\mysql\share\charsets\croat.conf -file19=C:\mysql\share\charsets\swe7.conf -file3=C:\mysql\share\charsets\danish.conf -file4=C:\mysql\share\charsets\dec8.conf -file5=C:\mysql\share\charsets\dos.conf -file6=C:\mysql\share\charsets\estonia.conf -file7=C:\mysql\share\charsets\german1.conf -file8=C:\mysql\share\charsets\greek.conf -file9=C:\mysql\share\charsets\hebrew.conf -file20=C:\mysql\share\charsets\usa7.conf -file21=C:\mysql\share\charsets\win1250.conf -file10=C:\mysql\share\charsets\hp8.conf -fulldirectory= -file22=C:\mysql\share\charsets\win1251.conf -file11=C:\mysql\share\charsets\hungarian.conf -file23=C:\mysql\share\charsets\cp1251.conf -file12=C:\mysql\share\charsets\Index -file13=C:\mysql\share\charsets\koi8_ru.conf -file14=C:\mysql\share\charsets\koi8_ukr.conf +file4=C:\mysql\share\charsets\cp1257.xml +file5=C:\mysql\share\charsets\cp850.xml +file6=C:\mysql\share\charsets\cp852.xml +file7=C:\mysql\share\charsets\cp866.xml +file8=C:\mysql\share\charsets\croat.conf +file9=C:\mysql\share\charsets\danish.conf +file10=C:\mysql\share\charsets\dec8.conf +file10=C:\mysql\share\charsets\dec8.xml +file11=C:\mysql\share\charsets\dos.conf +file12=C:\mysql\share\charsets\estonia.conf +file13=C:\mysql\share\charsets\geostd8.xml +file14=C:\mysql\share\charsets\german1.conf +file15=C:\mysql\share\charsets\greek.xml +file16=C:\mysql\share\charsets\greek.conf +file17=C:\mysql\share\charsets\hebrew.xml +file18=C:\mysql\share\charsets\hebrew.conf +file19=C:\mysql\share\charsets\hp8.xml +file20=C:\mysql\share\charsets\hp8.conf +file21=C:\mysql\share\charsets\hungarian.conf +file22=C:\mysql\share\charsets\keybcs2.xml +file23=C:\mysql\share\charsets\koi8_ru.conf +file24=C:\mysql\share\charsets\koi8_ukr.conf +file25=C:\mysql\share\charsets\koi8r.xml +file26=C:\mysql\share\charsets\koi8u.xml +file27=C:\mysql\share\charsets\latin1.conf +file28=C:\mysql\share\charsets\latin1.xml +file29=C:\mysql\share\charsets\latin2.conf +file30=C:\mysql\share\charsets\latin2.xml +file31=C:\mysql\share\charsets\latin5.conf +file32=C:\mysql\share\charsets\latin5.xml +file33=C:\mysql\share\charsets\latin7.xml +file34=C:\mysql\share\charsets\macce.xml +file35=C:\mysql\share\charsets\macroman.xml +file36=C:\mysql\share\charsets\swe7.conf +file37=C:\mysql\share\charsets\swe7.xml +file38=C:\mysql\share\charsets\usa7.conf +file39=C:\mysql\share\charsets\win1250.conf +file40=C:\mysql\share\charsets\win1251ukr.conf +file41=C:\mysql\share\charsets\win1251.conf +file42=C:\mysql\share\charsets\Index +file43=C:\mysql\share\charsets\Index.xml +file44=C:\mysql\share\charsets\Readme +file45=C:\mysql\share\charsets\languages.html +fulldirectory= [Embedded\DLL\debug] file0=C:\mysql\embedded\DLL\debug\libmysqld.dll diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl index c54ff378a55..6564512de2c 100755 --- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl +++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl @@ -43,31 +43,55 @@ file1=C:\mysql\share\korean\errmsg.txt fulldirectory= [share\charsets] -file15=C:\mysql\share\charsets\latin1.conf -file16=C:\mysql\share\charsets\latin2.conf -file0=C:\mysql\share\charsets\win1251ukr.conf -file17=C:\mysql\share\charsets\latin5.conf +file0=C:\mysql\share\charsets\cp1250.xml +file1=C:\mysql\share\charsets\cp1251.conf +file2=C:\mysql\share\charsets\cp1251.xml +file3=C:\mysql\share\charsets\cp1256.xml file1=C:\mysql\share\charsets\cp1257.conf -file18=C:\mysql\share\charsets\Readme -file2=C:\mysql\share\charsets\croat.conf -file19=C:\mysql\share\charsets\swe7.conf -file3=C:\mysql\share\charsets\danish.conf -file4=C:\mysql\share\charsets\dec8.conf -file5=C:\mysql\share\charsets\dos.conf -file6=C:\mysql\share\charsets\estonia.conf -file7=C:\mysql\share\charsets\german1.conf -file8=C:\mysql\share\charsets\greek.conf -file9=C:\mysql\share\charsets\hebrew.conf -file20=C:\mysql\share\charsets\usa7.conf -file21=C:\mysql\share\charsets\win1250.conf -file10=C:\mysql\share\charsets\hp8.conf -fulldirectory= -file22=C:\mysql\share\charsets\win1251.conf -file11=C:\mysql\share\charsets\hungarian.conf -file23=C:\mysql\share\charsets\cp1251.conf -file12=C:\mysql\share\charsets\Index -file13=C:\mysql\share\charsets\koi8_ru.conf -file14=C:\mysql\share\charsets\koi8_ukr.conf +file4=C:\mysql\share\charsets\cp1257.xml +file5=C:\mysql\share\charsets\cp850.xml +file6=C:\mysql\share\charsets\cp852.xml +file7=C:\mysql\share\charsets\cp866.xml +file8=C:\mysql\share\charsets\croat.conf +file9=C:\mysql\share\charsets\danish.conf +file10=C:\mysql\share\charsets\dec8.conf +file10=C:\mysql\share\charsets\dec8.xml +file11=C:\mysql\share\charsets\dos.conf +file12=C:\mysql\share\charsets\estonia.conf +file13=C:\mysql\share\charsets\geostd8.xml +file14=C:\mysql\share\charsets\german1.conf +file15=C:\mysql\share\charsets\greek.xml +file16=C:\mysql\share\charsets\greek.conf +file17=C:\mysql\share\charsets\hebrew.xml +file18=C:\mysql\share\charsets\hebrew.conf +file19=C:\mysql\share\charsets\hp8.xml +file20=C:\mysql\share\charsets\hp8.conf +file21=C:\mysql\share\charsets\hungarian.conf +file22=C:\mysql\share\charsets\keybcs2.xml +file23=C:\mysql\share\charsets\koi8_ru.conf +file24=C:\mysql\share\charsets\koi8_ukr.conf +file25=C:\mysql\share\charsets\koi8r.xml +file26=C:\mysql\share\charsets\koi8u.xml +file27=C:\mysql\share\charsets\latin1.conf +file28=C:\mysql\share\charsets\latin1.xml +file29=C:\mysql\share\charsets\latin2.conf +file30=C:\mysql\share\charsets\latin2.xml +file31=C:\mysql\share\charsets\latin5.conf +file32=C:\mysql\share\charsets\latin5.xml +file33=C:\mysql\share\charsets\latin7.xml +file34=C:\mysql\share\charsets\macce.xml +file35=C:\mysql\share\charsets\macroman.xml +file36=C:\mysql\share\charsets\swe7.conf +file37=C:\mysql\share\charsets\swe7.xml +file38=C:\mysql\share\charsets\usa7.conf +file39=C:\mysql\share\charsets\win1250.conf +file40=C:\mysql\share\charsets\win1251ukr.conf +file41=C:\mysql\share\charsets\win1251.conf +file42=C:\mysql\share\charsets\Index +file43=C:\mysql\share\charsets\Index.xml +file44=C:\mysql\share\charsets\Readme +file45=C:\mysql\share\charsets\languages.html +fulldirectory= [Embedded\DLL\debug] file0=C:\mysql\embedded\DLL\debug\libmysqld.dll diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl index 8a626c56253..b51c37f8db2 100755 --- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl +++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl @@ -41,31 +41,55 @@ file1=C:\mysql\share\korean\errmsg.txt fulldirectory= [share\charsets] -file15=C:\mysql\share\charsets\latin1.conf -file16=C:\mysql\share\charsets\latin2.conf -file0=C:\mysql\share\charsets\win1251ukr.conf -file17=C:\mysql\share\charsets\latin5.conf +file0=C:\mysql\share\charsets\cp1250.xml +file1=C:\mysql\share\charsets\cp1251.conf +file2=C:\mysql\share\charsets\cp1251.xml +file3=C:\mysql\share\charsets\cp1256.xml file1=C:\mysql\share\charsets\cp1257.conf -file18=C:\mysql\share\charsets\Readme -file2=C:\mysql\share\charsets\croat.conf -file19=C:\mysql\share\charsets\swe7.conf -file3=C:\mysql\share\charsets\danish.conf -file4=C:\mysql\share\charsets\dec8.conf -file5=C:\mysql\share\charsets\dos.conf -file6=C:\mysql\share\charsets\estonia.conf -file7=C:\mysql\share\charsets\german1.conf -file8=C:\mysql\share\charsets\greek.conf -file9=C:\mysql\share\charsets\hebrew.conf -file20=C:\mysql\share\charsets\usa7.conf -file21=C:\mysql\share\charsets\win1250.conf -file10=C:\mysql\share\charsets\hp8.conf -fulldirectory= -file22=C:\mysql\share\charsets\win1251.conf -file11=C:\mysql\share\charsets\hungarian.conf -file23=C:\mysql\share\charsets\cp1251.conf -file12=C:\mysql\share\charsets\Index -file13=C:\mysql\share\charsets\koi8_ru.conf -file14=C:\mysql\share\charsets\koi8_ukr.conf +file4=C:\mysql\share\charsets\cp1257.xml +file5=C:\mysql\share\charsets\cp850.xml +file6=C:\mysql\share\charsets\cp852.xml +file7=C:\mysql\share\charsets\cp866.xml +file8=C:\mysql\share\charsets\croat.conf +file9=C:\mysql\share\charsets\danish.conf +file10=C:\mysql\share\charsets\dec8.conf +file10=C:\mysql\share\charsets\dec8.xml +file11=C:\mysql\share\charsets\dos.conf +file12=C:\mysql\share\charsets\estonia.conf +file13=C:\mysql\share\charsets\geostd8.xml +file14=C:\mysql\share\charsets\german1.conf +file15=C:\mysql\share\charsets\greek.xml +file16=C:\mysql\share\charsets\greek.conf +file17=C:\mysql\share\charsets\hebrew.xml +file18=C:\mysql\share\charsets\hebrew.conf +file19=C:\mysql\share\charsets\hp8.xml +file20=C:\mysql\share\charsets\hp8.conf +file21=C:\mysql\share\charsets\hungarian.conf +file22=C:\mysql\share\charsets\keybcs2.xml +file23=C:\mysql\share\charsets\koi8_ru.conf +file24=C:\mysql\share\charsets\koi8_ukr.conf +file25=C:\mysql\share\charsets\koi8r.xml +file26=C:\mysql\share\charsets\koi8u.xml +file27=C:\mysql\share\charsets\latin1.conf +file28=C:\mysql\share\charsets\latin1.xml +file29=C:\mysql\share\charsets\latin2.conf +file30=C:\mysql\share\charsets\latin2.xml +file31=C:\mysql\share\charsets\latin5.conf +file32=C:\mysql\share\charsets\latin5.xml +file33=C:\mysql\share\charsets\latin7.xml +file34=C:\mysql\share\charsets\macce.xml +file35=C:\mysql\share\charsets\macroman.xml +file36=C:\mysql\share\charsets\swe7.conf +file37=C:\mysql\share\charsets\swe7.xml +file38=C:\mysql\share\charsets\usa7.conf +file39=C:\mysql\share\charsets\win1250.conf +file40=C:\mysql\share\charsets\win1251ukr.conf +file41=C:\mysql\share\charsets\win1251.conf +file42=C:\mysql\share\charsets\Index +file43=C:\mysql\share\charsets\Index.xml +file44=C:\mysql\share\charsets\Readme +file45=C:\mysql\share\charsets\languages.html +fulldirectory= [Embedded\DLL\debug] file0=C:\mysql\embedded\DLL\debug\libmysqld.dll diff --git a/VC++Files/examples/udf_example/udf_example.def b/VC++Files/examples/udf_example/udf_example.def index c1cfeea63f8..9764343e5f2 100644 --- a/VC++Files/examples/udf_example/udf_example.def +++ b/VC++Files/examples/udf_example/udf_example.def @@ -2,8 +2,17 @@ LIBRARY MYUDF DESCRIPTION 'MySQL Sample for UDF' VERSION 1.0 EXPORTS - metaphon - myfunc_double - myfunc_int - sequence - avgcost
\ No newline at end of file + metaphon_init + metaphon_deinit + metaphon + myfunc_double_init + myfunc_double + myfunc_int + sequence_init + sequence_deinit + sequence + avgcost_init + avgcost_deinit + avgcost_reset + avgcost_add + avgcost diff --git a/VC++Files/winmysqladmin/main.cpp b/VC++Files/winmysqladmin/main.cpp index 6ca29659255..dfb2004a780 100644 --- a/VC++Files/winmysqladmin/main.cpp +++ b/VC++Files/winmysqladmin/main.cpp @@ -1196,7 +1196,7 @@ bool __fastcall TForm1::Shutd() if (IsConnect)
{
mysql_kill(MySQL,mysql_thread_id(MySQL));
- mysql_shutdown(MySQL);
+ mysql_shutdown(MySQL, SHUTDOWN_DEFAULT); StatusLine->SimpleText = "";
}
diff --git a/VC++Files/winmysqladmin/mysql.h b/VC++Files/winmysqladmin/mysql.h index e83babb8fa8..f01b55f5d3f 100644 --- a/VC++Files/winmysqladmin/mysql.h +++ b/VC++Files/winmysqladmin/mysql.h @@ -229,7 +229,9 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *q, unsigned int length); int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); -int STDCALL mysql_shutdown(MYSQL *mysql); +int STDCALL mysql_shutdown(MYSQL *mysql, + enum enum_shutdown_level + shutdown_level); int STDCALL mysql_dump_debug_info(MYSQL *mysql); int STDCALL mysql_refresh(MYSQL *mysql, unsigned int refresh_options); diff --git a/VC++Files/winmysqladmin/mysql_com.h b/VC++Files/winmysqladmin/mysql_com.h index 2a1471f735d..0870f340451 100644 --- a/VC++Files/winmysqladmin/mysql_com.h +++ b/VC++Files/winmysqladmin/mysql_com.h @@ -155,6 +155,32 @@ enum enum_field_types { FIELD_TYPE_DECIMAL, FIELD_TYPE_TINY, #define FIELD_TYPE_CHAR FIELD_TYPE_TINY /* For compability */ #define FIELD_TYPE_INTERVAL FIELD_TYPE_ENUM /* For compability */ +enum enum_shutdown_level { + /* + We want levels to be in growing order of hardness. So we leave room + for future intermediate levels. For now, escalating one level is += 10; + later if we insert new levels in between we will need a function + next_shutdown_level(level). Note that DEFAULT does not respect the + growing property. + */ + SHUTDOWN_DEFAULT= 0, /* mapped to WAIT_ALL_BUFFERS for now */ + /* + Here is the list in growing order (the next does the previous plus + something). WAIT_ALL_BUFFERS is what we have now. Others are "this MySQL + server does not support this shutdown level yet". + */ + SHUTDOWN_WAIT_CONNECTIONS= 10, /* wait for existing connections to finish */ + SHUTDOWN_WAIT_TRANSACTIONS= 20, /* wait for existing trans to finish */ + SHUTDOWN_WAIT_STATEMENTS= 30, /* wait for existing updating stmts to finish */ + SHUTDOWN_WAIT_ALL_BUFFERS= 40, /* flush InnoDB buffers */ + SHUTDOWN_WAIT_CRITICAL_BUFFERS= 50, /* flush MyISAM buffs (no corruption) */ + /* Now the 2 levels of the KILL command */ +#if MYSQL_VERSION_ID >= 50000 + KILL_QUERY= 254, +#endif + KILL_CONNECTION= 255 +}; + extern unsigned long max_allowed_packet; extern unsigned long net_buffer_length; diff --git a/acconfig.h b/acconfig.h index 2065cefdad9..f9cff3010ca 100644 --- a/acconfig.h +++ b/acconfig.h @@ -84,6 +84,7 @@ #undef HAVE_CHARSET_euckr #undef HAVE_CHARSET_gb2312 #undef HAVE_CHARSET_gbk +#undef HAVE_CHARSET_geostd8 #undef HAVE_CHARSET_greek #undef HAVE_CHARSET_hebrew #undef HAVE_CHARSET_hp8 @@ -115,6 +116,9 @@ /* Builds Example DB */ #undef HAVE_EXAMPLE_DB +/* Builds Archive Storage Engine */ +#undef HAVE_ARCHIVE_DB + /* fp_except from ieeefp.h */ #undef HAVE_FP_EXCEPT @@ -278,6 +282,12 @@ /* mysql client protocoll version */ #undef PROTOCOL_VERSION +/* ndb version */ +#undef NDB_VERSION_MAJOR +#undef NDB_VERSION_MINOR +#undef NDB_VERSION_BUILD +#undef NDB_VERSION_STATUS + /* Define if qsort returns void */ #undef QSORT_TYPE_IS_VOID diff --git a/acinclude.m4 b/acinclude.m4 index c2daf4bbc3c..30bb1549715 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1310,7 +1310,7 @@ AC_DEFUN([MYSQL_CHECK_EXAMPLEDB], [ AC_ARG_WITH([example-storage-engine], [ --with-example-storage-engine - Enable the Example Storge Engine], + Enable the Example Storage Engine], [exampledb="$withval"], [exampledb=no]) AC_MSG_CHECKING([for example storage engine]) @@ -1333,6 +1333,36 @@ dnl END OF MYSQL_CHECK_EXAMPLE SECTION dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_CHECK_ARCHIVEDB +dnl Sets HAVE_ARCHIVE_DB if --with-archive-storage-engine is used +dnl --------------------------------------------------------------------------- +AC_DEFUN([MYSQL_CHECK_ARCHIVEDB], [ + AC_ARG_WITH([archive-storage-engine], + [ + --with-archive-storage-engine + Enable the Archive Storage Engine], + [archivedb="$withval"], + [archivedb=no]) + AC_MSG_CHECKING([for archive storage engine]) + + case "$archivedb" in + yes ) + AC_DEFINE(HAVE_ARCHIVE_DB) + AC_MSG_RESULT([yes]) + [archivedb=yes] + ;; + * ) + AC_MSG_RESULT([no]) + [archivedb=no] + ;; + esac + +]) +dnl --------------------------------------------------------------------------- +dnl END OF MYSQL_CHECK_ARCHIVE SECTION +dnl --------------------------------------------------------------------------- + +dnl --------------------------------------------------------------------------- dnl Macro: MYSQL_CHECK_NDBCLUSTER dnl Sets HAVE_NDBCLUSTER_DB if --with-ndbcluster is used dnl --------------------------------------------------------------------------- @@ -1353,6 +1383,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --with-ndb-test Include the NDB Cluster ndbapi test programs], [ndb_test="$withval"], [ndb_test=no]) + AC_ARG_WITH([ndb-docs], + [ + --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation], + [ndb_docs="$withval"], + [ndb_docs=no]) AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) @@ -1392,6 +1427,17 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac + have_ndb_docs=no + case "$ndb_docs" in + yes ) + AC_MSG_RESULT([-- including ndbapi and mgmapi documentation]) + have_ndb_docs="yes" + ;; + * ) + AC_MSG_RESULT([-- not including ndbapi and mgmapi documentation]) + ;; + esac + AC_MSG_RESULT([done.]) ]) @@ -1422,7 +1468,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ ;; esac - AM_CONDITIONAL(HAVE_NDBCLUSTER_DB, test "have_ndbcluster" = "yes") + AM_CONDITIONAL([HAVE_NDBCLUSTER_DB], [ test "$have_ndbcluster" = "yes" ]) AC_SUBST(ndbcluster_includes) AC_SUBST(ndbcluster_libs) AC_SUBST(ndbcluster_system_libs) diff --git a/client/mysqladmin.c b/client/mysqladmin.c index fcbcc0d7151..aaed101a83e 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -509,7 +509,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) !stat(pidfile, &pidfile_status)) last_modified= pidfile_status.st_mtime; - if (mysql_shutdown(mysql)) + if (mysql_shutdown(mysql, SHUTDOWN_DEFAULT)) { my_printf_error(0,"shutdown failed; error: '%s'",MYF(ME_BELL), mysql_error(mysql)); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 221015f8c7d..ba030379792 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -18,7 +18,6 @@ #undef MYSQL_SERVER #include "client_priv.h" #include <time.h> -#include <assert.h> #include "log_event.h" #define BIN_LOG_HEADER_SIZE 4 diff --git a/client/mysqldump.c b/client/mysqldump.c index 2b40264325f..218a97c252e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -43,7 +43,6 @@ #include <my_sys.h> #include <m_string.h> #include <m_ctype.h> -#include <assert.h> #include "client_priv.h" #include "mysql.h" @@ -394,7 +393,11 @@ static void write_header(FILE *sql_file, char *db_name) mysql_get_server_info(&mysql_connection)); } if (opt_set_charset) - fprintf(sql_file,"\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=%s */;\n",default_charset); + fprintf(sql_file, +"\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;" +"\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 (!path) { fprintf(md_result_file,"\ @@ -425,7 +428,9 @@ static void write_footer(FILE *sql_file) } if (opt_set_charset) fprintf(sql_file, - "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n"); +"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" +"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" +"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); fputs("\n", sql_file); } } /* write_footer */ diff --git a/client/mysqltest.c b/client/mysqltest.c index f638053b515..88b7917612e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -59,7 +59,8 @@ #include <sys/stat.h> #include <violite.h> -#define MAX_QUERY 65536 +#define MAX_QUERY 131072 +#define MAX_VAR_NAME 256 #define MAX_COLUMNS 256 #define PAD_SIZE 128 #define MAX_CONS 128 @@ -386,6 +387,7 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char* query) register char c; register int escaped = 0; VAR* v; + DBUG_ENTER("do_eval"); for (p= query; (c = *p); ++p) { @@ -417,6 +419,7 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char* query) break; } } + DBUG_VOID_RETURN; } @@ -628,6 +631,7 @@ static int check_result(DYNAMIC_STRING* ds, const char* fname, return error; } + VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw, my_bool ignore_not_existing) { @@ -642,25 +646,26 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw, if (!(digit < 10 && digit >= 0)) { const char* save_var_name = var_name, *end; + uint length; end = (var_name_end) ? *var_name_end : 0; while (my_isvar(charset_info,*var_name) && var_name != end) - ++var_name; + var_name++; if (var_name == save_var_name) { if (ignore_not_existing) DBUG_RETURN(0); die("Empty variable"); } + length= (uint) (var_name - save_var_name); - if (!(v = (VAR*) hash_search(&var_hash, save_var_name, - var_name - save_var_name))) + if (!(v = (VAR*) hash_search(&var_hash, save_var_name, length)) && + length < MAX_VAR_NAME) { - char c=*var_name, *s=(char*)var_name;; - *s=0; - v=var_from_env(save_var_name, ""); - *s=c; + char buff[MAX_VAR_NAME+1]; + strmake(buff, save_var_name, length); + v= var_from_env(buff, ""); } - --var_name; /* Point at last character */ + var_name--; /* Point at last character */ } else v = var_reg + digit; @@ -1737,6 +1742,7 @@ int read_line(char* buf, int size) enum {R_NORMAL, R_Q1, R_ESC_Q_Q1, R_ESC_Q_Q2, R_ESC_SLASH_Q1, R_ESC_SLASH_Q2, R_Q2, R_COMMENT, R_LINE_START} state= R_LINE_START; + DBUG_ENTER("read_line"); start_lineno= *lineno; for (; p < buf_end ;) @@ -1750,7 +1756,7 @@ int read_line(char* buf, int size) cur_file--; lineno--; if (cur_file == file_stack) - return 1; + DBUG_RETURN(1); continue; } @@ -1760,7 +1766,7 @@ int read_line(char* buf, int size) if (end_of_query(c)) { *p= 0; - return 0; + DBUG_RETURN(0); } else if (c == '\'') state = R_Q1; @@ -1777,7 +1783,7 @@ int read_line(char* buf, int size) { *p= 0; (*lineno)++; - return 0; + DBUG_RETURN(0); } break; case R_LINE_START: @@ -1795,12 +1801,12 @@ int read_line(char* buf, int size) { *buf++= '}'; *buf= 0; - return 0; + DBUG_RETURN(0); } else if (end_of_query(c) || c == '{') { *p= 0; - return 0; + DBUG_RETURN(0); } else if (c == '\'') state= R_Q1; @@ -1820,7 +1826,7 @@ int read_line(char* buf, int size) if (end_of_query(c)) { *p= 0; - return 0; + DBUG_RETURN(0); } if (c != '\'') state= R_NORMAL; @@ -1841,7 +1847,7 @@ int read_line(char* buf, int size) if (end_of_query(c)) { *p= 0; - return 0; + DBUG_RETURN(0); } if (c != '"') state= R_NORMAL; @@ -1857,7 +1863,7 @@ int read_line(char* buf, int size) *p++= c; } *p= 0; /* Always end with \0 */ - return feof(*cur_file); + DBUG_RETURN(feof(*cur_file)); } @@ -1892,8 +1898,11 @@ int read_query(struct st_query** q_ptr) q->type = Q_UNKNOWN; q->query_buf= q->query= 0; if (read_line(read_query_buf, sizeof(read_query_buf))) + { + DBUG_PRINT("warning",("too long query")); DBUG_RETURN(1); - + } + DBUG_PRINT("info", ("query: %s", read_query_buf)); if (*p == '#') { q->type = Q_COMMENT; @@ -2259,6 +2268,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) char* query; int query_len, got_error_on_send= 0; DBUG_ENTER("run_query"); + DBUG_PRINT("enter",("flags: %d", flags)); if (q->type != Q_EVAL) { @@ -2726,7 +2736,10 @@ int main(int argc, char **argv) case Q_EVAL_RESULT: eval_result = 1; break; case Q_EVAL: if (q->query == q->query_buf) + { q->query= q->first_argument; + q->first_word_len= 0; + } /* fall through */ case Q_QUERY_VERTICAL: case Q_QUERY_HORIZONTAL: @@ -2736,13 +2749,16 @@ int main(int argc, char **argv) { /* This happens when we use 'query_..' on it's own line */ q_send_flag=1; + DBUG_PRINT("info", + ("query: '%s' first_word_len: %d send_flag=1", + q->query, q->first_word_len)); break; } /* fix up query pointer if this is * first iteration for this line */ if (q->query == q->query_buf) q->query += q->first_word_len + 1; display_result_vertically= (q->type==Q_QUERY_VERTICAL); - error |= run_query(&cur_con->mysql, q, QUERY_REAP|QUERY_SEND); + error|= run_query(&cur_con->mysql, q, QUERY_REAP|QUERY_SEND); display_result_vertically= old_display_result_vertically; break; } diff --git a/configure.in b/configure.in index fccf9f5b4d0..27f1fbe0fab 100644 --- a/configure.in +++ b/configure.in @@ -12,6 +12,12 @@ DOT_FRM_VERSION=6 # See the libtool docs for information on how to do shared lib versions. SHARED_LIB_VERSION=14:0:0 +# ndb version +NDB_VERSION_MAJOR=3 +NDB_VERSION_MINOR=5 +NDB_VERSION_BUILD=0 +NDB_VERSION_STATUS=beta + # Set all version vars based on $VERSION. How do we do this more elegant ? # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` @@ -64,6 +70,16 @@ AC_SUBST(AVAILABLE_LANGUAGES) AC_SUBST(AVAILABLE_LANGUAGES_ERRORS) AC_SUBST_FILE(AVAILABLE_LANGUAGES_ERRORS_RULES) +AC_SUBST([NDB_VERSION_MAJOR]) +AC_SUBST([NDB_VERSION_MINOR]) +AC_SUBST([NDB_VERSION_BUILD]) +AC_SUBST([NDB_VERSION_STATUS]) +AC_DEFINE_UNQUOTED([NDB_VERSION_MAJOR], [$NDB_VERSION_MAJOR]) +AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR]) +AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD]) +AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"]) + + # Canonicalize the configuration name. SYSTEM_TYPE="$host_vendor-$host_os" MACHINE_TYPE="$host_cpu" @@ -354,12 +370,15 @@ AC_SUBST(INSTALL_SCRIPT) export CC CXX CFLAGS LD LDFLAGS AR +ndb_cxxflags_fix= if test "$GXX" = "yes" then # mysqld requires -fno-implicit-templates. # Disable exceptions as they seams to create problems with gcc and threads. # mysqld doesn't use run-time-type-checking, so we disable it. CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" + # ndb cannot be compiled with -fno-implicit-templaces + ndb_cxxflags_fix="$ndb_cxxflags_fix -fimplicit-templates" # If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux, # we will gets some problems when linking static programs. @@ -432,6 +451,15 @@ AC_SUBST(HOSTNAME) AC_SUBST(PERL) AC_SUBST(PERL5) +# for build ndb docs + +AC_PATH_PROG(DOXYGEN, doxygen, no) +AC_PATH_PROG(PDFLATEX, pdflatex, no) +AC_PATH_PROG(MAKEINDEX, makeindex, no) +AC_SUBST(DOXYGEN) +AC_SUBST(PDFLATEX) +AC_SUBST(MAKEINDEX) + # Lock for PS AC_PATH_PROG(PS, ps, ps) AC_MSG_CHECKING("how to check if pid exists") @@ -1004,6 +1032,7 @@ case $SYSTEM_TYPE in CXXFLAGS="$CXXFLAGS +O2" MAX_C_OPTIMIZE="" MAX_CXX_OPTIMIZE="" + ndb_cxxflags_fix="$ndb_cxxflags_fix -Aa" fi ;; *rhapsody*) @@ -2307,14 +2336,15 @@ dnl you must also create strings/ctype-$charset_name.c AC_DIVERT_PUSH(0) +define(CHARSETS_AVAILABLE0,binary) define(CHARSETS_AVAILABLE1,ascii armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257) -define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 dec8 euckr gb2312 gbk) +define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 dec8 euckr gb2312 gbk geostd8) define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u) define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman) define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8) DEFAULT_CHARSET=latin1 -CHARSETS_AVAILABLE="CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5" +CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5" CHARSETS_COMPLEX="big5 cp1250 euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8" AC_DIVERT_POP @@ -2322,6 +2352,7 @@ AC_DIVERT_POP AC_ARG_WITH(charset, [ --with-charset=CHARSET Default character set, use one of: + CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 @@ -2415,6 +2446,9 @@ do AC_DEFINE(USE_MB) AC_DEFINE(USE_MB_IDENT) ;; + geostd8) + AC_DEFINE(HAVE_CHARSET_geostd8) + ;; greek) AC_DEFINE(HAVE_CHARSET_greek) ;; @@ -2543,6 +2577,10 @@ case $default_charset in default_charset_default_collation="gbk_chinese_ci" default_charset_collations="gbk_chinese_ci gbk_bin" ;; + geostd8) + default_charset_default_collation="geostd8_general_ci" + default_charset_collations="geostd8_general_ci geostd8_bin" + ;; greek) default_charset_default_collation="greek_general_ci" default_charset_collations="greek_general_ci greek_bin" @@ -2605,7 +2643,17 @@ case $default_charset in ;; ucs2) default_charset_default_collation="ucs2_general_ci" - default_charset_collations="ucs2_general_ci ucs2_bin" + define(UCSC1, ucs2_general_ci ucs2_bin) + define(UCSC2, ucs2_czech_ci ucs2_danish_ci) + define(UCSC3, ucs2_estonian_ci ucs2_icelandic_ci) + define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci) + define(UCSC5, ucs2_polish_ci ucs2_romanian_ci) + define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci) + define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci) + define(UCSC8, ucs2_swedish_ci ucs2_turkish_ci) + define(UCSC9, ucs2_unicode_ci) + UCSC="UCSC1 UCSC2 UCSC3 UCSC4 UCSC5 UCSC6 UCSC7 UCSC8 UCSC9" + default_charset_collations="$UCSC" ;; ujis) default_charset_default_collation="ujis_japanese_ci" @@ -2613,7 +2661,17 @@ case $default_charset in ;; utf8) default_charset_default_collation="utf8_general_ci" - default_charset_collations="utf8_general_ci utf8_bin" + define(UTFC1, utf8_general_ci utf8_bin) + define(UTFC2, utf8_czech_ci utf8_danish_ci) + define(UTFC3, utf8_estonian_ci utf8_icelandic_ci) + define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci) + define(UTFC5, utf8_polish_ci utf8_romanian_ci) + define(UTFC6, utf8_slovak_ci utf8_slovenian_ci) + define(UTFC7, utf8_spanish2_ci utf8_spanish_ci) + define(UTFC8, utf8_swedish_ci utf8_turkish_ci) + define(UTFC9, utf8_unicode_ci) + UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9" + default_charset_collations="$UTFC" ;; *) AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE). @@ -2652,6 +2710,7 @@ MYSQL_CHECK_ISAM MYSQL_CHECK_BDB MYSQL_CHECK_INNODB MYSQL_CHECK_EXAMPLEDB +MYSQL_CHECK_ARCHIVEDB MYSQL_CHECK_NDBCLUSTER # If we have threads generate some library functions and test programs @@ -2868,21 +2927,20 @@ if test X"$have_ndbcluster" = Xyes then MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster" + CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)" if test "$with_debug" = "yes" then # Medium debug. NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" - CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_DEBUG_LOC)" elif test "$with_debug" = "full" then NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" - CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_DEBUG_LOC)" else NDB_DEFS="-DNDEBUG" - CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_RELEASE_LOC)" fi AC_SUBST([NDB_DEFS]) +AC_SUBST([ndb_cxxflags_fix]) ndb_transporter_opt_objs="" if test X"$have_ndb_shm" = Xyes @@ -2895,19 +2953,26 @@ then fi AC_SUBST([ndb_transporter_opt_objs]) +ndb_opt_subdirs= ndb_bin_am_ldflags="-static" if test X"$have_ndb_test" = Xyes then - ndb_opt_test_subdirs="tools ndbapi run-test" + ndb_opt_subdirs="test" + ndb_bin_am_ldflags="" +fi +if test X"$have_ndb_docs" = Xyes +then + ndb_opt_subdirs="$ndb_opt_subdirs docs" ndb_bin_am_ldflags="" fi AC_SUBST([ndb_bin_am_ldflags]) -AC_SUBST([ndb_opt_test_subdirs]) +AC_SUBST([ndb_opt_subdirs]) AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/src/Makefile ndb/src/common/Makefile dnl + ndb/docs/Makefile dnl ndb/tools/Makefile dnl ndb/src/common/debugger/Makefile ndb/src/common/debugger/signaldata/Makefile dnl - ndb/src/common/portlib/Makefile ndb/src/common/portlib/unix/Makefile dnl + ndb/src/common/portlib/Makefile dnl ndb/src/common/util/Makefile dnl ndb/src/common/logger/Makefile dnl ndb/src/common/transporter/Makefile dnl diff --git a/extra/Makefile.am b/extra/Makefile.am index df29a3a6ab7..aec7ad7dda5 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -14,7 +14,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include @ndbcluster_includes@ +INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include \ + @ndbcluster_includes@ -I$(top_srcdir)/sql LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \ ../dbug/libdbug.a ../strings/libmystrings.a bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \ diff --git a/extra/perror.c b/extra/perror.c index 26ebdd5b096..f1b1a4c2005 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -256,7 +256,7 @@ int main(int argc,char *argv[]) else { if (verbose) - printf("MySql error: %3d = %s\n",code,msg); + printf("MySQL error: %3d = %s\n",code,msg); else puts(msg); } diff --git a/heap/hp_hash.c b/heap/hp_hash.c index 1f36f9b3059..2014b2b0adc 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -18,7 +18,6 @@ #include "heapdef.h" #include <m_ctype.h> -#include <assert.h> diff --git a/include/m_ctype.h b/include/m_ctype.h index 475f73f16c2..785fa431385 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -53,7 +53,6 @@ typedef struct unicase_info_st #define MY_SEQ_SPACES 2 /* My charsets_list flags */ -#define MY_NO_SETS 0 #define MY_CS_COMPILED 1 /* compiled-in sets */ #define MY_CS_CONFIG 2 /* sets that have a *.conf file */ #define MY_CS_INDEX 4 /* sets listed in the Index file */ @@ -62,7 +61,7 @@ typedef struct unicase_info_st #define MY_CS_PRIMARY 32 /* if primary collation */ #define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ #define MY_CS_UNICODE 128 /* is a charset is full unicode */ -#define MY_CS_NONTEXT 256 /* if a charset is not sprintf() compatible */ +#define MY_CS_READY 256 /* if a charset is initialized */ #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ #define MY_CHARSET_UNDEFINED 0 @@ -102,6 +101,7 @@ struct charset_info_st; typedef struct my_collation_handler_st { + my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); /* Collation routines */ int (*strnncoll)(struct charset_info_st *, const uchar *, uint, const uchar *, uint, my_bool); @@ -140,6 +140,7 @@ extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; typedef struct my_charset_handler_st { + my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); /* Multibyte routines */ int (*ismbchar)(struct charset_info_st *, const char *, const char *); int (*mbcharlen)(struct charset_info_st *, uint); @@ -200,15 +201,17 @@ typedef struct charset_info_st const char *csname; const char *name; const char *comment; + const char *tailoring; uchar *ctype; uchar *to_lower; uchar *to_upper; uchar *sort_order; + uint16 *contractions; uint16 **sort_order_big; uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; - uchar state_map[256]; - uchar ident_map[256]; + uchar *state_map; + uchar *ident_map; uint strxfrm_multiply; uint mbminlen; uint mbmaxlen; diff --git a/include/m_string.h b/include/m_string.h index 7fc35dc2e48..0709dbaffb4 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -123,7 +123,6 @@ extern void bmove_align(gptr dst,const gptr src,uint len); #endif #ifdef HAVE_purify -#include <assert.h> #define memcpy_overlap(A,B,C) \ DBUG_ASSERT((A) <= (B) || ((B)+(C)) <= (A)); \ bmove((byte*) (A),(byte*) (B),(size_t) (C)); diff --git a/include/my_dbug.h b/include/my_dbug.h index 5c88e2e42db..bc90b91f1c7 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -16,6 +16,10 @@ #ifndef _dbug_h #define _dbug_h +#ifdef DBUG_OFF +#define NDEBUG /* for assert.h */ +#endif +#include <assert.h> #ifdef __cplusplus extern "C" { #endif diff --git a/include/my_global.h b/include/my_global.h index 3d1a770d877..70b5b1af819 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1102,6 +1102,14 @@ do { doubleget_union _tmp; \ #endif /* sint2korr */ /* + Macro for reading 32-bit integer from network byte order (big-endian) + from unaligned memory location. +*/ +#define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\ + (((uint32) ((uchar) (A)[2])) << 8) |\ + (((uint32) ((uchar) (A)[1])) << 16) |\ + (((uint32) ((uchar) (A)[0])) << 24)) +/* Define-funktions for reading and storing in machine format from/to short/long to/from some place in memory V should be a (not register) variable, M is a pointer to byte @@ -1178,16 +1186,6 @@ do { doubleget_union _tmp; \ #define statistic_add(V,C,L) (V)+=(C) #endif -#ifdef HAVE_OPENSSL -#include <openssl/opensslv.h> -#if OPENSSL_VERSION_NUMBER < 0x0090700f -#define DES_cblock des_cblock -#define DES_key_schedule des_key_schedule -#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks)) -#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e)) -#endif -#endif - #ifdef HAVE_CHARSET_utf8 #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" #else diff --git a/include/mysql.h b/include/mysql.h index d7c47667d0c..931995fb1ac 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -453,7 +453,9 @@ int STDCALL mysql_add_slave(MYSQL* mysql, const char* host, const char* user, const char* passwd); -int STDCALL mysql_shutdown(MYSQL *mysql); +int STDCALL mysql_shutdown(MYSQL *mysql, + enum enum_shutdown_level + shutdown_level); int STDCALL mysql_dump_debug_info(MYSQL *mysql); int STDCALL mysql_refresh(MYSQL *mysql, unsigned int refresh_options); @@ -558,7 +560,7 @@ typedef struct st_mysql_bind enum enum_field_types buffer_type; /* buffer type */ unsigned long buffer_length; /* buffer length, must be set for str/binary */ - /* Following are for internal use. Set by mysql_bind_param */ + /* Following are for internal use. Set by mysql_stmt_bind_param */ unsigned char *inter_buffer; /* for the current data position */ unsigned long offset; /* offset position for char/binary fetch */ unsigned long internal_length; /* Used if length is 0 */ @@ -710,6 +712,7 @@ void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt); my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt); +unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); my_bool STDCALL mysql_commit(MYSQL * mysql); my_bool STDCALL mysql_rollback(MYSQL * mysql); diff --git a/include/mysql_com.h b/include/mysql_com.h index d354a979cd1..47231ef31c6 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -223,6 +223,32 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, #define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY +enum enum_shutdown_level { + /* + We want levels to be in growing order of hardness. So we leave room + for future intermediate levels. For now, escalating one level is += 10; + later if we insert new levels in between we will need a function + next_shutdown_level(level). Note that DEFAULT does not respect the + growing property. + */ + SHUTDOWN_DEFAULT= 0, /* mapped to WAIT_ALL_BUFFERS for now */ + /* + Here is the list in growing order (the next does the previous plus + something). WAIT_ALL_BUFFERS is what we have now. Others are "this MySQL + server does not support this shutdown level yet". + */ + SHUTDOWN_WAIT_CONNECTIONS= 10, /* wait for existing connections to finish */ + SHUTDOWN_WAIT_TRANSACTIONS= 20, /* wait for existing trans to finish */ + SHUTDOWN_WAIT_STATEMENTS= 30, /* wait for existing updating stmts to finish */ + SHUTDOWN_WAIT_ALL_BUFFERS= 40, /* flush InnoDB buffers */ + SHUTDOWN_WAIT_CRITICAL_BUFFERS= 50, /* flush MyISAM buffs (no corruption) */ + /* Now the 2 levels of the KILL command */ +#if MYSQL_VERSION_ID >= 50000 + KILL_QUERY= 254, +#endif + KILL_CONNECTION= 255 +}; + /* options for mysql_set_option */ enum enum_mysql_set_option { diff --git a/include/mysqld_error.h b/include/mysqld_error.h index f341041fc75..0dcc09a173f 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -314,4 +314,6 @@ #define ER_UNSUPPORTED_PS 1295 #define ER_GET_ERRMSG 1296 #define ER_GET_TEMPORARY_ERRMSG 1297 -#define ER_ERROR_MESSAGES 298 +#define ER_UNKNOWN_TIME_ZONE 1298 +#define ER_WARN_INVALID_TIMESTAMP 1299 +#define ER_ERROR_MESSAGES 300 diff --git a/include/sql_state.h b/include/sql_state.h index 5c4b1c50745..52a359405e1 100644 --- a/include/sql_state.h +++ b/include/sql_state.h @@ -23,10 +23,10 @@ the second column is the ODBC state (which the 4.1 server sends out by default) and the last is the state used by the JDBC driver. If the last column is "" then it means that the JDBC driver is using the - ODBC state + ODBC state. - The errors in this file is sorted in the same order as in mysqld_error.h - to allow on to do binary searches for the sqlstate. + The errors in this file are sorted in the same order as in mysqld_error.h + to allow one to do binary searches for the sqlstate. */ ER_DUP_KEY, "23000", "", diff --git a/include/violite.h b/include/violite.h index b4b9f724d89..ba7de3ee175 100644 --- a/include/violite.h +++ b/include/violite.h @@ -83,6 +83,14 @@ my_bool vio_poll_read(Vio *vio,uint timeout); void vio_timeout(Vio *vio,uint timeout); #ifdef HAVE_OPENSSL +#include <openssl/opensslv.h> +#if OPENSSL_VERSION_NUMBER < 0x0090700f +#define DES_cblock des_cblock +#define DES_key_schedule des_key_schedule +#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks)) +#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e)) +#endif + #define HEADER_DES_LOCL_H dummy_something #include <openssl/ssl.h> #include <openssl/err.h> diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 09f5c66f687..27d798f925a 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -2165,7 +2165,6 @@ btr_discard_page( ut_ad(btr_check_node_ptr(tree, merge_page, mtr)); } -#ifdef UNIV_DEBUG /***************************************************************** Prints size info of a B-tree. */ @@ -2287,7 +2286,6 @@ btr_print_tree( btr_validate_tree(tree); } -#endif /* UNIV_DEBUG */ /**************************************************************** Checks that the node pointer to a page is appropriate. */ diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index 268d6f8e16d..5ec8998473d 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -223,14 +223,12 @@ in the free list to the frames. buf_pool_t* buf_pool = NULL; /* The buffer buf_pool of the database */ -#ifdef UNIV_DEBUG -static ulint buf_dbg_counter = 0; /* This is used to insert validation +ulint buf_dbg_counter = 0; /* This is used to insert validation operations in excution in the debug version */ ibool buf_debug_prints = FALSE; /* If this is set TRUE, the program prints info whenever read-ahead or flush occurs */ -#endif /* UNIV_DEBUG */ /************************************************************************ Calculates a page checksum which is stored to the page when it is written @@ -1729,12 +1727,10 @@ buf_page_create( /* If we get here, the page was not in buf_pool: init it there */ -#ifdef UNIV_DEBUG if (buf_debug_prints) { fprintf(stderr, "Creating space %lu page %lu to buffer\n", (ulong) space, (ulong) offset); } -#endif /* UNIV_DEBUG */ block = free_block; @@ -1885,11 +1881,9 @@ buf_page_io_complete( rw_lock_x_unlock_gen(&(block->lock), BUF_IO_READ); -#ifdef UNIV_DEBUG if (buf_debug_prints) { fputs("Has read ", stderr); } -#endif /* UNIV_DEBUG */ } else { ut_ad(io_type == BUF_IO_WRITE); @@ -1902,21 +1896,17 @@ buf_page_io_complete( buf_pool->n_pages_written++; -#ifdef UNIV_DEBUG if (buf_debug_prints) { fputs("Has written ", stderr); } -#endif /* UNIV_DEBUG */ } mutex_exit(&(buf_pool->mutex)); -#ifdef UNIV_DEBUG if (buf_debug_prints) { fprintf(stderr, "page space %lu page no %lu\n", (ulong) block->space, (ulong) block->offset); } -#endif /* UNIV_DEBUG */ } /************************************************************************* @@ -1945,7 +1935,6 @@ buf_pool_invalidate(void) mutex_exit(&(buf_pool->mutex)); } -#ifdef UNIV_DEBUG /************************************************************************* Validates the buffer buf_pool data structure. */ @@ -2145,7 +2134,6 @@ buf_print(void) ut_a(buf_validate()); } -#endif /* UNIV_DEBUG */ /************************************************************************* Returns the number of pending buf pool ios. */ diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c index 885bcf06456..6cefdb60956 100644 --- a/innobase/buf/buf0flu.c +++ b/innobase/buf/buf0flu.c @@ -32,7 +32,6 @@ flushed along with the original page. */ #define BUF_FLUSH_AREA ut_min(BUF_READ_AHEAD_AREA,\ buf_pool->curr_size / 16) -#ifdef UNIV_DEBUG /********************************************************************** Validates the flush list. */ static @@ -40,7 +39,6 @@ ibool buf_flush_validate_low(void); /*========================*/ /* out: TRUE if ok */ -#endif /* UNIV_DEBUG */ /************************************************************************ Inserts a modified block into the flush list. */ @@ -513,13 +511,11 @@ buf_flush_try_page( rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE); } -#ifdef UNIV_DEBUG if (buf_debug_prints) { fprintf(stderr, "Flushing page space %lu, page no %lu \n", (ulong) block->space, (ulong) block->offset); } -#endif /* UNIV_DEBUG */ buf_flush_write_block_low(block); @@ -603,14 +599,12 @@ buf_flush_try_page( rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE); -#ifdef UNIV_DEBUG if (buf_debug_prints) { fprintf(stderr, "Flushing single page space %lu, page no %lu \n", (ulong) block->space, (ulong) block->offset); } -#endif /* UNIV_DEBUG */ buf_flush_write_block_low(block); @@ -837,7 +831,6 @@ buf_flush_batch( buf_flush_buffered_writes(); -#ifdef UNIV_DEBUG if (buf_debug_prints && page_count > 0) { ut_a(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST); @@ -846,7 +839,6 @@ buf_flush_batch( : "Flushed %lu pages in flush list flush\n", (ulong) page_count); } -#endif /* UNIV_DEBUG */ return(page_count); } @@ -938,7 +930,6 @@ buf_flush_free_margin(void) } } -#ifdef UNIV_DEBUG /********************************************************************** Validates the flush list. */ static @@ -988,4 +979,3 @@ buf_flush_validate(void) return(ret); } -#endif /* UNIV_DEBUG */ diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c index 053161986e4..796311f0157 100644 --- a/innobase/buf/buf0lru.c +++ b/innobase/buf/buf0lru.c @@ -209,14 +209,12 @@ buf_LRU_search_and_free_block( ut_a(block->in_LRU_list); if (buf_flush_ready_for_replace(block)) { -#ifdef UNIV_DEBUG if (buf_debug_prints) { fprintf(stderr, "Putting space %lu page %lu to free list\n", (ulong) block->space, (ulong) block->offset); } -#endif /* UNIV_DEBUG */ buf_LRU_block_remove_hashed_page(block); @@ -888,7 +886,6 @@ buf_LRU_block_free_hashed_page( buf_LRU_block_free_non_file_page(block); } -#ifdef UNIV_DEBUG /************************************************************************** Validates the LRU list. */ @@ -1019,4 +1016,3 @@ buf_LRU_print(void) mutex_exit(&(buf_pool->mutex)); } -#endif /* UNIV_DEBUG */ diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c index 63e078f3f6e..71e885ff439 100644 --- a/innobase/buf/buf0rea.c +++ b/innobase/buf/buf0rea.c @@ -284,14 +284,12 @@ buf_read_ahead_random( os_aio_simulated_wake_handler_threads(); -#ifdef UNIV_DEBUG if (buf_debug_prints && (count > 0)) { fprintf(stderr, "Random read-ahead space %lu offset %lu pages %lu\n", (ulong) space, (ulong) offset, (ulong) count); } -#endif /* UNIV_DEBUG */ return(count); } @@ -571,13 +569,11 @@ buf_read_ahead_linear( /* Flush pages from the end of the LRU list if necessary */ buf_flush_free_margin(); -#ifdef UNIV_DEBUG if (buf_debug_prints && (count > 0)) { fprintf(stderr, "LINEAR read-ahead space %lu offset %lu pages %lu\n", (ulong) space, (ulong) offset, (ulong) count); } -#endif /* UNIV_DEBUG */ return(count); } @@ -636,13 +632,11 @@ buf_read_ibuf_merge_pages( /* Flush pages from the end of the LRU list if necessary */ buf_flush_free_margin(); -#ifdef UNIV_DEBUG if (buf_debug_prints) { fprintf(stderr, "Ibuf merge read-ahead space %lu pages %lu\n", (ulong) space_ids[0], (ulong) n_stored); } -#endif /* UNIV_DEBUG */ } /************************************************************************ @@ -706,10 +700,8 @@ buf_read_recv_pages( /* Flush pages from the end of the LRU list if necessary */ buf_flush_free_margin(); -#ifdef UNIV_DEBUG if (buf_debug_prints) { fprintf(stderr, "Recovery applies read-ahead pages %lu\n", (ulong) n_stored); } -#endif /* UNIV_DEBUG */ } diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c index 698b5361dfa..97d93b1b0ec 100644 --- a/innobase/data/data0type.c +++ b/innobase/data/data0type.c @@ -104,7 +104,6 @@ dtype_form_prtype( return(old_prtype + (charset_coll << 16)); } -#ifdef UNIV_DEBUG /************************************************************************* Validates a data type structure. */ @@ -123,7 +122,6 @@ dtype_validate( return(TRUE); } -#endif /* UNIV_DEBUG */ /************************************************************************* Prints a data type structure. */ diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index aa5787ee30e..71cf908db4e 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -3488,9 +3488,9 @@ dict_tree_create( tree->id = index->id; UT_LIST_INIT(tree->tree_indexes); -#ifdef UNIV_DEBUG + tree->magic_n = DICT_TREE_MAGIC_N; -#endif /* UNIV_DEBUG */ + rw_lock_create(&(tree->lock)); rw_lock_set_level(&(tree->lock), SYNC_INDEX_TREE); @@ -3929,7 +3929,6 @@ dict_foreign_print_low( fputs(" )\n", stderr); } -#ifdef UNIV_DEBUG /************************************************************************** Prints a table data. */ @@ -3962,7 +3961,6 @@ dict_table_print_by_name( dict_table_print_low(table); mutex_exit(&(dict_sys->mutex)); } -#endif /* UNIV_DEBUG */ /************************************************************************** Prints a table data. */ diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c index 936b06b1905..8f05475df47 100644 --- a/innobase/dict/dict0mem.c +++ b/innobase/dict/dict0mem.c @@ -87,9 +87,9 @@ dict_mem_table_create( mutex_set_level(&(table->autoinc_mutex), SYNC_DICT_AUTOINC_MUTEX); table->autoinc_inited = FALSE; -#ifdef UNIV_DEBUG + table->magic_n = DICT_TABLE_MAGIC_N; -#endif /* UNIV_DEBUG */ + return(table); } @@ -205,9 +205,7 @@ dict_mem_index_create( index->stat_n_diff_key_vals = NULL; index->cached = FALSE; -#ifdef UNIV_DEBUG index->magic_n = DICT_INDEX_MAGIC_N; -#endif /* UNIV_DEBUG */ return(index); } diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index a200116797a..59fbd6f785d 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -2220,6 +2220,7 @@ fil_create_new_single_table_tablespace( ut_free(buf2); error_exit: os_file_close(file); + error_exit2: os_file_delete(path); mem_free(path); @@ -2262,10 +2263,7 @@ fil_create_new_single_table_tablespace( os_file_close(file); if (*space_id == ULINT_UNDEFINED) { - os_file_delete(path); - error_exit2: - mem_free(path); - return(DB_ERROR); + goto error_exit2; } success = fil_space_create(path, *space_id, FIL_TABLESPACE); @@ -2822,12 +2820,11 @@ fil_load_single_table_tablespaces(void) if (len > dbpath_len) { dbpath_len = len; - if (!dbpath) { - dbpath = mem_alloc(dbpath_len); - } else { - dbpath = mem_realloc(dbpath, dbpath_len, - __FILE__, __LINE__); + if (dbpath) { + mem_free(dbpath); } + + dbpath = mem_alloc(dbpath_len); } sprintf(dbpath, "%s/%s", fil_path_to_mysql_datadir, dbinfo.name); diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c index e7b97e88f32..34b6de76ff4 100644 --- a/innobase/fsp/fsp0fsp.c +++ b/innobase/fsp/fsp0fsp.c @@ -3476,8 +3476,7 @@ fseg_validate_low( return(TRUE); } - -#ifdef UNIV_DEBUG + /*********************************************************************** Validates a segment. */ @@ -3502,7 +3501,6 @@ fseg_validate( return(ret); } -#endif /* UNIV_DEBUG */ /*********************************************************************** Writes info of a segment. */ @@ -3554,7 +3552,6 @@ fseg_print_low( (ulong) n_used); } -#ifdef UNIV_DEBUG /*********************************************************************** Writes info of a segment. */ @@ -3575,7 +3572,6 @@ fseg_print( fseg_print_low(inode, mtr); } -#endif /* UNIV_DEBUG */ /*********************************************************************** Validates the file space system and its segments. */ diff --git a/innobase/fut/fut0lst.c b/innobase/fut/fut0lst.c index 3d92aaba1ef..8deaa8adb3f 100644 --- a/innobase/fut/fut0lst.c +++ b/innobase/fut/fut0lst.c @@ -490,7 +490,6 @@ flst_validate( return(TRUE); } -#ifdef UNIV_DEBUG /************************************************************************ Prints info of a file-based list. */ @@ -517,4 +516,3 @@ flst_print( (ulong) buf_frame_get_page_no(frame), (ulong) (base - frame), (ulong) len); } -#endif /* UNIV_DEBUG */ diff --git a/innobase/ha/hash0hash.c b/innobase/ha/hash0hash.c index 372104e54b3..facdea66198 100644 --- a/innobase/ha/hash0hash.c +++ b/innobase/ha/hash0hash.c @@ -22,7 +22,6 @@ hash_mutex_enter( hash_table_t* table, /* in: hash table */ ulint fold) /* in: fold */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); mutex_enter(hash_get_mutex(table, fold)); } @@ -35,10 +34,41 @@ hash_mutex_exit( hash_table_t* table, /* in: hash table */ ulint fold) /* in: fold */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); mutex_exit(hash_get_mutex(table, fold)); } +/**************************************************************** +Reserves all the mutexes of a hash table, in an ascending order. */ + +void +hash_mutex_enter_all( +/*=================*/ + hash_table_t* table) /* in: hash table */ +{ + ulint i; + + for (i = 0; i < table->n_mutexes; i++) { + + mutex_enter(table->mutexes + i); + } +} + +/**************************************************************** +Releases all the mutexes of a hash table. */ + +void +hash_mutex_exit_all( +/*================*/ + hash_table_t* table) /* in: hash table */ +{ + ulint i; + + for (i = 0; i < table->n_mutexes; i++) { + + mutex_exit(table->mutexes + i); + } +} + /***************************************************************** Creates a hash table with >= n array cells. The actual number of cells is chosen to be a prime number slightly bigger than n. */ @@ -68,9 +98,7 @@ hash_create( table->mutexes = NULL; table->heaps = NULL; table->heap = NULL; -#ifdef UNIV_DEBUG table->magic_n = HASH_TABLE_MAGIC_N; -#endif /* UNIV_DEBUG */ /* Initialize the cell array */ @@ -91,7 +119,6 @@ hash_table_free( /*============*/ hash_table_t* table) /* in, own: hash table */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); ut_a(table->mutexes == NULL); ut_free(table->array); @@ -113,7 +140,6 @@ hash_create_mutexes( ulint i; ut_a(n_mutexes == ut_2_power_up(n_mutexes)); - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); table->mutexes = mem_alloc(n_mutexes * sizeof(mutex_t)); diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index 931fb7f4168..f05e69863a3 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -201,15 +201,13 @@ because ibuf merge is done to a page when it is read in, and it is still physically like the index page even if the index would have been dropped! So, there seems to be no problem. */ -#ifdef UNIV_DEBUG /********************************************************************** Validates the ibuf data structures when the caller owns ibuf_mutex. */ -static + ibool ibuf_validate_low(void); /*===================*/ /* out: TRUE if ok */ -#endif /* UNIV_DEBUG */ /********************************************************************** Sets the flag in the current OS thread local storage denoting that it is @@ -3278,10 +3276,10 @@ leave_loop: mem_heap_free(heap); } -#ifdef UNIV_DEBUG + /********************************************************************** Validates the ibuf data structures when the caller owns ibuf_mutex. */ -static + ibool ibuf_validate_low(void) /*===================*/ @@ -3308,7 +3306,6 @@ ibuf_validate_low(void) return(TRUE); } -#endif /* UNIV_DEBUG */ /********************************************************************** Looks if the insert buffer is empty. */ diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am index 5ec70da97a2..102d25566da 100644 --- a/innobase/include/Makefile.am +++ b/innobase/include/Makefile.am @@ -43,7 +43,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ row0purge.ic row0row.h row0row.ic row0sel.h row0sel.ic \ row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \ row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \ - row0vers.ic srv0srv.h srv0srv.ic srv0start.h \ + row0vers.ic srv0que.h srv0srv.h srv0srv.ic srv0start.h \ sync0arr.h sync0arr.ic sync0rw.h \ sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \ thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \ diff --git a/innobase/include/btr0btr.h b/innobase/include/btr0btr.h index e904db3272f..8606fcd2a5c 100644 --- a/innobase/include/btr0btr.h +++ b/innobase/include/btr0btr.h @@ -392,7 +392,6 @@ btr_page_free_low( page_t* page, /* in: page to be freed, x-latched */ ulint level, /* in: page level */ mtr_t* mtr); /* in: mtr */ -#ifdef UNIV_DEBUG /***************************************************************** Prints size info of a B-tree. */ @@ -409,7 +408,6 @@ btr_print_tree( dict_tree_t* tree, /* in: tree */ ulint width); /* in: print this many entries from start and end */ -#endif /* UNIV_DEBUG */ /**************************************************************** Checks the size and number of fields in a record based on the definition of the index. */ diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h index 9590fea1276..53599d03c73 100644 --- a/innobase/include/buf0buf.h +++ b/innobase/include/buf0buf.h @@ -54,11 +54,9 @@ Created 11/5/1995 Heikki Tuuri #define BUF_KEEP_OLD 52 extern buf_pool_t* buf_pool; /* The buffer pool of the database */ -#ifdef UNIV_DEBUG extern ibool buf_debug_prints;/* If this is set TRUE, the program prints info whenever read or flush occurs */ -#endif /* UNIV_DEBUG */ /************************************************************************ Creates the buffer pool. */ @@ -478,14 +476,12 @@ buf_pool_is_block( /*==============*/ /* out: TRUE if pointer to block */ void* ptr); /* in: pointer to memory */ -#ifdef UNIV_DEBUG /************************************************************************* Validates the buffer pool data structure. */ ibool buf_validate(void); /*==============*/ -#endif /* UNIV_DEBUG */ /************************************************************************ Prints a page to stderr. */ @@ -897,7 +893,7 @@ struct buf_pool_struct{ ulint n_pend_reads; /* number of pending read operations */ - time_t last_printout_time; /* when buf_print_io was last time + time_t last_printout_time; /* when buf_print was last time called */ ulint n_pages_read; /* number read operations */ ulint n_pages_written;/* number write operations */ @@ -912,10 +908,10 @@ struct buf_pool_struct{ ulint n_pages_awe_remapped; /* if AWE is enabled, the number of remaps of blocks to buffer frames */ - ulint n_page_gets_old;/* n_page_gets when buf_print_io was + ulint n_page_gets_old;/* n_page_gets when buf_print was last time called: used to calculate hit rate */ - ulint n_pages_read_old;/* n_pages_read when buf_print_io was + ulint n_pages_read_old;/* n_pages_read when buf_print was last time called */ ulint n_pages_written_old;/* number write operations */ ulint n_pages_created_old;/* number of pages created in diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic index fa8421b63ad..681a0ef000a 100644 --- a/innobase/include/buf0buf.ic +++ b/innobase/include/buf0buf.ic @@ -11,6 +11,10 @@ Created 11/5/1995 Heikki Tuuri #include "buf0rea.h" #include "mtr0mtr.h" +extern ulint buf_dbg_counter; /* This is used to insert validation + operations in execution in the + debug version */ + /************************************************************************ Recommends a move of a block to the start of the LRU list if there is danger of dropping from the buffer pool. NOTE: does not reserve the buffer pool diff --git a/innobase/include/buf0flu.h b/innobase/include/buf0flu.h index 6f39eef7210..1b40acaa269 100644 --- a/innobase/include/buf0flu.h +++ b/innobase/include/buf0flu.h @@ -97,7 +97,6 @@ buf_flush_ready_for_replace( /* out: TRUE if can replace immediately */ buf_block_t* block); /* in: buffer control block, must be in state BUF_BLOCK_FILE_PAGE and in the LRU list */ -#ifdef UNIV_DEBUG /********************************************************************** Validates the flush list. */ @@ -105,7 +104,6 @@ ibool buf_flush_validate(void); /*====================*/ /* out: TRUE if ok */ -#endif /* UNIV_DEBUG */ /* When buf_flush_free_margin is called, it tries to make this many blocks available to replacement in the free list and at the end of the LRU list (to diff --git a/innobase/include/buf0lru.h b/innobase/include/buf0lru.h index 98aa0252e12..69a376f8cab 100644 --- a/innobase/include/buf0lru.h +++ b/innobase/include/buf0lru.h @@ -112,7 +112,6 @@ void buf_LRU_make_block_old( /*===================*/ buf_block_t* block); /* in: control block */ -#ifdef UNIV_DEBUG /************************************************************************** Validates the LRU list. */ @@ -125,7 +124,6 @@ Prints the LRU list. */ void buf_LRU_print(void); /*===============*/ -#endif /* UNIV_DEBUG */ #ifndef UNIV_NONINL #include "buf0lru.ic" diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h index e2de13d0520..2136de0f9b3 100644 --- a/innobase/include/data0data.h +++ b/innobase/include/data0data.h @@ -395,11 +395,9 @@ struct dtuple_struct { UT_LIST_NODE_T(dtuple_t) tuple_list; /* data tuples can be linked into a list using this field */ -#ifdef UNIV_DEBUG - ulint magic_n; -#define DATA_TUPLE_MAGIC_N 65478679 -#endif /* UNIV_DEBUG */ + ulint magic_n; }; +#define DATA_TUPLE_MAGIC_N 65478679 /* A slot for a field in a big rec vector */ diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h index 2138df97392..fe38a224a66 100644 --- a/innobase/include/data0type.h +++ b/innobase/include/data0type.h @@ -305,7 +305,7 @@ dtype_new_read_for_order_and_null_size( /*===================================*/ dtype_t* type, /* in: type struct */ byte* buf); /* in: buffer for stored type order info */ -#ifdef UNIV_DEBUG + /************************************************************************* Validates a data type structure. */ @@ -314,7 +314,6 @@ dtype_validate( /*===========*/ /* out: TRUE if ok */ dtype_t* type); /* in: type struct to validate */ -#endif /* UNIV_DEBUG */ /************************************************************************* Prints a data type structure. */ diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index fe04359d6f1..ebb34f7dda0 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -325,19 +325,18 @@ dict_table_get_index_noninline( dict_table_t* table, /* in: table */ const char* name); /* in: index name */ /************************************************************************** -Prints a table data. */ +Prints a table definition. */ void -dict_table_print_low( -/*=================*/ +dict_table_print( +/*=============*/ dict_table_t* table); /* in: table */ -#ifdef UNIV_DEBUG /************************************************************************** -Prints a table definition. */ +Prints a table data. */ void -dict_table_print( -/*=============*/ +dict_table_print_low( +/*=================*/ dict_table_t* table); /* in: table */ /************************************************************************** Prints a table data when we know the table name. */ @@ -346,7 +345,6 @@ void dict_table_print_by_name( /*=====================*/ const char* name); -#endif /* UNIV_DEBUG */ /************************************************************************** Outputs info on foreign keys of a table. */ diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index f141ea9da09..3fc3e850987 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -188,12 +188,11 @@ struct dict_tree_struct{ the list; if the tree is of the mixed type, the first index in the list is the index of the cluster which owns the tree */ -#ifdef UNIV_DEBUG ulint magic_n;/* magic number */ -#define DICT_TREE_MAGIC_N 7545676 -#endif /* UNIV_DEBUG */ }; +#define DICT_TREE_MAGIC_N 7545676 + /* Data structure for an index */ struct dict_index_struct{ dulint id; /* id of the index */ @@ -238,10 +237,7 @@ struct dict_index_struct{ ulint stat_n_leaf_pages; /* approximate number of leaf pages in the index tree */ -#ifdef UNIV_DEBUG ulint magic_n;/* magic number */ -#define DICT_INDEX_MAGIC_N 76789786 -#endif /* UNIV_DEBUG */ }; /* Data structure for a foreign key constraint; an example: @@ -292,6 +288,9 @@ a foreign key constraint is enforced, therefore RESTRICT just means no flag */ #define DICT_FOREIGN_ON_DELETE_NO_ACTION 16 #define DICT_FOREIGN_ON_UPDATE_NO_ACTION 32 + +#define DICT_INDEX_MAGIC_N 76789786 + /* Data structure for a database table */ struct dict_table_struct{ dulint id; /* id of the table or cluster */ @@ -410,12 +409,10 @@ struct dict_table_struct{ inited; MySQL gets the init value by executing SELECT MAX(auto inc column) */ ib_longlong autoinc;/* autoinc counter value to give to the - next inserted row */ -#ifdef UNIV_DEBUG + next inserted row */ ulint magic_n;/* magic number */ -#define DICT_TABLE_MAGIC_N 76333786 -#endif /* UNIV_DEBUG */ }; +#define DICT_TABLE_MAGIC_N 76333786 #ifndef UNIV_NONINL #include "dict0mem.ic" diff --git a/innobase/include/fsp0fsp.h b/innobase/include/fsp0fsp.h index 20f4f4c2abd..2fcde882df7 100644 --- a/innobase/include/fsp0fsp.h +++ b/innobase/include/fsp0fsp.h @@ -332,7 +332,6 @@ void fsp_print( /*======*/ ulint space); /* in: space id */ -#ifdef UNIV_DEBUG /*********************************************************************** Validates a segment. */ @@ -350,7 +349,6 @@ fseg_print( /*=======*/ fseg_header_t* header, /* in: segment header */ mtr_t* mtr); /* in: mtr */ -#endif /* UNIV_DEBUG */ /* Flags for fsp_reserve_free_extents */ #define FSP_NORMAL 1000000 diff --git a/innobase/include/fut0lst.h b/innobase/include/fut0lst.h index 3f679d61ab5..5427e2248da 100644 --- a/innobase/include/fut0lst.h +++ b/innobase/include/fut0lst.h @@ -181,7 +181,6 @@ flst_validate( /* out: TRUE if ok */ flst_base_node_t* base, /* in: pointer to base node of list */ mtr_t* mtr1); /* in: mtr */ -#ifdef UNIV_DEBUG /************************************************************************ Prints info of a file-based list. */ @@ -190,7 +189,7 @@ flst_print( /*=======*/ flst_base_node_t* base, /* in: pointer to base node of list */ mtr_t* mtr); /* in: mtr */ -#endif /* UNIV_DEBUG */ + #ifndef UNIV_NONINL #include "fut0lst.ic" diff --git a/innobase/include/hash0hash.h b/innobase/include/hash0hash.h index 79efe016324..51315e40875 100644 --- a/innobase/include/hash0hash.h +++ b/innobase/include/hash0hash.h @@ -283,6 +283,21 @@ hash_mutex_exit( /*============*/ hash_table_t* table, /* in: hash table */ ulint fold); /* in: fold */ +/**************************************************************** +Reserves all the mutexes of a hash table, in an ascending order. */ + +void +hash_mutex_enter_all( +/*=================*/ + hash_table_t* table); /* in: hash table */ +/**************************************************************** +Releases all the mutexes of a hash table. */ + +void +hash_mutex_exit_all( +/*================*/ + hash_table_t* table); /* in: hash table */ + struct hash_cell_struct{ void* node; /* hash chain node, NULL if none */ @@ -303,12 +318,11 @@ struct hash_table_struct { memory heaps; there are then n_mutexes many of these heaps */ mem_heap_t* heap; -#ifdef UNIV_DEBUG ulint magic_n; -#define HASH_TABLE_MAGIC_N 76561114 -#endif /* UNIV_DEBUG */ }; +#define HASH_TABLE_MAGIC_N 76561114 + #ifndef UNIV_NONINL #include "hash0hash.ic" #endif diff --git a/innobase/include/hash0hash.ic b/innobase/include/hash0hash.ic index 1b9acfa2f34..0d713140c13 100644 --- a/innobase/include/hash0hash.ic +++ b/innobase/include/hash0hash.ic @@ -18,7 +18,6 @@ hash_get_nth_cell( hash_table_t* table, /* in: hash table */ ulint n) /* in: cell index */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); ut_ad(n < table->n_cells); return(table->array + n); @@ -33,7 +32,6 @@ hash_get_n_cells( /* out: number of cells */ hash_table_t* table) /* in: table */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); return(table->n_cells); } @@ -47,7 +45,6 @@ hash_calc_hash( ulint fold, /* in: folded value */ hash_table_t* table) /* in: hash table */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); return(ut_hash_ulint(fold, table->n_cells)); } @@ -61,7 +58,6 @@ hash_get_mutex_no( hash_table_t* table, /* in: hash table */ ulint fold) /* in: fold */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); return(ut_2pow_remainder(fold, table->n_mutexes)); } @@ -75,7 +71,6 @@ hash_get_nth_heap( hash_table_t* table, /* in: hash table */ ulint i) /* in: index of the heap */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); ut_ad(i < table->n_mutexes); return(table->heaps[i]); @@ -93,8 +88,6 @@ hash_get_heap( { ulint i; - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); - if (table->heap) { return(table->heap); } @@ -114,7 +107,6 @@ hash_get_nth_mutex( hash_table_t* table, /* in: hash table */ ulint i) /* in: index of the mutex */ { - ut_ad(table->magic_n == HASH_TABLE_MAGIC_N); ut_ad(i < table->n_mutexes); return(table->mutexes + i); diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h index b1f9a10ee05..9c5f35c6674 100644 --- a/innobase/include/lock0lock.h +++ b/innobase/include/lock0lock.h @@ -19,9 +19,7 @@ Created 5/7/1996 Heikki Tuuri #include "read0types.h" #include "hash0hash.h" -#ifdef UNIV_DEBUG extern ibool lock_print_waits; -#endif /* UNIV_DEBUG */ /* Buffer for storing information about the most recent deadlock error */ extern FILE* lock_latest_err_file; @@ -475,7 +473,6 @@ lock_check_trx_id_sanity( dict_index_t* index, /* in: clustered index */ ibool has_kernel_mutex);/* in: TRUE if the caller owns the kernel mutex */ -#ifdef UNIV_DEBUG /************************************************************************* Validates the lock queue on a single record. */ @@ -485,7 +482,6 @@ lock_rec_queue_validate( /* out: TRUE if ok */ rec_t* rec, /* in: record to look at */ dict_index_t* index); /* in: index, or NULL if not known */ -#endif /* UNIV_DEBUG */ /************************************************************************* Prints info of a table lock. */ @@ -509,7 +505,6 @@ void lock_print_info( /*============*/ FILE* file); /* in: file where to print */ -#ifdef UNIV_DEBUG /************************************************************************* Validates the lock queue on a table. */ @@ -534,7 +529,6 @@ ibool lock_validate(void); /*===============*/ /* out: TRUE if ok */ -#endif /* UNIV_DEBUG */ /* The lock system */ extern lock_sys_t* lock_sys; diff --git a/innobase/include/log0log.h b/innobase/include/log0log.h index 25adc3b24b7..d14a116072d 100644 --- a/innobase/include/log0log.h +++ b/innobase/include/log0log.h @@ -18,9 +18,7 @@ typedef struct log_struct log_t; typedef struct log_group_struct log_group_t; extern ibool log_do_write; -#ifdef UNIV_LOG_DEBUG extern ibool log_debug_writes; -#endif /* UNIV_LOG_DEBUG */ /* Wait modes for log_write_up_to */ #define LOG_NO_WAIT 91 @@ -691,13 +689,11 @@ struct log_struct{ ulint max_buf_free; /* recommended maximum value of buf_free, after which the buffer is flushed */ -#ifdef UNIV_LOG_DEBUG ulint old_buf_free; /* value of buf free when log was last time opened; only in the debug version */ dulint old_lsn; /* value of lsn when log was last time opened; only in the debug version */ -#endif /* UNIV_LOG_DEBUG */ ibool check_flush_or_checkpoint; /* this is set to TRUE when there may be need to flush the log buffer, or diff --git a/innobase/include/log0log.ic b/innobase/include/log0log.ic index 3a4a3c6a5e6..ca7531783a2 100644 --- a/innobase/include/log0log.ic +++ b/innobase/include/log0log.ic @@ -10,7 +10,6 @@ Created 12/9/1995 Heikki Tuuri #include "mach0data.h" #include "mtr0mtr.h" -#ifdef UNIV_LOG_DEBUG /********************************************************** Checks by parsing that the catenated log segment for a single mtr is consistent. */ @@ -22,7 +21,6 @@ log_check_log_recs( in the log_sys->buf log buffer */ ulint len, /* in: segment length in bytes */ dulint buf_start_lsn); /* in: buffer start lsn */ -#endif /* UNIV_LOG_DEBUG */ /**************************************************************** Gets a log block flush bit. */ diff --git a/innobase/include/mem0dbg.h b/innobase/include/mem0dbg.h index 61c66cc218c..96f30842df6 100644 --- a/innobase/include/mem0dbg.h +++ b/innobase/include/mem0dbg.h @@ -31,7 +31,6 @@ check fields at the both ends of the field. */ #define MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT) #endif -#ifdef UNIV_DEBUG /******************************************************************* Checks a memory heap for consistency and prints the contents if requested. Outputs the sum of sizes of buffers given to the user (only in @@ -61,7 +60,6 @@ mem_heap_validate_or_print( ulint* n_blocks); /* out: number of blocks in the heap, if a NULL pointer is passed as this argument, it is ignored */ -#endif /* UNIV_DEBUG */ #ifdef UNIV_MEM_DEBUG /****************************************************************** Prints the contents of a memory heap. */ @@ -71,7 +69,6 @@ mem_heap_print( /*===========*/ mem_heap_t* heap); /* in: memory heap */ #endif /* UNIV_MEM_DEBUG */ -#ifdef UNIV_DEBUG /****************************************************************** Checks that an object is a memory heap (or a block of it) */ @@ -88,7 +85,6 @@ mem_heap_validate( /*==============*/ /* out: TRUE if ok */ mem_heap_t* heap); /* in: memory heap */ -#endif /* UNIV_DEBUG */ #ifdef UNIV_MEM_DEBUG /********************************************************************* TRUE if no memory is currently allocated. */ @@ -120,4 +116,17 @@ void mem_analyze_corruption( /*===================*/ byte* ptr); /* in: pointer to place of possible corruption */ +/********************************************************************* +Prints information of dynamic memory usage and currently allocated memory +heaps or buffers. Can only be used in the debug version. */ +void +mem_print_info(void); +/*================*/ +/********************************************************************* +Prints information of dynamic memory usage and currently allocated memory +heaps or buffers since the last ..._print_info or..._print_new_info. */ + +void +mem_print_new_info(void); +/*====================*/ diff --git a/innobase/include/mem0dbg.ic b/innobase/include/mem0dbg.ic index 00db22eb518..7ce5f6f1ba5 100644 --- a/innobase/include/mem0dbg.ic +++ b/innobase/include/mem0dbg.ic @@ -56,7 +56,6 @@ mem_hash_insert( mem_heap_t* heap, /* in: the created heap */ const char* file_name, /* in: file name of creation */ ulint line); /* in: line where created */ -#ifdef UNIV_MEM_DEBUG /******************************************************************* Removes a memory heap (which is going to be freed by the caller) from the list of live memory heaps. Returns the size of the heap @@ -72,7 +71,7 @@ mem_hash_remove( mem_heap_t* heap, /* in: the heap to be freed */ const char* file_name, /* in: file name of freeing */ ulint line); /* in: line where freed */ -#endif /* UNIV_MEM_DEBUG */ + void mem_field_header_set_len(byte* field, ulint len); diff --git a/innobase/include/mem0mem.h b/innobase/include/mem0mem.h index 18bffe5732e..cd01ac77bf3 100644 --- a/innobase/include/mem0mem.h +++ b/innobase/include/mem0mem.h @@ -261,18 +261,6 @@ mem_free_func( const char* file_name, /* in: file name where created */ ulint line /* in: line where created */ ); -/******************************************************************* -Implements realloc. */ -UNIV_INLINE -void* -mem_realloc( -/*========*/ - /* out, own: free storage, - NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - const char* file_name, /* in: file name where called */ - ulint line); /* in: line where called */ /************************************************************************** Duplicates a NUL-terminated string. */ diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic index df3dbf9b576..d97b7d6c4dd 100644 --- a/innobase/include/mem0mem.ic +++ b/innobase/include/mem0mem.ic @@ -562,24 +562,6 @@ mem_heap_get_size( return(size); } -/******************************************************************* -Implements realloc. */ -UNIV_INLINE -void* -mem_realloc( -/*========*/ - /* out, own: free storage, - NULL if did not succeed */ - void* buf, /* in: pointer to an old buffer */ - ulint n, /* in: desired number of bytes */ - const char* file_name, /* in: file name where called */ - ulint line) /* in: line where called */ -{ - mem_free(buf); - - return(mem_alloc_func(n, file_name, line)); -} - /************************************************************************** Duplicates a NUL-terminated string. */ UNIV_INLINE diff --git a/innobase/include/mem0pool.h b/innobase/include/mem0pool.h index 95cf19676fb..43707bd5f61 100644 --- a/innobase/include/mem0pool.h +++ b/innobase/include/mem0pool.h @@ -83,7 +83,6 @@ Releases the mem pool mutex. */ void mem_pool_mutex_exit(void); /*=====================*/ -#ifdef UNIV_DEBUG /************************************************************************ Validates a memory pool. */ @@ -100,7 +99,7 @@ mem_pool_print_info( /*================*/ FILE* outfile,/* in: output file to write to */ mem_pool_t* pool); /* in: memory pool */ -#endif /* UNIV_DEBUG */ + #ifndef UNIV_NONINL #include "mem0pool.ic" diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h index 55fa3d80a42..e8c68a91dad 100644 --- a/innobase/include/mtr0mtr.h +++ b/innobase/include/mtr0mtr.h @@ -246,7 +246,6 @@ mtr_memo_contains( mtr_t* mtr, /* in: mtr */ void* object, /* in: object to search */ ulint type); /* in: type of object */ -#ifdef UNIV_DEBUG /************************************************************* Prints info of an mtr handle. */ @@ -254,7 +253,6 @@ void mtr_print( /*======*/ mtr_t* mtr); /* in: mtr */ -#endif /* UNIV_DEBUG */ /*######################################################################*/ #define MTR_BUF_MEMO_SIZE 200 /* number of slots in memo */ @@ -287,12 +285,7 @@ struct mtr_memo_slot_struct{ /* Mini-transaction handle and buffer */ struct mtr_struct{ -#ifdef UNIV_DEBUG ulint state; /* MTR_ACTIVE, MTR_COMMITTING, MTR_COMMITTED */ -#define MTR_ACTIVE 12231 -#define MTR_COMMITTING 56456 -#define MTR_COMMITTED 34676 -#endif /* UNIV_DEBUG */ dyn_array_t memo; /* memo stack for locks etc. */ dyn_array_t log; /* mini-transaction log */ ibool modifications; @@ -307,12 +300,15 @@ struct mtr_struct{ this mtr */ dulint end_lsn;/* end lsn of the possible log entry for this mtr */ -#ifdef UNIV_DEBUG ulint magic_n; -#define MTR_MAGIC_N 54551 -#endif /* UNIV_DEBUG */ }; +#define MTR_MAGIC_N 54551 + +#define MTR_ACTIVE 12231 +#define MTR_COMMITTING 56456 +#define MTR_COMMITTED 34676 + #ifndef UNIV_NONINL #include "mtr0mtr.ic" #endif diff --git a/innobase/include/pars0opt.h b/innobase/include/pars0opt.h index ac0e885d05a..d091c3ee2d0 100644 --- a/innobase/include/pars0opt.h +++ b/innobase/include/pars0opt.h @@ -43,7 +43,6 @@ opt_find_all_cols( to add new found columns */ plan_t* plan, /* in: plan or NULL */ que_node_t* exp); /* in: expression or condition */ -#ifdef UNIV_SQL_DEBUG /************************************************************************ Prints info of a query plan. */ @@ -51,7 +50,6 @@ void opt_print_query_plan( /*=================*/ sel_node_t* sel_node); /* in: select node */ -#endif /* UNIV_SQL_DEBUG */ #ifndef UNIV_NONINL #include "pars0opt.ic" diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h index a438116781f..e1874edcaf2 100644 --- a/innobase/include/que0que.h +++ b/innobase/include/que0que.h @@ -152,6 +152,17 @@ que_run_threads( /*============*/ que_thr_t* thr); /* in: query thread which is run initially */ /************************************************************************** +After signal handling is finished, returns control to a query graph error +handling routine. (Currently, just returns the control to the root of the +graph so that the graph can communicate an error message to the client.) */ + +void +que_fork_error_handle( +/*==================*/ + trx_t* trx, /* in: trx */ + que_t* fork); /* in: query graph which was run before signal + handling started, NULL not allowed */ +/************************************************************************** Handles an SQL error noticed during query thread execution. At the moment, does nothing! */ @@ -170,15 +181,18 @@ a single worker thread to execute it. This function should be used to end the wait state of a query thread waiting for a lock or a stored procedure completion. */ -que_thr_t* +void que_thr_end_wait( /*=============*/ - /* out: next query thread to run; - NULL if none */ - que_thr_t* thr); /* in: query thread in the + que_thr_t* thr, /* in: query thread in the QUE_THR_LOCK_WAIT, or QUE_THR_PROCEDURE_WAIT, or QUE_THR_SIG_REPLY_WAIT state */ + que_thr_t** next_thr); /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread */ /************************************************************************** Same as que_thr_end_wait, but no parameter next_thr available. */ @@ -293,6 +307,22 @@ que_thr_peek_stop( mutex reserved is necessary before deciding the actual stopping */ que_thr_t* thr); /* in: query thread */ +/*************************************************************************** +Returns TRUE if the query graph is for a SELECT statement. */ +UNIV_INLINE +ibool +que_graph_is_select( +/*================*/ + /* out: TRUE if a select */ + que_t* graph); /* in: graph */ +/************************************************************************** +Prints info of an SQL query graph node. */ + +void +que_node_print_info( +/*================*/ + que_node_t* node); /* in: query graph node */ + /* Query graph query thread node: the fields are protected by the kernel mutex with the exceptions named below */ diff --git a/innobase/include/que0que.ic b/innobase/include/que0que.ic index a63922f8c80..ae4ed10560f 100644 --- a/innobase/include/que0que.ic +++ b/innobase/include/que0que.ic @@ -238,3 +238,21 @@ que_thr_peek_stop( return(FALSE); } + +/*************************************************************************** +Returns TRUE if the query graph is for a SELECT statement. */ +UNIV_INLINE +ibool +que_graph_is_select( +/*================*/ + /* out: TRUE if a select */ + que_t* graph) /* in: graph */ +{ + if (graph->fork_type == QUE_FORK_SELECT_SCROLL + || graph->fork_type == QUE_FORK_SELECT_NON_SCROLL) { + + return(TRUE); + } + + return(FALSE); +} diff --git a/innobase/include/row0ins.h b/innobase/include/row0ins.h index f3f0b7e8eca..a5b4b74e7fc 100644 --- a/innobase/include/row0ins.h +++ b/innobase/include/row0ins.h @@ -145,12 +145,11 @@ struct ins_node_struct{ entry_list and sys fields are stored here; if this is NULL, entry list should be created and buffers for sys fields in row allocated */ -#ifdef UNIV_DEBUG ulint magic_n; -#define INS_NODE_MAGIC_N 15849075 -#endif /* UNIV_DEBUG */ }; +#define INS_NODE_MAGIC_N 15849075 + /* Insert node types */ #define INS_SEARCHED 0 /* INSERT INTO ... SELECT ... */ #define INS_VALUES 1 /* INSERT INTO ... VALUES ... */ diff --git a/innobase/include/row0upd.h b/innobase/include/row0upd.h index 687e90deee5..f5e0a88231f 100644 --- a/innobase/include/row0upd.h +++ b/innobase/include/row0upd.h @@ -384,12 +384,11 @@ struct upd_node_struct{ sym_node_t* table_sym;/* table node in symbol table */ que_node_t* col_assign_list; /* column assignment list */ -#ifdef UNIV_DEBUG ulint magic_n; -#define UPD_NODE_MAGIC_N 1579975 -#endif /* UNIV_DEBUG */ }; +#define UPD_NODE_MAGIC_N 1579975 + /* Node execution states */ #define UPD_NODE_SET_IX_LOCK 1 /* execution came to the node from a node above and if the field diff --git a/innobase/include/srv0que.h b/innobase/include/srv0que.h new file mode 100644 index 00000000000..05c339cdd32 --- /dev/null +++ b/innobase/include/srv0que.h @@ -0,0 +1,53 @@ +/****************************************************** +Server query execution + +(c) 1996 Innobase Oy + +Created 6/5/1996 Heikki Tuuri +*******************************************************/ + + +#ifndef srv0que_h +#define srv0que_h + +#include "univ.i" +#include "que0types.h" + +/************************************************************************** +Checks if there is work to do in the server task queue. If there is, the +thread starts processing a task. Before leaving, it again checks the task +queue and picks a new task if any exists. This is called by a SRV_WORKER +thread. */ + +void +srv_que_task_queue_check(void); +/*==========================*/ +/************************************************************************** +Performs round-robin on the server tasks. This is called by a SRV_WORKER +thread every second or so. */ + +que_thr_t* +srv_que_round_robin( +/*================*/ + /* out: the new (may be == thr) query thread + to run */ + que_thr_t* thr); /* in: query thread */ +/************************************************************************** +Enqueues a task to server task queue and releases a worker thread, if +there exists one suspended. */ + +void +srv_que_task_enqueue( +/*=================*/ + que_thr_t* thr); /* in: query thread */ +/************************************************************************** +Enqueues a task to server task queue and releases a worker thread, if +there exists one suspended. */ + +void +srv_que_task_enqueue_low( +/*=====================*/ + que_thr_t* thr); /* in: query thread */ + +#endif + diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h index 63b01ffac80..9a988a03e92 100644 --- a/innobase/include/sync0rw.h +++ b/innobase/include/sync0rw.h @@ -85,7 +85,6 @@ void rw_lock_free( /*=========*/ rw_lock_t* lock); /* in: rw-lock */ -#ifdef UNIV_DEBUG /********************************************************************** Checks that the rw-lock has been initialized and that there are no simultaneous shared and exclusive locks. */ @@ -94,7 +93,6 @@ ibool rw_lock_validate( /*=============*/ rw_lock_t* lock); -#endif /* UNIV_DEBUG */ /****************************************************************** NOTE! The following macros should be used in rw s-locking, not the corresponding function. */ diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h index 4307ca5ba0c..8e0ec715b12 100644 --- a/innobase/include/sync0sync.h +++ b/innobase/include/sync0sync.h @@ -143,7 +143,6 @@ void sync_print( /*=======*/ FILE* file); /* in: file where to print */ -#ifdef UNIV_DEBUG /********************************************************************** Checks that the mutex has been initialized. */ @@ -151,7 +150,6 @@ ibool mutex_validate( /*===========*/ mutex_t* mutex); -#endif /* UNIV_DEBUG */ /********************************************************************** Sets the mutex latching level field. */ diff --git a/innobase/include/trx0roll.h b/innobase/include/trx0roll.h index aa88fc249fc..6004551f456 100644 --- a/innobase/include/trx0roll.h +++ b/innobase/include/trx0roll.h @@ -91,12 +91,16 @@ trx_undo_rec_release( /************************************************************************* Starts a rollback operation. */ -que_thr_t* +void trx_rollback( /*=========*/ - /* out: next query thread to run */ trx_t* trx, /* in: transaction */ - trx_sig_t* sig); /* in: signal starting the rollback */ + trx_sig_t* sig, /* in: signal starting the rollback */ + que_thr_t** next_thr);/* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread */ /*********************************************************************** Rollback or clean up transactions which have no user session. If the transaction already was committed, then we clean up a possible insert @@ -108,12 +112,17 @@ trx_rollback_or_clean_all_without_sess(void); /******************************************************************** Finishes a transaction rollback. */ -que_thr_t* +void trx_finish_rollback_off_kernel( /*===========================*/ - /* out: next query thread to run */ que_t* graph, /* in: undo graph which can now be freed */ - trx_t* trx); /* in: transaction */ + trx_t* trx, /* in: transaction */ + que_thr_t** next_thr);/* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread; if this parameter is + NULL, it is ignored */ /******************************************************************** Builds an undo 'query' graph for a transaction. The actual rollback is performed by executing this query graph like a query subprocedure call. diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 9b7ac22e617..a8c1df534da 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -194,10 +194,9 @@ trx_end_lock_wait( /******************************************************************** Sends a signal to a trx object. */ -que_thr_t* +ibool trx_sig_send( /*=========*/ - /* out: next query thread to run */ /* out: TRUE if the signal was successfully delivered */ trx_t* trx, /* in: trx handle */ @@ -207,17 +206,27 @@ trx_sig_send( que_thr_t* receiver_thr, /* in: query thread which wants the reply, or NULL; if type is TRX_SIG_END_WAIT, this must be NULL */ - trx_savept_t* savept); /* in: possible rollback savepoint, or + trx_savept_t* savept, /* in: possible rollback savepoint, or NULL */ + que_thr_t** next_thr); /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread; if the parameter + is NULL, it is ignored */ /******************************************************************** Send the reply message when a signal in the queue of the trx has been handled. */ -que_thr_t* +void trx_sig_reply( /*==========*/ - /* out: next query thread to run */ - trx_sig_t* sig); /* in: signal */ + trx_sig_t* sig, /* in: signal */ + que_thr_t** next_thr); /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread */ /******************************************************************** Removes the signal object from a trx signal queue. */ @@ -229,11 +238,15 @@ trx_sig_remove( /******************************************************************** Starts handling of a trx signal. */ -que_thr_t* +void trx_sig_start_handle( /*=================*/ - /* out: next query thread to run, or NULL */ - trx_t* trx); /* in: trx handle */ + trx_t* trx, /* in: trx handle */ + que_thr_t** next_thr); /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread */ /******************************************************************** Ends signal handling. If the session is in the error state, and trx->graph_before_signal_handling != NULL, returns control to the error diff --git a/innobase/include/usr0sess.h b/innobase/include/usr0sess.h index aeff7191e68..c7bcfb20fed 100644 --- a/innobase/include/usr0sess.h +++ b/innobase/include/usr0sess.h @@ -38,6 +38,7 @@ sess_try_close( /* The session handle. All fields are protected by the kernel mutex */ struct sess_struct{ + ulint state; /* state of the session */ trx_t* trx; /* transaction object permanently assigned for the session: the transaction instance designated by the @@ -48,6 +49,11 @@ struct sess_struct{ session */ }; +/* Session states */ +#define SESS_ACTIVE 1 +#define SESS_ERROR 2 /* session contains an error message + which has not yet been communicated + to the client */ #ifndef UNIV_NONINL #include "usr0sess.ic" #endif diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index 85b99efff68..2e02b3f0b6b 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -67,6 +67,37 @@ ut_free( /*====*/ void* ptr); /* in, own: memory block */ /************************************************************************** +Implements realloc. This is needed by /pars/lexyy.c. Otherwise, you should not +use this function because the allocation functions in mem0mem.h are the +recommended ones in InnoDB. + +man realloc in Linux, 2004: + + realloc() changes the size of the memory block pointed to + by ptr to size bytes. The contents will be unchanged to + the minimum of the old and new sizes; newly allocated mem + ory will be uninitialized. If ptr is NULL, the call is + equivalent to malloc(size); if size is equal to zero, the + call is equivalent to free(ptr). Unless ptr is NULL, it + must have been returned by an earlier call to malloc(), + calloc() or realloc(). + +RETURN VALUE + realloc() returns a pointer to the newly allocated memory, + which is suitably aligned for any kind of variable and may + be different from ptr, or NULL if the request fails. If + size was equal to 0, either NULL or a pointer suitable to + be passed to free() is returned. If realloc() fails the + original block is left untouched - it is not freed or + moved. */ + +void* +ut_realloc( +/*=======*/ + /* out, own: pointer to new mem block or NULL */ + void* ptr, /* in: pointer to old block or NULL */ + ulint size); /* in: desired size */ +/************************************************************************** Frees in shutdown all allocated memory not freed yet. */ void diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 58c88f67017..be0806590a9 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -292,9 +292,7 @@ waiting, in its lock queue. Solution: We can copy the locks as gap type locks, so that also the waiting locks are transformed to granted gap type locks on the inserted record. */ -#ifdef UNIV_DEBUG ibool lock_print_waits = FALSE; -#endif /* UNIV_DEBUG */ /* The lock system */ lock_sys_t* lock_sys = NULL; @@ -1354,8 +1352,7 @@ lock_rec_has_expl( return(NULL); } - -#ifdef UNIV_DEBUG + /************************************************************************* Checks if some other transaction has a lock request in the queue. */ static @@ -1398,7 +1395,6 @@ lock_rec_other_has_expl_req( return(NULL); } -#endif /* UNIV_DEBUG */ /************************************************************************* Checks if some other transaction has a conflicting explicit lock request @@ -1688,13 +1684,11 @@ lock_rec_enqueue_waiting( ut_a(que_thr_stop(thr)); -#ifdef UNIV_DEBUG if (lock_print_waits) { fprintf(stderr, "Lock wait for trx %lu in index ", (ulong) ut_dulint_get_low(trx->id)); ut_print_name(stderr, index->name); } -#endif /* UNIV_DEBUG */ return(DB_LOCK_WAIT); } @@ -2034,12 +2028,10 @@ lock_grant( lock->trx->n_tables_locked++; } -#ifdef UNIV_DEBUG if (lock_print_waits) { fprintf(stderr, "Lock wait for trx %lu ends\n", (ulong) ut_dulint_get_low(lock->trx->id)); } -#endif /* UNIV_DEBUG */ /* If we are resolving a deadlock by choosing another transaction as a victim, then our original transaction may not be in the @@ -3110,11 +3102,9 @@ lock_deadlock_recursive( lock_table_print(ef, start->wait_lock); } -#ifdef UNIV_DEBUG if (lock_print_waits) { fputs("Deadlock detected\n", stderr); } -#endif /* UNIV_DEBUG */ if (ut_dulint_cmp(wait_lock->trx->undo_no, start->undo_no) >= 0) { @@ -4177,7 +4167,6 @@ loop: goto loop; } -#ifdef UNIV_DEBUG /************************************************************************* Validates the lock queue on a table. */ @@ -4488,7 +4477,6 @@ lock_validate(void) return(TRUE); } -#endif /* UNIV_DEBUG */ /*============ RECORD LOCK CHECKS FOR ROW OPERATIONS ====================*/ diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c index 7d7c7dcf998..923ab448e07 100644 --- a/innobase/log/log0log.c +++ b/innobase/log/log0log.c @@ -32,9 +32,9 @@ ulint log_fsp_current_free_limit = 0; log_t* log_sys = NULL; ibool log_do_write = TRUE; -#ifdef UNIV_LOG_DEBUG + ibool log_debug_writes = FALSE; -#endif /* UNIV_LOG_DEBUG */ + /* These control how often we print warnings if the last checkpoint is too old */ @@ -945,12 +945,10 @@ log_group_check_flush_completion( #endif /* UNIV_SYNC_DEBUG */ if (!log_sys->one_flushed && group->n_pending_writes == 0) { -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Log flushed first to group %lu\n", (ulong) group->id); } -#endif /* UNIV_LOG_DEBUG */ log_sys->written_to_some_lsn = log_sys->write_lsn; log_sys->one_flushed = TRUE; @@ -958,12 +956,10 @@ log_group_check_flush_completion( return(LOG_UNLOCK_NONE_FLUSHED_LOCK); } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes && (group->n_pending_writes == 0)) { fprintf(stderr, "Log flushed to group %lu\n", (ulong) group->id); } -#endif /* UNIV_LOG_DEBUG */ return(0); } @@ -1041,13 +1037,11 @@ log_io_complete( fil_flush(group->space_id); } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Checkpoint info written to group %lu\n", group->id); } -#endif /* UNIV_LOG_DEBUG */ log_io_complete_checkpoint(); @@ -1110,13 +1104,11 @@ log_group_file_header_flush( dest_offset = nth_file * group->file_size; -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Writing log file header to group %lu file %lu\n", (ulong) group->id, (ulong) nth_file); } -#endif /* UNIV_LOG_DEBUG */ if (log_do_write) { log_sys->n_log_ios++; @@ -1200,7 +1192,6 @@ loop: write_len = len; } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, @@ -1224,7 +1215,6 @@ loop: + i * OS_FILE_LOG_BLOCK_SIZE)); } } -#endif /* UNIV_LOG_DEBUG */ /* Calculate the checksums for each log block and write them to the trailer fields of the log blocks */ @@ -1352,7 +1342,6 @@ loop: return; } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Writing log from %lu %lu up to lsn %lu %lu\n", @@ -1361,7 +1350,6 @@ loop: (ulong) ut_dulint_get_high(log_sys->lsn), (ulong) ut_dulint_get_low(log_sys->lsn)); } -#endif /* UNIV_LOG_DEBUG */ log_sys->n_pending_writes++; @@ -1931,14 +1919,12 @@ log_checkpoint( log_sys->next_checkpoint_lsn = oldest_lsn; -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Making checkpoint no %lu at lsn %lu %lu\n", (ulong) ut_dulint_get_low(log_sys->next_checkpoint_no), (ulong) ut_dulint_get_high(oldest_lsn), (ulong) ut_dulint_get_low(oldest_lsn)); } -#endif /* UNIV_LOG_DEBUG */ log_groups_write_checkpoint_info(); @@ -2319,11 +2305,9 @@ loop: exit(1); } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Created archive file %s\n", name); } -#endif /* UNIV_LOG_DEBUG */ ret = os_file_close(file_handle); @@ -2350,7 +2334,6 @@ loop: len = group->file_size - (next_offset % group->file_size); } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Archiving starting at lsn %lu %lu, len %lu to group %lu\n", @@ -2358,7 +2341,6 @@ loop: (ulong) ut_dulint_get_low(start_lsn), (ulong) len, (ulong) group->id); } -#endif /* UNIV_LOG_DEBUG */ log_sys->n_pending_archive_ios++; @@ -2449,13 +2431,11 @@ log_archive_write_complete_groups(void) trunc_files = n_files - 1; } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes && trunc_files) { fprintf(stderr, "Complete file(s) archived to group %lu\n", (ulong) group->id); } -#endif /* UNIV_LOG_DEBUG */ /* Calculate the archive file space start lsn */ start_lsn = ut_dulint_subtract(log_sys->next_archived_lsn, @@ -2478,11 +2458,9 @@ log_archive_write_complete_groups(void) fil_space_truncate_start(group->archive_space_id, trunc_files * group->file_size); -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fputs("Archiving writes completed\n", stderr); } -#endif /* UNIV_LOG_DEBUG */ } /********************************************************** @@ -2499,11 +2477,9 @@ log_archive_check_completion_low(void) if (log_sys->n_pending_archive_ios == 0 && log_sys->archiving_phase == LOG_ARCHIVE_READ) { -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fputs("Archiving read completed\n", stderr); } -#endif /* UNIV_LOG_DEBUG */ /* Archive buffer has now been read in: start archive writes */ @@ -2647,7 +2623,6 @@ loop: log_sys->next_archived_lsn = limit_lsn; -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Archiving from lsn %lu %lu to lsn %lu %lu\n", @@ -2656,7 +2631,6 @@ loop: (ulong) ut_dulint_get_high(limit_lsn), (ulong) ut_dulint_get_low(limit_lsn)); } -#endif /* UNIV_LOG_DEBUG */ /* Read the log segment to the archive buffer */ @@ -2759,14 +2733,12 @@ log_archive_close_groups( group->archived_file_no += 2; } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "Incrementing arch file no to %lu in log group %lu\n", (ulong) group->archived_file_no + 2, (ulong) group->id); } -#endif /* UNIV_LOG_DEBUG */ } } @@ -3181,7 +3153,6 @@ loop: ut_a(0 == ut_dulint_cmp(lsn, log_sys->lsn)); } -#ifdef UNIV_LOG_DEBUG /********************************************************** Checks by parsing that the catenated log segment for a single mtr is consistent. */ @@ -3234,7 +3205,6 @@ log_check_log_recs( return(TRUE); } -#endif /* UNIV_LOG_DEBUG */ /********************************************************** Peeks the current lsn. */ diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 49d537d23db..7e57efcf9e1 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -189,7 +189,6 @@ recv_sys_empty_hash(void) recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 256); } -#ifndef UNIV_LOG_DEBUG /************************************************************ Frees the recovery system. */ static @@ -209,7 +208,6 @@ recv_sys_free(void) mutex_exit(&(recv_sys->mutex)); } -#endif /* !UNIV_LOG_DEBUG */ /************************************************************ Truncates possible corrupted or extra records from a log group. */ @@ -491,7 +489,6 @@ recv_find_max_checkpoint( log_group_read_checkpoint_info(group, field); if (!recv_check_cp_is_consistent(buf)) { -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Checkpoint in group %lu at %lu invalid, %lu\n", @@ -501,7 +498,6 @@ recv_find_max_checkpoint( + LOG_CHECKPOINT_CHECKSUM_1)); } -#endif /* UNIV_LOG_DEBUG */ goto not_consistent; } @@ -515,14 +511,12 @@ recv_find_max_checkpoint( checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO); -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Checkpoint number %lu found in group %lu\n", (ulong) ut_dulint_get_low(checkpoint_no), (ulong) group->id); } -#endif /* UNIV_LOG_DEBUG */ if (ut_dulint_cmp(checkpoint_no, max_no) >= 0) { *max_group = group; @@ -1146,7 +1140,6 @@ recv_recover_page( start_lsn = recv->start_lsn; } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Applying log rec type %lu len %lu to space %lu page no %lu\n", @@ -1154,7 +1147,6 @@ recv_recover_page( (ulong) recv_addr->space, (ulong) recv_addr->page_no); } -#endif /* UNIV_LOG_DEBUG */ recv_parse_or_apply_log_rec_body(recv->type, buf, buf + recv->len, page, &mtr); @@ -1397,7 +1389,6 @@ loop: mutex_exit(&(recv_sys->mutex)); } -#ifdef UNIV_HOTBACKUP /* This page is allocated from the buffer pool and used in the function below */ page_t* recv_backup_application_page = NULL; @@ -1522,9 +1513,8 @@ skip_this_recv_addr: recv_sys_empty_hash(); } -#endif /* UNIV_HOTBACKUP */ -#ifdef UNIV_LOG_REPLICATE +#ifdef notdefined /*********************************************************************** In the debug version, updates the replica of a file page, based on a log record. */ @@ -1820,11 +1810,10 @@ recv_calc_lsn_on_data_add( return(ut_dulint_add(lsn, lsn_len)); } -#ifdef UNIV_LOG_DEBUG /*********************************************************** Checks that the parser recognizes incomplete initial segments of a log record as incomplete. */ -static + void recv_check_incomplete_log_recs( /*===========================*/ @@ -1842,7 +1831,6 @@ recv_check_incomplete_log_recs( &page_no, &body)); } } -#endif /* UNIV_LOG_DEBUG */ /*********************************************************** Prints diagnostic info of corrupt log. */ @@ -1979,14 +1967,12 @@ loop: recv_sys->recovered_offset += len; recv_sys->recovered_lsn = new_recovered_lsn; -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Parsed a single log rec type %lu len %lu space %lu page no %lu\n", (ulong) type, (ulong) len, (ulong) space, (ulong) page_no); } -#endif /* UNIV_LOG_DEBUG */ if (type == MLOG_DUMMY_RECORD) { /* Do nothing */ @@ -2070,14 +2056,12 @@ loop: #endif /* UNIV_LOG_REPLICATE */ } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Parsed a multi log rec type %lu len %lu space %lu page no %lu\n", (ulong) type, (ulong) len, (ulong) space, (ulong) page_no); } -#endif /* UNIV_LOG_DEBUG */ total_len += len; n_recs++; @@ -2484,7 +2468,6 @@ recv_group_scan_log_recs( start_lsn = end_lsn; } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Scanned group %lu up to log sequence number %lu %lu\n", @@ -2492,7 +2475,6 @@ recv_group_scan_log_recs( (ulong) ut_dulint_get_high(*group_scanned_lsn), (ulong) ut_dulint_get_low(*group_scanned_lsn)); } -#endif /* UNIV_LOG_DEBUG */ } /************************************************************ @@ -2879,12 +2861,10 @@ recv_recovery_from_checkpoint_finish(void) recv_apply_hashed_log_recs(TRUE); } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Log records applied to the database\n"); } -#endif /* UNIV_LOG_DEBUG */ if (recv_needed_recovery) { trx_sys_print_mysql_master_log_pos(); @@ -3214,7 +3194,6 @@ ask_again: break; } -#ifdef UNIV_LOG_DEBUG if (log_debug_writes) { fprintf(stderr, "InnoDB: Archive read starting at lsn %lu %lu, len %lu from file %s\n", @@ -3222,7 +3201,6 @@ ask_again: (ulong) ut_dulint_get_low(start_lsn), (ulong) len, name); } -#endif /* UNIV_LOG_DEBUG */ fil_io(OS_FILE_READ | OS_FILE_LOG, TRUE, group->archive_space_id, read_offset / UNIV_PAGE_SIZE, diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c index d86784cb048..f46984f6bb3 100644 --- a/innobase/mem/mem0dbg.c +++ b/innobase/mem/mem0dbg.c @@ -373,7 +373,6 @@ mem_hash_remove( } #endif /* UNIV_MEM_DEBUG */ -#ifdef UNIV_DEBUG /******************************************************************* Checks a memory heap for consistency and prints the contents if requested. Outputs the sum of sizes of buffers given to the user (only in @@ -603,7 +602,6 @@ mem_heap_validate( return(TRUE); } -#endif /* UNIV_DEBUG */ #ifdef UNIV_MEM_DEBUG /********************************************************************* @@ -816,3 +814,128 @@ mem_analyze_corruption( dist++; } } + +/********************************************************************* +Prints information of dynamic memory usage and currently allocated +memory heaps or buffers. Can only be used in the debug version. */ +static +void +mem_print_info_low( +/*===============*/ + ibool print_all) /* in: if TRUE, all heaps are printed, + else only the heaps allocated after the + previous call of this function */ +{ +#ifdef UNIV_MEM_DEBUG + mem_hash_node_t* node; + ulint n_heaps = 0; + ulint allocated_mem; + ulint ph_size; + ulint total_allocated_mem = 0; + ibool error; + ulint n_blocks; +#endif + FILE* outfile; + + /* outfile = fopen("ibdebug", "a"); */ + + outfile = stdout; + + fprintf(outfile, "\n"); + fprintf(outfile, + "________________________________________________________\n"); + fprintf(outfile, "MEMORY ALLOCATION INFORMATION\n\n"); + +#ifndef UNIV_MEM_DEBUG + + UT_NOT_USED(print_all); + + mem_pool_print_info(outfile, mem_comm_pool); + + fprintf(outfile, + "Sorry, non-debug version cannot give more memory info\n"); + + /* fclose(outfile); */ + + return; +#else + mutex_enter(&mem_hash_mutex); + + fprintf(outfile, "LIST OF CREATED HEAPS AND ALLOCATED BUFFERS: \n\n"); + + if (!print_all) { + fprintf(outfile, "AFTER THE LAST PRINT INFO\n"); + } + + node = UT_LIST_GET_FIRST(mem_all_list_base); + + while (node != NULL) { + n_heaps++; + + if (!print_all && node->nth_heap < mem_last_print_info) { + + goto next_heap; + } + + mem_heap_validate_or_print(node->heap, NULL, + FALSE, &error, &allocated_mem, + &ph_size, &n_blocks); + total_allocated_mem += allocated_mem; + + fprintf(outfile, + "%lu: file %s line %lu of size %lu phys.size %lu with %lu blocks, type %lu\n", + node->nth_heap, node->file_name, node->line, + allocated_mem, ph_size, n_blocks, + (node->heap)->type); + next_heap: + node = UT_LIST_GET_NEXT(all_list, node); + } + + fprintf(outfile, "\n"); + + fprintf(outfile, "Current allocated memory : %lu\n", + mem_current_allocated_memory); + fprintf(outfile, "Current allocated heaps and buffers : %lu\n", + n_heaps); + fprintf(outfile, "Cumulative allocated memory : %lu\n", + mem_total_allocated_memory); + fprintf(outfile, "Maximum allocated memory : %lu\n", + mem_max_allocated_memory); + fprintf(outfile, "Cumulative created heaps and buffers : %lu\n", + mem_n_created_heaps); + fprintf(outfile, "Cumulative number of allocations : %lu\n", + mem_n_allocations); + + mem_last_print_info = mem_n_created_heaps; + + mutex_exit(&mem_hash_mutex); + + mem_pool_print_info(outfile, mem_comm_pool); + +/* mem_validate(); */ + +/* fclose(outfile); */ +#endif +} + +/********************************************************************* +Prints information of dynamic memory usage and currently allocated memory +heaps or buffers. Can only be used in the debug version. */ + +void +mem_print_info(void) +/*================*/ +{ + mem_print_info_low(TRUE); +} + +/********************************************************************* +Prints information of dynamic memory usage and currently allocated memory +heaps or buffers since the last ..._print_info or..._print_new_info. */ + +void +mem_print_new_info(void) +/*====================*/ +{ + mem_print_info_low(FALSE); +} diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c index 0227c2d0969..023369e8ec5 100644 --- a/innobase/mem/mem0pool.c +++ b/innobase/mem/mem0pool.c @@ -559,7 +559,6 @@ mem_area_free( ut_ad(mem_pool_validate(pool)); } -#ifdef UNIV_DEBUG /************************************************************************ Validates a memory pool. */ @@ -637,7 +636,6 @@ mem_pool_print_info( (ulong) pool->reserved); mutex_exit(&(pool->mutex)); } -#endif /* UNIV_DEBUG */ /************************************************************************ Returns the amount of reserved memory. */ diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c index deb4dabde4b..6e918806eb1 100644 --- a/innobase/mtr/mtr0mtr.c +++ b/innobase/mtr/mtr0mtr.c @@ -319,7 +319,6 @@ mtr_read_dulint( return(mach_read_from_8(ptr)); } -#ifdef UNIV_DEBUG /************************************************************* Prints info of an mtr handle. */ @@ -333,4 +332,3 @@ mtr_print( (ulong) dyn_array_get_data_size(&(mtr->memo)), (ulong) dyn_array_get_data_size(&(mtr->log))); } -#endif /* UNIV_DEBUG */ diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 469e7c025b6..d5ca8f927c6 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -368,7 +368,7 @@ os_file_handle_error( #undef USE_FILE_LOCK #define USE_FILE_LOCK -#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__) +#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__FreeBSD__) || defined(__NETWARE__) /* InnoDB Hot Backup does not lock the data files. * On Windows, mandatory locking is used. * On FreeBSD with LinuxThreads, advisory locking does not work properly. diff --git a/innobase/pars/lexyy.c b/innobase/pars/lexyy.c index 1b8c69ccc7a..d98d3c9b945 100644 --- a/innobase/pars/lexyy.c +++ b/innobase/pars/lexyy.c @@ -636,9 +636,9 @@ Linux. #include "mem0mem.h" #include "os0proc.h" -#define malloc(A) mem_alloc(A) -#define free(A) mem_free(A) -#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__) +#define malloc(A) ut_malloc(A) +#define free(A) ut_free(A) +#define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error #define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size) @@ -655,16 +655,16 @@ string_append( const char* str, /* in: string to be appended */ ulint len) /* in: length of the string */ { + if (stringbuf == NULL) { + stringbuf = malloc(1); + stringbuf_len_alloc = 1; + } + if (stringbuf_len + len > stringbuf_len_alloc) { - if (stringbuf_len_alloc == 0) { - stringbuf_len_alloc++; - } while (stringbuf_len + len > stringbuf_len_alloc) { stringbuf_len_alloc <<= 1; } - stringbuf = stringbuf - ? realloc(stringbuf, stringbuf_len_alloc) - : malloc(stringbuf_len_alloc); + stringbuf = realloc(stringbuf, stringbuf_len_alloc); } memcpy(stringbuf + stringbuf_len, str, len); diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l index 0b1af554bed..4e2399613cb 100644 --- a/innobase/pars/pars0lex.l +++ b/innobase/pars/pars0lex.l @@ -58,9 +58,9 @@ Linux. #include "mem0mem.h" #include "os0proc.h" -#define malloc(A) mem_alloc(A) -#define free(A) mem_free(A) -#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__) +#define malloc(A) ut_malloc(A) +#define free(A) ut_free(A) +#define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error #define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size) @@ -77,16 +77,16 @@ string_append( const char* str, /* in: string to be appended */ ulint len) /* in: length of the string */ { + if (stringbuf == NULL) { + stringbuf = malloc(1); + stringbuf_len_alloc = 1; + } + if (stringbuf_len + len > stringbuf_len_alloc) { - if (stringbuf_len_alloc == 0) { - stringbuf_len_alloc++; - } while (stringbuf_len + len > stringbuf_len_alloc) { stringbuf_len_alloc <<= 1; } - stringbuf = stringbuf - ? realloc(stringbuf, stringbuf_len_alloc) - : malloc(stringbuf_len_alloc); + stringbuf = realloc(stringbuf, stringbuf_len_alloc); } memcpy(stringbuf + stringbuf_len, str, len); diff --git a/innobase/pars/pars0opt.c b/innobase/pars/pars0opt.c index 4fb0c937f1e..7ba4af15243 100644 --- a/innobase/pars/pars0opt.c +++ b/innobase/pars/pars0opt.c @@ -1190,7 +1190,6 @@ opt_search_plan( #endif } -#ifdef UNIV_SQL_DEBUG /************************************************************************ Prints info of a query plan. */ @@ -1237,4 +1236,3 @@ opt_print_query_plan( (unsigned long) UT_LIST_GET_LEN(plan->end_conds)); } } -#endif /* UNIV_SQL_DEBUG */ diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c index 363376a72da..22878dec27f 100644 --- a/innobase/que/que0que.c +++ b/innobase/que/que0que.c @@ -12,6 +12,7 @@ Created 5/27/1996 Heikki Tuuri #include "que0que.ic" #endif +#include "srv0que.h" #include "usr0sess.h" #include "trx0trx.h" #include "trx0roll.h" @@ -174,15 +175,19 @@ a single worker thread to execute it. This function should be used to end the wait state of a query thread waiting for a lock or a stored procedure completion. */ -que_thr_t* +void que_thr_end_wait( /*=============*/ - /* out: next query thread to run; - NULL if none */ - que_thr_t* thr) /* in: query thread in the + que_thr_t* thr, /* in: query thread in the QUE_THR_LOCK_WAIT, or QUE_THR_PROCEDURE_WAIT, or QUE_THR_SIG_REPLY_WAIT state */ + que_thr_t** next_thr) /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread; if NULL is passed + as the parameter, it is ignored */ { ibool was_active; @@ -201,8 +206,18 @@ que_thr_end_wait( que_thr_move_to_run_state(thr); - return(was_active ? NULL : thr); -} + if (was_active) { + + return; + } + + if (next_thr && *next_thr == NULL) { + *next_thr = thr; + } else { + ut_a(0); + srv_que_task_enqueue_low(thr); + } +} /************************************************************************** Same as que_thr_end_wait, but no parameter next_thr available. */ @@ -239,6 +254,8 @@ que_thr_end_wait_no_next_thr( for the lock to be released: */ srv_release_mysql_thread_if_suspended(thr); + + /* srv_que_task_enqueue_low(thr); */ } /************************************************************************** @@ -339,6 +356,49 @@ que_fork_start_command( return(NULL); } +/************************************************************************** +After signal handling is finished, returns control to a query graph error +handling routine. (Currently, just returns the control to the root of the +graph so that the graph can communicate an error message to the client.) */ + +void +que_fork_error_handle( +/*==================*/ + trx_t* trx __attribute__((unused)), /* in: trx */ + que_t* fork) /* in: query graph which was run before signal + handling started, NULL not allowed */ +{ + que_thr_t* thr; + +#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&kernel_mutex)); +#endif /* UNIV_SYNC_DEBUG */ + ut_ad(trx->sess->state == SESS_ERROR); + ut_ad(UT_LIST_GET_LEN(trx->reply_signals) == 0); + ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0); + + thr = UT_LIST_GET_FIRST(fork->thrs); + + while (thr != NULL) { + ut_ad(!thr->is_active); + ut_ad(thr->state != QUE_THR_SIG_REPLY_WAIT); + ut_ad(thr->state != QUE_THR_LOCK_WAIT); + + thr->run_node = thr; + thr->prev_node = thr->child; + thr->state = QUE_THR_COMPLETED; + + thr = UT_LIST_GET_NEXT(thrs, thr); + } + + thr = UT_LIST_GET_FIRST(fork->thrs); + + que_thr_move_to_run_state(thr); + + ut_a(0); + srv_que_task_enqueue_low(thr); +} + /******************************************************************** Tests if all the query threads in the same fork have a given state. */ UNIV_INLINE @@ -707,18 +767,22 @@ this function may only be called from inside que_run_threads or que_thr_check_if_switch! These restrictions exist to make the rollback code easier to maintain. */ static -que_thr_t* +void que_thr_dec_refer_count( /*====================*/ - /* out: next query thread to run */ - que_thr_t* thr) /* in: query thread */ + que_thr_t* thr, /* in: query thread */ + que_thr_t** next_thr) /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread */ { que_fork_t* fork; trx_t* trx; sess_t* sess; ulint fork_type; - que_thr_t* next_thr = NULL; - + ibool stopped; + fork = thr->common.parent; trx = thr->graph->trx; sess = trx->sess; @@ -729,7 +793,9 @@ que_thr_dec_refer_count( if (thr->state == QUE_THR_RUNNING) { - if (!que_thr_stop(thr)) { + stopped = que_thr_stop(thr); + + if (!stopped) { /* The reason for the thr suspension or wait was already canceled before we came here: continue running the thread */ @@ -737,9 +803,16 @@ que_thr_dec_refer_count( /* fputs("!!!!!!!! Wait already ended: continue thr\n", stderr); */ + if (next_thr && *next_thr == NULL) { + *next_thr = thr; + } else { + ut_a(0); + srv_que_task_enqueue_low(thr); + } + mutex_exit(&kernel_mutex); - return(thr); + return; } } @@ -755,7 +828,7 @@ que_thr_dec_refer_count( mutex_exit(&kernel_mutex); - return(next_thr); + return; } fork_type = fork->fork_type; @@ -771,7 +844,7 @@ que_thr_dec_refer_count( ut_ad(UT_LIST_GET_LEN(trx->signals) > 0); ut_ad(trx->handling_signals == TRUE); - next_thr = trx_finish_rollback_off_kernel(fork, trx); + trx_finish_rollback_off_kernel(fork, trx, next_thr); } else if (fork_type == QUE_FORK_PURGE) { @@ -793,7 +866,7 @@ que_thr_dec_refer_count( zero, then we start processing a signal; from it we may get a new query thread to run */ - next_thr = trx_sig_start_handle(trx); + trx_sig_start_handle(trx, next_thr); } if (trx->handling_signals && UT_LIST_GET_LEN(trx->signals) == 0) { @@ -802,8 +875,6 @@ que_thr_dec_refer_count( } mutex_exit(&kernel_mutex); - - return(next_thr); } /************************************************************************** @@ -968,10 +1039,9 @@ que_thr_stop_for_mysql_no_error( trx->n_active_thrs--; } -#ifdef UNIV_DEBUG /************************************************************************** Prints info of an SQL query graph node. */ -static + void que_node_print_info( /*================*/ @@ -1028,7 +1098,6 @@ que_node_print_info( fprintf(stderr, "Node type %lu: %s, address %p\n", (ulong) type, str, node); } -#endif /* UNIV_DEBUG */ /************************************************************************** Performs an execution step on a query thread. */ @@ -1177,7 +1246,6 @@ loop: /*-------------------------*/ next_thr = que_thr_step(thr); /*-------------------------*/ - ut_a(next_thr == thr || next_thr == NULL); /* Test the effect on performance of adding extra mutex reservations */ @@ -1190,7 +1258,8 @@ loop: loop_count++; if (next_thr != thr) { - next_thr = que_thr_dec_refer_count(thr); + ut_a(next_thr == NULL); + que_thr_dec_refer_count(thr, &next_thr); if (next_thr == NULL) { diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c index 254ebeec8c9..6e8f3d82ef3 100644 --- a/innobase/rem/rem0cmp.c +++ b/innobase/rem/rem0cmp.c @@ -33,12 +33,13 @@ At the present, the comparison functions return 0 in the case, where two records disagree only in the way that one has more fields than the other. */ +#ifdef UNIV_DEBUG /***************************************************************** Used in debug checking of cmp_dtuple_... . This function is used to compare a data tuple to a physical record. If dtuple has n fields then rec must have either m >= n fields, or it must differ from dtuple in some of the m fields rec has. */ - +static int cmp_debug_dtuple_rec_with_match( /*============================*/ @@ -54,6 +55,7 @@ cmp_debug_dtuple_rec_with_match( completely matched fields; when function returns, contains the value for current comparison */ +#endif /* UNIV_DEBUG */ /***************************************************************** This function is used to compare two data fields for which the data type is such that we must use MySQL code to compare them. The prototype here @@ -962,13 +964,14 @@ order_resolved: return(ret); } +#ifdef UNIV_DEBUG /***************************************************************** Used in debug checking of cmp_dtuple_... . This function is used to compare a data tuple to a physical record. If dtuple has n fields then rec must have either m >= n fields, or it must differ from dtuple in some of the m fields rec has. If encounters an externally stored field, returns 0. */ - +static int cmp_debug_dtuple_rec_with_match( /*============================*/ @@ -1064,3 +1067,4 @@ order_resolved: return(ret); } +#endif /* UNIV_DEBUG */ diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index fdd6989479d..7f1852c70f2 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -42,14 +42,13 @@ extern void innobase_invalidate_query_cache( /*============================*/ - trx_t* trx, /* in: transaction which modifies - the table */ - const char* full_name, /* in: concatenation of database name, - null char '\0', table name, null char - '\0'; NOTE that in Windows this is - always in LOWER CASE! */ - ulint full_name_len); /* in: full name length where also the - null chars count */ + trx_t* trx, /* in: transaction which modifies the table */ + char* full_name, /* in: concatenation of database name, null + char '\0', table name, null char'\0'; + NOTE that in Windows this is always + in LOWER CASE! */ + ulint full_name_len); /* in: full name length where also the null + chars count */ /************************************************************************* @@ -81,9 +80,9 @@ ins_node_create( node->trx_id = ut_dulint_zero; node->entry_sys_heap = mem_heap_create(128); -#ifdef UNIV_DEBUG - node->magic_n = INS_NODE_MAGIC_N; -#endif /* UNIV_DEBUG */ + + node->magic_n = INS_NODE_MAGIC_N; + return(node); } @@ -195,7 +194,6 @@ ins_node_set_new_row( ins_node_t* node, /* in: insert node */ dtuple_t* row) /* in: new row (or first row) for the node */ { - ut_ad(node->magic_n == INS_NODE_MAGIC_N); node->state = INS_NODE_SET_IX_LOCK; node->index = NULL; node->entry = NULL; @@ -652,24 +650,27 @@ row_ins_foreign_check_on_constraint( ulint n_to_update; ulint err; ulint i; - const char* ptr; - char* table_name; + char* ptr; + char* table_name_buf; ut_a(thr && foreign && pcur && mtr); -#ifndef UNIV_HOTBACKUP /* Since we are going to delete or update a row, we have to invalidate the MySQL query cache for table */ - ptr = strchr(table->name, '/'); + table_name_buf = mem_strdup(table->name); + + ptr = strchr(table_name_buf, '/'); ut_a(ptr); - table_name = mem_strdupl(table->name, ptr - table->name); + *ptr = '\0'; +#ifndef UNIV_HOTBACKUP /* We call a function in ha_innodb.cc */ - innobase_invalidate_query_cache(thr_get_trx(thr), table_name, - ptr - table->name + 1); - mem_free(table_name); + innobase_invalidate_query_cache(thr_get_trx(thr), table_name_buf, + strlen(table->name) + 1); #endif + mem_free(table_name_buf); + node = thr->run_node; if (node->is_delete && 0 == (foreign->type & @@ -2012,7 +2013,6 @@ row_ins( ulint err; ut_ad(node && thr); - ut_ad(node->magic_n == INS_NODE_MAGIC_N); if (node->state == INS_NODE_ALLOC_ROW_ID) { @@ -2077,7 +2077,7 @@ row_ins_step( trx_start_if_not_started(trx); node = thr->run_node; - ut_ad(node->magic_n == INS_NODE_MAGIC_N); + ut_ad(que_node_get_type(node) == QUE_NODE_INSERT); parent = que_node_get_parent(node); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 974dfa3e1c8..c4408de2a85 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1414,7 +1414,8 @@ row_create_table_for_mysql( tab_node_t* node; mem_heap_t* heap; que_thr_t* thr; - ulint namelen; + const char* table_name; + ulint table_name_len; ulint err; ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); @@ -1466,10 +1467,17 @@ row_create_table_for_mysql( return(row_mysql_recover_tmp_table(table, trx)); } - namelen = strlen(table->name) + 1; + /* The table name is prefixed with the database name and a '/'. + Certain table names starting with 'innodb_' have their special + meaning regardless of the database name. Thus, we need to + ignore the database name prefix in the comparisons. */ + table_name = strchr(table->name, '/'); + ut_a(table_name); + table_name++; + table_name_len = strlen(table_name) + 1; - if (namelen == sizeof S_innodb_monitor - && !memcmp(table->name, S_innodb_monitor, + if (table_name_len == sizeof S_innodb_monitor + && !memcmp(table_name, S_innodb_monitor, sizeof S_innodb_monitor)) { /* Table equals "innodb_monitor": @@ -1481,27 +1489,27 @@ row_create_table_for_mysql( of InnoDB monitor prints */ os_event_set(srv_lock_timeout_thread_event); - } else if (namelen == sizeof S_innodb_lock_monitor - && !memcmp(table->name, S_innodb_lock_monitor, + } else if (table_name_len == sizeof S_innodb_lock_monitor + && !memcmp(table_name, S_innodb_lock_monitor, sizeof S_innodb_lock_monitor)) { srv_print_innodb_monitor = TRUE; srv_print_innodb_lock_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); - } else if (namelen == sizeof S_innodb_tablespace_monitor - && !memcmp(table->name, S_innodb_tablespace_monitor, + } else if (table_name_len == sizeof S_innodb_tablespace_monitor + && !memcmp(table_name, S_innodb_tablespace_monitor, sizeof S_innodb_tablespace_monitor)) { srv_print_innodb_tablespace_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); - } else if (namelen == sizeof S_innodb_table_monitor - && !memcmp(table->name, S_innodb_table_monitor, + } else if (table_name_len == sizeof S_innodb_table_monitor + && !memcmp(table_name, S_innodb_table_monitor, sizeof S_innodb_table_monitor)) { srv_print_innodb_table_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); - } else if (namelen == sizeof S_innodb_mem_validate - && !memcmp(table->name, S_innodb_mem_validate, + } else if (table_name_len == sizeof S_innodb_mem_validate + && !memcmp(table_name, S_innodb_mem_validate, sizeof S_innodb_mem_validate)) { /* We define here a debugging feature intended for developers */ @@ -2204,6 +2212,7 @@ row_drop_table_for_mysql( que_thr_t* thr; que_t* graph; ulint err; + const char* table_name; ulint namelen; ibool success; ibool locked_dictionary = FALSE; @@ -2293,10 +2302,17 @@ row_drop_table_for_mysql( trx_start_if_not_started(trx); - namelen = strlen(name) + 1; + /* The table name is prefixed with the database name and a '/'. + Certain table names starting with 'innodb_' have their special + meaning regardless of the database name. Thus, we need to + ignore the database name prefix in the comparisons. */ + table_name = strchr(name, '/'); + ut_a(table_name); + table_name++; + namelen = strlen(table_name) + 1; if (namelen == sizeof S_innodb_monitor - && !memcmp(name, S_innodb_monitor, + && !memcmp(table_name, S_innodb_monitor, sizeof S_innodb_monitor)) { /* Table name equals "innodb_monitor": @@ -2305,17 +2321,17 @@ row_drop_table_for_mysql( srv_print_innodb_monitor = FALSE; srv_print_innodb_lock_monitor = FALSE; } else if (namelen == sizeof S_innodb_lock_monitor - && !memcmp(name, S_innodb_lock_monitor, + && !memcmp(table_name, S_innodb_lock_monitor, sizeof S_innodb_lock_monitor)) { srv_print_innodb_monitor = FALSE; srv_print_innodb_lock_monitor = FALSE; } else if (namelen == sizeof S_innodb_tablespace_monitor - && !memcmp(name, S_innodb_tablespace_monitor, + && !memcmp(table_name, S_innodb_tablespace_monitor, sizeof S_innodb_tablespace_monitor)) { srv_print_innodb_tablespace_monitor = FALSE; } else if (namelen == sizeof S_innodb_table_monitor - && !memcmp(name, S_innodb_table_monitor, + && !memcmp(table_name, S_innodb_table_monitor, sizeof S_innodb_table_monitor)) { srv_print_innodb_table_monitor = FALSE; diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index 724e7bf91e7..d35ae0a3e38 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -287,9 +287,7 @@ upd_node_create( node->select = NULL; node->heap = mem_heap_create(128); -#ifdef UNIV_DEBUG - node->magic_n = UPD_NODE_MAGIC_N; -#endif /* UNIV_DEBUG */ + node->magic_n = UPD_NODE_MAGIC_N; node->cmpl_info = 0; @@ -1806,7 +1804,6 @@ row_upd_step( trx_start_if_not_started(trx); node = thr->run_node; - ut_ad(node->magic_n == UPD_NODE_MAGIC_N); sel_node = node->select; @@ -1926,7 +1923,6 @@ row_upd_in_place_in_select( node = que_node_get_parent(sel_node); - ut_ad(node->magic_n == UPD_NODE_MAGIC_N); ut_ad(que_node_get_type(node) == QUE_NODE_UPDATE); pcur = node->pcur; diff --git a/innobase/srv/Makefile.am b/innobase/srv/Makefile.am index 37fd73a4bf0..752683b82b8 100644 --- a/innobase/srv/Makefile.am +++ b/innobase/srv/Makefile.am @@ -19,6 +19,6 @@ include ../include/Makefile.i noinst_LIBRARIES = libsrv.a -libsrv_a_SOURCES = srv0srv.c srv0start.c +libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c EXTRA_PROGRAMS = diff --git a/innobase/srv/srv0que.c b/innobase/srv/srv0que.c new file mode 100644 index 00000000000..9dc9ae453d9 --- /dev/null +++ b/innobase/srv/srv0que.c @@ -0,0 +1,113 @@ +/****************************************************** +Server query execution + +(c) 1996 Innobase Oy + +Created 6/5/1996 Heikki Tuuri +*******************************************************/ + +#include "srv0que.h" + +#include "srv0srv.h" +#include "sync0sync.h" +#include "os0thread.h" +#include "usr0sess.h" +#include "que0que.h" + +/************************************************************************** +Checks if there is work to do in the server task queue. If there is, the +thread starts processing a task. Before leaving, it again checks the task +queue and picks a new task if any exists. This is called by a SRV_WORKER +thread. */ + +void +srv_que_task_queue_check(void) +/*==========================*/ +{ + que_thr_t* thr; + + for (;;) { + mutex_enter(&kernel_mutex); + + thr = UT_LIST_GET_FIRST(srv_sys->tasks); + + if (thr == NULL) { + mutex_exit(&kernel_mutex); + + return; + } + + UT_LIST_REMOVE(queue, srv_sys->tasks, thr); + + mutex_exit(&kernel_mutex); + + que_run_threads(thr); + } +} + +/************************************************************************** +Performs round-robin on the server tasks. This is called by a SRV_WORKER +thread every second or so. */ + +que_thr_t* +srv_que_round_robin( +/*================*/ + /* out: the new (may be == thr) query thread + to run */ + que_thr_t* thr) /* in: query thread */ +{ + que_thr_t* new_thr; + + ut_ad(thr); + ut_ad(thr->state == QUE_THR_RUNNING); + + mutex_enter(&kernel_mutex); + + UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr); + + new_thr = UT_LIST_GET_FIRST(srv_sys->tasks); + + mutex_exit(&kernel_mutex); + + return(new_thr); +} + +/************************************************************************** +Enqueues a task to server task queue and releases a worker thread, if there +is a suspended one. */ + +void +srv_que_task_enqueue_low( +/*=====================*/ + que_thr_t* thr) /* in: query thread */ +{ + ut_ad(thr); + +#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&kernel_mutex)); +#endif /* UNIV_SYNC_DEBUG */ + + UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr); + + srv_release_threads(SRV_WORKER, 1); +} + +/************************************************************************** +Enqueues a task to server task queue and releases a worker thread, if there +is a suspended one. */ + +void +srv_que_task_enqueue( +/*=================*/ + que_thr_t* thr) /* in: query thread */ +{ + ut_ad(thr); + + ut_a(0); /* Under MySQL this is never called */ + + mutex_enter(&kernel_mutex); + + srv_que_task_enqueue_low(thr); + + mutex_exit(&kernel_mutex); +} diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 3817501ae70..fc46c95a8a6 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -34,6 +34,7 @@ Created 10/8/1995 Heikki Tuuri #include "sync0sync.h" #include "thr0loc.h" #include "que0que.h" +#include "srv0que.h" #include "log0recv.h" #include "pars0pars.h" #include "usr0sess.h" diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 3bf39e6422b..dd38eddb20b 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1478,9 +1478,7 @@ NetWare. */ os_thread_create(&srv_master_thread, NULL, thread_ids + 1 + SRV_MAX_N_IO_THREADS); -#ifdef UNIV_DEBUG /* buf_debug_prints = TRUE; */ -#endif /* UNIV_DEBUG */ sum_of_data_file_sizes = 0; diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c index 2d3b48b1d89..77757685208 100644 --- a/innobase/sync/sync0rw.c +++ b/innobase/sync/sync0rw.c @@ -171,7 +171,6 @@ rw_lock_free( mutex_exit(&rw_lock_list_mutex); } -#ifdef UNIV_DEBUG /********************************************************************** Checks that the rw-lock has been initialized and that there are no simultaneous shared and exclusive locks. */ @@ -199,7 +198,6 @@ rw_lock_validate( return(TRUE); } -#endif /* UNIV_DEBUG */ /********************************************************************** Lock an rw-lock in shared mode for the current thread. If the rw-lock is diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c index 89bfb5dd02e..86306e49cac 100644 --- a/innobase/sync/sync0sync.c +++ b/innobase/sync/sync0sync.c @@ -314,7 +314,6 @@ mutex_enter_nowait( return(1); } -#ifdef UNIV_DEBUG /********************************************************************** Checks that the mutex has been initialized. */ @@ -328,7 +327,6 @@ mutex_validate( return(TRUE); } -#endif /* UNIV_DEBUG */ /********************************************************************** Sets the waiters field in a mutex. */ @@ -1077,12 +1075,8 @@ sync_thread_add_level( } else if (level == SYNC_DICT_HEADER) { ut_a(sync_thread_levels_g(array, SYNC_DICT_HEADER)); } else if (level == SYNC_DICT) { -#ifdef UNIV_DEBUG - ut_a(buf_debug_prints || - sync_thread_levels_g(array, SYNC_DICT)); -#else /* UNIV_DEBUG */ - ut_a(sync_thread_levels_g(array, SYNC_DICT)); -#endif /* UNIV_DEBUG */ + ut_a(buf_debug_prints + || sync_thread_levels_g(array, SYNC_DICT)); } else { ut_error; } diff --git a/innobase/thr/thr0loc.c b/innobase/thr/thr0loc.c index a17d09fcca6..033bb22807f 100644 --- a/innobase/thr/thr0loc.c +++ b/innobase/thr/thr0loc.c @@ -46,12 +46,11 @@ struct thr_local_struct{ ibool in_ibuf;/* TRUE if the the thread is doing an ibuf operation */ hash_node_t hash; /* hash chain node */ -#ifdef UNIV_DEBUG ulint magic_n; -#define THR_LOCAL_MAGIC_N 1231234 -#endif /* UNIV_DEBUG */ }; +#define THR_LOCAL_MAGIC_N 1231234 + /*********************************************************************** Returns the local storage struct for a thread. */ static @@ -170,9 +169,8 @@ thr_local_create(void) local->id = os_thread_get_curr_id(); local->handle = os_thread_get_curr(); -#ifdef UNIV_DEBUG local->magic_n = THR_LOCAL_MAGIC_N; -#endif /* UNIV_DEBUG */ + local->in_ibuf = FALSE; mutex_enter(&thr_local_mutex); @@ -211,7 +209,7 @@ thr_local_free( mutex_exit(&thr_local_mutex); - ut_ad(local->magic_n == THR_LOCAL_MAGIC_N); + ut_a(local->magic_n == THR_LOCAL_MAGIC_N); mem_free(local); } diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c index 002775eaac1..3d5f0d3f03a 100644 --- a/innobase/trx/trx0purge.c +++ b/innobase/trx/trx0purge.c @@ -23,6 +23,7 @@ Created 3/26/1996 Heikki Tuuri #include "row0purge.h" #include "row0upd.h" #include "trx0rec.h" +#include "srv0que.h" #include "os0thread.h" /* The global data structure coordinating a purge */ @@ -1059,6 +1060,8 @@ trx_purge(void) mutex_exit(&kernel_mutex); +/* srv_que_task_enqueue(thr2); */ + if (srv_print_thread_releases) { fputs("Starting purge\n", stderr); diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c index 8b8a079bb7f..e65755a0f73 100644 --- a/innobase/trx/trx0roll.c +++ b/innobase/trx/trx0roll.c @@ -20,6 +20,7 @@ Created 3/26/1996 Heikki Tuuri #include "trx0rec.h" #include "que0que.h" #include "usr0sess.h" +#include "srv0que.h" #include "srv0start.h" #include "row0undo.h" #include "row0mysql.h" @@ -931,15 +932,21 @@ trx_undo_rec_release( /************************************************************************* Starts a rollback operation. */ -que_thr_t* +void trx_rollback( /*=========*/ - /* out: next query thread to run */ trx_t* trx, /* in: transaction */ - trx_sig_t* sig) /* in: signal starting the rollback */ + trx_sig_t* sig, /* in: signal starting the rollback */ + que_thr_t** next_thr)/* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread; if the passed value is + NULL, the parameter is ignored */ { que_t* roll_graph; que_thr_t* thr; +/* que_thr_t* thr2; */ #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -981,7 +988,18 @@ trx_rollback( thr = que_fork_start_command(roll_graph); ut_ad(thr); - return(thr); + +/* thr2 = que_fork_start_command(roll_graph); + + ut_ad(thr2); */ + + if (next_thr && (*next_thr == NULL)) { + *next_thr = thr; +/* srv_que_task_enqueue_low(thr2); */ + } else { + srv_que_task_enqueue_low(thr); +/* srv_que_task_enqueue_low(thr2); */ + } } /******************************************************************** @@ -1053,14 +1071,17 @@ trx_finish_error_processing( /************************************************************************* Finishes a partial rollback operation. */ static -que_thr_t* +void trx_finish_partial_rollback_off_kernel( /*===================================*/ - /* out: next query thread to run */ - trx_t* trx) /* in: transaction */ + trx_t* trx, /* in: transaction */ + que_thr_t** next_thr)/* in/out: next query thread to run; + if the value which is passed in is a pointer + to a NULL pointer, then the calling function + can start running a new query thread; if this + parameter is NULL, it is ignored */ { trx_sig_t* sig; - que_thr_t* next_thr; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -1071,26 +1092,29 @@ trx_finish_partial_rollback_off_kernel( /* Remove the signal from the signal queue and send reply message to it */ - next_thr = trx_sig_reply(sig); + trx_sig_reply(sig, next_thr); trx_sig_remove(trx, sig); trx->que_state = TRX_QUE_RUNNING; - return(next_thr); } /******************************************************************** Finishes a transaction rollback. */ -que_thr_t* +void trx_finish_rollback_off_kernel( /*===========================*/ - /* out: next query thread to run */ que_t* graph, /* in: undo graph which can now be freed */ - trx_t* trx) /* in: transaction */ + trx_t* trx, /* in: transaction */ + que_thr_t** next_thr)/* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread; if this parameter is + NULL, it is ignored */ { trx_sig_t* sig; trx_sig_t* next_sig; - que_thr_t* next_thr; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -1105,21 +1129,21 @@ trx_finish_rollback_off_kernel( if (sig->type == TRX_SIG_ROLLBACK_TO_SAVEPT) { - return(trx_finish_partial_rollback_off_kernel(trx)); + trx_finish_partial_rollback_off_kernel(trx, next_thr); + + return; } else if (sig->type == TRX_SIG_ERROR_OCCURRED) { trx_finish_error_processing(trx); - return(NULL); + return; } -#ifdef UNIV_DEBUG if (lock_print_waits) { fprintf(stderr, "Trx %lu rollback finished\n", (ulong) ut_dulint_get_low(trx->id)); } -#endif /* UNIV_DEBUG */ trx_commit_off_kernel(trx); @@ -1127,23 +1151,19 @@ trx_finish_rollback_off_kernel( send reply messages to them */ trx->que_state = TRX_QUE_RUNNING; - - next_thr = NULL; + while (sig != NULL) { next_sig = UT_LIST_GET_NEXT(signals, sig); if (sig->type == TRX_SIG_TOTAL_ROLLBACK) { - ut_a(next_thr == NULL); - next_thr = trx_sig_reply(sig); + trx_sig_reply(sig, next_thr); trx_sig_remove(trx, sig); } sig = next_sig; } - - return(next_thr); } /************************************************************************* @@ -1176,6 +1196,7 @@ trx_rollback_step( que_thr_t* thr) /* in: query thread */ { roll_node_t* node; + ibool success; ulint sig_no; trx_savept_t* savept; @@ -1202,13 +1223,19 @@ trx_rollback_step( /* Send a rollback signal to the transaction */ - trx_sig_send(thr_get_trx(thr), sig_no, TRX_SIG_SELF, - thr, savept); + success = trx_sig_send(thr_get_trx(thr), + sig_no, TRX_SIG_SELF, + thr, savept, NULL); thr->state = QUE_THR_SIG_REPLY_WAIT; mutex_exit(&kernel_mutex); + if (!success) { + /* Error in delivering the rollback signal */ + que_thr_handle_error(thr, DB_ERROR, NULL, 0); + } + return(NULL); } diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c index b377bdb9809..5c8ae0952ef 100644 --- a/innobase/trx/trx0sys.c +++ b/innobase/trx/trx0sys.c @@ -619,7 +619,6 @@ trx_sys_update_mysql_binlog_offset( MLOG_4BYTES, mtr); } -#ifdef UNIV_HOTBACKUP /********************************************************************* Prints to stderr the MySQL binlog info in the system header if the magic number shows it valid. */ @@ -647,7 +646,6 @@ trx_sys_print_mysql_binlog_offset_from_page( sys_header + TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME); } } -#endif /* UNIV_HOTBACKUP */ /********************************************************************* Prints to stderr the MySQL binlog offset info in the trx system header if diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index afef08dc100..a9aae48dae6 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -897,15 +897,18 @@ trx_assign_read_view( /******************************************************************** Commits a transaction. NOTE that the kernel mutex is temporarily released. */ static -que_thr_t* +void trx_handle_commit_sig_off_kernel( /*=============================*/ - /* out: next query thread to run */ - trx_t* trx) /* in: transaction */ + trx_t* trx, /* in: transaction */ + que_thr_t** next_thr) /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread */ { trx_sig_t* sig; trx_sig_t* next_sig; - que_thr_t* next_thr = NULL; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -927,8 +930,7 @@ trx_handle_commit_sig_off_kernel( if (sig->type == TRX_SIG_COMMIT) { - ut_a(next_thr == NULL); - next_thr = trx_sig_reply(sig); + trx_sig_reply(sig, next_thr); trx_sig_remove(trx, sig); } @@ -936,8 +938,6 @@ trx_handle_commit_sig_off_kernel( } trx->que_state = TRX_QUE_RUNNING; - - return(next_thr); } /*************************************************************** @@ -999,6 +999,39 @@ trx_lock_wait_to_suspended( trx->que_state = TRX_QUE_RUNNING; } +/*************************************************************** +Moves the query threads in the sig reply wait list of trx to the SUSPENDED +state. */ +static +void +trx_sig_reply_wait_to_suspended( +/*============================*/ + trx_t* trx) /* in: transaction */ +{ + trx_sig_t* sig; + que_thr_t* thr; + +#ifdef UNIV_SYNC_DEBUG + ut_ad(mutex_own(&kernel_mutex)); +#endif /* UNIV_SYNC_DEBUG */ + + sig = UT_LIST_GET_FIRST(trx->reply_signals); + + while (sig != NULL) { + thr = sig->receiver; + + ut_ad(thr->state == QUE_THR_SIG_REPLY_WAIT); + + thr->state = QUE_THR_SUSPENDED; + + sig->receiver = NULL; + + UT_LIST_REMOVE(reply_signals, trx->reply_signals, sig); + + sig = UT_LIST_GET_FIRST(trx->reply_signals); + } +} + /********************************************************************* Checks the compatibility of a new signal with the other signals in the queue. */ @@ -1078,10 +1111,11 @@ trx_sig_is_compatible( /******************************************************************** Sends a signal to a trx object. */ -que_thr_t* +ibool trx_sig_send( /*=========*/ - /* out: next query thread to run */ + /* out: TRUE if the signal was + successfully delivered */ trx_t* trx, /* in: trx handle */ ulint type, /* in: signal type */ ulint sender, /* in: TRX_SIG_SELF or @@ -1089,8 +1123,14 @@ trx_sig_send( que_thr_t* receiver_thr, /* in: query thread which wants the reply, or NULL; if type is TRX_SIG_END_WAIT, this must be NULL */ - trx_savept_t* savept) /* in: possible rollback savepoint, or + trx_savept_t* savept, /* in: possible rollback savepoint, or NULL */ + que_thr_t** next_thr) /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread; if the parameter + is NULL, it is ignored */ { trx_sig_t* sig; trx_t* receiver_trx; @@ -1100,7 +1140,14 @@ trx_sig_send( ut_ad(mutex_own(&kernel_mutex)); #endif /* UNIV_SYNC_DEBUG */ - ut_a(trx_sig_is_compatible(trx, type, sender)); + if (!trx_sig_is_compatible(trx, type, sender)) { + /* The signal is not compatible with the other signals in + the queue: do nothing */ + + ut_error; + + return(FALSE); + } /* Queue the signal object */ @@ -1134,6 +1181,11 @@ trx_sig_send( sig); } + if (trx->sess->state == SESS_ERROR) { + + trx_sig_reply_wait_to_suspended(trx); + } + if ((sender != TRX_SIG_SELF) || (type == TRX_SIG_BREAK_EXECUTION)) { /* The following call will add a TRX_SIG_ERROR_OCCURRED @@ -1148,10 +1200,10 @@ trx_sig_send( if (UT_LIST_GET_FIRST(trx->signals) == sig) { - return(trx_sig_start_handle(trx)); + trx_sig_start_handle(trx, next_thr); } - return(NULL); + return(TRUE); } /******************************************************************** @@ -1173,18 +1225,27 @@ trx_end_signal_handling( trx->handling_signals = FALSE; trx->graph = trx->graph_before_signal_handling; + + if (trx->graph && (trx->sess->state == SESS_ERROR)) { + + que_fork_error_handle(trx, trx->graph); + } } /******************************************************************** Starts handling of a trx signal. */ -que_thr_t* +void trx_sig_start_handle( /*=================*/ - /* out: next query thread to run, or NULL */ - trx_t* trx) /* in: trx handle */ + trx_t* trx, /* in: trx handle */ + que_thr_t** next_thr) /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread; if the parameter + is NULL, it is ignored */ { - que_thr_t* next_thr = NULL; trx_sig_t* sig; ulint type; loop: @@ -1200,7 +1261,7 @@ loop: trx_end_signal_handling(trx); - return(next_thr); + return; } if (trx->conc_state == TRX_NOT_STARTED) { @@ -1216,13 +1277,23 @@ loop: trx_lock_wait_to_suspended(trx); } + /* If the session is in the error state and this trx has threads + waiting for reply from signals, moves these threads to the suspended + state, canceling wait reservations; note that if the transaction has + sent a commit or rollback signal to itself, and its session is not in + the error state, then nothing is done here. */ + + if (trx->sess->state == SESS_ERROR) { + trx_sig_reply_wait_to_suspended(trx); + } + /* If there are no running query threads, we can start processing of a signal, otherwise we have to wait until all query threads of this transaction are aware of the arrival of the signal. */ if (trx->n_active_thrs > 0) { - return(NULL); + return; } if (trx->handling_signals == FALSE) { @@ -1236,19 +1307,30 @@ loop: if (type == TRX_SIG_COMMIT) { - next_thr = trx_handle_commit_sig_off_kernel(trx); + trx_handle_commit_sig_off_kernel(trx, next_thr); } else if ((type == TRX_SIG_TOTAL_ROLLBACK) - || (type == TRX_SIG_ROLLBACK_TO_SAVEPT) - || (type == TRX_SIG_ERROR_OCCURRED)) { + || (type == TRX_SIG_ROLLBACK_TO_SAVEPT)) { + + trx_rollback(trx, sig, next_thr); + + /* No further signals can be handled until the rollback + completes, therefore we return */ + + return; + + } else if (type == TRX_SIG_ERROR_OCCURRED) { + + trx_rollback(trx, sig, next_thr); + /* No further signals can be handled until the rollback completes, therefore we return */ - return(trx_rollback(trx, sig)); + return; } else if (type == TRX_SIG_BREAK_EXECUTION) { - next_thr = trx_sig_reply(sig); + trx_sig_reply(sig, next_thr); trx_sig_remove(trx, sig); } else { ut_error; @@ -1261,14 +1343,17 @@ loop: Send the reply message when a signal in the queue of the trx has been handled. */ -que_thr_t* +void trx_sig_reply( /*==========*/ - /* out: next query thread to run */ - trx_sig_t* sig) /* in: signal */ + trx_sig_t* sig, /* in: signal */ + que_thr_t** next_thr) /* in/out: next query thread to run; + if the value which is passed in is + a pointer to a NULL pointer, then the + calling function can start running + a new query thread */ { - trx_t* receiver_trx; - que_thr_t* next_thr = NULL; + trx_t* receiver_trx; ut_ad(sig); #ifdef UNIV_SYNC_DEBUG @@ -1282,13 +1367,13 @@ trx_sig_reply( UT_LIST_REMOVE(reply_signals, receiver_trx->reply_signals, sig); - next_thr = que_thr_end_wait(sig->receiver); + ut_ad(receiver_trx->sess->state != SESS_ERROR); + + que_thr_end_wait(sig->receiver, next_thr); sig->receiver = NULL; } - - return(next_thr); } /******************************************************************** @@ -1344,6 +1429,7 @@ trx_commit_step( { commit_node_t* node; que_thr_t* next_thr; + ibool success; node = thr->run_node; @@ -1358,15 +1444,22 @@ trx_commit_step( node->state = COMMIT_NODE_WAIT; + next_thr = NULL; + thr->state = QUE_THR_SIG_REPLY_WAIT; /* Send the commit signal to the transaction */ - next_thr = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT, - TRX_SIG_SELF, thr, NULL); - + success = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT, + TRX_SIG_SELF, thr, NULL, &next_thr); + mutex_exit(&kernel_mutex); + if (!success) { + /* Error in delivering the commit signal */ + que_thr_handle_error(thr, DB_ERROR, NULL, 0); + } + return(next_thr); } diff --git a/innobase/usr/usr0sess.c b/innobase/usr/usr0sess.c index cc016f2b823..359c1552421 100644 --- a/innobase/usr/usr0sess.c +++ b/innobase/usr/usr0sess.c @@ -37,6 +37,8 @@ sess_open(void) #endif /* UNIV_SYNC_DEBUG */ sess = mem_alloc(sizeof(sess_t)); + sess->state = SESS_ACTIVE; + sess->trx = trx_create(sess); UT_LIST_INIT(sess->graphs); diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index 47b612d757e..9a591df9f77 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -203,6 +203,81 @@ ut_free( } /************************************************************************** +Implements realloc. This is needed by /pars/lexyy.c. Otherwise, you should not +use this function because the allocation functions in mem0mem.h are the +recommended ones in InnoDB. + +man realloc in Linux, 2004: + + realloc() changes the size of the memory block pointed to + by ptr to size bytes. The contents will be unchanged to + the minimum of the old and new sizes; newly allocated mem + ory will be uninitialized. If ptr is NULL, the call is + equivalent to malloc(size); if size is equal to zero, the + call is equivalent to free(ptr). Unless ptr is NULL, it + must have been returned by an earlier call to malloc(), + calloc() or realloc(). + +RETURN VALUE + realloc() returns a pointer to the newly allocated memory, + which is suitably aligned for any kind of variable and may + be different from ptr, or NULL if the request fails. If + size was equal to 0, either NULL or a pointer suitable to + be passed to free() is returned. If realloc() fails the + original block is left untouched - it is not freed or + moved. */ + +void* +ut_realloc( +/*=======*/ + /* out, own: pointer to new mem block or NULL */ + void* ptr, /* in: pointer to old block or NULL */ + ulint size) /* in: desired size */ +{ + ut_mem_block_t* block; + ulint old_size; + ulint min_size; + void* new_ptr; + + if (ptr == NULL) { + + return(ut_malloc(size)); + } + + if (size == 0) { + ut_free(ptr); + + return(NULL); + } + + block = (ut_mem_block_t*)((byte*)ptr - sizeof(ut_mem_block_t)); + + ut_a(block->magic_n == UT_MEM_MAGIC_N); + + old_size = block->size - sizeof(ut_mem_block_t); + + if (size < old_size) { + min_size = size; + } else { + min_size = old_size; + } + + new_ptr = ut_malloc(size); + + if (new_ptr == NULL) { + + return(NULL); + } + + /* Copy the old data from ptr */ + ut_memcpy(new_ptr, ptr, min_size); + + ut_free(ptr); + + return(new_ptr); +} + +/************************************************************************** Frees in shutdown all allocated memory not freed yet. */ void diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index b12965a85e7..d29a7deb69e 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -27,7 +27,6 @@ #include <sys/stat.h> #include <signal.h> #include <time.h> -#include <assert.h> /* for DBUG_ASSERT() */ #ifdef HAVE_PWD_H #include <pwd.h> #endif @@ -85,7 +84,6 @@ my_bool net_flush(NET *net); #define MAX_LONG_DATA_LENGTH 8192 #define unsigned_field(A) ((A)->flags & UNSIGNED_FLAG) -static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); static void append_wild(char *to,char *end,const char *wild); sig_handler pipe_sig_handler(int sig); @@ -1286,10 +1284,12 @@ mysql_drop_db(MYSQL *mysql, const char *db) int STDCALL -mysql_shutdown(MYSQL *mysql) +mysql_shutdown(MYSQL *mysql, enum enum_shutdown_level shutdown_level) { + uchar level[1]; DBUG_ENTER("mysql_shutdown"); - DBUG_RETURN(simple_command(mysql,COM_SHUTDOWN,0,0,0)); + level[0]= (uchar) shutdown_level; + DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, (char *)level, 1, 0)); } @@ -1640,70 +1640,72 @@ myodbc_remove_escape(MYSQL *mysql,char *name) } /******************************************************************** + Implementation of new client API for 4.1 version. - Implementation of new client-server prototypes for 4.1 version - starts from here .. - - mysql_* are real prototypes used by applications + mysql_stmt_* are real prototypes used by applications. + To make API work in embedded library all functions performing + real I/O are prefixed with 'cli_' (abbreviated from 'Call Level + Interface'). This functions are invoked via pointers set in + MYSQL::methods structure. Embedded counterparts, prefixed with + 'emb_' reside in libmysqld/lib_sql.cc. *********************************************************************/ -/******************************************************************** - Misc Utility functions -********************************************************************/ +/******************* Declarations ***********************************/ + /* - Set the internal stmt error messages + These functions are called by function pointer MYSQL_STMT::read_row_func. + Each function corresponds to one of the read methods: + - mysql_stmt_fetch without prior mysql_stmt_store_result, + - mysql_stmt_fetch when result is stored, + - mysql_stmt_fetch when there are no rows (always returns MYSQL_NO_DATA) */ -static void set_stmt_error(MYSQL_STMT * stmt, int errcode, - const char *sqlstate) -{ - DBUG_ENTER("set_stmt_error"); - DBUG_PRINT("enter", ("error: %d '%s'", errcode, ER(errcode))); - DBUG_ASSERT(stmt != 0); - - stmt->last_errno= errcode; - strmov(stmt->last_error, ER(errcode)); - strmov(stmt->sqlstate, sqlstate); - - DBUG_VOID_RETURN; -} +static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row); +static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row); +static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row); +/* + This function is used in mysql_stmt_store_result if + STMT_ATTR_UPDATE_MAX_LENGTH attribute is set. +*/ +static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); /* - Copy error message to statement handler + Maximum sizes of MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME + values stored in network buffer. */ -void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, - const char *sqlstate) -{ - DBUG_ENTER("set_stmt_error_msg"); - DBUG_PRINT("enter", ("error: %d/%s '%s'", errcode, sqlstate, err)); - DBUG_ASSERT(stmt != 0); +/* 1 (length) + 2 (year) + 1 (month) + 1 (day) */ +#define MAX_DATE_REP_LENGTH 5 - stmt->last_errno= errcode; - if (err && err[0]) - strmov(stmt->last_error, err); - strmov(stmt->sqlstate, sqlstate); +/* + 1 (length) + 1 (is negative) + 4 (day count) + 1 (hour) + + 1 (minute) + 1 (seconds) + 4 (microseconds) +*/ +#define MAX_TIME_REP_LENGTH 13 - DBUG_VOID_RETURN; -} +/* + 1 (length) + 2 (year) + 1 (month) + 1 (day) + + 1 (hour) + 1 (minute) + 1 (second) + 4 (microseconds) +*/ +#define MAX_DATETIME_REP_LENGTH 12 +/**************** Misc utility functions ****************************/ /* Reallocate the NET package to be at least of 'length' bytes SYNPOSIS my_realloc_str() - net The NET structure to modify - int length Ensure that net->buff is at least this big + net The NET structure to modify + length Ensure that net->buff is at least this big RETURN VALUES 0 ok 1 Error - */ static my_bool my_realloc_str(NET *net, ulong length) @@ -1719,20 +1721,54 @@ static my_bool my_realloc_str(NET *net, ulong length) DBUG_RETURN(res); } -/******************************************************************** - Prepare related implementations -********************************************************************/ -static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row); -static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row); -static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row); +/* + Set statement error code, sqlstate, and error message + from given errcode and sqlstate. +*/ + +static void set_stmt_error(MYSQL_STMT * stmt, int errcode, + const char *sqlstate) +{ + DBUG_ENTER("set_stmt_error"); + DBUG_PRINT("enter", ("error: %d '%s'", errcode, ER(errcode))); + DBUG_ASSERT(stmt != 0); + + stmt->last_errno= errcode; + strmov(stmt->last_error, ER(errcode)); + strmov(stmt->sqlstate, sqlstate); + + DBUG_VOID_RETURN; +} + /* - Read the prepared statement results .. + Set statement error code, sqlstate, and error message. +*/ - NOTE - This is only called for connection to servers that supports - prepared statements (and thus the 4.1 protocol) +void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, + const char *sqlstate) +{ + DBUG_ENTER("set_stmt_errmsg"); + DBUG_PRINT("enter", ("error: %d/%s '%s'", errcode, sqlstate, err)); + DBUG_ASSERT(stmt != 0); + + stmt->last_errno= errcode; + if (err && err[0]) + strmov(stmt->last_error, err); + strmov(stmt->sqlstate, sqlstate); + + DBUG_VOID_RETURN; +} + +/* + Read and unpack server reply to COM_PREPARE command (sent from + mysql_stmt_prepare). + + SYNOPSIS + cli_read_prepare_result() + mysql connection handle + stmt statement handle RETURN VALUES 0 ok @@ -1752,7 +1788,9 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) pos= (uchar*) mysql->net.read_pos; stmt->stmt_id= uint4korr(pos+1); pos+= 5; + /* Number of columns in result set */ field_count= uint2korr(pos); pos+= 2; + /* Number of placeholders in the statement */ param_count= uint2korr(pos); pos+= 2; if (param_count != 0) @@ -1802,10 +1840,30 @@ MYSQL_STMT * STDCALL mysql_prepare(MYSQL *mysql, const char *query, #endif /* - Allocate memory and init prepared statement structure + Allocate memory and init prepared statement structure. + SYNOPSIS mysql_stmt_init() - mysql connection handle + mysql connection handle + + DESCRIPTION + This is an entry point of the new API. Returned handle stands for + a server-side prepared statement. Memory for this structure (~700 + bytes) is allocated using 'malloc'. Once created, the handle can be + reused many times. Created statement handle is bound to connection + handle provided to this call: it's lifetime is limited by lifetime + of connection. + 'mysql_stmt_init()' is a pure local call, server side structure is + created only in mysql_stmt_prepare. + Next steps you may want to make: + - set a statement attribute (mysql_stmt_attr_set()), + - prepare statement handle with a query (mysql_stmt_prepare()), + - close statement handle and free it's memory (mysql_stmt_close()), + - reset statement with mysql_stmt_reset() (a no-op which will + just return). + Behaviour of the rest of API calls on this statement is not defined yet + (though we're working on making each wrong call sequence return + error). RETURN VALUE statement structure upon success and NULL if out of @@ -1838,27 +1896,41 @@ mysql_stmt_init(MYSQL *mysql) DBUG_RETURN(stmt); } + /* - Prepare server side statement with query: + Prepare server side statement with query. + SYNOPSIS mysql_stmt_prepare() - query statement to prepare - length statement length + stmt statement handle + query statement to prepare + length statement length DESCRIPTION - - if this is a re-prepare of the statement, first close previous data + Associate statement with statement handle. This is done both on + client and server sides. At this point the server parses given query + and creates an internal structure to represent it. + Next steps you may want to make: + - find out if this statement returns a result set by + calling mysql_stmt_field_count(), and get result set metadata + with mysql_stmt_result_metadata(), + - if query contains placeholders, bind input parameters to placeholders + using mysql_stmt_bind_param(), + - otherwise proceed directly to mysql_stmt_execute(). + + IMPLEMENTATION NOTES + - if this is a re-prepare of the statement, first close previous data structure on the server and free old statement data - - send the query to server and get back number of placeholders, + - then send the query to server and get back number of placeholders, number of columns in result set (if any), and result set metadata. - At the same time allocate memory for input and output parameters + At the same time allocate memory for input and output parameters to have less checks in mysql_stmt_bind_{param, result}. RETURN VALUES 0 success - !0 error + !0 error */ - int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) { @@ -1879,7 +1951,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) mysql_stmt_free_result(stmt); /* - These members must be reset for API to + These members must be reset for API to function in case of error or misuse. */ stmt->bind_param_done= stmt->bind_result_done= FALSE; @@ -1918,14 +1990,14 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) } /* - alloc_root will return valid address even in case param_count + alloc_root will return valid address even in case param_count and field_count are zero. Thus we should never rely on stmt->bind or stmt->params when checking for existence of placeholders or result set. */ if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, sizeof(MYSQL_BIND)* - (stmt->param_count + + (stmt->param_count + stmt->field_count)))) { set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); @@ -1938,8 +2010,10 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length) } /* - Get the execute query meta information for non-select - statements. + Get result set metadata from reply to mysql_stmt_execute. + This is used mainly for SHOW commands, as metadata for these + commands is sent only with result set. + To be removed when all commands will fully support prepared mode. */ static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt) @@ -1947,22 +2021,22 @@ static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt) MYSQL_FIELD *fields, *field, *end; MEM_ROOT *alloc= &stmt->mem_root; MYSQL *mysql= stmt->mysql->last_used_con; - + stmt->field_count= mysql->field_count; - + /* - Get the field information for non-select statements + Get the field information for non-select statements like SHOW and DESCRIBE commands */ - if (!(stmt->fields= (MYSQL_FIELD *) alloc_root(alloc, + if (!(stmt->fields= (MYSQL_FIELD *) alloc_root(alloc, sizeof(MYSQL_FIELD) * - stmt->field_count)) || - !(stmt->bind= (MYSQL_BIND *) alloc_root(alloc, + stmt->field_count)) || + !(stmt->bind= (MYSQL_BIND *) alloc_root(alloc, sizeof(MYSQL_BIND) * stmt->field_count))) return 0; - - for (fields= mysql->fields, end= fields+stmt->field_count, + + for (fields= mysql->fields, end= fields+stmt->field_count, field= stmt->fields; field && fields < end; fields++, field++) { @@ -1982,9 +2056,56 @@ static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt) return stmt->field_count; } + +/* + Update result set columns metadata if it was sent again in + reply to COM_EXECUTE. +*/ + +static void update_stmt_fields(MYSQL_STMT *stmt) +{ + MYSQL_FIELD *field= stmt->mysql->fields; + MYSQL_FIELD *field_end= field + stmt->field_count; + MYSQL_FIELD *stmt_field= stmt->fields; + + DBUG_ASSERT(stmt->field_count == stmt->mysql->field_count); + + for (; field < field_end; ++field, ++stmt_field) + { + stmt_field->charsetnr= field->charsetnr; + stmt_field->length = field->length; + stmt_field->type = field->type; + stmt_field->flags = field->flags; + stmt_field->decimals = field->decimals; + } +} + /* - Returns prepared meta information in the form of resultset - to client. + Returns prepared statement metadata in the form of a result set. + + SYNOPSIS + mysql_stmt_result_metadata() + stmt statement handle + + RETURN + NULL statement contains no result set or out of memory. + In the latter case you can retreive error message + with mysql_stmt_error. + MYSQL_RES a result set with no rows + + DESCRIPTION + This function should be used after mysql_stmt_execute(). + You can safely check that prepared statement has a result set by calling + mysql_stmt_num_fields(): if number of fields is not zero, you can call + this function to get fields metadata. + Next steps you may want to make: + - find out number of columns in result set by calling + mysql_num_fields(res) (the same value is returned by + mysql_stmt_num_fields) + - fetch metadata for any column with mysql_fetch_field, + mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek. + - free returned MYSQL_RES structure with mysql_free_result. + - proceed to binding of output parameters. */ MYSQL_RES * STDCALL @@ -1992,7 +2113,7 @@ mysql_stmt_result_metadata(MYSQL_STMT *stmt) { MYSQL_RES *result; DBUG_ENTER("mysql_stmt_result_metadata"); - + /* stmt->fields is only defined if stmt->field_count is not null; stmt->field_count is initialized in prepare. @@ -2015,45 +2136,66 @@ mysql_stmt_result_metadata(MYSQL_STMT *stmt) DBUG_RETURN(result); } + /* - Returns parameter columns meta information in the form of - resultset. + Returns parameter columns meta information in the form of + result set. + + SYNOPSYS + mysql_stmt_param_metadata() + stmt statement handle + + DESCRIPTION + This function can be called after you prepared the statement handle + with mysql_stmt_prepare(). + XXX: not implemented yet. + + RETURN + MYSQL_RES on success, 0 if there is no metadata. + Currently this function always returns 0. */ MYSQL_RES * STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt) { DBUG_ENTER("mysql_stmt_param_metadata"); - + if (!stmt->param_count) DBUG_RETURN(0); /* - TODO: Fix this when server sends the information. - Till then keep a dummy prototype + TODO: Fix this when server sends the information. + Till then keep a dummy prototype. */ DBUG_RETURN(0); } -/******************************************************************** - Prepare-execute, and param handling -*********************************************************************/ +/* Store type of parameter in network buffer. */ -/**************************************************************************** - Functions to store parameter data from a prepared statement. +static void store_param_type(char **pos, MYSQL_BIND *param) +{ + uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0); + int2store(*pos, typecode); + *pos+= 2; +} - All functions have the following characteristics: + +/* + Functions to store parameter data in network packet. SYNOPSIS store_param_xxx() net MySQL NET connection param MySQL bind param - RETURN VALUES - 0 ok - 1 Error (Can't alloc net->buffer) -****************************************************************************/ + DESCRIPTION + These funtions are invoked from mysql_stmt_execute by + MYSQL_BIND::store_param_func pointer. This pointer is set once per many + executions in mysql_stmt_bind_param. The caller must ensure that network + buffer have enough capacity to store parameter (MYSQL_BIND::buffer_length + contains needed number of bytes). +*/ static void store_param_tinyint(NET *net, MYSQL_BIND *param) { @@ -2098,7 +2240,7 @@ static void store_param_double(NET *net, MYSQL_BIND *param) static void store_param_time(NET *net, MYSQL_BIND *param) { MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer; - char buff[15], *pos; + char buff[MAX_TIME_REP_LENGTH], *pos; uint length; pos= buff+1; @@ -2109,19 +2251,19 @@ static void store_param_time(NET *net, MYSQL_BIND *param) pos[7]= (uchar) tm->second; int4store(pos+8, tm->second_part); if (tm->second_part) - length= 11; + length= 12; else if (tm->hour || tm->minute || tm->second || tm->day) length= 8; else length= 0; - buff[0]= (char) length++; + buff[0]= (char) length++; memcpy((char *)net->write_pos, buff, length); net->write_pos+= length; } static void net_store_datetime(NET *net, MYSQL_TIME *tm) { - char buff[12], *pos; + char buff[MAX_DATETIME_REP_LENGTH], *pos; uint length; pos= buff+1; @@ -2141,7 +2283,7 @@ static void net_store_datetime(NET *net, MYSQL_TIME *tm) length= 4; else length= 0; - buff[0]= (char) length++; + buff[0]= (char) length++; memcpy((char *)net->write_pos, buff, length); net->write_pos+= length; } @@ -2159,10 +2301,11 @@ static void store_param_datetime(NET *net, MYSQL_BIND *param) MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer; net_store_datetime(net, tm); } - + static void store_param_str(NET *net, MYSQL_BIND *param) { - ulong length= param->length ? *param->length : param->buffer_length; + /* param->length is always set in mysql_stmt_bind_param */ + ulong length= *param->length; char *to= (char *) net_store_length((char *) net->write_pos, length); memcpy(to, param->buffer, length); net->write_pos= (uchar*) to+length; @@ -2179,7 +2322,8 @@ static void store_param_str(NET *net, MYSQL_BIND *param) DESCRIPTION A data package starts with a string of bits where we set a bit - if a parameter is NULL + if a parameter is NULL. Unlike bit string in result set row, here + we don't have reserved bits for OK/error packet. */ static void store_param_null(NET *net, MYSQL_BIND *param) @@ -2190,8 +2334,9 @@ static void store_param_null(NET *net, MYSQL_BIND *param) /* - Set parameter data by reading from input buffers from the - client application + Store one parameter in network packet: data is read from + client buffer and saved in network packet by means of one + of store_param_xxxx functions. */ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) @@ -2211,7 +2356,7 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) Param->length should ALWAYS point to the correct length for the type Either to the length pointer given by the user or param->buffer_length */ - if ((my_realloc_str(net, 9 + *param->length))) + if ((my_realloc_str(net, *param->length))) { set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); DBUG_RETURN(1); @@ -2223,14 +2368,15 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) /* - Send the prepared query to server for execution + Auxilary function to send COM_EXECUTE packet to server and read reply. + Used from cli_stmt_execute, which is in turn used by mysql_stmt_execute. */ -static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length) +static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) { MYSQL *mysql= stmt->mysql; NET *net= &mysql->net; - char buff[4 /* size of stmt id */ + + char buff[4 /* size of stmt id */ + 5 /* execution flags */]; DBUG_ENTER("execute"); DBUG_PRINT("enter",("packet: %s, length :%d",packet ? packet :" ", length)); @@ -2250,14 +2396,6 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length) stmt->insert_id= mysql->insert_id; DBUG_RETURN(0); } - - -static void store_param_type(char **pos, MYSQL_BIND *param) -{ - uint typecode= param->buffer_type | (param->is_unsigned ? 32768 : 0); - int2store(*pos, typecode); - *pos+= 2; -} int cli_stmt_execute(MYSQL_STMT *stmt) @@ -2300,7 +2438,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt) for (param= stmt->params; param < param_end; param++) { - /* check if mysql_long_data() was used */ + /* check if mysql_stmt_send_long_data() was used */ if (param->long_data_used) param->long_data_used= 0; /* Clear for next execute call */ else if (store_param(stmt, param)) @@ -2359,16 +2497,16 @@ static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row) 0 - success; *row contains valid address of a row; row data is stored in network buffer 1 - error; error code is written to - stmt->last_{errno,error}; *row is not changed + stmt->last_{errno,error}; *row is not changed MYSQL_NO_DATA - end of file was read from network; - *row is to NULL + *row is set to NULL */ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row) { int rc= 1; MYSQL *mysql= stmt->mysql; - /* + /* This function won't be called if stmt->field_count is zero or execution wasn't done: this is ensured by mysql_stmt_execute. */ @@ -2388,6 +2526,13 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); + /* + If there was an error, there are no more pending rows: + reset statement status to not hang up in following + mysql_stmt_close (it will try to flush result set before + closing the statement). + */ + mysql->status= MYSQL_STATUS_READY; goto error; } if (!*row) @@ -2435,7 +2580,7 @@ stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)), 0 success !0 wrong attribute type */ - + my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value) @@ -2444,14 +2589,14 @@ my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt, case STMT_ATTR_UPDATE_MAX_LENGTH: stmt->update_max_length= value ? *(const my_bool*) value : 0; break; - default: + default: return TRUE; } return FALSE; } -my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, +my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value) { @@ -2459,7 +2604,7 @@ my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, case STMT_ATTR_UPDATE_MAX_LENGTH: *(unsigned long *) value= stmt->update_max_length; break; - default: + default: return TRUE; } return FALSE; @@ -2467,7 +2612,47 @@ my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt, /* - Execute the prepared query + Send placeholders data to server (if there are placeholders) + and execute prepared statement. + + SYNOPSIS + mysql_stmt_execute() + stmt statement handle. The handle must be created + with mysql_stmt_init() and prepared with + mysql_stmt_prepare(). If there are placeholders + in the statement they must be bound to local + variables with mysql_stmt_bind_param(). + + DESCRIPTION + This function will automatically flush pending result + set (if there is one), send parameters data to the server + and read result of statement execution. + If previous result set was cached with mysql_stmt_store_result() + it will also be freed in the beginning of this call. + The server can return 3 types of responses to this command: + - error, can be retrieved with mysql_stmt_error() + - ok, no result set pending. In this case we just update + stmt->insert_id and stmt->affected_rows. + - the query returns a result set: there could be 0 .. N + rows in it. In this case the server can also send updated + result set metadata. + + Next steps you may want to make: + - find out if there is result set with mysql_stmt_field_count(). + If there is one: + - optionally, cache entire result set on client to unblock + connection with mysql_stmt_store_result() + - bind client variables to result set columns and start read rows + with mysql_stmt_fetch(). + - reset statement with mysql_stmt_reset() or close it with + mysql_stmt_close() + Otherwise: + - find out last insert id and number of affected rows with + mysql_stmt_insert_id(), mysql_stmt_affected_rows() + + RETURN + 0 success + 1 error, message can be retrieved with mysql_stmt_error(). */ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt) @@ -2488,16 +2673,37 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt) */ if (mysql->methods->stmt_execute(stmt)) DBUG_RETURN(1); - if (!stmt->field_count && mysql->field_count) + if (mysql->field_count) { - /* - This is 'SHOW'/'EXPLAIN'-like query. Current implementation of - prepared statements can't send result set metadata for this queries - on prepare stage. Read it now. - */ - alloc_stmt_fields(stmt); + /* Server has sent result set metadata */ + if (stmt->field_count == 0) + { + /* + This is 'SHOW'/'EXPLAIN'-like query. Current implementation of + prepared statements can't send result set metadata for these queries + on prepare stage. Read it now. + */ + alloc_stmt_fields(stmt); + } + else + { + /* + Update result set metadata if it for some reason changed between + prepare and execute, i.e.: + - in case of 'SELECT ?' we don't know column type unless data was + supplied to mysql_stmt_execute, so updated column type is sent + now. + - if data dictionary changed between prepare and execute, for + example a table used in the query was altered. + Note, that now (4.1.3) we always send metadata in reply to + COM_EXECUTE (even if it is not necessary), so either this or + previous always branch works. + TODO: send metadata only when it's really necessary and add a warning + 'Metadata changed' when it's sent twice. + */ + update_stmt_fields(stmt); + } } - stmt->state= MYSQL_STMT_EXECUTE_DONE; if (stmt->field_count) { @@ -2530,7 +2736,29 @@ my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt) /* - Return last inserted id for auto_increment columns + Returns the number of result columns for the most recent query + run on this statement. +*/ + +unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt) +{ + return stmt->field_count; +} + +/* + Return last inserted id for auto_increment columns. + + SYNOPSIS + mysql_stmt_insert_id() + stmt statement handle + + DESCRIPTION + Current implementation of this call has a caveat: stmt->insert_id is + unconditionally updated from mysql->insert_id in the end of each + mysql_stmt_execute(). This works OK if mysql->insert_id contains new + value (sent in reply to mysql_stmt_execute()), otherwise stmt->insert_id + value gets undefined, as it's updated from some arbitrary value saved in + connection structure during some other call. */ my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt) @@ -2538,14 +2766,28 @@ my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt) return stmt->insert_id; } + static my_bool int_is_null_true= 1; /* Used for MYSQL_TYPE_NULL */ static my_bool int_is_null_false= 0; + /* - Setup the parameter data buffers from application + Setup the input parameter data buffers from application + + SYNOPSIS + mysql_stmt_bind_param() + stmt statement handle + The statement must be prepared with mysql_stmt_prepare(). + bind Array of mysql_stmt_param_count() bind parameters. + + RETURN + 0 success + 1 error, can be retrieved with mysql_stmt_error. + Note, that this function doesn't check that size of MYSQL_BIND + array is >= mysql_stmt_field_count(), */ -my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind) +my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *bind) { uint count=0; MYSQL_BIND *param, *end; @@ -2613,15 +2855,17 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind) param->store_param_func= store_param_double; break; case MYSQL_TYPE_TIME: - /* Buffer length ignored for DATE, TIME and DATETIME */ param->store_param_func= store_param_time; + param->buffer_length= MAX_TIME_REP_LENGTH; break; case MYSQL_TYPE_DATE: param->store_param_func= store_param_date; + param->buffer_length= MAX_DATE_REP_LENGTH; break; case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_TIMESTAMP: param->store_param_func= store_param_datetime; + param->buffer_length= MAX_DATETIME_REP_LENGTH; break; case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: @@ -2630,6 +2874,10 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind) case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_STRING: param->store_param_func= store_param_str; + /* + For variable length types user must set either length or + buffer_length. + */ break; default: strmov(stmt->sqlstate, unknown_sqlstate); @@ -2645,7 +2893,7 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind) if (!param->length) param->length= ¶m->buffer_length; } - /* We have to send/resendtype information to MySQL */ + /* We have to send/resend type information to MySQL */ stmt->send_types_to_server= TRUE; stmt->bind_param_done= TRUE; DBUG_RETURN(0); @@ -2666,12 +2914,35 @@ my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind) data Data to send to server length Length of data to send (may be 0) + DESCRIPTION + This call can be used repeatedly to send long data in pieces + for any string/binary placeholder. Data supplied for + a placeholder is saved at server side till execute, and then + used instead of value from MYSQL_BIND object. More precisely, + if long data for a parameter was supplied, MYSQL_BIND object + corresponding to this parameter is not sent to server. In the + end of execution long data states of placeholders are reset, + so next time values of such placeholders will be taken again + from MYSQL_BIND array. + The server does not reply to this call: if there was an error + in data handling (which now only can happen if server run out + of memory) it would be returned in reply to + mysql_stmt_execute(). + You should choose type of long data carefully if you care + about character set conversions performed by server when the + statement is executed. No conversion is performed at all for + MYSQL_TYPE_BLOB and other binary typecodes. For + MYSQL_TYPE_STRING and the rest of text placeholders data is + converted from client character set to character set of + connection. If these character sets are different, this + conversion may require additional memory at server, equal to + total size of supplied pieces. + RETURN VALUES 0 ok 1 error */ - my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length) @@ -2681,7 +2952,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, DBUG_ASSERT(stmt != 0); DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld", param_number, data, length)); - + /* We only need to check for stmt->param_count, if it's not null prepare was done. @@ -2706,7 +2977,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, DBUG_RETURN(1); } - /* + /* Send long data packet if there is data or we're sending long data for the first time. */ @@ -2714,8 +2985,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, { MYSQL *mysql= stmt->mysql; /* Packet header: stmt id (4 bytes), param no (2 bytes) */ - char buff[MYSQL_LONG_DATA_HEADER]; - + char buff[MYSQL_LONG_DATA_HEADER]; + int4store(buff, stmt->stmt_id); int2store(buff + 4, param_number); param->long_data_used= 1; @@ -2768,23 +3039,24 @@ static uint read_binary_time(MYSQL_TIME *tm, uchar **pos) { uchar *to; uint length; - + + /* net_field_length will set pos to the first byte of data */ if (!(length= net_field_length(pos))) { set_zero_time(tm); return 0; } - - to= *pos; - tm->second_part= (length > 8 ) ? (ulong) sint4korr(to+7): 0; + + to= *pos; + tm->neg= (bool) to[0]; tm->day= (ulong) sint4korr(to+1); tm->hour= (uint) to[5]; tm->minute= (uint) to[6]; tm->second= (uint) to[7]; + tm->second_part= (length > 8) ? (ulong) sint4korr(to+8) : 0; tm->year= tm->month= 0; - tm->neg= (bool)to[0]; return length; } @@ -2793,16 +3065,20 @@ static uint read_binary_datetime(MYSQL_TIME *tm, uchar **pos) { uchar *to; uint length; - + if (!(length= net_field_length(pos))) { set_zero_time(tm); return 0; } - - to= *pos; - tm->second_part= (length > 7 ) ? (ulong) sint4korr(to+7): 0; - + + to= *pos; + + tm->neg= 0; + tm->year= (uint) sint2korr(to); + tm->month= (uint) to[2]; + tm->day= (uint) to[3]; + if (length > 4) { tm->hour= (uint) to[4]; @@ -2811,11 +3087,7 @@ static uint read_binary_datetime(MYSQL_TIME *tm, uchar **pos) } else tm->hour= tm->minute= tm->second= 0; - - tm->year= (uint) sint2korr(to); - tm->month= (uint) to[2]; - tm->day= (uint) to[3]; - tm->neg= 0; + tm->second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; return length; } @@ -2824,14 +3096,14 @@ static uint read_binary_date(MYSQL_TIME *tm, uchar **pos) { uchar *to; uint length; - + if (!(length= net_field_length(pos))) { set_zero_time(tm); return 0; } - - to= *pos; + + to= *pos; tm->year = (uint) sint2korr(to); tm->month= (uint) to[2]; tm->day= (uint) to[3]; @@ -2842,10 +3114,11 @@ static uint read_binary_date(MYSQL_TIME *tm, uchar **pos) return length; } + /* Convert Numeric to buffer types */ static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field, longlong value) -{ +{ char *buffer= param->buffer; uint field_is_unsigned= (field->flags & UNSIGNED_FLAG); @@ -2856,52 +3129,52 @@ static void send_data_long(MYSQL_BIND *param, MYSQL_FIELD *field, *param->buffer= (uchar) value; break; case MYSQL_TYPE_SHORT: - int2store(buffer, value); + shortstore(buffer, value); break; case MYSQL_TYPE_LONG: - int4store(buffer, value); + longstore(buffer, value); break; case MYSQL_TYPE_LONGLONG: - int8store(buffer, value); + longlongstore(buffer, value); break; case MYSQL_TYPE_FLOAT: { float data= (field_is_unsigned ? (float) ulonglong2double(value) : (float) value); - float4store(buffer, data); + floatstore(buffer, data); break; } case MYSQL_TYPE_DOUBLE: { double data= (field_is_unsigned ? ulonglong2double(value) : (double) value); - float8store(buffer, data); + doublestore(buffer, data); break; } default: { char tmp[22]; /* Enough for longlong */ uint length= (uint)(longlong10_to_str(value,(char *)tmp, - field_is_unsigned ? 10: -10) - - tmp); + field_is_unsigned ? 10: -10) - + tmp); ulong copy_length= min((ulong)length-param->offset, param->buffer_length); if ((long) copy_length < 0) copy_length=0; else memcpy(buffer, (char *)tmp+param->offset, copy_length); - *param->length= length; - + *param->length= length; + if (copy_length != param->buffer_length) *(buffer+copy_length)= '\0'; } - } + } } /* Convert Double to buffer types */ static void send_data_double(MYSQL_BIND *param, double value) -{ +{ char *buffer= param->buffer; switch(param->buffer_type) { @@ -2911,24 +3184,26 @@ static void send_data_double(MYSQL_BIND *param, double value) *buffer= (uchar)value; break; case MYSQL_TYPE_SHORT: - int2store(buffer, (short)value); + shortstore(buffer, (short)value); break; case MYSQL_TYPE_LONG: - int4store(buffer, (long)value); + longstore(buffer, (long)value); break; case MYSQL_TYPE_LONGLONG: - int8store(buffer, (longlong)value); + { + longlong val= (longlong) value; + longlongstore(buffer, val); break; + } case MYSQL_TYPE_FLOAT: { - float data= (float)value; - float4store(buffer, data); + float data= (float) value; + floatstore(buffer, data); break; } case MYSQL_TYPE_DOUBLE: { - double data= (double)value; - float8store(buffer, data); + doublestore(buffer, value); break; } default: @@ -2940,19 +3215,19 @@ static void send_data_double(MYSQL_BIND *param, double value) copy_length=0; else memcpy(buffer, (char *)tmp+param->offset, copy_length); - *param->length= length; - + *param->length= length; + if (copy_length != param->buffer_length) *(buffer+copy_length)= '\0'; } - } + } } /* Convert string to buffer types */ static void send_data_str(MYSQL_BIND *param, char *value, uint length) -{ +{ char *buffer= param->buffer; int err=0; @@ -2970,32 +3245,32 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length) { short data= (short)my_strntol(&my_charset_latin1,value,length,10,NULL, &err); - int2store(buffer, data); + shortstore(buffer, data); break; } case MYSQL_TYPE_LONG: { int32 data= (int32)my_strntol(&my_charset_latin1,value,length,10,NULL, &err); - int4store(buffer, data); + longstore(buffer, data); break; } case MYSQL_TYPE_LONGLONG: { longlong data= my_strntoll(&my_charset_latin1,value,length,10,NULL,&err); - int8store(buffer, data); + longlongstore(buffer, data); break; } case MYSQL_TYPE_FLOAT: { float data = (float)my_strntod(&my_charset_latin1,value,length,NULL,&err); - float4store(buffer, data); + floatstore(buffer, data); break; } case MYSQL_TYPE_DOUBLE: { double data= my_strntod(&my_charset_latin1,value,length,NULL,&err); - float8store(buffer, data); + doublestore(buffer, data); break; } case MYSQL_TYPE_TINY_BLOB: @@ -3020,7 +3295,7 @@ static void send_data_str(MYSQL_BIND *param, char *value, uint length) } -static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime, +static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime, uint length) { switch (param->buffer_type) { @@ -3033,7 +3308,7 @@ static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime, case MYSQL_TYPE_TIMESTAMP: { MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer; - + tm->year= ltime.year; tm->month= ltime.month; tm->day= ltime.day; @@ -3044,37 +3319,37 @@ static void send_data_time(MYSQL_BIND *param, MYSQL_TIME ltime, tm->second_part= ltime.second_part; tm->neg= ltime.neg; - break; + break; } default: { char buff[25]; - + if (!length) ltime.time_type= MYSQL_TIMESTAMP_NONE; switch (ltime.time_type) { case MYSQL_TIMESTAMP_DATE: length= my_sprintf(buff,(buff, "%04d-%02d-%02d", ltime.year, - ltime.month,ltime.day)); + ltime.month,ltime.day)); break; case MYSQL_TIMESTAMP_FULL: length= my_sprintf(buff,(buff, "%04d-%02d-%02d %02d:%02d:%02d", - ltime.year,ltime.month,ltime.day, - ltime.hour,ltime.minute,ltime.second)); + ltime.year,ltime.month,ltime.day, + ltime.hour,ltime.minute,ltime.second)); break; case MYSQL_TIMESTAMP_TIME: length= my_sprintf(buff, (buff, "%02d:%02d:%02d", - ltime.hour,ltime.minute,ltime.second)); + ltime.hour,ltime.minute,ltime.second)); break; default: length= 0; buff[0]='\0'; } - send_data_str(param, (char *)buff, length); + send_data_str(param, (char *)buff, length); } } } - + /* Fetch data to buffers */ @@ -3102,7 +3377,7 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) longlong data= ((field_is_unsigned) ? (longlong) (unsigned short) value: (longlong) value); send_data_long(param, field, data); - length= 2; + length= 2; break; } case MYSQL_TYPE_LONG: @@ -3141,7 +3416,7 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) case MYSQL_TYPE_DATE: { MYSQL_TIME tm; - + length= read_binary_date(&tm, row); tm.time_type= MYSQL_TIMESTAMP_DATE; send_data_time(param, tm, length); @@ -3150,7 +3425,7 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) case MYSQL_TYPE_TIME: { MYSQL_TIME tm; - + length= read_binary_time(&tm, row); tm.time_type= MYSQL_TIMESTAMP_TIME; send_data_time(param, tm, length); @@ -3160,14 +3435,14 @@ static void fetch_results(MYSQL_BIND *param, MYSQL_FIELD *field, uchar **row) case MYSQL_TYPE_TIMESTAMP: { MYSQL_TIME tm; - + length= read_binary_datetime(&tm, row); tm.time_type= MYSQL_TIMESTAMP_FULL; send_data_time(param, tm, length); break; } - default: - length= net_field_length(row); + default: + length= net_field_length(row); send_data_str(param,(char*) *row,length); break; } @@ -3196,7 +3471,7 @@ static void fetch_result_int32(MYSQL_BIND *param, uchar **row) } static void fetch_result_int64(MYSQL_BIND *param, uchar **row) -{ +{ longlong value= (longlong)sint8korr(*row); longlongstore(param->buffer, value); *row+= 8; @@ -3237,11 +3512,11 @@ static void fetch_result_datetime(MYSQL_BIND *param, uchar **row) } static void fetch_result_bin(MYSQL_BIND *param, uchar **row) -{ +{ ulong length= net_field_length(row); ulong copy_length= min(length, param->buffer_length); memcpy(param->buffer, (char *)*row, copy_length); - *param->length= length; + *param->length= length; *row+= length; } @@ -3322,7 +3597,7 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) We only need to check that stmt->field_count - if it is not null stmt->bind was initialized in mysql_stmt_prepare */ - + memcpy((char*) stmt->bind, (char*) bind, sizeof(MYSQL_BIND) * bind_count); for (param= stmt->bind, end= param + bind_count, field= stmt->fields ; @@ -3484,16 +3759,16 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row) /* If output parameters were not bound we should just return success */ return 0; } - - null_ptr= row; + + null_ptr= row; row+= (stmt->field_count+9)/8; /* skip null bits */ bit= 4; /* first 2 bits are reserved */ - + /* Copy complete row to application buffers */ for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ; bind < end ; bind++, field++) - { + { if (*null_ptr & bit) { /* @@ -3507,12 +3782,12 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row) *bind->is_null= 1; } else - { + { *bind->is_null= 0; bind->inter_buffer= row; if (field->type == bind->buffer_type) (*bind->fetch_result)(bind, &row); - else + else fetch_results(bind, field, &row); } if (!((bit<<=1) & 255)) @@ -3572,15 +3847,15 @@ int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt) column Column to fetch (first column is 0) ulong offset Offset in result data (to fetch blob in pieces) This is normally 0 - RETURN + RETURN 0 ok 1 error */ -int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, +int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, uint column, ulong offset) { - MYSQL_BIND *param= stmt->bind+column; + MYSQL_BIND *param= stmt->bind+column; DBUG_ENTER("mysql_stmt_fetch_column"); if ((int) stmt->state < (int) MYSQL_STMT_FETCH_DONE) @@ -3596,7 +3871,7 @@ int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, if (param->inter_buffer) { - MYSQL_FIELD *field= stmt->fields+column; + MYSQL_FIELD *field= stmt->fields+column; uchar *row= param->inter_buffer; bind->offset= offset; if (bind->is_null) @@ -3667,6 +3942,49 @@ err: /* + Update meta data for statement + + SYNOPSIS + stmt_update_metadata() + stmt Statement handler + row Binary data + + NOTES + Only updates MYSQL_FIELD->max_length for strings +*/ + +static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data) +{ + MYSQL_BIND *bind, *end; + MYSQL_FIELD *field; + uchar *null_ptr, bit; + uchar *row= (uchar*) data->data; +#ifndef DBUG_OFF + uchar *row_end= row + data->length; +#endif + + null_ptr= row; + row+= (stmt->field_count+9)/8; /* skip null bits */ + bit= 4; /* first 2 bits are reserved */ + + /* Go throw all fields and calculate metadata */ + for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ; + bind < end ; + bind++, field++) + { + if (!(*null_ptr & bit)) + (*bind->skip_result)(bind, field, &row); + DBUG_ASSERT(row <= row_end); + if (!((bit<<=1) & 255)) + { + bit= 1; /* To next byte */ + null_ptr++; + } + } +} + + +/* Store or buffer the binary results to stmt */ @@ -3721,6 +4039,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); result->data= NULL; result->rows= 0; + mysql->status= MYSQL_STATUS_READY; DBUG_RETURN(1); } @@ -3749,7 +4068,7 @@ mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row) { MYSQL_ROW_OFFSET offset= stmt->data_cursor; DBUG_ENTER("mysql_stmt_row_seek"); - + stmt->data_cursor= row; DBUG_RETURN(offset); } @@ -3759,11 +4078,11 @@ mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row) Return the current statement row cursor position */ -MYSQL_ROW_OFFSET STDCALL +MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt) { DBUG_ENTER("mysql_stmt_row_tell"); - + DBUG_RETURN(stmt->data_cursor); } @@ -3778,7 +4097,7 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row) MYSQL_ROWS *tmp= stmt->result.data; DBUG_ENTER("mysql_stmt_data_seek"); DBUG_PRINT("enter",("row id to seek: %ld",(long) row)); - + for (; tmp && row; --row, tmp= tmp->next) ; stmt->data_cursor= tmp; @@ -3793,7 +4112,7 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row) my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt) { DBUG_ENTER("mysql_stmt_num_rows"); - + DBUG_RETURN(stmt->result.rows); } @@ -3803,7 +4122,7 @@ my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt) DBUG_ENTER("mysql_stmt_free_result"); DBUG_ASSERT(stmt != 0); - + if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) { MYSQL *mysql= stmt->mysql; @@ -3871,7 +4190,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) mysql->unbuffered_fetch_owner= 0; if (mysql->status != MYSQL_STATUS_READY) { - /* + /* Flush result set of the connection. If it does not belong to this statement, set a warning. */ @@ -3909,13 +4228,13 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) /* If statement hasnt been prepared there is nothing to reset */ if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE) DBUG_RETURN(0); - + mysql= stmt->mysql->last_used_con; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ if ((*mysql->methods->advanced_command)(mysql, COM_RESET_STMT, buff, sizeof(buff), 0, 0, 0)) { - set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, + set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); DBUG_RETURN(1); } @@ -3956,50 +4275,6 @@ const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt) } -/* - Update meta data for statement - - SYNOPSIS - stmt_update_metadata() - stmt Statement handler - row Binary data - - NOTES - Only updates MYSQL_FIELD->max_length for strings - -*/ - -static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data) -{ - MYSQL_BIND *bind, *end; - MYSQL_FIELD *field; - uchar *null_ptr, bit; - uchar *row= (uchar*) data->data; -#ifndef DBUG_OFF - uchar *row_end= row + data->length; -#endif - - null_ptr= row; - row+= (stmt->field_count+9)/8; /* skip null bits */ - bit= 4; /* first 2 bits are reserved */ - - /* Go throw all fields and calculate metadata */ - for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ; - bind < end ; - bind++, field++) - { - if (!(*null_ptr & bit)) - (*bind->skip_result)(bind, field, &row); - DBUG_ASSERT(row <= row_end); - if (!((bit<<=1) & 255)) - { - bit= 1; /* To next byte */ - null_ptr++; - } - } -} - - /******************************************************************** Transactional APIs *********************************************************************/ @@ -4053,10 +4328,10 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql) { my_bool res; DBUG_ENTER("mysql_more_results"); - - res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ? + + res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ? 1: 0); - DBUG_PRINT("exit",("More results exists ? %d", res)); + DBUG_PRINT("exit",("More results exists ? %d", res)); DBUG_RETURN(res); } @@ -4067,7 +4342,7 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql) int STDCALL mysql_next_result(MYSQL *mysql) { DBUG_ENTER("mysql_next_result"); - + if (mysql->status != MYSQL_STATUS_READY) { strmov(mysql->net.sqlstate, unknown_sqlstate); diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index 927d46be91c..bbd5af6558d 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -131,3 +131,4 @@ EXPORTS mysql_stmt_insert_id mysql_stmt_attr_get mysql_stmt_attr_set + mysql_stmt_field_count diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index b165d7f457b..58e11e4f297 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -56,7 +56,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \ sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \ unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ - spatial.cc gstream.cc sql_help.cc + spatial.cc gstream.cc sql_help.cc tztime.cc libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) libmysqld_a_SOURCES= diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 2ceeb43a91e..0adf9aeb86a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -356,6 +356,7 @@ int init_embedded_server(int argc, char **argv, char **groups) int fake_argc = 1; char *fake_argv[] = { (char *)"", 0 }; const char *fake_groups[] = { "server", "embedded", 0 }; + my_bool acl_error; if (argc) { argcp= &argc; @@ -397,16 +398,17 @@ int init_embedded_server(int argc, char **argv, char **groups) error_handler_hook = my_message_sql; + acl_error= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (acl_init((THD *)0, opt_noacl)) + if (!(acl_error= acl_init((THD *)0, opt_noacl)) && + !opt_noacl) + (void) grant_init((THD *)0); +#endif + if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap)) { mysql_server_end(); return 1; } - if (!opt_noacl) - (void) grant_init((THD *)0); - -#endif init_max_user_conn(); init_update_queries(); @@ -511,6 +513,7 @@ int check_embedded_connection(MYSQL *mysql) thd->host= (char*)my_localhost; thd->host_or_ip= thd->host; thd->user= my_strdup(mysql->user, MYF(0)); + thd->priv_user= thd->user; return check_user(thd, COM_CONNECT, NULL, 0, thd->db, true); } diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index cac4d08f5d6..196cb5c21fb 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -53,10 +53,11 @@ static double _nwghts[11]= -3.796875000000000}; static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */ -#define FTB_FLAG_TRUNC 1 /* */ -#define FTB_FLAG_YES 2 /* no two from these three */ -#define FTB_FLAG_NO 4 /* YES, NO, WONLY */ -#define FTB_FLAG_WONLY 8 /* should be _ever_ set both */ +#define FTB_FLAG_TRUNC 1 +/* At most one of the following flags can be set */ +#define FTB_FLAG_YES 2 +#define FTB_FLAG_NO 4 +#define FTB_FLAG_WONLY 8 typedef struct st_ftb_expr FTB_EXPR; struct st_ftb_expr diff --git a/myisam/ftdefs.h b/myisam/ftdefs.h index a97485ec021..e23bc3b75ac 100644 --- a/myisam/ftdefs.h +++ b/myisam/ftdefs.h @@ -22,7 +22,6 @@ #include <m_ctype.h> #include <my_tree.h> #include <queues.h> -#include <assert.h> #define true_word_char(s,X) (my_isalnum(s,X) || (X)=='_') #define misc_word_char(X) ((X)=='\'') diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 96a26fd90f1..052fa55a559 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -376,8 +376,6 @@ int chk_key(MI_CHECK *param, register MI_INFO *info) for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ; rec_per_key_part+=keyinfo->keysegs, key++, keyinfo++) { - if (*killed_ptr(param)) - DBUG_RETURN(-1); param->key_crc[key]=0; if (!(((ulonglong) 1 << key) & share->state.key_map)) { diff --git a/myisam/mi_delete.c b/myisam/mi_delete.c index 3eb8e9a7226..c19f2582b9c 100644 --- a/myisam/mi_delete.c +++ b/myisam/mi_delete.c @@ -18,7 +18,6 @@ #include "fulltext.h" #include "rt_index.h" -#include <assert.h> static int d_search(MI_INFO *info,MI_KEYDEF *keyinfo,uint comp_flag, uchar *key,uint key_length,my_off_t page,uchar *anc_buff); diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c index f64e774810d..0b8d3c97872 100644 --- a/myisam/mi_dynrec.c +++ b/myisam/mi_dynrec.c @@ -25,7 +25,6 @@ */ #include "myisamdef.h" -#include <assert.h> /* Enough for comparing if number is zero */ static char zero_string[]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 4aebba041f8..d19a3130a86 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -19,7 +19,6 @@ #include "myisamdef.h" #include "m_ctype.h" #include "sp_defs.h" -#include <assert.h> #ifdef HAVE_IEEEFP_H #include <ieeefp.h> #endif diff --git a/myisam/mi_open.c b/myisam/mi_open.c index d03c18091aa..562227d2f03 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -20,7 +20,6 @@ #include "sp_defs.h" #include "rt_index.h" #include <m_ctype.h> -#include <assert.h> #if defined(MSDOS) || defined(__WIN__) #ifdef __WIN__ diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 51ced6fa15a..1b03acddbc1 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -18,7 +18,6 @@ #include "fulltext.h" #include "m_ctype.h" -#include <assert.h> static my_bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key, uchar *keypos, diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c index 38b4ed93311..ad685f4cbdc 100644 --- a/myisam/mi_unique.c +++ b/myisam/mi_unique.c @@ -69,7 +69,8 @@ my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, byte *record, ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record) { const byte *pos, *end; - ha_checksum crc=0; + ha_checksum crc= 0; + ulong seed1=0, seed2= 4; HA_KEYSEG *keyseg; for (keyseg=def->seg ; keyseg < def->end ; keyseg++) @@ -108,9 +109,10 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record) end= pos+length; if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT) { - ulong nr=1, nr2=4; - keyseg->charset->coll->hash_sort(keyseg->charset,(const uchar*)pos,length,&nr, &nr2); - crc=nr; + keyseg->charset->coll->hash_sort(keyseg->charset, + (const uchar*) pos, length, &seed1, + &seed2); + crc^= seed1; } else while (pos != end) diff --git a/myisam/mi_write.c b/myisam/mi_write.c index c17f47fc1ae..dc596672a84 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -18,7 +18,6 @@ #include "fulltext.h" #include "rt_index.h" -#include <assert.h> #define MAX_POINTER_LENGTH 8 diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index ef4b7a5ff87..c4b5acadc92 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -362,13 +362,13 @@ static void usage(void) this option is deprecated; you can set variables\n\ directly with '--variable-name=value'.\n\ -t, --tmpdir=path Path for temporary files. Multiple paths can be\n\ - specified, separated by " + specified, separated by "); #if defined( __WIN__) || defined(OS2) || defined(__NETWARE__) - "semicolon (;)" + puts("semicolon (;)"); #else - "colon (:)" + puts("colon (:)"); #endif - ", they will be used\n\ + puts(", they will be used\n\ in a round-robin fashion.\n\ -s, --silent Only print errors. One can use two -s to make\n\ myisamchk very silent.\n\ diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 8629b18a4ad..9a899361f59 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -76,6 +76,7 @@ SUFFIXES = .sh -e 's!@''libexecdir''@!$(libexecdir)!g' \ -e 's!@''PERL''@!@PERL@!' \ -e 's!@''VERSION''@!@VERSION@!' \ + -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \ -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \ -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \ diff --git a/mysql-test/include/have_archive.inc b/mysql-test/include/have_archive.inc new file mode 100644 index 00000000000..f7fb942e83e --- /dev/null +++ b/mysql-test/include/have_archive.inc @@ -0,0 +1,4 @@ +-- require r/have_archive.require +disable_query_log; +show variables like "have_archive"; +enable_query_log; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index eaa5d0b9da3..d4c5bfb2209 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -16,7 +16,7 @@ USE_MANAGER=0 MY_TZ=GMT-3 TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work LOCAL_SOCKET=@MYSQL_UNIX_ADDR@ -MYSQL_TCP_PORT=@MYSQL_TCP_PORT@; export MYSQL_TCP_PORT +MYSQL_TCP_PORT=@MYSQL_TCP_PORT@ # For query_cache test case `uname` in @@ -434,7 +434,7 @@ SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err" CURRENT_TEST="$MYSQL_TEST_DIR/var/log/current_test" SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" -export MASTER_MYPORT SLAVE_MYPORT +export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR @@ -1439,7 +1439,7 @@ then if [ -z "$USE_RUNNING_NDBCLUSTER" ] then echo "Starting ndbcluster" - ./ndb/ndbcluster --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 + ./ndb/ndbcluster --small --discless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 export NDB_CONNECTSTRING=`cat Ndb.cfg` else export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" diff --git a/mysql-test/ndb/Makefile.am b/mysql-test/ndb/Makefile.am index 44627c85bb5..3ed222344a6 100644 --- a/mysql-test/ndb/Makefile.am +++ b/mysql-test/ndb/Makefile.am @@ -4,9 +4,9 @@ testdir = $(benchdir_root)/mysql-test/ndb test_SCRIPTS = ndbcluster -EXTRA_SCRIPTS = ndbcluster.sh +noinst_HEADERS = ndbcluster.sh -test_DATA = ndb_config_2_node.ini +dist_test_DATA = ndb_config_2_node.ini SUFFIXES = .sh diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index 57aa2f527e0..5acb757d253 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -1,8 +1,9 @@ [DB DEFAULT] -#NoOfFragmentLogfiles: 1 -#TimeBetweenLocalCheckpoints: 31 NoOfReplicas: 2 -MaxNoOfConcurrentOperations: 100000 +MaxNoOfConcurrentOperations: CHOOSE_MaxNoOfConcurrentOperations +DataMemory: CHOOSE_DataMemory +IndexMemory: CHOOSE_IndexMemory +Discless: CHOOSE_Discless [COMPUTER] Id: 1 @@ -72,63 +73,5 @@ ExecuteOnComputer: 6 Id: 14 ExecuteOnComputer: 7 -# Mgmtsrvr connections - -[TCP] -NodeId1: 1 -NodeId2: 2 +[TCP DEFAULT] PortNumber: CHOOSE_PORT_BASE02 - -[TCP] -NodeId1: 1 -NodeId2: 3 -PortNumber: CHOOSE_PORT_BASE03 - -# Ndb nodes connections - -[TCP] -NodeId1: 2 -NodeId2: 3 -PortNumber: CHOOSE_PORT_BASE04 - -# Api connections - -[TCP] -NodeId1: 11 -NodeId2: 2 -PortNumber: CHOOSE_PORT_BASE05 - -[TCP] -NodeId1: 11 -NodeId2: 3 -PortNumber: CHOOSE_PORT_BASE06 - -[TCP] -NodeId1: 12 -NodeId2: 2 -PortNumber: CHOOSE_PORT_BASE07 - -[TCP] -NodeId1: 12 -NodeId2: 3 -PortNumber: CHOOSE_PORT_BASE08 - -[TCP] -NodeId1: 13 -NodeId2: 2 -PortNumber: CHOOSE_PORT_BASE09 - -[TCP] -NodeId1: 13 -NodeId2: 3 -PortNumber: CHOOSE_PORT_BASE10 - -[TCP] -NodeId1: 14 -NodeId2: 2 -PortNumber: CHOOSE_PORT_BASE11 - -[TCP] -NodeId1: 14 -NodeId2: 3 -PortNumber: CHOOSE_PORT_BASE12 diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 5334604db33..d706f5dcffe 100755..100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -41,6 +41,12 @@ pidfile=ndbcluster.pid cfgfile=Ndb.cfg stop_ndb= initial_ndb= +status_ndb= +ndb_discless=0 + +ndb_con_op=100000 +ndb_dmem=80M +ndb_imem=24M while test $# -gt 0; do case "$1" in @@ -51,6 +57,17 @@ while test $# -gt 0; do flags_ndb=$flags_ndb" -i" initial_ndb=1 ;; + --status) + status_ndb=1 + ;; + --small) + ndb_con_op=10000 + ndb_dmem=40M + ndb_imem=12M + ;; + --discless) + ndb_discless=1 + ;; --data-dir=*) fsdir=`echo "$1" | sed -e "s;--data-dir=;;"` ;; @@ -121,6 +138,10 @@ NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID if [ $initial_ndb ] ; then sed \ + -e s,"CHOOSE_MaxNoOfConcurrentOperations",$ndb_con_op,g \ + -e s,"CHOOSE_DataMemory",$ndb_dmem,g \ + -e s,"CHOOSE_IndexMemory",$ndb_imem,g \ + -e s,"CHOOSE_Discless",$ndb_discless,g \ -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \ -e s,"CHOOSE_FILESYSTEM_NODE_2","$fs_name_2",g \ -e s,"CHOOSE_FILESYSTEM_NODE_3","$fs_name_3",g \ @@ -140,6 +161,7 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile NDB_ID="2" NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID +echo "Starting ndbd connectstring=\""$NDB_CONNECTSTRING\" ( cd $fs_ndb_2 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & ) cat `find $fs_ndb -name 'node*.pid'` > $pidfile @@ -148,17 +170,14 @@ cat `find $fs_ndb -name 'node*.pid'` > $pidfile NDB_ID="3" NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID +echo "Starting ndbd connectstring=\""$NDB_CONNECTSTRING\" ( cd $fs_ndb_3 ; echo $NDB_CONNECTSTRING > $cfgfile ; $exec_ndb -d $flags_ndb & ) cat `find $fs_ndb -name 'node*.pid'` > $pidfile -# Start management client - -sleep 10 -echo "show" | $exec_mgmtclient $ndb_host $ndb_port - # test if Ndb Cluster starts properly +echo "Waiting for started..." NDB_ID="11" NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else @@ -169,6 +188,14 @@ fi echo $NDB_CONNECTSTRING > $cfgfile cat `find $fs_ndb -name 'node*.pid'` > $pidfile + +status_ndbcluster +} + +status_ndbcluster() { +# Start management client + +echo "show" | $exec_mgmtclient $ndb_host $ndb_port } stop_default_ndbcluster() { @@ -195,12 +222,17 @@ echo "all stop" | $exec_mgmtclient sleep 5 if [ -f $pidfile ] ; then - kill `cat $pidfile` + kill `cat $pidfile` 2> /dev/null rm $pidfile fi } +if [ $status_ndb ] ; then + status_ndbcluster + exit 0 +fi + if [ $stop_ndb ] ; then stop_default_ndbcluster else diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index a7c1dbde697..c2ed40f3f94 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -121,7 +121,7 @@ create database mysqltest; create table mysqltest.t1 (a int,b int,c int); grant all on mysqltest.t1 to mysqltest_1@localhost; alter table t1 rename t2; -ERROR 42000: insert command denied to user: 'mysqltest_1'@'localhost' for table 't2' +ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2' revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; drop database mysqltest; @@ -468,5 +468,5 @@ t1 CREATE TABLE `t1` ( UNIQUE KEY `b` (`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ALTER TABLE t1 DROP PRIMARY KEY; -ERROR 42000: Can't DROP 'PRIMARY'. Check that column/key exists +ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists DROP TABLE t1; diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result new file mode 100644 index 00000000000..b380ea910de --- /dev/null +++ b/mysql-test/r/archive.result @@ -0,0 +1,1396 @@ +drop table if exists t1,t2; +CREATE TABLE t1 ( +Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, +Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +) ENGINE=archive; +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, +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 +) ENGINE=archive; +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 +select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3; +fld3 +honeysuckle +honoring +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 like 'f%'; +fld1 fld3 +012001 flanking +013602 foldout +013606 fingerings +018007 fanatic +018017 featherweight +018054 fetters +018103 flint +018104 flopping +036002 funereal +038017 fetched +038205 firearm +058004 Fenton +088303 feminine +186002 freakish +188007 flurried +188505 fitting +198006 furthermore +202301 Fitzpatrick +208101 fiftieth +208113 freest +218008 finishers +218022 feed +218401 faithful +226205 foothill +226209 furnishings +228306 forthcoming +228311 fated +231315 freezes +232102 forgivably +238007 filial +238008 fixedly +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 +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',''); +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 +drop table t1, t2; diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 66b24248cf9..6bc59d4771f 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -1,4 +1,5 @@ drop table if exists t1; +drop table if exists t2; SET SQL_WARNINGS=1; create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3; insert into t1 values (1,1),(NULL,3),(NULL,4); @@ -162,7 +163,7 @@ last_insert_id() 255 insert into t1 set i = null; Warnings: -Warning 1264 Data truncated, out of range for column 'i' at row 1 +Warning 1264 Data truncated; out of range for column 'i' at row 1 select last_insert_id(); last_insert_id() 255 @@ -213,7 +214,7 @@ a b delete from t1 where a=0; update t1 set a=NULL where b=6; Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4 update t1 set a=300 where b=7; SET SQL_MODE=''; insert into t1(a,b)values(NULL,8); @@ -255,7 +256,7 @@ a b delete from t1 where a=0; update t1 set a=NULL where b=13; Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 9 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 9 update t1 set a=500 where b=14; select * from t1 order by b; a b diff --git a/mysql-test/r/bdb-deadlock.result b/mysql-test/r/bdb-deadlock.result index c5871ff282a..9394c90ff00 100644 --- a/mysql-test/r/bdb-deadlock.result +++ b/mysql-test/r/bdb-deadlock.result @@ -9,7 +9,7 @@ set autocommit=0; update t2 set x = 1 where id = 0; select x from t1 where id = 0; select x from t2 where id = 0; -ERROR 40001: Deadlock found when trying to get lock; Try restarting transaction +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction commit; x 1 diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index c0608af0de2..6ac32232b2b 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -9,6 +9,11 @@ help_relation help_topic host tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type user show tables; Tables_in_test @@ -25,6 +30,11 @@ help_relation help_topic host tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type user show tables; Tables_in_test @@ -42,6 +52,11 @@ help_relation help_topic host tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type user show tables; Tables_in_test diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index b5f7da30bb3..699485ff3f7 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -11,7 +11,7 @@ create table t1 (b char(0) not null); create table if not exists t1 (b char(0) not null); insert into t1 values (""),(null); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2 select * from t1; b @@ -35,7 +35,7 @@ drop table if exists t1; Warnings: Note 1051 Unknown table 't1' create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap; -ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key +ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key create table not_existing_database.test (a int); Got one of the listed errors create table `a/a` (a int); @@ -47,7 +47,7 @@ ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa create table test (a datetime default now()); ERROR 42000: Invalid default value for 'a' create table test (a datetime on update now()); -ERROR HY000: Invalid ON UPDATE clause for 'a' field +ERROR HY000: Invalid ON UPDATE clause for 'a' column create table test (a int default 100 auto_increment); ERROR 42000: Invalid default value for 'a' create table 1ea10 (1a20 int,1e int); @@ -275,11 +275,11 @@ ERROR 42000: Incorrect database name 'db1 ' create table t1(`a ` int); ERROR 42000: Incorrect column name 'a ' create table t1 (a int,); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 create table t1 (a int,,b int); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1 create table t1 (,b int); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1 create table t1 (a int, key(a)); create table t2 (b int, foreign key(b) references t1(a), key(b)); drop table if exists t1,t2; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result new file mode 100644 index 00000000000..cb6fbecb6e8 --- /dev/null +++ b/mysql-test/r/ctype_uca.result @@ -0,0 +1,1657 @@ +DROP TABLE IF EXISTS t1; +set names utf8; +create table t1 (c1 char(10) character set utf8 collate utf8_bin); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Â,Ã,à ,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,á +Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ã,ð +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +E,e,È,Ê,Ë,è,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +É,é +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,ÃŽ,Ã,ì,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +Ã,à +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ô,Õ,ò,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ó,ó +Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Û,Ü,ù,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Ú,ú +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,ÿ,Ŷ,Å·,Ÿ +Ã,ý +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Þ,þ +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Ã…,Ã¥ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +CH,Ch,cH,ch +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ǧ,ǧ,Ç´,ǵ +Ä¢,Ä£ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +Y,y +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ǩ,Ç© +Ķ,Ä· +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ä»,ļ +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Å…,ņ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Ř,Å™ +RR,Rr,rR,rr +Å–,Å— +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Ã,Ä,Ã…,à ,á,ã,ä,Ã¥,Ä€,Ä,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ä‚,ă +Â,â +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,Ã,ì,Ã,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ÃŽ,î +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Åž,ÅŸ +Æ© +ƪ +T,t,Ť,Å¥ +ƾ +Å¢,Å£ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +CH,Ch,cH,ch +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ä„,Ä… +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ć,ć +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Äš,Ä› +Ę,Ä™ +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Ń,Å„ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ô,Õ,Ö,ò,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ó,ó +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Åš,Å› +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ž,ž +Æ +Ź,ź +Å»,ż +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ã…,à ,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz +Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,ò,ó,ô,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Z,z +Ž,ž +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +Õ,õ +Ä,ä +Ö,ö +Ü,ü +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Ź,ź,Å»,ż +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Ñ,ñ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,à ,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ü,Ã,ü,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ã…,Ã¥ +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ç,ç +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Äž,ÄŸ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +I,ı +IJ,Ij +Æ•,Ƕ +Ħ,ħ +i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +iJ,ij,IJ,ij +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ö,ö +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Åž,ÅŸ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Ü,ü +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +cH +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +CH,Ch,ch +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å— +RR,Rr,rR,rr +Ř,Å™ +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,à ,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +aA +Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ü,Ã,ü,ý,ÿ,Ű,ű,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ä,Æ,ä,æ +Ö,Ø,ö,ø,Å,Å‘ +AA,Aa,aa,Ã…,Ã¥ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +cH +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,Y,i,y,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à ,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +cH +CH,Ch,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,Ã,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +lL +LL,Ll,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Ñ,ñ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,RR,Rr,r,rr,Å”,Å•,Å–,Å—,Ř,Å™ +rR +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 30795aaf106..f16524c020b 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -47,6 +47,15 @@ t1 CREATE TABLE `t1` ( `r` char(10) character set ucs2 NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +create table t2(f1 Char(30)); +insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000"); +select lpad(f1, 12, "-o-/") from t2; +lpad(f1, 12, "-o-/") +-o-/-o103000 +-o-/22720000 +-o-/-3401200 +-o-/-o-78000 +drop table t2; SET NAMES koi8r; SET character_set_connection=ucs2; create table t1 (a varchar(10) character set ucs2, key(a)); diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index cc062094535..7c3ae52cbc9 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -111,3 +111,18 @@ no index ¤¢ ¤¢ drop table t1; +CREATE TABLE t1 ( +a char(1) NOT NULL default '', +b enum('¤¢','¤¤') default NULL +) CHARACTER SET ujis; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) NOT NULL default '', + `b` enum('¤¢','¤¤') default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +a char(1) +b enum('¤¢','¤¤') YES NULL +DROP TABLE t1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 28af71b7681..6c11dd210aa 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -218,3 +218,25 @@ b select * from t1 where a = 'b' and a != 'b'; a drop table t1; +set names utf8; +select 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select 'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select ' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select ' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]' +1 +select 'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]' +0 +select 'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]' +0 +select 'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'; +'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]' +0 diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index b73953823ca..6a4935ef3f8 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -303,14 +303,14 @@ date format str_to_date 2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12 03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12 Warnings: -Note 1292 Truncated wrong string value: '10:20:10AM' +Warning 1292 Truncated incorrect datetime value: '10:20:10AM' select date,format,concat(str_to_date(date, format),'') as con from t1; date format con 10:20:10AM %h:%i:%s 0000-00-00 10:20:10 2003-01-02 10:11:12 %Y-%m-%d %h:%i:%S 2003-01-02 10:11:12 03-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 0003-01-02 22:11:12 Warnings: -Note 1292 Truncated wrong string value: '10:20:10AM' +Warning 1292 Truncated incorrect datetime value: '10:20:10AM' drop table t1; select get_format(DATE, 'USA') as a; a @@ -374,7 +374,7 @@ str_to_date("02 10", "%d %f") as f6; f1 f2 f3 f4 f5 f6 2003-01-02 10:11:12.001200 2003-01-02 10:11:12 2003-01-02 58:11:12 58:11:12 48:00:00.100000 Warnings: -Note 1292 Truncated wrong datetime value: '2003-01-02 10:11:12.0012' +Warning 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012' drop table t1, t2; select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1, addtime("-01:01:01.01 GGG", "-23:59:59.1") as f2, @@ -382,13 +382,13 @@ microsecond("1997-12-31 23:59:59.01XXXX") as f3; f1 f2 f3 2003-01-02 10:11:12.001200 -25:01:00.110000 10000 Warnings: -Note 1292 Truncated wrong datetime value: '2003-01-02 10:11:12.0012ABCD' -Note 1292 Truncated wrong time value: '-01:01:01.01 GG' -Note 1292 Truncated wrong datetime value: '1997-12-31 23:59:59.01XXXX' +Warning 1292 Truncated incorrect datetime value: '2003-01-02 10:11:12.0012ABCD' +Warning 1292 Truncated incorrect time value: '-01:01:01.01 GGG' +Warning 1292 Truncated incorrect time value: '1997-12-31 23:59:59.01XXXX' 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; f1 f2 2003-04-05 2003-04-05 10:11:12.101010 Warnings: -Note 1292 Truncated wrong date value: '2003-04-05 g' -Note 1292 Truncated wrong datetime value: '2003-04-05 10:11:12.101010234567' +Warning 1292 Truncated incorrect date value: '2003-04-05 g' +Warning 1292 Truncated incorrect datetime value: '2003-04-05 10:11:12.101010234567' diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index f1acc5d2dfa..c6b7a40214d 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -120,3 +120,13 @@ a b 0 10 1 11 drop table t11, t12, t2; +create table t1 (a int, b int, unique key (a), key (b)); +insert into t1 values (3, 3), (7, 7); +delete t1 from t1 where a = 3; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +a b +7 7 +drop table t1; diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index dd4c32403b5..7e6b9b44566 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -27,7 +27,7 @@ a y SELECT a FROM (SELECT 1 FROM (SELECT 1) a HAVING a=1) b; ERROR 42S22: Unknown column 'a' in 'having clause' SELECT a,b as a FROM (SELECT '1' as a,'2' as b) b HAVING a=1; -ERROR 23000: Column: 'a' in having clause is ambiguous +ERROR 23000: Column 'a' in having clause is ambiguous SELECT a,2 as a FROM (SELECT '1' as a) b HAVING a=2; a a 1 2 @@ -204,22 +204,22 @@ x 1 create table t1 select 1 as a; select 2 as a from (select * from t1) b; -ERROR 3D000: No Database Selected +ERROR 3D000: No database selected use test; select 2 as a from (select * from t1) b; a 2 drop table t1; select mail_id, if(folder.f_description!='', folder.f_description, folder.f_name) as folder_name, date, address_id, phrase, address, subject from folder, (select mail.mail_id as mail_id, date_format(mail.h_date, '%b %e, %Y %h:%i') as date, mail.folder_id, sender.address_id as address_id, sender.phrase as phrase, sender.address as address, mail.h_subject as subject from mail left join mxa as mxa_sender on mail.mail_id=mxa_sender.mail_id and mxa_sender.type='from' left join address as sender on mxa_sender.address_id=sender.address_id mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_recipient.mail_id and mxa_recipient.address_id=recipient.address_id and mxa_recipient.type='to' and match(sender.phrase, sender.address, sender.comment) against ('jeremy' in boolean mode) and match(recipient.phrase, recipient.address, recipient.comment) against ('monty' in boolean mode) order by mail.h_date desc limit 0, 25 ) as query where query.folder_id=folder.folder_id; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mxa as mxa_recipient, address as recipient, where 1 and mail.mail_id=mxa_r' at line 1 create table t1 (a int); insert into t1 values (1),(2),(3); update (select * from t1) as t1 set a = 5; ERROR HY000: The target table t1 of the UPDATE is not updatable delete from (select * from t1); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1 insert into (select * from t1) values (5); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1) values (5)' at line 1 drop table t1; create table t1 (E1 INTEGER UNSIGNED NOT NULL, E2 INTEGER UNSIGNED NOT NULL, E3 INTEGER UNSIGNED NOT NULL, PRIMARY KEY(E1) ); diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 8b5e3d84b68..30c4c75f3d1 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -253,11 +253,11 @@ KEY tig (ticket), fulltext index tix (inhalt) ); select * from t2 where MATCH inhalt AGAINST (t2.inhalt); -ERROR HY000: Wrong arguments to AGAINST +ERROR HY000: Incorrect arguments to AGAINST select * from t2 where MATCH ticket AGAINST ('foobar'); ERROR HY000: Can't find FULLTEXT index matching the column list select * from t2,t3 where MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar'); -ERROR HY000: Wrong arguments to MATCH +ERROR HY000: Incorrect arguments to MATCH drop table t1,t2,t3; CREATE TABLE t1 ( id int(11) auto_increment, diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index ef03ec71c69..a3d28471993 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -66,5 +66,5 @@ NULL NULL Warnings: Error 1259 ZLIB: Input data corrupted -Error 1256 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted) +Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) drop table t1; diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 43bcf94d6d9..0c8054c1f03 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -149,19 +149,19 @@ grp group_concat(c order by c) 3 D,D,E 4 5 NULL -set group_concat_max_len = 5; +set group_concat_max_len = 4; select grp,group_concat(c) from t1 group by grp; grp group_concat(c) 1 NULL 2 b -3 D,D,E +3 D,D, 4 5 NULL Warnings: -Warning 1260 1 line(s) was(were) cut by group_concat() +Warning 1260 1 line(s) were cut by GROUP_CONCAT() show warnings; Level Code Message -Warning 1260 1 line(s) was(were) cut by group_concat() +Warning 1260 1 line(s) were cut by GROUP_CONCAT() set group_concat_max_len = 1024; select group_concat(sum(a)) from t1 group by grp; ERROR HY000: Invalid use of group function @@ -310,3 +310,14 @@ GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) 1,2 2,4 DROP TABLE t1, t2; +CREATE TABLE t1 (a char(4)); +INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill'); +SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1 +HAVING names LIKE '%An%'; +names +John||Anna||Bill +SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1 +HAVING LEFT(names, 1) ='J'; +names +John###Anna###Bill +DROP TABLE t1; diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index bd5646f4068..06259ff4931 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -656,3 +656,31 @@ select stddev(2) from t1; stddev(2) NULL drop table t1; +create table t1 (a int); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT COUNT(*) FROM t1'; +execute stmt1; +COUNT(*) +2 +execute stmt1; +COUNT(*) +2 +execute stmt1; +COUNT(*) +2 +deallocate prepare stmt1; +drop table t1; +create table t1 (a int, primary key(a)); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT max(a) FROM t1'; +execute stmt1; +max(a) +2 +execute stmt1; +max(a) +2 +execute stmt1; +max(a) +2 +deallocate prepare stmt1; +drop table t1; diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result index ce26a0bf30a..4c8a0561b0a 100644 --- a/mysql-test/r/func_if.result +++ b/mysql-test/r/func_if.result @@ -77,3 +77,9 @@ select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1; min(if(y -x > 5,y,NULL)) max(if(y - x > 5,y,NULL)) 6 56 drop table t1; +create table t1 (a int); +insert t1 values (1),(2); +select if(1>2,a,avg(a)) from t1; +if(1>2,a,avg(a)) +1.5000 +drop table t1; diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 75692738caf..f2c11bc51f6 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -45,6 +45,12 @@ a\b select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; a a\b +prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?'; +set @esc='#'; +execute stmt1 using @esc; +a +a\b +deallocate prepare stmt1; drop table t1; create table t1 (a datetime); insert into t1 values ('2004-03-11 12:00:21'); diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result index 7f977e2782b..8228d6982d3 100644 --- a/mysql-test/r/func_regexp.result +++ b/mysql-test/r/func_regexp.result @@ -81,3 +81,20 @@ _latin1'a' regexp _latin1'A' collate latin1_general_ci select _latin1'a' regexp _latin1'A' collate latin1_bin; _latin1'a' regexp _latin1'A' collate latin1_bin 0 +create table t1 (a varchar(40)); +insert into t1 values ('C1'),('C2'),('R1'),('C3'),('R2'),('R3'); +prepare stmt1 from 'select a from t1 where a rlike ? order by a'; +set @a="^C.*"; +execute stmt1 using @a; +a +C1 +C2 +C3 +set @a="^R.*"; +execute stmt1 using @a; +a +R1 +R2 +R3 +deallocate prepare stmt1; +drop table t1; diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index 31868261157..cf2bd687115 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -119,6 +119,8 @@ timestamp("2001-12-01", "01:01:01.999999") select timestamp("2001-13-01", "01:01:01.000001"); timestamp("2001-13-01", "01:01:01.000001") NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '2001-13-01' select timestamp("2001-12-01", "25:01:01"); timestamp("2001-12-01", "25:01:01") 2001-12-02 01:01:01 @@ -137,12 +139,16 @@ date("1997-12-31 23:59:59.000001") select date("1997-13-31 23:59:59.000001"); date("1997-13-31 23:59:59.000001") NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '1997-13-31 23:59:59.000001' select time("1997-12-31 23:59:59.000001"); time("1997-12-31 23:59:59.000001") 23:59:59.000001 select time("1997-12-31 25:59:59.000001"); time("1997-12-31 25:59:59.000001") NULL +Warnings: +Warning 1292 Truncated incorrect time value: '1997-12-31 25:59:59.000001' select microsecond("1997-12-31 23:59:59.000001"); microsecond("1997-12-31 23:59:59.000001") 1 diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 569b4da0f85..f91691853b9 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -528,6 +528,9 @@ latin2_general_ci 3 select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')); collation(replace(_latin2'abcd',_latin2'b',_latin2'B')) coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')) latin2_general_ci 3 +select collation(encode('abcd','ab')), coercibility(encode('abcd','ab')); +collation(encode('abcd','ab')) coercibility(encode('abcd','ab')) +binary 3 create table t1 select bin(130), @@ -559,7 +562,8 @@ quote(_latin2'ab'), soundex(_latin2'ab'), substring(_latin2'ab',1), insert(_latin2'abcd',2,3,_latin2'ef'), -replace(_latin2'abcd',_latin2'b',_latin2'B') +replace(_latin2'abcd',_latin2'b',_latin2'B'), +encode('abcd','ab') ; Warnings: Warning 1265 Data truncated for column 'format(130,10)' at row 1 @@ -595,7 +599,8 @@ t1 CREATE TABLE `t1` ( `soundex(_latin2'ab')` char(4) character set latin2 NOT NULL default '', `substring(_latin2'ab',1)` char(2) character set latin2 NOT NULL default '', `insert(_latin2'abcd',2,3,_latin2'ef')` char(6) character set latin2 NOT NULL default '', - `replace(_latin2'abcd',_latin2'b',_latin2'B')` char(4) character set latin2 NOT NULL default '' + `replace(_latin2'abcd',_latin2'b',_latin2'B')` char(4) character set latin2 NOT NULL default '', + `encode('abcd','ab')` binary(4) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select SUBSTR('abcdefg',3,2); diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 6f1b4af5d3c..2dc6bffd071 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -411,9 +411,13 @@ INSERT INTO t1 VALUES (''); SELECT month(updated) from t1; month(updated) NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '' SELECT year(updated) from t1; year(updated) NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '' drop table t1; create table t1 (d date, dt datetime, t timestamp, c char(10)); insert into t1 values ("0000-00-00", "0000-00-00", "0000-00-00", "0000-00-00"); @@ -528,7 +532,9 @@ date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) 2003-01-03 01:01:01 select date_add(time,INTERVAL 1 SECOND) from t1; date_add(time,INTERVAL 1 SECOND) -2006-07-08 00:00:01 +NULL +Warnings: +Warning 1264 Data truncated; out of range for column 'time' at row 1 drop table t1; select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2, last_day('2003-03-32') as f3, last_day('2003-04-01') as f4, @@ -536,6 +542,8 @@ last_day('2001-01-01 01:01:01') as f5, last_day(NULL), last_day('2001-02-12'); f1 f2 f3 f4 f5 last_day(NULL) last_day('2001-02-12') 2000-02-29 2002-12-31 NULL 2003-04-30 2001-01-31 NULL 2001-02-28 +Warnings: +Warning 1292 Truncated incorrect datetime value: '2003-03-32' create table t1 select last_day('2000-02-05') as a, from_days(to_days("960101")) as b; describe t1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index c47530cdc46..0ae4ec8dee1 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -129,7 +129,7 @@ delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or flush privileges; drop table t1; GRANT FILE on mysqltest.* to mysqltest_1@localhost; -ERROR HY000: Wrong usage of DB GRANT and GLOBAL PRIVILEGES +ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES select 1; 1 1 diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index d0765e2721f..6f341e12344 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -10,7 +10,7 @@ current_user mysqltest_1@localhost grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option; grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option; -ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'my_%' +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'my_%' show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result index 48068c0f68d..b890f2e454e 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -134,7 +134,7 @@ a b c a 1 1 1 test.t1 2 2 2 test.t1 select * from t2; -ERROR 42000: select command denied to user: 'mysqltest_2'@'localhost' for table 't2' +ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -148,17 +148,17 @@ select "user3"; user3 user3 select * from t1; -ERROR 42000: select command denied to user: 'mysqltest_3'@'localhost' for column 'b' in table 't1' +ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1' select a from t1; a 1 2 select c from t1; -ERROR 42000: SELECT command denied to user: 'mysqltest_3'@'localhost' for column 'c' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' select * from t2; -ERROR 42000: select command denied to user: 'mysqltest_3'@'localhost' for table 't2' +ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2' select mysqltest.t1.c from test.t1,mysqltest.t1; -ERROR 42000: SELECT command denied to user: 'mysqltest_3'@'localhost' for column 'c' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -176,7 +176,7 @@ Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' select a from t1; -ERROR 3D000: No Database Selected +ERROR 3D000: No database selected select * from mysqltest.t1,test.t1; a b c a 1 1 1 test.t1 diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index fddad8dba51..f66e9f1759d 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -6,7 +6,7 @@ insert into t1 values (20,"ggg"),(21,"hhh"),(22,"iii"); handler t1 open as t2; handler t2 read a=(SELECT 1); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1)' at line 1 handler t2 read a first; a b 14 aaa @@ -51,7 +51,7 @@ handler t2 read a=(16); a b 16 ccc handler t2 read a=(19,"fff"); -ERROR 42000: Too many key parts specified. Max 1 parts allowed +ERROR 42000: Too many key parts specified; max 1 parts allowed handler t2 read b=(19,"fff"); a b 19 fff @@ -135,7 +135,7 @@ handler t2 read next; a b 19 fff handler t2 read last; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 handler t2 close; handler t1 open as t2; drop table t1; @@ -173,7 +173,7 @@ handler t1 open; handler t1 read a=(W); ERROR 42S22: Unknown column 'W' in 'field list' handler t1 read a=(a); -ERROR HY000: Wrong arguments to HANDLER ... READ +ERROR HY000: Incorrect arguments to HANDLER ... READ drop table t1; create table t1 (a char(5)); insert into t1 values ("Ok"); diff --git a/mysql-test/r/have_archive.require b/mysql-test/r/have_archive.require new file mode 100644 index 00000000000..c4b4ba24fcd --- /dev/null +++ b/mysql-test/r/have_archive.require @@ -0,0 +1,2 @@ +Variable_name Value +have_archive YES diff --git a/mysql-test/r/innodb_handler.result b/mysql-test/r/innodb_handler.result index a608e5c71ab..7f4960ffa35 100644 --- a/mysql-test/r/innodb_handler.result +++ b/mysql-test/r/innodb_handler.result @@ -49,7 +49,7 @@ handler t2 read a=(16); a b 16 ccc handler t2 read a=(19,"fff"); -ERROR 42000: Too many key parts specified. Max 1 parts allowed +ERROR 42000: Too many key parts specified; max 1 parts allowed handler t2 read b=(19,"fff"); a b 19 fff @@ -130,7 +130,7 @@ handler t2 read next; a b 18 eee handler t2 read last; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 handler t2 close; handler t1 open as t2; handler t2 read first; diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 782a71e83d1..71b10699fa9 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -63,7 +63,7 @@ insert into t1 values(NULL); ERROR 23000: Column 'id' cannot be null insert into t1 values (1), (NULL), (2); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id' at row 2 select * from t1; id 1 @@ -159,18 +159,18 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val Warnings: Warning 1265 Data truncated for column 'f_double' at row 1 Warning 1265 Data truncated for column 'f_float' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 Warning 1265 Data truncated for column 'f_double_7_2' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 Warning 1265 Data truncated for column 'f_float_4_3' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 Warning 1265 Data truncated for column 'f_double_u' at row 1 Warning 1265 Data truncated for column 'f_float_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 4 original_value 1e+1111111111a @@ -187,19 +187,19 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val Warnings: Warning 1265 Data truncated for column 'f_double' at row 1 Warning 1265 Data truncated for column 'f_float' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 Warning 1265 Data truncated for column 'f_double_7_2' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 Warning 1265 Data truncated for column 'f_float_4_3' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 Warning 1265 Data truncated for column 'f_double_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 Warning 1265 Data truncated for column 'f_float_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 Warning 1265 Data truncated for column 'f_double_15_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 5 original_value -1e+1111111111a @@ -214,12 +214,12 @@ f_float_3_1_u 0.0 set @value= 1e+1111111111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); Warnings: -Warning 1264 Data truncated, out of range for column 'f_float' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 6 original_value 1.7976931348623e+308 @@ -234,13 +234,13 @@ f_float_3_1_u 99.9 set @value= -1e+1111111111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); Warnings: -Warning 1264 Data truncated, out of range for column 'f_float' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 7 original_value -1.7976931348623e+308 @@ -255,12 +255,12 @@ f_float_3_1_u 0.0 set @value= 1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); Warnings: -Warning 1264 Data truncated, out of range for column 'f_float' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 8 original_value 1e+111 @@ -275,13 +275,13 @@ f_float_3_1_u 99.9 set @value= -1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); Warnings: -Warning 1264 Data truncated, out of range for column 'f_float' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_7_2' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_4_3' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_7_2' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_4_3' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 9 original_value -1e+111 @@ -309,10 +309,10 @@ f_float_3_1_u 1.0 set @value= -1; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); Warnings: -Warning 1264 Data truncated, out of range for column 'f_double_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_double_15_1_u' at row 1 -Warning 1264 Data truncated, out of range for column 'f_float_3_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_double_15_1_u' at row 1 +Warning 1264 Data truncated; out of range for column 'f_float_3_1_u' at row 1 select * from t1 where number =last_insert_id(); number 11 original_value -1 diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index 2e90f8b2d81..7c7ac152aa5 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -622,8 +622,8 @@ NULL 2 100 create table t2(No int not null, Field int not null, Count int not null); insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2; Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'No' at row 1 -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'No' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'No' at row 2 select * from t2; No Field Count 0 1 100 diff --git a/mysql-test/r/isam.result b/mysql-test/r/isam.result index 2c7b3a4a568..52eb2d73ed5 100644 --- a/mysql-test/r/isam.result +++ b/mysql-test/r/isam.result @@ -34,7 +34,7 @@ ERROR 42000: Column 'a' is used with UNIQUE or INDEX but is not defined as NOT N create table t1 (a int,b text, index(b)) engine=isam; ERROR 42000: BLOB column 'b' can't be used in key specification with the used table type create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=isam; -ERROR 42000: Incorrect table definition; There can only be one auto column and it must be defined as a key +ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key create table t1 (ordid int(8), unique (ordid)) engine=isam; ERROR 42000: Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL drop table if exists t1; diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index f9e49c40dc1..db9b051a58f 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -126,7 +126,7 @@ a 1 2 select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a); -ERROR HY000: Too many tables. MySQL can only use XX tables in a join +ERROR HY000: Too many tables; MySQL can only use XX tables in a join drop table t1; CREATE TABLE t1 ( a int(11) NOT NULL, diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 9d7c3d98952..d6f2b7a72d8 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -106,11 +106,11 @@ grp a c id a c d a 3 6 D 3 6 C 6 6 NULL NULL NULL NULL NULL NULL NULL explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); -ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions select t1.*,t2.* from t1 inner join t2 using (a); grp a c id a c d 1 1 a 1 1 a 1 @@ -406,7 +406,7 @@ insert into t3 values (1); insert into t4 values (1,1); insert into t5 values (1,1); explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; -ERROR 42000: Cross dependency found in OUTER JOIN. Examine your ON conditions +ERROR 42000: Cross dependency found in OUTER JOIN; examine your ON conditions drop table t1,t2,t3,t4,t5; create table t1 (n int, m int, o int, key(n)); create table t2 (n int not null, m int, o int, primary key(n)); diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 28824de94ce..9b4621edc42 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -156,8 +156,8 @@ CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT, UNIQUE (c,i)); INSERT INTO t1 (c) VALUES (NULL),(NULL); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1 -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2 SELECT * FROM t1; c i 1 diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 1580f51975e..fe8708f882d 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -39,9 +39,9 @@ SELECT @@medium.key_buffer_size; 0 SET @@global.key_buffer_size=@save_key_buffer; SELECT @@default.key_buffer_size; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'default.key_buffer_size' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default.key_buffer_size' at line 1 SELECT @@skr.storage_engine="test"; -ERROR HY000: Variable 'storage_engine' is not a variable component (Can't be used as XXXX.variable_name) +ERROR HY000: Variable 'storage_engine' is not a variable component (can't be used as XXXX.variable_name) select @@keycache1.key_cache_block_size; @@keycache1.key_cache_block_size 0 diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 5718397e1ec..c0baabcc507 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -44,9 +44,9 @@ create table t1 (a int, b char(10)); load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; Warnings: Warning 1265 Data truncated for column 'a' at row 3 -Warning 1262 Row 3 was truncated; It contained more data than there were input columns +Warning 1262 Row 3 was truncated; it contained more data than there were input columns Warning 1265 Data truncated for column 'a' at row 5 -Warning 1262 Row 5 was truncated; It contained more data than there were input columns +Warning 1262 Row 5 was truncated; it contained more data than there were input columns select * from t1; a b 1 row 1 diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index d8c70625e35..b4b78dc4b5b 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -191,7 +191,7 @@ n d unix_timestamp(t) 1 10 1038401397 2 20 1038401397 UPDATE t1,t2 SET 1=2 WHERE t1.n=t2.n; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '1=2 WHERE t1.n=t2.n' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1=2 WHERE t1.n=t2.n' at line 1 drop table t1,t2; set timestamp=0; set sql_safe_updates=0; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 5592524cc39..e88ece6b361 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -1,5 +1,5 @@ -drop table if exists t1,t2; set timestamp=1000000000; +drop table if exists t1,t2; create table t1 (word varchar(20)); create table t2 (id int auto_increment not null primary key); insert into t1 values ("abirvalg"); @@ -17,6 +17,8 @@ flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; +drop table if exists t1,t2; +SET TIMESTAMP=1000000000; create table t1 (word varchar(20)); SET TIMESTAMP=1000000000; create table t2 (id int auto_increment not null primary key); @@ -51,6 +53,8 @@ insert into t1 values ("Alas"); /*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; +drop table if exists t1,t2; +SET TIMESTAMP=1000000000; create table t1 (word varchar(20)); SET TIMESTAMP=1000000000; create table t2 (id int auto_increment not null primary key); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 01114104088..b9f4f62e882 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -54,7 +54,10 @@ 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); -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */; +/*!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" */; @@ -75,6 +78,8 @@ UNLOCK TABLES; /*!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 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; @@ -138,7 +143,10 @@ DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r; INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'); -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */; +/*!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" */; @@ -158,6 +166,8 @@ UNLOCK TABLES; /*!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 */; DROP TABLE t1; CREATE TABLE t1 (a int) ENGINE=MYISAM; @@ -208,7 +218,10 @@ CREATE TABLE ```a` ( drop table ```a`; create table t1(a int); -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */; +/*!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" */; @@ -227,6 +240,8 @@ UNLOCK TABLES; /*!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 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; @@ -248,7 +263,10 @@ UNLOCK TABLES; set global sql_mode='ANSI_QUOTES'; -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */; +/*!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" */; @@ -267,6 +285,8 @@ UNLOCK TABLES; /*!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 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; @@ -291,7 +311,10 @@ drop table t1; create table t1(a int); insert into t1 values (1),(2),(3); -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */; +/*!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 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="" */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( @@ -301,6 +324,8 @@ CREATE TABLE `t1` ( /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!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 */; 1 2 diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/r/ndb_replace.result index 7c10101ff2e..45af0f7fcb5 100644 --- a/mysql-test/r/ndb_replace.result +++ b/mysql-test/r/ndb_replace.result @@ -11,7 +11,7 @@ insert into t1 (gesuchnr, benutzer_id) value (3,2); replace into t1 (gesuchnr,benutzer_id) values (1,1); replace into t1 (gesuchnr,benutzer_id) values (1,1); insert into t1 (gesuchnr,benutzer_id) values (1,1); -ERROR 23000: Can't write, duplicate key in table 't1' +ERROR 23000: Can't write; duplicate key in table 't1' replace into t1 (gesuchnr,benutzer_id) values (1,1); select * from t1 order by gesuchnr; gesuchnr benutzer_id diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 7391f4192bf..1d76fbf2fb3 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -97,39 +97,39 @@ Warnings: Warning 1265 Data truncated for column 'd' at row 1 UPDATE t1 SET d=NULL; Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1 INSERT INTO t1 (a) values (null); ERROR 23000: Column 'a' cannot be null INSERT INTO t1 (a) values (1/null); ERROR 23000: Column 'a' cannot be null INSERT INTO t1 (a) values (null),(null); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 1 -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2 INSERT INTO t1 (b) values (null); ERROR 23000: Column 'b' cannot be null INSERT INTO t1 (b) values (1/null); ERROR 23000: Column 'b' cannot be null INSERT INTO t1 (b) values (null),(null); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 1 -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2 INSERT INTO t1 (c) values (null); ERROR 23000: Column 'c' cannot be null INSERT INTO t1 (c) values (1/null); ERROR 23000: Column 'c' cannot be null INSERT INTO t1 (c) values (null),(null); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1 -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2 INSERT INTO t1 (d) values (null); ERROR 23000: Column 'd' cannot be null INSERT INTO t1 (d) values (1/null); ERROR 23000: Column 'd' cannot be null INSERT INTO t1 (d) values (null),(null); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1 -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 2 select * from t1; a b c d 0 0000-00-00 00:00:00 0 diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index e57ac321f46..4b7400e5e60 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -337,7 +337,7 @@ index (id2) ); insert into t1 values(null,null),(1,1); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id2' at row 1 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'id2' at row 1 select * from t1; id id2 NULL 0 diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 4cf6bee6123..a87d0c33559 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -10,22 +10,22 @@ select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user1'@'localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user1'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user2'@'localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user2'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user3'@'localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user3'@'localhost' to database 'test' select * from t1; f1 5 delete from t1; -ERROR 42000: Access denied for user: 'ssl_user4'@'localhost' to database 'test' +ERROR 42000: Access denied for user 'ssl_user4'@'localhost' to database 'test' delete from mysql.user where user='ssl_user%'; delete from mysql.db where user='ssl_user%'; flush privileges; diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index 5729d7af166..29bbcf4466f 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -12,7 +12,7 @@ select @@net_buffer_length, @@max_allowed_packet; @@net_buffer_length @@max_allowed_packet 1024 1024 SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; -ERROR 08S01: Got a packet bigger than 'max_allowed_packet' +ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes set global max_allowed_packet=default; set max_allowed_packet=default; set global net_buffer_length=default; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result new file mode 100644 index 00000000000..7d80d08e663 --- /dev/null +++ b/mysql-test/r/ps.result @@ -0,0 +1,139 @@ +drop table if exists t1,t2; +create table t1 +( +a int primary key, +b char(10) +); +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +set @a=2; +prepare stmt1 from 'select * from t1 where a <= ?'; +execute stmt1 using @a; +a b +1 one +2 two +set @a=3; +execute stmt1 using @a; +a b +1 one +2 two +3 three +deallocate prepare no_such_statement; +ERROR HY000: Unknown prepared statement handler (no_such_statement) given to DEALLOCATE PREPARE +execute stmt1; +ERROR HY000: Incorrect arguments to EXECUTE +prepare stmt2 from 'prepare nested_stmt from "select 1"'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1 +prepare stmt2 from 'execute stmt1'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt1' at line 1 +prepare stmt2 from 'deallocate prepare z'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'z' at line 1 +prepare stmt3 from 'insert into t1 values (?,?)'; +set @arg1=5, @arg2='five'; +execute stmt3 using @arg1, @arg2; +select * from t1 where a>3; +a b +4 four +5 five +prepare stmt4 from 'update t1 set a=? where b=?'; +set @arg1=55, @arg2='five'; +execute stmt4 using @arg1, @arg2; +select * from t1 where a>3; +a b +4 four +55 five +prepare stmt4 from 'create table t2 (a int)'; +execute stmt4; +prepare stmt4 from 'drop table t2'; +execute stmt4; +execute stmt4; +ERROR 42S02: Unknown table 't2' +prepare stmt5 from 'select ? + a from t1'; +set @a=1; +execute stmt5 using @a; +? + a +2 +3 +4 +5 +56 +execute stmt5 using @no_such_var; +? + a +NULL +NULL +NULL +NULL +NULL +set @nullvar=1; +set @nullvar=NULL; +execute stmt5 using @nullvar; +? + a +NULL +NULL +NULL +NULL +NULL +set @nullvar2=NULL; +execute stmt5 using @nullvar2; +? + a +NULL +NULL +NULL +NULL +NULL +prepare stmt6 from 'select 1; select2'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1 +prepare stmt6 from 'insert into t1 values (5,"five"); select2'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; select2' at line 1 +explain prepare stmt6 from 'insert into t1 values (5,"five"); select2'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from 'insert into t1 values (5,"five"); select2'' at line 1 +create table t2 +( +a int +); +insert into t2 values (0); +set @arg00=NULL ; +prepare stmt1 from 'select 1 FROM t2 where a=?' ; +execute stmt1 using @arg00 ; +1 +prepare stmt1 from @nosuchvar; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1 +set @ivar= 1234; +prepare stmt1 from @ivar; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1234' at line 1 +set @fvar= 123.4567; +prepare stmt1 from @fvar; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123.4567' at line 1 +set @str1 = 'select ?'; +set @str2 = convert(@str1 using ucs2); +prepare stmt1 from @str2; +execute stmt1 using @ivar; +? +1234 +drop table t1,t2; +PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?"; +set @var='A'; +EXECUTE stmt1 USING @var; +_utf8 'A' collate utf8_bin = ? +1 +DEALLOCATE PREPARE stmt1; +create table t1 (id int); +prepare stmt1 from "select FOUND_ROWS()"; +select SQL_CALC_FOUND_ROWS * from t1; +id +execute stmt1; +FOUND_ROWS() +0 +insert into t1 values (1); +select SQL_CALC_FOUND_ROWS * from t1; +id +1 +execute stmt1; +FOUND_ROWS() +1 +execute stmt1; +FOUND_ROWS() +0 +deallocate prepare stmt1; diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 185961c53ff..a93ea1aa7fe 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -593,7 +593,7 @@ select * from t1; a set GLOBAL query_cache_size=1024; Warnings: -Warning 1282 Query cache failed to set size 1024, new query cache size is 0 +Warning 1282 Query cache failed to set size 1024; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -601,7 +601,7 @@ select * from t1; a set GLOBAL query_cache_size=10240; Warnings: -Warning 1282 Query cache failed to set size 10240, new query cache size is 0 +Warning 1282 Query cache failed to set size 10240; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -609,7 +609,7 @@ select * from t1; a set GLOBAL query_cache_size=20480; Warnings: -Warning 1282 Query cache failed to set size 20480, new query cache size is 0 +Warning 1282 Query cache failed to set size 20480; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 @@ -617,7 +617,7 @@ select * from t1; a set GLOBAL query_cache_size=40960; Warnings: -Warning 1282 Query cache failed to set size 40960, new query cache size is 0 +Warning 1282 Query cache failed to set size 40960; new query cache size is 0 show global variables like "query_cache_size"; Variable_name Value query_cache_size 0 diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 290e72d3b55..06a479c964c 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -299,6 +299,27 @@ a b 15 1 47 1 DROP TABLE t1; +CREATE TABLE t1 ( +id int( 11 ) unsigned NOT NULL AUTO_INCREMENT , +line int( 5 ) unsigned NOT NULL default '0', +columnid int( 3 ) unsigned NOT NULL default '0', +owner int( 3 ) unsigned NOT NULL default '0', +ordinal int( 3 ) unsigned NOT NULL default '0', +showid smallint( 6 ) unsigned NOT NULL default '1', +tableid int( 1 ) unsigned NOT NULL default '1', +content int( 5 ) unsigned NOT NULL default '188', +PRIMARY KEY ( owner, id ) , +KEY menu( owner, showid, columnid ) , +KEY `COLUMN` ( owner, columnid, line ) , +KEY `LINES` ( owner, tableid, content, id ) , +KEY recount( owner, line ) +) ENGINE = MYISAM; +INSERT into t1 (owner,id,columnid,line) values (11,15,15,1),(11,13,13,5); +SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30; +id columnid tableid content showid line ordinal +13 13 1 188 1 5 0 +15 15 1 188 1 1 0 +drop table t1; create table t1 (id int(10) primary key); insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9); select id from t1 where id in (2,5,9) ; diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index 6ba82d0dd2f..8d42957c9d3 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -105,60 +105,62 @@ drop database test2; drop database test3; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 79 Query 1 79 use `test`; create database test2 character set latin2 -master-bin.000001 156 Query 1 156 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30 -master-bin.000001 290 Query 1 290 use `test`; create database test3 -master-bin.000001 346 Query 1 346 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 -master-bin.000001 480 Query 1 480 use `test`; drop database test3 -master-bin.000001 534 Query 1 534 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 -master-bin.000001 668 Query 1 668 use `test`; create database test3 -master-bin.000001 724 Query 1 724 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 859 Query 1 859 use `test2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 961 Query 1 961 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1097 Intvar 1 1097 INSERT_ID=1 -master-bin.000001 1125 Query 1 1125 use `test2`; insert into t1 (b) values(@@character_set_server) -master-bin.000001 1210 Query 1 1210 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1346 Intvar 1 1346 INSERT_ID=2 -master-bin.000001 1374 Query 1 1374 use `test2`; insert into t1 (b) values(@@collation_server) -master-bin.000001 1455 Query 1 1455 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1591 Intvar 1 1591 INSERT_ID=3 -master-bin.000001 1619 Query 1 1619 use `test2`; insert into t1 (b) values(@@character_set_client) -master-bin.000001 1704 Query 1 1704 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1840 Intvar 1 1840 INSERT_ID=4 -master-bin.000001 1868 Query 1 1868 use `test2`; insert into t1 (b) values(@@character_set_connection) -master-bin.000001 1957 Query 1 1957 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2093 Intvar 1 2093 INSERT_ID=5 -master-bin.000001 2121 Query 1 2121 use `test2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 2206 Query 1 2206 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2341 Query 1 2341 use `test2`; truncate table t1 -master-bin.000001 2394 Query 1 2394 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2529 Intvar 1 2529 INSERT_ID=1 -master-bin.000001 2557 Query 1 2557 use `test2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 2642 Query 1 2642 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2777 Intvar 1 2777 INSERT_ID=2 -master-bin.000001 2805 Query 1 2805 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 2893 Query 1 2893 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3029 Intvar 1 3029 INSERT_ID=3 -master-bin.000001 3057 Query 1 3057 use `test2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 3142 Query 1 3142 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3278 Intvar 1 3278 INSERT_ID=4 -master-bin.000001 3306 Query 1 3306 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 3394 Query 1 3394 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3530 Intvar 1 3530 INSERT_ID=74 -master-bin.000001 3558 Create_file 1 3558 db=test2;table=t1;file_id=1;block_len=581 -master-bin.000001 4226 Query 1 4226 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 4362 Intvar 1 4362 INSERT_ID=5 -master-bin.000001 4390 Exec_load 1 4390 ;file_id=1 -master-bin.000001 4413 Query 1 4413 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 4549 Query 1 4549 use `test2`; truncate table t1 -master-bin.000001 4602 Query 1 4602 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 4738 Intvar 1 4738 INSERT_ID=1 -master-bin.000001 4766 User var 1 4766 @`a`=_cp850'Müller' COLLATE cp850_general_ci -master-bin.000001 4806 Query 1 4806 use `test2`; insert into t1 (b) values(collation(@a)) -master-bin.000001 4882 Query 1 4882 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5018 Query 1 5018 use `test2`; drop database test2 -master-bin.000001 5073 Query 1 5073 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5204 Query 1 5204 drop database test3 +master-bin.000001 79 Query 1 79 use `test`; drop database if exists test2 +master-bin.000001 143 Query 1 143 use `test`; drop database if exists test3 +master-bin.000001 207 Query 1 207 use `test`; create database test2 character set latin2 +master-bin.000001 284 Query 1 284 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30 +master-bin.000001 418 Query 1 418 use `test`; create database test3 +master-bin.000001 474 Query 1 474 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 608 Query 1 608 use `test`; drop database test3 +master-bin.000001 662 Query 1 662 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 796 Query 1 796 use `test`; create database test3 +master-bin.000001 852 Query 1 852 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 987 Query 1 987 use `test2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 1089 Query 1 1089 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1225 Intvar 1 1225 INSERT_ID=1 +master-bin.000001 1253 Query 1 1253 use `test2`; insert into t1 (b) values(@@character_set_server) +master-bin.000001 1338 Query 1 1338 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1474 Intvar 1 1474 INSERT_ID=2 +master-bin.000001 1502 Query 1 1502 use `test2`; insert into t1 (b) values(@@collation_server) +master-bin.000001 1583 Query 1 1583 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1719 Intvar 1 1719 INSERT_ID=3 +master-bin.000001 1747 Query 1 1747 use `test2`; insert into t1 (b) values(@@character_set_client) +master-bin.000001 1832 Query 1 1832 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1968 Intvar 1 1968 INSERT_ID=4 +master-bin.000001 1996 Query 1 1996 use `test2`; insert into t1 (b) values(@@character_set_connection) +master-bin.000001 2085 Query 1 2085 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2221 Intvar 1 2221 INSERT_ID=5 +master-bin.000001 2249 Query 1 2249 use `test2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2334 Query 1 2334 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2469 Query 1 2469 use `test2`; truncate table t1 +master-bin.000001 2522 Query 1 2522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2657 Intvar 1 2657 INSERT_ID=1 +master-bin.000001 2685 Query 1 2685 use `test2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2770 Query 1 2770 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2905 Intvar 1 2905 INSERT_ID=2 +master-bin.000001 2933 Query 1 2933 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3021 Query 1 3021 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3157 Intvar 1 3157 INSERT_ID=3 +master-bin.000001 3185 Query 1 3185 use `test2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 3270 Query 1 3270 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3406 Intvar 1 3406 INSERT_ID=4 +master-bin.000001 3434 Query 1 3434 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3522 Query 1 3522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3658 Intvar 1 3658 INSERT_ID=74 +master-bin.000001 3686 Create_file 1 3686 db=test2;table=t1;file_id=1;block_len=581 +master-bin.000001 4354 Query 1 4354 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4490 Intvar 1 4490 INSERT_ID=5 +master-bin.000001 4518 Exec_load 1 4518 ;file_id=1 +master-bin.000001 4541 Query 1 4541 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4677 Query 1 4677 use `test2`; truncate table t1 +master-bin.000001 4730 Query 1 4730 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4866 Intvar 1 4866 INSERT_ID=1 +master-bin.000001 4894 User var 1 4894 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci +master-bin.000001 4934 Query 1 4934 use `test2`; insert into t1 (b) values(collation(@a)) +master-bin.000001 5010 Query 1 5010 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5146 Query 1 5146 use `test2`; drop database test2 +master-bin.000001 5201 Query 1 5201 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5332 Query 1 5332 drop database test3 set global character_set_server=latin2; ERROR HY000: Binary logging and replication forbid changing the global server character set or collation set global character_set_server=latin2; diff --git a/mysql-test/r/rpl_delete_all.result b/mysql-test/r/rpl_delete_all.result new file mode 100644 index 00000000000..9966d73f3dd --- /dev/null +++ b/mysql-test/r/rpl_delete_all.result @@ -0,0 +1,31 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create database test1; +drop database if exists test1; +Warnings: +Note 1008 Can't drop database 'test1'; database doesn't exist +show tables from test1; +ERROR HY000: Can't read dir of './test1/' (Errcode: 2) +create table t1 (a int); +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +select * from t1; +ERROR 42S02: Table 'test.t1' doesn't exist +create table t1 (a int); +insert into t1 values(1); +delete from t1; +select * from t1; +a +insert into t1 values(1); +insert into t1 values(2); +update t1 set a=2; +select * from t1; +a +2 +2 +drop table t1; diff --git a/mysql-test/r/rpl_flush_log_loop.result b/mysql-test/r/rpl_flush_log_loop.result index 6992b635672..25177a6bca3 100644 --- a/mysql-test/r/rpl_flush_log_loop.result +++ b/mysql-test/r/rpl_flush_log_loop.result @@ -14,4 +14,4 @@ start slave; flush logs; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 79 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 79 4 None 0 No # +# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 161 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 161 4 None 0 No # diff --git a/mysql-test/r/rpl_free_items.result b/mysql-test/r/rpl_free_items.result new file mode 100644 index 00000000000..91c1e2aa6e5 --- /dev/null +++ b/mysql-test/r/rpl_free_items.result @@ -0,0 +1,10 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1 (a int); +create table t2 (a int); +drop table t1; +drop table t2; diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/r/rpl_get_lock.result index 2c57069e91a..26f33bfb42c 100644 --- a/mysql-test/r/rpl_get_lock.result +++ b/mysql-test/r/rpl_get_lock.result @@ -18,9 +18,9 @@ get_lock("lock",3) select * from t1; n 1 -select is_free_lock("lock"), is_used_lock("lock"); -is_free_lock("lock") is_used_lock("lock") -0 6 +select is_free_lock("lock"), is_used_lock("lock") = connection_id(); +is_free_lock("lock") is_used_lock("lock") = connection_id() +0 1 explain extended select is_free_lock("lock"), is_used_lock("lock"); 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 diff --git a/mysql-test/r/rpl_ps.result b/mysql-test/r/rpl_ps.result new file mode 100644 index 00000000000..c969575de76 --- /dev/null +++ b/mysql-test/r/rpl_ps.result @@ -0,0 +1,28 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop table if exists t1; +create table t1(n char(30)); +prepare stmt1 from 'insert into t1 values (?)'; +set @var1= "from-master-1"; +execute stmt1 using @var1; +set @var1= "from-master-2-'',"; +execute stmt1 using @var1; +select * from t1; +n +from-master-1 +from-master-2-'', +set @var2= 'insert into t1 values (concat("from-var-", ?))'; +prepare stmt2 from @var2; +set @var1='from-master-3'; +execute stmt2 using @var1; +select * from t1; +n +from-master-1 +from-master-2-'', +from-var-from-master-3 +drop table t1; +stop slave; diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/r/rpl_replicate_do.result index 43de4a67ce9..ca290d46fda 100644 --- a/mysql-test/r/rpl_replicate_do.result +++ b/mysql-test/r/rpl_replicate_do.result @@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist drop table if exists t1,t2,t11; show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1281 slave-relay-bin.000002 1325 master-bin.000001 Yes Yes test.t1 0 0 1281 1325 None 0 No # +# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1340 slave-relay-bin.000002 1384 master-bin.000001 Yes Yes test.t1 0 0 1340 1384 None 0 No # diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index 20755d265aa..62e5522fad9 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -1,11 +1,11 @@ drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4; start slave; -ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log +ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log start slave; -ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log +ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; -ERROR HY000: Could not initialize master info structure, more error messages can be found in the MySQL error log +ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log reset slave; change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root'; reset master; diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result index 465a1fed2b4..b9865d282fa 100644 --- a/mysql-test/r/rpl_temporary.result +++ b/mysql-test/r/rpl_temporary.result @@ -7,12 +7,12 @@ start slave; reset master; SET @save_select_limit=@@session.sql_select_limit; SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100; -ERROR HY000: Access denied. You need the SUPER privilege for this operation +ERROR HY000: Access denied; you need the SUPER privilege for this operation SELECT @@session.sql_select_limit = @save_select_limit; @@session.sql_select_limit = @save_select_limit 1 SET @@session.sql_select_limit=10, @@session.sql_log_bin=0; -ERROR HY000: Access denied. You need the SUPER privilege for this operation +ERROR HY000: Access denied; you need the SUPER privilege for this operation SELECT @@session.sql_select_limit = @save_select_limit; @@session.sql_select_limit = @save_select_limit 1 @@ -39,17 +39,18 @@ f show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.000001 79 Query 1 79 use `test`; create table t1(f int) -master-bin.000001 136 Query 1 136 use `test`; create table t2(f int) -master-bin.000001 193 Query 1 193 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10) -master-bin.000001 290 Query 1 290 use `test`; create temporary table t3(f int) -master-bin.000001 357 Query 1 357 use `test`; insert into t3 select * from t1 where f<6 -master-bin.000001 433 Query 1 433 use `test`; create temporary table t3(f int) -master-bin.000001 500 Query 1 500 use `test`; insert into t2 select count(*) from t3 -master-bin.000001 573 Query 1 573 use `test`; insert into t3 select * from t1 where f>=4 -master-bin.000001 650 Query 1 650 use `test`; drop temporary table t3 -master-bin.000001 708 Query 1 708 use `test`; insert into t2 select count(*) from t3 -master-bin.000001 781 Query 1 781 use `test`; drop temporary table t3 +master-bin.000001 79 Query 1 79 use `test`; drop table if exists t1,t2 +master-bin.000001 140 Query 1 140 use `test`; create table t1(f int) +master-bin.000001 197 Query 1 197 use `test`; create table t2(f int) +master-bin.000001 254 Query 1 254 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10) +master-bin.000001 351 Query 1 351 use `test`; create temporary table t3(f int) +master-bin.000001 418 Query 1 418 use `test`; insert into t3 select * from t1 where f<6 +master-bin.000001 494 Query 1 494 use `test`; create temporary table t3(f int) +master-bin.000001 561 Query 1 561 use `test`; insert into t2 select count(*) from t3 +master-bin.000001 634 Query 1 634 use `test`; insert into t3 select * from t1 where f>=4 +master-bin.000001 711 Query 1 711 use `test`; drop temporary table t3 +master-bin.000001 769 Query 1 769 use `test`; insert into t2 select count(*) from t3 +master-bin.000001 842 Query 1 842 use `test`; drop temporary table t3 drop table t1, t2; use test; SET TIMESTAMP=1040323920; diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/r/rpl_timezone.result new file mode 100644 index 00000000000..c7be3324533 --- /dev/null +++ b/mysql-test/r/rpl_timezone.result @@ -0,0 +1,77 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1 (t timestamp); +create table t2 (t char(32)); +select @@time_zone; +@@time_zone +Europe/Moscow +set time_zone='UTC'; +insert into t1 values ('20040101000000'), ('20040611093902'); +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +select * from t1; +t +2004-01-01 03:00:00 +2004-06-11 13:39:02 +delete from t1; +set time_zone='Europe/Moscow'; +insert into t1 values ('20040101000000'), ('20040611093902'); +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +select * from t1; +t +2004-01-01 00:00:00 +2004-06-11 09:39:02 +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 79 Query 1 79 use `test`; create table t1 (t timestamp) +master-bin.000001 143 Query 1 143 use `test`; create table t2 (t char(32)) +master-bin.000001 206 Query 1 206 use `test`; SET ONE_SHOT TIME_ZONE='UTC' +master-bin.000001 269 Query 1 269 use `test`; insert into t1 values ('20040101000000'), ('20040611093902') +master-bin.000001 364 Query 1 364 use `test`; delete from t1 +master-bin.000001 413 Query 1 413 use `test`; insert into t1 values ('20040101000000'), ('20040611093902') +set time_zone='MET'; +insert into t2 (select t from t1); +select * from t1; +t +2003-12-31 22:00:00 +2004-06-11 07:39:02 +select * from t2; +t +2003-12-31 22:00:00 +2004-06-11 07:39:02 +delete from t2; +set timestamp=1000072000; +insert into t2 values (current_timestamp), (current_date), (current_time); +set timestamp=1000072000; +select current_timestamp, current_date, current_time; +current_timestamp current_date current_time +2001-09-10 01:46:40 2001-09-10 01:46:40 +select * from t2; +t +2001-09-09 23:46:40 +2001-09-09 +23:46:40 +delete from t2; +insert into t2 values (from_unixtime(1000000000)), +(unix_timestamp('2001-09-09 03:46:40')); +select * from t2; +t +2001-09-09 03:46:40 +1000000000 +select * from t2; +t +2001-09-09 03:46:40 +1000000000 +set global time_zone='MET'; +ERROR HY000: Binary logging and replication forbid changing of the global server time zone +drop table t1, t2; diff --git a/mysql-test/r/rpl_until.result b/mysql-test/r/rpl_until.result index 120c3d7a57f..5772f176919 100644 --- a/mysql-test/r/rpl_until.result +++ b/mysql-test/r/rpl_until.result @@ -57,15 +57,15 @@ show slave status; Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master # 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 561 slave-relay-bin.000002 # master-bin.000001 Yes No 0 0 561 # Master master-bin.000001 561 No # start slave until master_log_file='master-bin', master_log_pos=561; -ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12; -ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until master_log_file='master-bin.000001'; -ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until relay_log_file='slave-relay-bin.000002'; -ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561; -ERROR HY000: Wrong parameter or combination of parameters for START SLAVE UNTIL +ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL start slave sql_thread; start slave until master_log_file='master-bin.000001', master_log_pos=561; Warnings: diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result index ce2fb9c6f9c..85768270ba3 100644 --- a/mysql-test/r/rpl_user_variables.result +++ b/mysql-test/r/rpl_user_variables.result @@ -86,11 +86,11 @@ slave-bin.000001 313 Query 1 313 use `test`; insert into t1 values (@i1), (@i2), slave-bin.000001 396 User var 2 396 @`r1`=12.5 slave-bin.000001 439 User var 2 439 @`r2`=-12.5 slave-bin.000001 482 Query 1 482 use `test`; insert into t1 values (@r1), (@r2) -slave-bin.000001 551 User var 2 551 @`s1`=_latin1'This is a test' COLLATE latin1_swedish_ci -slave-bin.000001 600 User var 2 600 @`s2`=_latin1'' COLLATE latin1_swedish_ci -slave-bin.000001 635 User var 2 635 @`s3`=_latin1'abc\'def' COLLATE latin1_swedish_ci -slave-bin.000001 677 User var 2 677 @`s4`=_latin1'abc\\def' COLLATE latin1_swedish_ci -slave-bin.000001 719 User var 2 719 @`s5`=_latin1'abc\'def' COLLATE latin1_swedish_ci +slave-bin.000001 551 User var 2 551 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci +slave-bin.000001 600 User var 2 600 @`s2`=_latin1 "" COLLATE latin1_swedish_ci +slave-bin.000001 635 User var 2 635 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci +slave-bin.000001 677 User var 2 677 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci +slave-bin.000001 719 User var 2 719 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci slave-bin.000001 761 Query 1 761 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) slave-bin.000001 851 User var 2 851 @`n1`=NULL slave-bin.000001 877 Query 1 877 use `test`; insert into t1 values (@n1) @@ -99,7 +99,7 @@ slave-bin.000001 965 Query 1 965 use `test`; insert into t1 values (@n2) slave-bin.000001 1027 Query 1 1027 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) slave-bin.000001 1115 User var 2 1115 @`a`=2 slave-bin.000001 1157 Query 1 1157 use `test`; insert into t1 values (@a+(@b:=@a+1)) -slave-bin.000001 1229 User var 2 1229 @`q`=_latin1'abc' COLLATE latin1_swedish_ci +slave-bin.000001 1229 User var 2 1229 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci slave-bin.000001 1266 Query 1 1266 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) slave-bin.000001 1370 User var 2 1370 @`a`=5 slave-bin.000001 1412 Query 1 1412 use `test`; insert into t1 values (@a),(@a) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 8c783445127..8da1660a109 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2071,7 +2071,14 @@ CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned defa INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'NULL' AND b.sampletime < 'NULL' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +gvid the_success the_fail the_size the_time +Warnings: +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; gvid the_success the_fail the_size the_time DROP TABLE t1,t2; create table t1 ( A_Id bigint(20) NOT NULL default '0', A_UpdateBy char(10) NOT NULL default '', A_UpdateDate bigint(20) NOT NULL default '0', A_UpdateSerial int(11) NOT NULL default '0', other_types bigint(20) NOT NULL default '0', wss_type bigint(20) NOT NULL default '0'); diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result index 6bffdd85aa4..766ee8c0e14 100644 --- a/mysql-test/r/select_safe.result +++ b/mysql-test/r/select_safe.result @@ -30,7 +30,7 @@ ERROR HY000: You are using safe update mode and you tried to update a table with delete from t1 where a+0=1; ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5; -ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok +ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay update t1 set b="a" limit 1; update t1 set b="a" where b="b" limit 2; delete from t1 where b="test" limit 1; @@ -42,7 +42,7 @@ SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS; 2 0 insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); SELECT * from t1 order by a; -ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok +ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay SET SQL_BIG_SELECTS=1; SELECT * from t1 order by a; a b @@ -52,7 +52,7 @@ a b 5 a SET MAX_JOIN_SIZE=2; SELECT * from t1; -ERROR 42000: The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok +ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay SET MAX_JOIN_SIZE=DEFAULT; SELECT * from t1; a b diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 86a90d553da..653a8e7302e 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -378,21 +378,21 @@ show create database test_$1; Database Create Database test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */ drop table t1; -ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1' drop database test_$1; -ERROR 42000: Access denied for user: 'mysqltest_1'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1' select * from test_$1.t1; -ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1' show create database test_$1; -ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1' drop table test_$1.t1; -ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1' drop database test_$1; -ERROR 42000: Access denied for user: 'mysqltest_2'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1' select * from test_$1.t1; -ERROR 42000: Access denied for user: 'mysqltest_3'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1' show create database test_$1; -ERROR 42000: Access denied for user: 'mysqltest_3'@'localhost' to database 'test_$1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1' drop table test_$1.t1; drop database test_$1; delete from mysql.user diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a6ff608ab66..5ab36dacaaf 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -6,7 +6,7 @@ explain extended select (select 2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1249 Select 2 was reduced during optimisation +Note 1249 Select 2 was reduced during optimization Note 1003 select 2 AS `(select 2)` SELECT (SELECT 1) UNION SELECT (SELECT 2); (SELECT 1) @@ -18,8 +18,8 @@ id select_type table type possible_keys key key_len ref rows Extra 3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL Warnings: -Note 1249 Select 2 was reduced during optimisation -Note 1249 Select 4 was reduced during optimisation +Note 1249 Select 2 was reduced during optimization +Note 1249 Select 4 was reduced during optimization Note 1003 select 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)` SELECT (SELECT (SELECT 0 UNION SELECT 0)); (SELECT (SELECT 0 UNION SELECT 0)) @@ -31,7 +31,7 @@ id select_type table type possible_keys key key_len ref rows Extra 4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL Warnings: -Note 1249 Select 2 was reduced during optimisation +Note 1249 Select 2 was reduced during optimization Note 1003 select (select 0 AS `0` union select 0 AS `0`) AS `(SELECT (SELECT 0 UNION SELECT 0))` SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a; ERROR 42S22: Reference 'a' not supported (forward reference in item list) @@ -73,7 +73,7 @@ SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a)); 1 1 select (SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(1)); -ERROR HY000: Wrong usage of PROCEDURE and subquery +ERROR HY000: Incorrect usage of PROCEDURE and subquery SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE((SELECT 1)); ERROR HY000: Incorrect parameters to procedure 'ANALYSE' SELECT (SELECT 1) as a FROM (SELECT 1) b WHERE (SELECT a) IS NULL; @@ -328,12 +328,12 @@ patient_uq clinic_uq explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t6 ALL NULL NULL NULL NULL 4 Using where -2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 +2 DEPENDENT SUBQUERY t7 eq_ref PRIMARY PRIMARY 4 test.t6.clinic_uq 1 Using index Warnings: Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1 -Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select test.t7.uq AS `uq`,test.t7.name AS `name` from test.t7 where (test.t7.uq = test.t6.clinic_uq)) +Note 1003 select test.t6.patient_uq AS `patient_uq`,test.t6.clinic_uq AS `clinic_uq` from test.t6 where exists(select 1 AS `Not_used` from test.t7 where (test.t7.uq = test.t6.clinic_uq)) select * from t1 where a= (select a from t2,t4 where t2.b=t4.b); -ERROR 23000: Column: 'a' in field list is ambiguous +ERROR 23000: Column 'a' in field list is ambiguous drop table t1,t2,t3; CREATE TABLE t3 (a varchar(20),b char(1) NOT NULL default '0'); INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b'); @@ -712,7 +712,7 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ref id id 5 const 1 Using where; Using index Warnings: -Note 1249 Select 2 was reduced during optimisation +Note 1249 Select 2 was reduced during optimization Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = 1) SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id @@ -724,8 +724,8 @@ EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ref id id 5 const 1 Using where; Using index Warnings: -Note 1249 Select 3 was reduced during optimisation -Note 1249 Select 2 was reduced during optimisation +Note 1249 Select 3 was reduced during optimization +Note 1249 Select 2 was reduced during optimization Note 1003 select test.t2.id AS `id` from test.t2 where (test.t2.id = (1 + 1)) EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3); id select_type table type possible_keys key key_len ref rows Extra @@ -859,7 +859,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Warnings: Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1 -Note 1249 Select 2 was reduced during optimisation +Note 1249 Select 2 was reduced during optimization Note 1003 select (test.t1.a + 1) AS `(select a+1)` from test.t1 select (select a+1) from t1; (select a+1) @@ -976,7 +976,7 @@ ERROR 42S02: Table 'test.t1' doesn't exist CREATE TABLE t1 (a int, KEY(a)); HANDLER t1 OPEN; HANDLER t1 READ a=((SELECT 1)); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1))' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT 1))' at line 1 HANDLER t1 CLOSE; drop table t1; create table t1 (a int); @@ -1075,24 +1075,24 @@ CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT 1)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(1) NOT NULL default '0', - `(SELECT 1)` bigint(1) NOT NULL default '0' + `a` bigint(20) NOT NULL default '0', + `(SELECT 1)` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(1) NOT NULL default '0', - `(SELECT a)` bigint(1) NOT NULL default '0' + `a` bigint(20) NOT NULL default '0', + `(SELECT a)` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(1) NOT NULL default '0', - `(SELECT a+0)` bigint(17) NOT NULL default '0' + `a` bigint(20) NOT NULL default '0', + `(SELECT a+0)` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a; @@ -1102,7 +1102,7 @@ a SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(17) NOT NULL default '0' + `a` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int); @@ -1714,7 +1714,7 @@ create table t1(id int); create table t2(id int); create table t3(flag int); select (select * from t3 where id not null) from t1, t2; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) from t1, t2' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null) from t1, t2' at line 1 drop table t1,t2,t3; CREATE TABLE t1 (id INT); CREATE TABLE t2 (id INT); @@ -1817,3 +1817,77 @@ a 1 3 DROP TABLE t1; +create table t1 (a int, b int); +insert into t1 values (1,2),(3,4); +select * from t1 up where exists (select * from t1 where t1.a=up.a); +a b +1 2 +3 4 +explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY up ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where +Warnings: +Note 1276 Field or reference 'up.a' of SELECT #2 was resolved in SELECT #1 +Note 1003 select test.up.a AS `a`,test.up.b AS `b` from test.t1 up where exists(select 1 AS `Not_used` from test.t1 where (test.t1.a = test.up.a)) +drop table t1; +CREATE TABLE t1 (t1_a int); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (t2_a int, t2_b int, PRIMARY KEY (t2_a, t2_b)); +INSERT INTO t2 VALUES (1, 1), (1, 2); +SELECT * FROM t1, t2 table2 WHERE t1_a = 1 AND table2.t2_a = 1 +HAVING table2.t2_b = (SELECT MAX(t2_b) FROM t2 WHERE t2_a = table2.t2_a); +t1_a t2_a t2_b +1 1 2 +DROP TABLE t1, t2; +CREATE TABLE t1 (id int(11) default NULL,name varchar(10) default NULL); +INSERT INTO t1 VALUES (1,'Tim'),(2,'Rebecca'),(3,NULL); +CREATE TABLE t2 (id int(11) default NULL, pet varchar(10) default NULL); +INSERT INTO t2 VALUES (1,'Fido'),(2,'Spot'),(3,'Felix'); +SELECT a.*, b.* FROM (SELECT * FROM t1) AS a JOIN t2 as b on a.id=b.id; +id name id pet +1 Tim 1 Fido +2 Rebecca 2 Spot +3 NULL 3 Felix +drop table t1,t2; +CREATE TABLE t1 ( a int, b int ); +CREATE TABLE t2 ( c int, d int ); +INSERT INTO t1 VALUES (1,2), (2,3), (3,4); +SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +abc b +1 2 +2 3 +3 4 +INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +select * from t2; +c d +1 2 +2 3 +3 4 +CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +select * from t3; +abc b +1 2 +2 3 +3 4 +prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +deallocate prepare stmt1; +select * from t2; +c d +1 2 +2 3 +3 4 +1 2 +2 3 +3 4 +drop table t3; +prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +select * from t3; +abc b +1 2 +2 3 +3 4 +deallocate prepare stmt1; +DROP TABLE t1, t2, t3; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index d53ace261bf..1f09a20abc5 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -9,6 +9,11 @@ help_relation help_topic host tables_priv +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type user show create table db; Table Create Table diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result index 15f0d4121c7..10944c3706e 100644 --- a/mysql-test/r/timezone.result +++ b/mysql-test/r/timezone.result @@ -1,7 +1,7 @@ DROP TABLE IF EXISTS t1; -show variables like "timezone"; +show variables like "system_time_zone"; Variable_name Value -timezone MET +system_time_zone MET select @a:=FROM_UNIXTIME(1); @a:=FROM_UNIXTIME(1) 1970-01-01 01:00:01 @@ -32,6 +32,13 @@ ts from_unixtime(ts) 1048989599 2003-03-30 03:59:59 1048989601 2003-03-30 04:00:01 DROP TABLE t1; +CREATE TABLE t1 (ts timestamp); +INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'), +('2003-03-30 02:59:59'), +('2003-03-30 03:00:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +DROP TABLE t1; select unix_timestamp('1970-01-01 01:00:00'), unix_timestamp('1970-01-01 01:00:01'), unix_timestamp('2038-01-01 00:59:59'), diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result new file mode 100644 index 00000000000..5361ff4ffe6 --- /dev/null +++ b/mysql-test/r/timezone2.result @@ -0,0 +1,246 @@ +drop table if exists t1; +create table t1 (ts timestamp); +set time_zone='+00:00'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()) +0 +insert into t1 (ts) values ('2003-03-30 02:30:00'); +set time_zone='+10:30'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()) +-37800 +insert into t1 (ts) values ('2003-03-30 02:30:00'); +set time_zone='-10:00'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()) +36000 +insert into t1 (ts) values ('2003-03-30 02:30:00'); +select * from t1; +ts +2003-03-29 16:30:00 +2003-03-29 06:00:00 +2003-03-30 02:30:00 +drop table t1; +select Name from mysql.time_zone_name where Name in +('UTC','Universal','MET','Europe/Moscow','leap/Europe/Moscow'); +Name +Europe/Moscow +leap/Europe/Moscow +MET +Universal +UTC +create table t1 (i int, ts timestamp); +set time_zone='MET'; +insert into t1 (i, ts) values +(unix_timestamp('2003-03-01 00:00:00'),'2003-03-01 00:00:00'); +insert into t1 (i, ts) values +(unix_timestamp('2003-03-30 01:59:59'),'2003-03-30 01:59:59'), +(unix_timestamp('2003-03-30 02:30:00'),'2003-03-30 02:30:00'), +(unix_timestamp('2003-03-30 03:00:00'),'2003-03-30 03:00:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +insert into t1 (i, ts) values +(unix_timestamp('2003-05-01 00:00:00'),'2003-05-01 00:00:00'); +insert into t1 (i, ts) values +(unix_timestamp('2003-10-26 01:00:00'),'2003-10-26 01:00:00'), +(unix_timestamp('2003-10-26 02:00:00'),'2003-10-26 02:00:00'), +(unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59'), +(unix_timestamp('2003-10-26 04:00:00'),'2003-10-26 04:00:00'), +(unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59'); +set time_zone='UTC'; +select * from t1; +i ts +1046473200 2003-02-28 23:00:00 +1048985999 2003-03-30 00:59:59 +1048986000 2003-03-30 01:00:00 +1048986000 2003-03-30 01:00:00 +1051740000 2003-04-30 22:00:00 +1067122800 2003-10-25 23:00:00 +1067126400 2003-10-26 00:00:00 +1067129999 2003-10-26 00:59:59 +1067137200 2003-10-26 03:00:00 +1067129999 2003-10-26 00:59:59 +delete from t1; +set time_zone='Europe/Moscow'; +insert into t1 (i, ts) values +(unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'), +(unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'), +(unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'), +(unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +select * from t1; +i ts +1072904400 2004-01-01 00:00:00 +1080428400 2004-03-28 03:00:00 +1091304000 2003-08-01 00:00:00 +1099175400 2004-10-31 02:30:00 +delete from t1; +set time_zone='leap/Europe/Moscow'; +insert into t1 (i, ts) values +(unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'), +(unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'), +(unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'), +(unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00'); +Warnings: +Warning 1299 Invalid TIMESTAMP value in column 'ts' at row 2 +select * from t1; +i ts +1072904422 2004-01-01 00:00:00 +1080428422 2004-03-28 03:00:00 +1091304022 2003-08-01 00:00:00 +1099175422 2004-10-31 02:30:00 +delete from t1; +insert into t1 (i, ts) values +(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), +(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); +select * from t1; +i ts +362793608 1981-07-01 03:59:59 +362793610 1981-07-01 04:00:00 +select from_unixtime(362793609); +from_unixtime(362793609) +1981-07-01 03:59:60 +drop table t1; +create table t1 (ts timestamp); +set time_zone='UTC'; +insert into t1 values ('0000-00-00 00:00:00'),('1969-12-31 23:59:59'), +('1970-01-01 00:00:00'),('1970-01-01 00:00:01'), +('2037-12-31 23:59:59'),('2038-01-01 00:00:00'); +Warnings: +Warning 1264 Data truncated; out of range for column 'ts' at row 2 +Warning 1264 Data truncated; out of range for column 'ts' at row 3 +Warning 1264 Data truncated; out of range for column 'ts' at row 6 +select * from t1; +ts +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +1970-01-01 00:00:01 +2037-12-31 23:59:59 +0000-00-00 00:00:00 +delete from t1; +set time_zone='MET'; +insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 00:30:00'), +('1970-01-01 01:00:00'),('1970-01-01 01:00:01'), +('2038-01-01 00:59:59'),('2038-01-01 01:00:00'); +Warnings: +Warning 1264 Data truncated; out of range for column 'ts' at row 2 +Warning 1264 Data truncated; out of range for column 'ts' at row 3 +Warning 1264 Data truncated; out of range for column 'ts' at row 6 +select * from t1; +ts +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +1970-01-01 01:00:01 +2038-01-01 00:59:59 +0000-00-00 00:00:00 +delete from t1; +set time_zone='+01:30'; +insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 01:00:00'), +('1970-01-01 01:30:00'),('1970-01-01 01:30:01'), +('2038-01-01 01:29:59'),('2038-01-01 01:30:00'); +Warnings: +Warning 1264 Data truncated; out of range for column 'ts' at row 2 +Warning 1264 Data truncated; out of range for column 'ts' at row 3 +Warning 1264 Data truncated; out of range for column 'ts' at row 6 +select * from t1; +ts +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +1970-01-01 01:30:01 +2038-01-01 01:29:59 +0000-00-00 00:00:00 +drop table t1; +show variables like 'time_zone'; +Variable_name Value +time_zone +01:30 +set time_zone = default; +show variables like 'time_zone'; +Variable_name Value +time_zone SYSTEM +set time_zone= '0'; +ERROR HY000: Unknown or incorrect time zone: '0' +set time_zone= '0:0'; +ERROR HY000: Unknown or incorrect time zone: '0:0' +set time_zone= '-20:00'; +ERROR HY000: Unknown or incorrect time zone: '-20:00' +set time_zone= '+20:00'; +ERROR HY000: Unknown or incorrect time zone: '+20:00' +set time_zone= 'Some/Unknown/Time/Zone'; +ERROR HY000: Unknown or incorrect time zone: 'Some/Unknown/Time/Zone' +select convert_tz(now(),'UTC', 'Universal') = now(); +convert_tz(now(),'UTC', 'Universal') = now() +1 +select convert_tz(now(),'utc', 'UTC') = now(); +convert_tz(now(),'utc', 'UTC') = now() +1 +select convert_tz('1917-11-07 12:00:00', 'MET', 'UTC'); +convert_tz('1917-11-07 12:00:00', 'MET', 'UTC') +1917-11-07 12:00:00 +select convert_tz('1970-01-01 01:00:00', 'MET', 'UTC'); +convert_tz('1970-01-01 01:00:00', 'MET', 'UTC') +1970-01-01 01:00:00 +select convert_tz('1970-01-01 01:00:01', 'MET', 'UTC'); +convert_tz('1970-01-01 01:00:01', 'MET', 'UTC') +1970-01-01 00:00:01 +select convert_tz('2003-03-01 00:00:00', 'MET', 'UTC'); +convert_tz('2003-03-01 00:00:00', 'MET', 'UTC') +2003-02-28 23:00:00 +select convert_tz('2003-03-30 01:59:59', 'MET', 'UTC'); +convert_tz('2003-03-30 01:59:59', 'MET', 'UTC') +2003-03-30 00:59:59 +select convert_tz('2003-03-30 02:30:00', 'MET', 'UTC'); +convert_tz('2003-03-30 02:30:00', 'MET', 'UTC') +2003-03-30 01:00:00 +select convert_tz('2003-03-30 03:00:00', 'MET', 'UTC'); +convert_tz('2003-03-30 03:00:00', 'MET', 'UTC') +2003-03-30 01:00:00 +select convert_tz('2003-05-01 00:00:00', 'MET', 'UTC'); +convert_tz('2003-05-01 00:00:00', 'MET', 'UTC') +2003-04-30 22:00:00 +select convert_tz('2003-10-26 01:00:00', 'MET', 'UTC'); +convert_tz('2003-10-26 01:00:00', 'MET', 'UTC') +2003-10-25 23:00:00 +select convert_tz('2003-10-26 02:00:00', 'MET', 'UTC'); +convert_tz('2003-10-26 02:00:00', 'MET', 'UTC') +2003-10-26 00:00:00 +select convert_tz('2003-10-26 02:59:59', 'MET', 'UTC'); +convert_tz('2003-10-26 02:59:59', 'MET', 'UTC') +2003-10-26 00:59:59 +select convert_tz('2003-10-26 04:00:00', 'MET', 'UTC'); +convert_tz('2003-10-26 04:00:00', 'MET', 'UTC') +2003-10-26 03:00:00 +select convert_tz('2038-01-01 00:59:59', 'MET', 'UTC'); +convert_tz('2038-01-01 00:59:59', 'MET', 'UTC') +2037-12-31 23:59:59 +select convert_tz('2038-01-01 01:00:00', 'MET', 'UTC'); +convert_tz('2038-01-01 01:00:00', 'MET', 'UTC') +2038-01-01 01:00:00 +select convert_tz('2103-01-01 04:00:00', 'MET', 'UTC'); +convert_tz('2103-01-01 04:00:00', 'MET', 'UTC') +2103-01-01 04:00:00 +create table t1 (tz varchar(3)); +insert into t1 (tz) values ('MET'), ('UTC'); +select tz, convert_tz('2003-12-31 00:00:00',tz,'UTC'), convert_tz('2003-12-31 00:00:00','UTC',tz) from t1 order by tz; +tz convert_tz('2003-12-31 00:00:00',tz,'UTC') convert_tz('2003-12-31 00:00:00','UTC',tz) +MET 2003-12-30 23:00:00 2003-12-31 01:00:00 +UTC 2003-12-31 00:00:00 2003-12-31 00:00:00 +drop table t1; +select convert_tz('2003-12-31 04:00:00', NULL, 'UTC'); +convert_tz('2003-12-31 04:00:00', NULL, 'UTC') +NULL +select convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC'); +convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC') +NULL +select convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone'); +convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone') +NULL +select convert_tz('2003-12-31 04:00:00', 'MET', NULL); +convert_tz('2003-12-31 04:00:00', 'MET', NULL) +NULL +select convert_tz( NULL, 'MET', 'UTC'); +convert_tz( NULL, 'MET', 'UTC') +NULL diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 6792f2f4c2c..580fc9a8d0b 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -27,7 +27,7 @@ t3 CREATE TABLE `t3` ( drop table t1,t2,t3 #; CREATE TABLE t1 (a char(257) default "hello"); -ERROR 42000: Too big column length for column 'a' (max = 255). Use BLOB instead +ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB instead CREATE TABLE t2 (a blob default "hello"); ERROR 42000: BLOB/TEXT column 'a' can't have a default value drop table if exists t1,t2; diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index cebd005c2c8..e77ef9f975b 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -73,3 +73,9 @@ SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2. DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800 drop table t1,t2; +CREATE TABLE t1 (f1 time default NULL, f2 time default NULL); +INSERT INTO t1 (f1, f2) VALUES ('09:00', '12:00'); +SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1; +DATE_FORMAT(f1, "%l.%i %p") DATE_FORMAT(f2, "%l.%i %p") +9.00 AM 12.00 PM +DROP TABLE t1; diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 66eb744e7ce..524bc9c50d4 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -1,12 +1,6 @@ drop table if exists t1; create table t1 (t datetime); -insert into t1 values(101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); -Warnings: -Warning 1265 Data truncated for column 't' at row 13 -Warning 1265 Data truncated for column 't' at row 14 -Warning 1265 Data truncated for column 't' at row 15 -Warning 1265 Data truncated for column 't' at row 16 -Warning 1265 Data truncated for column 't' at row 17 +insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000); select * from t1; t 2000-01-01 00:00:00 @@ -21,11 +15,8 @@ t 1999-12-31 23:59:59 1000-01-01 00:00:00 9999-12-31 23:59:59 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 +2003-01-00 00:00:00 +2003-00-00 00:00:00 delete from t1 where t > 0; optimize table t1; Table Op Msg_type Msg_text @@ -34,13 +25,7 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK delete from t1; -insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); -Warnings: -Warning 1264 Data truncated, out of range for column 't' at row 14 -Warning 1264 Data truncated, out of range for column 't' at row 15 -Warning 1264 Data truncated, out of range for column 't' at row 16 -Warning 1264 Data truncated, out of range for column 't' at row 17 -Warning 1264 Data truncated, out of range for column 't' at row 18 +insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); select * from t1; t 2000-01-01 00:00:00 @@ -56,11 +41,8 @@ t 1999-12-31 23:59:59 1000-01-01 00:00:00 9999-12-31 23:59:59 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 -0000-00-00 00:00:00 +2003-01-00 00:00:00 +2003-00-00 00:00:00 drop table t1; CREATE TABLE t1 (a timestamp, b date, c time, d datetime); insert into t1 (b,c,d) values(now(),curtime(),now()); @@ -114,3 +96,43 @@ insert into t1 values (now(), now()); select * from t1 where a is null or b is null; a b drop table t1; +create table t1 (t datetime); +insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +Warnings: +Warning 1265 Data truncated for column 't' at row 1 +Warning 1265 Data truncated for column 't' at row 2 +Warning 1265 Data truncated for column 't' at row 3 +Warning 1265 Data truncated for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 5 +select * from t1; +t +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +delete from t1; +insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +Warnings: +Warning 1264 Data truncated; out of range for column 't' at row 1 +Warning 1264 Data truncated; out of range for column 't' at row 2 +Warning 1264 Data truncated; out of range for column 't' at row 3 +Warning 1264 Data truncated; out of range for column 't' at row 4 +Warning 1264 Data truncated; out of range for column 't' at row 5 +select * from t1; +t +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +delete from t1; +insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); +Warnings: +Warning 1264 Data truncated; out of range for column 't' at row 1 +Warning 1264 Data truncated; out of range for column 't' at row 2 +select * from t1; +t +0000-00-00 00:00:00 +2003-01-01 00:00:00 +drop table t1; diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index dc78369f583..a9dcabd121e 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -158,14 +158,14 @@ insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 Warning 1265 Data truncated for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: Warning 1265 Data truncated for column 'a' at row 3 @@ -201,29 +201,29 @@ drop table t1; create table t1 (a decimal(10,2) unsigned); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 6 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 Warning 1265 Data truncated for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: Warning 1265 Data truncated for column 'a' at row 3 @@ -259,29 +259,29 @@ drop table t1; create table t1 (a decimal(10,2) zerofill); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 6 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 Warning 1265 Data truncated for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: Warning 1265 Data truncated for column 'a' at row 3 @@ -321,13 +321,13 @@ insert into t1 values (00000000000001),(+0000000000001),(-0000000000001); insert into t1 values (+111111111.11),(111111111.11),(-11111111.11); insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values (1e+100),(1e-100),(-1e+100); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 3 insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0); select * from t1; a @@ -361,8 +361,8 @@ drop table t1; create table t1 (a decimal); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 7 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a -9999999999 @@ -376,9 +376,9 @@ drop table t1; create table t1 (a decimal unsigned); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 7 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a 0 @@ -392,9 +392,9 @@ drop table t1; create table t1 (a decimal zerofill); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 7 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a 0000000000 @@ -408,9 +408,9 @@ drop table t1; create table t1 (a decimal unsigned zerofill); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); Warnings: -Warning 1264 Data truncated, out of range for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 7 +Warning 1264 Data truncated; out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 2 +Warning 1264 Data truncated; out of range for column 'a' at row 7 select * from t1; a 0000000000 @@ -425,7 +425,7 @@ create table t1(a decimal(10,0)); insert into t1 values ("1e4294967295"); Warnings: Warning 1265 Data truncated for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 select * from t1; a 99999999999 @@ -433,17 +433,24 @@ delete from t1; insert into t1 values("1e4294967297"); Warnings: Warning 1265 Data truncated for column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'a' at row 1 select * from t1; a 99999999999 drop table t1; CREATE TABLE t1 (a_dec DECIMAL(-1,0)); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1 CREATE TABLE t1 (a_dec DECIMAL(-2,1)); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-2,1))' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2,1))' at line 1 CREATE TABLE t1 (a_dec DECIMAL(-1,1)); -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1 +CREATE TABLE t1 (a_dec DECIMAL(0,11)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a_dec` decimal(12,11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; create table t1(a decimal(7,3)); insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000'); select * from t1; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index f044ced2342..30de1e62df7 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -15,8 +15,8 @@ f1 float NULL YES NULL select,insert,update,references f2 double NULL YES NULL select,insert,update,references insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); Warnings: -Warning 1264 Data truncated, out of range for column 'f1' at row 7 -Warning 1264 Data truncated, out of range for column 'f1' at row 8 +Warning 1264 Data truncated; out of range for column 'f1' at row 7 +Warning 1264 Data truncated; out of range for column 'f1' at row 8 insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); select * from t1; f1 f2 diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 8d80f342c1c..e803fde14a6 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -89,33 +89,33 @@ insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,N insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); Warnings: -Warning 1264 Data truncated, out of range for column 'utiny' at row 1 -Warning 1264 Data truncated, out of range for column 'ushort' at row 1 -Warning 1264 Data truncated, out of range for column 'umedium' at row 1 -Warning 1264 Data truncated, out of range for column 'ulong' at row 1 +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1264 Data truncated; out of range for column 'ulong' at row 1 Warning 1265 Data truncated for column 'options' at row 1 Warning 1265 Data truncated for column 'flags' at row 1 insert into t1 values (0,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,NULL,0,0,0,-4294967295,-4294967295,-4294967295,'-4294967295',0,"one,two,tree"); Warnings: Warning 1265 Data truncated for column 'string' at row 1 -Warning 1264 Data truncated, out of range for column 'tiny' at row 1 -Warning 1264 Data truncated, out of range for column 'short' at row 1 -Warning 1264 Data truncated, out of range for column 'medium' at row 1 -Warning 1264 Data truncated, out of range for column 'long_int' at row 1 -Warning 1264 Data truncated, out of range for column 'utiny' at row 1 -Warning 1264 Data truncated, out of range for column 'ushort' at row 1 -Warning 1264 Data truncated, out of range for column 'umedium' at row 1 -Warning 1264 Data truncated, out of range for column 'ulong' at row 1 +Warning 1264 Data truncated; out of range for column 'tiny' at row 1 +Warning 1264 Data truncated; out of range for column 'short' at row 1 +Warning 1264 Data truncated; out of range for column 'medium' at row 1 +Warning 1264 Data truncated; out of range for column 'long_int' at row 1 +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 +Warning 1264 Data truncated; out of range for column 'ulong' at row 1 Warning 1265 Data truncated for column 'options' at row 1 insert into t1 values (0,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,NULL,0,0,0,4294967295,4294967295,4294967295,'4294967295',0,0); Warnings: -Warning 1264 Data truncated, out of range for column 'tiny' at row 1 -Warning 1264 Data truncated, out of range for column 'short' at row 1 -Warning 1264 Data truncated, out of range for column 'medium' at row 1 -Warning 1264 Data truncated, out of range for column 'long_int' at row 1 -Warning 1264 Data truncated, out of range for column 'utiny' at row 1 -Warning 1264 Data truncated, out of range for column 'ushort' at row 1 -Warning 1264 Data truncated, out of range for column 'umedium' at row 1 +Warning 1264 Data truncated; out of range for column 'tiny' at row 1 +Warning 1264 Data truncated; out of range for column 'short' at row 1 +Warning 1264 Data truncated; out of range for column 'medium' at row 1 +Warning 1264 Data truncated; out of range for column 'long_int' at row 1 +Warning 1264 Data truncated; out of range for column 'utiny' at row 1 +Warning 1264 Data truncated; out of range for column 'ushort' at row 1 +Warning 1264 Data truncated; out of range for column 'umedium' at row 1 Warning 1265 Data truncated for column 'options' at row 1 insert into t1 (tiny) values (1); select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1; diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 68b56802120..025cf2a57f1 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -25,11 +25,11 @@ t 36:30:31 insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a"); Warnings: -Note 1292 Truncated wrong time value: '10.22.22' -Warning 1264 Data truncated, out of range for column 't' at row 2 -Warning 1264 Data truncated, out of range for column 't' at row 3 -Warning 1264 Data truncated, out of range for column 't' at row 4 -Note 1292 Truncated wrong time value: '12.45a' +Warning 1265 Data truncated for column 't' at row 1 +Warning 1264 Data truncated; out of range for column 't' at row 2 +Warning 1264 Data truncated; out of range for column 't' at row 3 +Warning 1264 Data truncated; out of range for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 6 select * from t1; t 10:22:33 diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 976b3e72385..aa8c0903558 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -43,13 +43,7 @@ date_format(a,"%Y %y") year(a) year(now()) 1970 70 1970 1970 drop table t1; create table t1 (ix timestamp); -insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101); -Warnings: -Warning 1265 Data truncated for column 'ix' at row 10 -Warning 1265 Data truncated for column 'ix' at row 11 -Warning 1265 Data truncated for column 'ix' at row 12 -Warning 1265 Data truncated for column 'ix' at row 13 -Warning 1265 Data truncated for column 'ix' at row 14 +insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000); select ix+0 from t1; ix+0 19991101000000 @@ -61,24 +55,14 @@ ix+0 19990501000000 19991101000000 19990501000000 -0 -0 -0 -0 -0 delete from t1; -insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"); +insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"); select ix+0 from t1; ix+0 19991101000000 19990102030405 19990630232922 19990601000000 -0 -0 -0 -0 -0 drop table t1; CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp); INSERT INTO t1 VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959); @@ -128,16 +112,66 @@ t2 t4 t6 t8 t10 t12 t14 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 drop table t1; +create table t1 (ix timestamp); +insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000); +Warnings: +Warning 1265 Data truncated for column 'ix' at row 2 +Warning 1265 Data truncated for column 'ix' at row 3 +Warning 1265 Data truncated for column 'ix' at row 4 +Warning 1265 Data truncated for column 'ix' at row 5 +Warning 1265 Data truncated for column 'ix' at row 6 +Warning 1265 Data truncated for column 'ix' at row 7 +Warning 1265 Data truncated for column 'ix' at row 8 +select ix+0 from t1; +ix+0 +0 +0 +0 +0 +0 +0 +0 +0 +delete from t1; +insert into t1 values ("00000000000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"),("20031200000000"),("20030000000000"); +Warnings: +Warning 1265 Data truncated for column 'ix' at row 2 +Warning 1265 Data truncated for column 'ix' at row 3 +Warning 1265 Data truncated for column 'ix' at row 4 +Warning 1265 Data truncated for column 'ix' at row 5 +Warning 1265 Data truncated for column 'ix' at row 6 +Warning 1265 Data truncated for column 'ix' at row 7 +Warning 1265 Data truncated for column 'ix' at row 8 +select ix+0 from t1; +ix+0 +0 +0 +0 +0 +0 +0 +0 +0 +delete from t1; +insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); +Warnings: +Warning 1265 Data truncated for column 'ix' at row 1 +Warning 1265 Data truncated for column 'ix' at row 2 +select ix+0 from t1; +ix+0 +0 +20030101000000 +drop table t1; create table t1 (t1 timestamp, t2 timestamp default now()); -ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause create table t1 (t1 timestamp, t2 timestamp on update now()); -ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause create table t1 (t1 timestamp, t2 timestamp default now() on update now()); -ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause create table t1 (t1 timestamp default now(), t2 timestamp on update now()); -ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now()); -ERROR HY000: Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause +ERROR HY000: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp); SET TIMESTAMP=1000000000; insert into t1 values (); diff --git a/mysql-test/r/type_uint.result b/mysql-test/r/type_uint.result index f312e9b7f64..07eb47faa7c 100644 --- a/mysql-test/r/type_uint.result +++ b/mysql-test/r/type_uint.result @@ -4,7 +4,7 @@ create table t1 (this int unsigned); insert into t1 values (1); insert into t1 values (-1); Warnings: -Warning 1264 Data truncated, out of range for column 'this' at row 1 +Warning 1264 Data truncated; out of range for column 'this' at row 1 select * from t1; this 1 diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 0735ea4dc40..bed4e890c18 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -81,7 +81,7 @@ a b 2 b 1 a (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b; -ERROR 42000: Table 't1' from one of SELECT's can not be used in global ORDER clause +ERROR 42000: Table 't1' from one of the SELECTs cannot be used in global ORDER clause explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 4 @@ -117,11 +117,11 @@ ERROR 21000: The used SELECT statements have a different number of columns explain select a,b from t1 union select 1 limit 0; ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 into outfile 'skr' union select a,b from t2; -ERROR HY000: Wrong usage of UNION and INTO +ERROR HY000: Incorrect usage of UNION and INTO select a,b from t1 order by a union select a,b from t2; -ERROR HY000: Wrong usage of UNION and ORDER BY +ERROR HY000: Incorrect usage of UNION and ORDER BY insert into t3 select a from t1 order by a union select a from t2; -ERROR HY000: Wrong usage of UNION and ORDER BY +ERROR HY000: Incorrect usage of UNION and ORDER BY create table t3 select a,b from t1 union select a from t2; ERROR 21000: The used SELECT statements have a different number of columns select a,b from t1 union select a from t2; @@ -131,7 +131,7 @@ ERROR 21000: The used SELECT statements have a different number of columns select a from t1 union select * from t2; ERROR 21000: The used SELECT statements have a different number of columns select * from t1 union select SQL_BUFFER_RESULT * from t2; -ERROR 42000: Wrong usage/placement of 'SQL_BUFFER_RESULT' +ERROR 42000: Incorrect usage/placement of 'SQL_BUFFER_RESULT' create table t3 select a,b from t1 union all select a,b from t2; insert into t3 select a,b from t1 union all select a,b from t2; replace into t3 select a,b as c from t1 union all select a,b from t2; @@ -341,7 +341,7 @@ select found_rows(); found_rows() 4 (SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2; a 1 @@ -424,7 +424,7 @@ a 3 3 (SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1; -ERROR 42000: Wrong usage/placement of 'SQL_CALC_FOUND_ROWS' +ERROR 42000: Incorrect usage/placement of 'SQL_CALC_FOUND_ROWS' create temporary table t1 select a from t1 union select a from t2; drop temporary table t1; create table t1 select a from t1 union select a from t2; @@ -546,7 +546,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` char(2) NOT NULL default '' + `a` char(20) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; @@ -557,7 +557,7 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` double(4,1) NOT NULL default '0.0' + `a` double(53,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); @@ -647,7 +647,7 @@ f show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `f` binary(12) default NULL + `f` binary(24) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT y from t2 UNION select da from t2; @@ -795,7 +795,7 @@ select * from t1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `1` bigint(1) NOT NULL default '0' + `1` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 select _latin1"test" union select _latin2"testt" ; @@ -953,3 +953,10 @@ CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); explain (select * from t1) union (select * from t2) order by not_existing_column; ERROR 42S22: Unknown column 'not_existing_column' in 'order clause' drop table t1, t2; +CREATE TABLE t1 (uid int(1)); +INSERT INTO t1 SELECT 150; +SELECT 'a' UNION SELECT uid FROM t1; +a +a +150 +drop table t1; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 605780a7280..2750478c1c5 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -174,24 +174,24 @@ set @v=convert('abc' using ucs2); insert into t2 values (@v); show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 79 User var 1 79 @`a b`=_latin1'hello' COLLATE latin1_swedish_ci +master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) -master-bin.000001 184 User var 1 184 @`var1`=_latin1'\';aaa' COLLATE latin1_swedish_ci +master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci master-bin.000001 226 Query 1 226 use `test`; insert into t1 values (@var1) master-bin.000001 290 Query 1 290 use `test`; create table t2 (c char(30)) charset=ucs2 -master-bin.000001 366 User var 1 366 @`v`=_ucs2'\0a\0b\0c' COLLATE ucs2_general_ci +master-bin.000001 366 User var 1 366 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci master-bin.000001 406 Query 1 406 use `test`; insert into t2 values (@v) /*!40019 SET @@session.max_insert_delayed_threads=0*/; -SET @`a b`:=_latin1'hello' COLLATE latin1_swedish_ci; +SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci; use test; SET TIMESTAMP=10000; INSERT INTO t1 VALUES(@`a b`); -SET @`var1`:=_latin1'\';aaa' COLLATE latin1_swedish_ci; +SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci; SET TIMESTAMP=10000; insert into t1 values (@var1); SET TIMESTAMP=10000; create table t2 (c char(30)) charset=ucs2; -SET @`v`:=_ucs2'\0a\0b\0c' COLLATE ucs2_general_ci; +SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; SET TIMESTAMP=10000; insert into t2 values (@v); drop table t1, t2; diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index 26ce91286da..ab5779859ae 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -18,7 +18,7 @@ Warnings: Note 1003 select test.t1.ID AS `ID`,test.t1.UNIQ AS `UNIQ` from test.t1 where (test.t1.UNIQ = 4084688022709641610) drop table t1; select x'hello'; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'x'hello'' at line 1 select 0xfg; ERROR 42S22: Unknown column '0xfg' in 'field list' create table t1 select 1 as x, 2 as xx; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index cd86c69d8f0..41ea95cf933 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -217,7 +217,7 @@ ERROR 42000: Variable 'big_tables' can't be set to the value of 'OFFF' set unknown_variable=1; ERROR HY000: Unknown system variable 'unknown_variable' set max_join_size="hello"; -ERROR 42000: Wrong argument type to variable 'max_join_size' +ERROR 42000: Incorrect argument type to variable 'max_join_size' set storage_engine=UNKNOWN_TABLE_TYPE; ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE' set storage_engine=INNODB, big_tables=2; @@ -427,12 +427,12 @@ select @a, @b; @a @b 2 1 set @@global.global.key_buffer_size= 1; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1 set GLOBAL global.key_buffer_size= 1; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size= 1' at line 1 SELECT @@global.global.key_buffer_size; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1 SELECT @@global.session.key_buffer_size; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1 SELECT @@global.local.key_buffer_size; -ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1 +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key_buffer_size' at line 1 diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index 19d44ab6fea..d883feb7ce2 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -43,13 +43,13 @@ drop table t1; create table t1(a tinyint, b int not null, c date, d char(5)); load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2 Warning 1265 Data truncated for column 'd' at row 3 Warning 1265 Data truncated for column 'c' at row 4 Warning 1261 Row 5 doesn't contain data for all columns Warning 1265 Data truncated for column 'b' at row 6 -Warning 1262 Row 7 was truncated; It contained more data than there were input columns -Warning 1264 Data truncated, out of range for column 'a' at row 8 +Warning 1262 Row 7 was truncated; it contained more data than there were input columns +Warning 1264 Data truncated; out of range for column 'a' at row 8 select @@warning_count; @@warning_count 7 @@ -57,11 +57,11 @@ drop table t1; create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5)); insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test'); Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 1 -Warning 1264 Data truncated, out of range for column 'b' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +Warning 1264 Data truncated; out of range for column 'b' at row 2 Warning 1265 Data truncated for column 'c' at row 2 -Warning 1264 Data truncated, out of range for column 'a' at row 3 -Warning 1264 Data truncated, out of range for column 'b' at row 3 +Warning 1264 Data truncated; out of range for column 'a' at row 3 +Warning 1264 Data truncated; out of range for column 'b' at row 3 Warning 1265 Data truncated for column 'c' at row 3 alter table t1 modify c char(4); Warnings: @@ -70,7 +70,7 @@ Warning 1265 Data truncated for column 'c' at row 2 alter table t1 add d char(2); update t1 set a=NULL where a=10; Warnings: -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 2 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2 update t1 set c='mysql ab' where c='test'; Warnings: Warning 1265 Data truncated for column 'c' at row 4 @@ -86,7 +86,7 @@ Warnings: Warning 1265 Data truncated for column 'b' at row 1 Warning 1265 Data truncated for column 'b' at row 2 Warning 1265 Data truncated for column 'b' at row 3 -Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4 +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 4 Warning 1265 Data truncated for column 'b' at row 4 insert into t2(b) values('mysqlab'); Warnings: @@ -125,11 +125,11 @@ Warning 1266 Using storage engine MyISAM for table 't1' drop table t1; create table t1 (id int) type=heap; Warnings: -Warning 1287 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead +Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead alter table t1 type=myisam; Warnings: -Warning 1287 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead +Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead drop table t1; set table_type=MYISAM; Warnings: -Warning 1287 'table_type' is deprecated, use 'storage_engine' instead +Warning 1287 'table_type' is deprecated; use 'storage_engine' instead diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test new file mode 100644 index 00000000000..5c2e73e5af7 --- /dev/null +++ b/mysql-test/t/archive.test @@ -0,0 +1,1300 @@ +# +# Simple test for archive example +# Taken fromm the select test +# +-- source include/have_archive.inc + +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + +CREATE TABLE t1 ( + Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, + Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL +) ENGINE=archive; + +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, + 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 +) ENGINE=archive; + +# +# 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 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; +select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3; + +# +# 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_"; + +# +# Test for insert after select +# +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',''); +SELECT * FROM t2; +drop table t1, t2; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 99a75889431..73588a91aac 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -3,6 +3,7 @@ # --disable_warnings drop table if exists t1; +drop table if exists t2; --enable_warnings SET SQL_WARNINGS=1; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test new file mode 100644 index 00000000000..6ff1407247f --- /dev/null +++ b/mysql-test/t/ctype_uca.test @@ -0,0 +1,181 @@ +-- source include/have_ucs2.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# Test Unicode collations. +# + +set names utf8; +create table t1 (c1 char(10) character set utf8 collate utf8_bin); + +# +# Basic Latin +# +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); + +# +# Latin1 suppliment +# +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); + +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); + +# +# Latin extended-A, 0100-017F +# +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); + +# +# Latin extended-B, 0180-024F +# +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); + + +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); + +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; + +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; +--select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; + diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 5b1a5923ad4..b8574fb7623 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -47,6 +47,16 @@ LPAD(_ucs2 X'0420',10,_ucs2 X'0421') l, RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r; SHOW CREATE TABLE t1; DROP TABLE t1; + + +# +# BUG3946 +# + +create table t2(f1 Char(30)); +insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000"); +select lpad(f1, 12, "-o-/") from t2; +drop table t2; ###################################################### # # Test of like diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 6281f2a4249..e5405d9f1bd 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -73,3 +73,13 @@ create index idx_c1 on t1(c1); select c1 as 'using index' from t1 where c1 like cast(concat(0xA4A2, '%') as char character set ujis); select c1 as 'no index' from t1 where c1 like cast(concat('%',0xA4A2, '%') as char character set ujis); drop table t1; + + +# Bug 2077 +CREATE TABLE t1 ( + a char(1) NOT NULL default '', + b enum('¤¢','¤¤') default NULL +) CHARACTER SET ujis; +SHOW CREATE TABLE t1; +SHOW COLUMNS FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 4e68efeffc3..6a504a8533a 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -141,3 +141,19 @@ select * from t1 where a = 'b'; select * from t1 where a = 'b' and a = 'b'; select * from t1 where a = 'b' and a != 'b'; drop table t1; + +# +# Bug #3928 regexp [[:>:]] and UTF-8 +# +set names utf8; + +# This should return TRUE +select 'ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +select 'ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +select ' ваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +select ' ваÑÑ ' rlike '[[:<:]]ваÑÑ[[:>:]]'; + +# This should return FALSE +select 'ваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'; +select 'zваÑÑ' rlike '[[:<:]]ваÑÑ[[:>:]]'; +select 'zваÑÑz' rlike '[[:<:]]ваÑÑ[[:>:]]'; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index e370b545eff..56c8ce77627 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -98,3 +98,14 @@ select * from t11; delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a); select * from t11; drop table t11, t12, t2; + +# +# Bug #4198: deletion and KEYREAD +# + +create table t1 (a int, b int, unique key (a), key (b)); +insert into t1 values (3, 3), (7, 7); +delete t1 from t1 where a = 3; +check table t1; +select * from t1; +drop table t1; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 2448a1d3209..62343fa2af8 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -61,7 +61,7 @@ select grp,group_concat(c order by c) from t1 group by grp; # Test warnings -set group_concat_max_len = 5; +set group_concat_max_len = 4; select grp,group_concat(c) from t1 group by grp; show warnings; set group_concat_max_len = 1024; @@ -189,3 +189,15 @@ INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1), (2); SELECT GROUP_CONCAT(t1.a*t2.a ORDER BY t2.a) FROM t1, t2 GROUP BY t1.a; DROP TABLE t1, t2; + +# +# Bug #4035: group_concat() and HAVING +# + +CREATE TABLE t1 (a char(4)); +INSERT INTO t1 VALUES ('John'), ('Anna'), ('Bill'); +SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1 + HAVING names LIKE '%An%'; +SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1 + HAVING LEFT(names, 1) ='J'; +DROP TABLE t1; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 7966a2262f4..74f4c1bad44 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -396,3 +396,25 @@ create table t1 (a int); select variance(2) from t1; select stddev(2) from t1; drop table t1; + + +# +# cleunup() of optimized away count(*) and max/min +# +create table t1 (a int); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT COUNT(*) FROM t1'; +execute stmt1; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop table t1; + +create table t1 (a int, primary key(a)); +insert into t1 values (1),(2); +prepare stmt1 from 'SELECT max(a) FROM t1'; +execute stmt1; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop table t1; diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index 36c3a38d2fe..7048d188604 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -47,3 +47,12 @@ create table t1 (x int, y int); insert into t1 values (0,6),(10,16),(20,26),(30,10),(40,46),(50,56); select min(if(y -x > 5,y,NULL)), max(if(y - x > 5,y,NULL)) from t1; drop table t1; + +# +# BUG#3987 +# +create table t1 (a int); +insert t1 values (1),(2); +select if(1>2,a,avg(a)) from t1; +drop table t1; + diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 91f55af48cc..ad83202afa0 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -25,14 +25,23 @@ select * from t1 where a like "%abc\d%"; drop table t1; +create table t1 (a varchar(10), key(a)); + # # Bug #2231 # - -create table t1 (a varchar(10), key(a)); insert into t1 values ('a'), ('a\\b'); select * from t1 where a like 'a\\%' escape '#'; select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; + +# +# Bug #4200: Prepared statement parameter as argument to ESCAPE +# +prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?'; +set @esc='#'; +execute stmt1 using @esc; +deallocate prepare stmt1; + drop table t1; # diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test index edfa9afcfa6..1a771d466fa 100644 --- a/mysql-test/t/func_regexp.test +++ b/mysql-test/t/func_regexp.test @@ -60,3 +60,16 @@ select _koi8r 0xF7 regexp _koi8r '[[:alpha:]]'; select _latin1'a' regexp _latin1'A' collate latin1_general_ci; select _latin1'a' regexp _latin1'A' collate latin1_bin; + +# +# regexp cleanup() +# +create table t1 (a varchar(40)); +insert into t1 values ('C1'),('C2'),('R1'),('C3'),('R2'),('R3'); +prepare stmt1 from 'select a from t1 where a rlike ? order by a'; +set @a="^C.*"; +execute stmt1 using @a; +set @a="^R.*"; +execute stmt1 using @a; +deallocate prepare stmt1; +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index c138b848491..cc8d8a88437 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -304,6 +304,7 @@ select collation(soundex(_latin2'ab')), coercibility(soundex(_latin2'ab')); select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1)); select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef')); select collation(replace(_latin2'abcd',_latin2'b',_latin2'B')), coercibility(replace(_latin2'abcd',_latin2'b',_latin2'B')); +select collation(encode('abcd','ab')), coercibility(encode('abcd','ab')); create table t1 select @@ -336,7 +337,8 @@ select soundex(_latin2'ab'), substring(_latin2'ab',1), insert(_latin2'abcd',2,3,_latin2'ef'), - replace(_latin2'abcd',_latin2'b',_latin2'B') + replace(_latin2'abcd',_latin2'b',_latin2'B'), + encode('abcd','ab') ; show create table t1; drop table t1; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index a85f9d563e9..67192c55ef9 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -255,8 +255,6 @@ select date_add(date,INTERVAL "1 1" YEAR_MONTH) from t1; select date_add(date,INTERVAL "1:1:1" HOUR_SECOND) from t1; select date_add(date,INTERVAL "1 1:1" DAY_MINUTE) from t1; select date_add(date,INTERVAL "1 1:1:1" DAY_SECOND) from t1; - -# The following is not as one would expect... select date_add(time,INTERVAL 1 SECOND) from t1; drop table t1; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 1b07ddc63a6..ea66a44d44e 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -1,11 +1,12 @@ # We are using .opt file since we need small binlog size ---disable_warnings -drop table if exists t1,t2; ---enable_warnings # we need this for getting fixed timestamps inside of this test set timestamp=1000000000; +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + create table t1 (word varchar(20)); create table t2 (id int auto_increment not null primary key); diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test new file mode 100644 index 00000000000..8881d6b9eec --- /dev/null +++ b/mysql-test/t/ps.test @@ -0,0 +1,142 @@ +# +# SQL Syntax for Prepared Statements test +# +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + +create table t1 +( + a int primary key, + b char(10) +); +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); + +# basic functionality +set @a=2; +prepare stmt1 from 'select * from t1 where a <= ?'; +execute stmt1 using @a; +set @a=3; +execute stmt1 using @a; + +# non-existant statement +--error 1243 +deallocate prepare no_such_statement; + +--error 1210 +execute stmt1; + +# Nesting ps commands is not allowed: +--error 1064 +prepare stmt2 from 'prepare nested_stmt from "select 1"'; + +--error 1064 +prepare stmt2 from 'execute stmt1'; + +--error 1064 +prepare stmt2 from 'deallocate prepare z'; + +# PS insert +prepare stmt3 from 'insert into t1 values (?,?)'; +set @arg1=5, @arg2='five'; +execute stmt3 using @arg1, @arg2; +select * from t1 where a>3; + +# PS update +prepare stmt4 from 'update t1 set a=? where b=?'; +set @arg1=55, @arg2='five'; +execute stmt4 using @arg1, @arg2; +select * from t1 where a>3; + +# PS create/delete +prepare stmt4 from 'create table t2 (a int)'; +execute stmt4; +prepare stmt4 from 'drop table t2'; +execute stmt4; + +# Do something that will cause error +--error 1051 +execute stmt4; + +# placeholders in result field names. +prepare stmt5 from 'select ? + a from t1'; +set @a=1; +execute stmt5 using @a; + +execute stmt5 using @no_such_var; + +set @nullvar=1; +set @nullvar=NULL; +execute stmt5 using @nullvar; + +set @nullvar2=NULL; +execute stmt5 using @nullvar2; + +# Check that multiple SQL statements are disabled inside PREPARE +--error 1064 +prepare stmt6 from 'select 1; select2'; + +--error 1064 +prepare stmt6 from 'insert into t1 values (5,"five"); select2'; + +# This shouldn't parse +--error 1064 +explain prepare stmt6 from 'insert into t1 values (5,"five"); select2'; + +create table t2 +( + a int +); + +insert into t2 values (0); + +# parameter is NULL +set @arg00=NULL ; +prepare stmt1 from 'select 1 FROM t2 where a=?' ; +execute stmt1 using @arg00 ; + +# prepare using variables: +--error 1064 +prepare stmt1 from @nosuchvar; + +set @ivar= 1234; +--error 1064 +prepare stmt1 from @ivar; + +set @fvar= 123.4567; +--error 1064 +prepare stmt1 from @fvar; + +set @str1 = 'select ?'; +set @str2 = convert(@str1 using ucs2); +prepare stmt1 from @str2; +execute stmt1 using @ivar; + +drop table t1,t2; +# +# Bug #4105: Server crash on attempt to prepare a statement with character +# set introducer +# +PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?"; +set @var='A'; +EXECUTE stmt1 USING @var; +DEALLOCATE PREPARE stmt1; + +# +# BUG#3486: FOUND_ROWS() fails inside stored procedure [and prepared statement] +# +create table t1 (id int); +prepare stmt1 from "select FOUND_ROWS()"; +select SQL_CALC_FOUND_ROWS * from t1; +# Expect 0 +execute stmt1; +insert into t1 values (1); +select SQL_CALC_FOUND_ROWS * from t1; +# Expect 1 +execute stmt1; +# Expect 0 +execute stmt1; +deallocate prepare stmt1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 4665cd02ed8..471af8e4a5b 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -255,7 +255,34 @@ WHERE ); DROP TABLE t1; +# +# Test of problem with IN on many different keyparts. (Bug #4157) +# + +CREATE TABLE t1 ( +id int( 11 ) unsigned NOT NULL AUTO_INCREMENT , +line int( 5 ) unsigned NOT NULL default '0', +columnid int( 3 ) unsigned NOT NULL default '0', +owner int( 3 ) unsigned NOT NULL default '0', +ordinal int( 3 ) unsigned NOT NULL default '0', +showid smallint( 6 ) unsigned NOT NULL default '1', +tableid int( 1 ) unsigned NOT NULL default '1', +content int( 5 ) unsigned NOT NULL default '188', +PRIMARY KEY ( owner, id ) , +KEY menu( owner, showid, columnid ) , +KEY `COLUMN` ( owner, columnid, line ) , +KEY `LINES` ( owner, tableid, content, id ) , +KEY recount( owner, line ) +) ENGINE = MYISAM; + +INSERT into t1 (owner,id,columnid,line) values (11,15,15,1),(11,13,13,5); + +SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30; +drop table t1; + +# # test for a bug with in() and unique key +# create table t1 (id int(10) primary key); insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9); diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test new file mode 100644 index 00000000000..cb6da3674da --- /dev/null +++ b/mysql-test/t/rpl_delete_all.test @@ -0,0 +1,40 @@ +source include/master-slave.inc; + +connection slave; +create database test1; +connection master; +drop database if exists test1; +sync_slave_with_master; +# can't read dir +error 12; +show tables from test1; + +connection slave; +create table t1 (a int); +connection master; +drop table if exists t1; +sync_slave_with_master; +# table does not exist +error 1146; +select * from t1; + +connection master; +create table t1 (a int); +sync_slave_with_master; +insert into t1 values(1); +connection master; +delete from t1; +sync_slave_with_master; +select * from t1; + +insert into t1 values(1); +connection master; +insert into t1 values(2); +update t1 set a=2; +sync_slave_with_master; +select * from t1; + +# cleanup +connection master; +drop table t1; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_free_items-slave.opt b/mysql-test/t/rpl_free_items-slave.opt new file mode 100644 index 00000000000..b828d03fafb --- /dev/null +++ b/mysql-test/t/rpl_free_items-slave.opt @@ -0,0 +1 @@ +--replicate-wild-ignore-table=test.% diff --git a/mysql-test/t/rpl_free_items.test b/mysql-test/t/rpl_free_items.test new file mode 100644 index 00000000000..3228ffd9cde --- /dev/null +++ b/mysql-test/t/rpl_free_items.test @@ -0,0 +1,20 @@ +source include/master-slave.inc; +create table t1 (a int); +create table t2 (a int); +disable_query_log; +SET @query="INSERT INTO t2 SELECT * FROM t1 WHERE a REGEXP \"0\""; +let $1 = 2000; +while ($1) +{ + eval SET @query=concat(@query, " OR a REGEXP '$1'"); + dec $1; +} +let $1=`select @query`; +eval $1; +enable_query_log; +# I have seen the slave crash either now or at shutdown +sync_slave_with_master; +connection master; +drop table t1; +drop table t2; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/t/rpl_get_lock.test index c3b033fb03a..5e58753e59a 100644 --- a/mysql-test/t/rpl_get_lock.test +++ b/mysql-test/t/rpl_get_lock.test @@ -22,7 +22,7 @@ connection slave; sync_with_master; select get_lock("lock",3); select * from t1; -select is_free_lock("lock"), is_used_lock("lock"); +select is_free_lock("lock"), is_used_lock("lock") = connection_id(); explain extended select is_free_lock("lock"), is_used_lock("lock"); # Check lock functions select is_free_lock("lock2"); diff --git a/mysql-test/t/rpl_ps.test b/mysql-test/t/rpl_ps.test new file mode 100644 index 00000000000..79f48381a4f --- /dev/null +++ b/mysql-test/t/rpl_ps.test @@ -0,0 +1,43 @@ +# +# Test of replicating user variables +# +source include/master-slave.inc; + +#save_master_pos; +#connection slave; +#sync_with_master; +#reset master; +#connection master; + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1(n char(30)); + +prepare stmt1 from 'insert into t1 values (?)'; +set @var1= "from-master-1"; +execute stmt1 using @var1; +set @var1= "from-master-2-'',"; +execute stmt1 using @var1; +select * from t1; + +set @var2= 'insert into t1 values (concat("from-var-", ?))'; +prepare stmt2 from @var2; +set @var1='from-master-3'; +execute stmt2 using @var1; + +save_master_pos; +connection slave; +sync_with_master; +select * from t1; + +connection master; + +drop table t1; + +save_master_pos; +connection slave; +sync_with_master; +stop slave; + diff --git a/mysql-test/t/rpl_timezone-master.opt b/mysql-test/t/rpl_timezone-master.opt new file mode 100644 index 00000000000..8e43bfbbb7e --- /dev/null +++ b/mysql-test/t/rpl_timezone-master.opt @@ -0,0 +1 @@ +--default-time-zone=Europe/Moscow diff --git a/mysql-test/t/rpl_timezone-slave.opt b/mysql-test/t/rpl_timezone-slave.opt new file mode 100644 index 00000000000..8e43bfbbb7e --- /dev/null +++ b/mysql-test/t/rpl_timezone-slave.opt @@ -0,0 +1 @@ +--default-time-zone=Europe/Moscow diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/t/rpl_timezone.test new file mode 100644 index 00000000000..8dff90a84cf --- /dev/null +++ b/mysql-test/t/rpl_timezone.test @@ -0,0 +1,84 @@ +# Test of replication of time zones. +source include/master-slave.inc; + +# Some preparations +let $VERSION=`select version()`; +create table t1 (t timestamp); +create table t2 (t char(32)); + +# +# Let us check how well replication works when we are saving datetime +# value in TIMESTAMP field. +# +connection master; +select @@time_zone; +set time_zone='UTC'; +insert into t1 values ('20040101000000'), ('20040611093902'); +select * from t1; +# On slave we still in 'Europe/Moscow' so we should see equivalent but +# textually different values. +sync_slave_with_master; +select * from t1; + +# Let us check also that setting of time_zone back to default also works +# well +connection master; +delete from t1; +set time_zone='Europe/Moscow'; +insert into t1 values ('20040101000000'), ('20040611093902'); +select * from t1; +sync_slave_with_master; +select * from t1; +connection master; +# We should not see SET ONE_SHOT time_zone before second insert +--replace_result $VERSION VERSION +show binlog events; + +# +# Now let us check how well we replicate statments reading TIMESTAMP fields +# (We should see the same data on master and on slave but it should differ +# from originally inserted) +# +set time_zone='MET'; +insert into t2 (select t from t1); +select * from t1; +sync_slave_with_master; +select * from t2; + +# +# Now let us check how well we replicate various CURRENT_* functions +# +connection master; +delete from t2; +set timestamp=1000072000; +insert into t2 values (current_timestamp), (current_date), (current_time); +sync_slave_with_master; +# Values in ouput of these to queries should differ because we are in +# in 'MET' on master and in 'Europe/Moscow on slave... +set timestamp=1000072000; +select current_timestamp, current_date, current_time; +select * from t2; + +# +# At last let us check replication of FROM_UNIXTIME/UNIX_TIMESTAMP functions. +# +connection master; +delete from t2; +insert into t2 values (from_unixtime(1000000000)), + (unix_timestamp('2001-09-09 03:46:40')); +select * from t2; +sync_slave_with_master; +# We should get same result on slave as on master +select * from t2; + +# +# Let us check that we are not allowing to set global time_zone with +# replication +# +connection master; +--error 1105 +set global time_zone='MET'; + +# Clean up +drop table t1, t2; +sync_slave_with_master; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 0a3de178456..57827f3cc7f 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1771,7 +1771,9 @@ CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned defa INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL); CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM; INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35); -SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'NULL' AND b.sampletime < 'NULL' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; +# Testing the same select with NULL's instead of invalid datetime values +SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; DROP TABLE t1,t2; # diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index bdefc87b3fd..0c093c4ae3e 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1158,3 +1158,57 @@ SELECT a FROM t1 WHERE a >= ALL ( SELECT a FROM t1 WHERE b = 2 ); SELECT a FROM t1 WHERE a <= ALL ( SELECT a FROM t1 WHERE b = 2 ); SELECT a FROM t1 WHERE a <> ALL ( SELECT a FROM t1 WHERE b = 2 ); DROP TABLE t1; + +# +# SELECT(EXISTS * ...)optimisation +# +create table t1 (a int, b int); +insert into t1 values (1,2),(3,4); +select * from t1 up where exists (select * from t1 where t1.a=up.a); +explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); +drop table t1; + +# +# Bug #4102: subselect in HAVING +# + +CREATE TABLE t1 (t1_a int); +INSERT INTO t1 VALUES (1); +CREATE TABLE t2 (t2_a int, t2_b int, PRIMARY KEY (t2_a, t2_b)); +INSERT INTO t2 VALUES (1, 1), (1, 2); +SELECT * FROM t1, t2 table2 WHERE t1_a = 1 AND table2.t2_a = 1 + HAVING table2.t2_b = (SELECT MAX(t2_b) FROM t2 WHERE t2_a = table2.t2_a); +DROP TABLE t1, t2; + +# +# Test problem with NULL and derived tables (Bug #4097) +# + +CREATE TABLE t1 (id int(11) default NULL,name varchar(10) default NULL); +INSERT INTO t1 VALUES (1,'Tim'),(2,'Rebecca'),(3,NULL); +CREATE TABLE t2 (id int(11) default NULL, pet varchar(10) default NULL); +INSERT INTO t2 VALUES (1,'Fido'),(2,'Spot'),(3,'Felix'); +SELECT a.*, b.* FROM (SELECT * FROM t1) AS a JOIN t2 as b on a.id=b.id; +drop table t1,t2; + +# +# outer fields resolving in INSERT/REPLACE and CRETE with SELECT +# +CREATE TABLE t1 ( a int, b int ); +CREATE TABLE t2 ( c int, d int ); +INSERT INTO t1 VALUES (1,2), (2,3), (3,4); +SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +select * from t2; +CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); +select * from t3; +prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +deallocate prepare stmt1; +select * from t2; +drop table t3; +prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +select * from t3; +deallocate prepare stmt1; +DROP TABLE t1, t2, t3; diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test index 194602f376c..ffc2e3a3ebf 100644 --- a/mysql-test/t/timezone.test +++ b/mysql-test/t/timezone.test @@ -1,5 +1,6 @@ # -# Test of timezone handling. This script must be run with TZ=MET +# Test of SYSTEM time zone handling ( for my_system_gmt_sec()). +# This script must be run with TZ=MET -- require r/have_met_timezone.require disable_query_log; @@ -13,7 +14,7 @@ DROP TABLE IF EXISTS t1; # The following is because of daylight saving time --replace_result MEST MET -show variables like "timezone"; +show variables like "system_time_zone"; # # Test unix timestamp @@ -40,6 +41,16 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01')); SELECT ts,from_unixtime(ts) FROM t1; DROP TABLE t1; + +# +# Test of warning for spring time-gap values for system time zone +# +CREATE TABLE t1 (ts timestamp); +INSERT INTO t1 (ts) VALUES ('2003-03-30 01:59:59'), + ('2003-03-30 02:59:59'), + ('2003-03-30 03:00:00'); +DROP TABLE t1; + # # Test for fix for Bug#2523 # diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test new file mode 100644 index 00000000000..49579421570 --- /dev/null +++ b/mysql-test/t/timezone2.test @@ -0,0 +1,189 @@ +# This script tests our own time zone support functions + +# Preparing playground +--disable_warnings +drop table if exists t1; +--enable_warnings + + +# +# Let us first check +HH:MM style timezones +# +create table t1 (ts timestamp); + +set time_zone='+00:00'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +insert into t1 (ts) values ('2003-03-30 02:30:00'); + +set time_zone='+10:30'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +insert into t1 (ts) values ('2003-03-30 02:30:00'); + +set time_zone='-10:00'; +select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); +insert into t1 (ts) values ('2003-03-30 02:30:00'); + +# Here we will get different results +select * from t1; + +drop table t1; + + +# +# Let us try DB specified time zones +# +select Name from mysql.time_zone_name where Name in + ('UTC','Universal','MET','Europe/Moscow','leap/Europe/Moscow'); + +create table t1 (i int, ts timestamp); + +set time_zone='MET'; + +# We check common date time value and non existent or ambiguios values +# Normal value without DST +insert into t1 (i, ts) values + (unix_timestamp('2003-03-01 00:00:00'),'2003-03-01 00:00:00'); +# Values around and in spring time-gap +insert into t1 (i, ts) values + (unix_timestamp('2003-03-30 01:59:59'),'2003-03-30 01:59:59'), + (unix_timestamp('2003-03-30 02:30:00'),'2003-03-30 02:30:00'), + (unix_timestamp('2003-03-30 03:00:00'),'2003-03-30 03:00:00'); +# Normal value with DST +insert into t1 (i, ts) values + (unix_timestamp('2003-05-01 00:00:00'),'2003-05-01 00:00:00'); +# Ambiguos values (also check for determenism) +insert into t1 (i, ts) values + (unix_timestamp('2003-10-26 01:00:00'),'2003-10-26 01:00:00'), + (unix_timestamp('2003-10-26 02:00:00'),'2003-10-26 02:00:00'), + (unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59'), + (unix_timestamp('2003-10-26 04:00:00'),'2003-10-26 04:00:00'), + (unix_timestamp('2003-10-26 02:59:59'),'2003-10-26 02:59:59'); + +set time_zone='UTC'; + +select * from t1; + +delete from t1; + +# Simple check for 'Europe/Moscow' time zone just for showing that it works +set time_zone='Europe/Moscow'; +insert into t1 (i, ts) values + (unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'), + (unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'), + (unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'), + (unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00'); +select * from t1; +delete from t1; + + +# +# Check for time zone with leap seconds +# Values in ts column must be the same but values in i column should +# differ from corresponding values for Europe/Moscow a bit. +# +set time_zone='leap/Europe/Moscow'; +insert into t1 (i, ts) values + (unix_timestamp('2004-01-01 00:00:00'),'2004-01-01 00:00:00'), + (unix_timestamp('2004-03-28 02:30:00'),'2004-03-28 02:30:00'), + (unix_timestamp('2004-08-01 00:00:00'),'2003-08-01 00:00:00'), + (unix_timestamp('2004-10-31 02:30:00'),'2004-10-31 02:30:00'); +select * from t1; +delete from t1; +# Let us test leap jump +insert into t1 (i, ts) values + (unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), + (unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); +select * from t1; +# Additional 60ieth second! +select from_unixtime(362793609); + +drop table t1; + + +# +# Let us test range for TIMESTAMP +# +create table t1 (ts timestamp); +set time_zone='UTC'; +insert into t1 values ('0000-00-00 00:00:00'),('1969-12-31 23:59:59'), + ('1970-01-01 00:00:00'),('1970-01-01 00:00:01'), + ('2037-12-31 23:59:59'),('2038-01-01 00:00:00'); +select * from t1; +delete from t1; +# MET time zone has range shifted by one hour +set time_zone='MET'; +insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 00:30:00'), + ('1970-01-01 01:00:00'),('1970-01-01 01:00:01'), + ('2038-01-01 00:59:59'),('2038-01-01 01:00:00'); +select * from t1; +delete from t1; +# same for +01:30 time zone +set time_zone='+01:30'; +insert into t1 values ('0000-00-00 00:00:00'),('1970-01-01 01:00:00'), + ('1970-01-01 01:30:00'),('1970-01-01 01:30:01'), + ('2038-01-01 01:29:59'),('2038-01-01 01:30:00'); +select * from t1; + +drop table t1; + + +# +# Test of show variables +# +show variables like 'time_zone'; +set time_zone = default; +show variables like 'time_zone'; + + +# +# Let us try some invalid time zone specifications +# +--error 1298 +set time_zone= '0'; +--error 1298 +set time_zone= '0:0'; +--error 1298 +set time_zone= '-20:00'; +--error 1298 +set time_zone= '+20:00'; +--error 1298 +set time_zone= 'Some/Unknown/Time/Zone'; + + +# Let us check that aliases for time zones work and they are +# case-insensitive +select convert_tz(now(),'UTC', 'Universal') = now(); +select convert_tz(now(),'utc', 'UTC') = now(); + + +# +# Let us test CONVERT_TZ function (may be func_time.test is better place). +# +select convert_tz('1917-11-07 12:00:00', 'MET', 'UTC'); +select convert_tz('1970-01-01 01:00:00', 'MET', 'UTC'); +select convert_tz('1970-01-01 01:00:01', 'MET', 'UTC'); +select convert_tz('2003-03-01 00:00:00', 'MET', 'UTC'); +select convert_tz('2003-03-30 01:59:59', 'MET', 'UTC'); +select convert_tz('2003-03-30 02:30:00', 'MET', 'UTC'); +select convert_tz('2003-03-30 03:00:00', 'MET', 'UTC'); +select convert_tz('2003-05-01 00:00:00', 'MET', 'UTC'); +select convert_tz('2003-10-26 01:00:00', 'MET', 'UTC'); +select convert_tz('2003-10-26 02:00:00', 'MET', 'UTC'); +select convert_tz('2003-10-26 02:59:59', 'MET', 'UTC'); +select convert_tz('2003-10-26 04:00:00', 'MET', 'UTC'); +select convert_tz('2038-01-01 00:59:59', 'MET', 'UTC'); +select convert_tz('2038-01-01 01:00:00', 'MET', 'UTC'); +select convert_tz('2103-01-01 04:00:00', 'MET', 'UTC'); + +# Let us test variable time zone argument +create table t1 (tz varchar(3)); +insert into t1 (tz) values ('MET'), ('UTC'); +select tz, convert_tz('2003-12-31 00:00:00',tz,'UTC'), convert_tz('2003-12-31 00:00:00','UTC',tz) from t1 order by tz; +drop table t1; + +# Parameters to CONVERT_TZ() what should give NULL +select convert_tz('2003-12-31 04:00:00', NULL, 'UTC'); +select convert_tz('2003-12-31 04:00:00', 'SomeNotExistingTimeZone', 'UTC'); +select convert_tz('2003-12-31 04:00:00', 'MET', 'SomeNotExistingTimeZone'); +select convert_tz('2003-12-31 04:00:00', 'MET', NULL); +select convert_tz( NULL, 'MET', 'UTC'); diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 5a53c635e6e..8d67802d42a 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -79,3 +79,12 @@ SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2. INSERT INTO t1 VALUES(1); SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD; drop table t1,t2; + +# +# Multiple SELECT DATE_FORMAT gave incorrect results (Bug #4036) +# + +CREATE TABLE t1 (f1 time default NULL, f2 time default NULL); +INSERT INTO t1 (f1, f2) VALUES ('09:00', '12:00'); +SELECT DATE_FORMAT(f1, "%l.%i %p") , DATE_FORMAT(f2, "%l.%i %p") FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index cec2aa3582b..47866058524 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -7,13 +7,13 @@ drop table if exists t1; --enable_warnings create table t1 (t datetime); -insert into t1 values(101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +insert into t1 values (101),(691231),(700101),(991231),(10000101),(99991231),(101000000),(691231000000),(700101000000),(991231235959),(10000101000000),(99991231235959),(20030100000000),(20030000000000); select * from t1; delete from t1 where t > 0; optimize table t1; check table t1; delete from t1; -insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); select * from t1; drop table t1; @@ -71,3 +71,18 @@ insert into t1 values (now(), now()); insert into t1 values (now(), now()); select * from t1 where a is null or b is null; drop table t1; + +# +# Let us check if we properly treat wrong datetimes and produce proper +# warnings (for both strings and numbers) +# +create table t1 (t datetime); +insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +select * from t1; +delete from t1; +insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +select * from t1; +delete from t1; +insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); +select * from t1; +drop table t1; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 3257002ae2c..414a06deaa9 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -244,6 +244,9 @@ CREATE TABLE t1 (a_dec DECIMAL(-1,0)); CREATE TABLE t1 (a_dec DECIMAL(-2,1)); --error 1064 CREATE TABLE t1 (a_dec DECIMAL(-1,1)); +CREATE TABLE t1 (a_dec DECIMAL(0,11)); +SHOW CREATE TABLE t1; +DROP TABLE t1; # # Zero prepend overflow bug diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 72633f9ef7d..9b3abc9f155 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -37,10 +37,10 @@ select date_format(a,"%Y %y"),year(a),year(now()) from t1; drop table t1; create table t1 (ix timestamp); -insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101); +insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000); select ix+0 from t1; delete from t1; -insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"); +insert into t1 values ("19991101000000"),("19990102030405"),("19990630232922"),("19990601000000"); select ix+0 from t1; drop table t1; @@ -76,6 +76,21 @@ select * from t1; drop table t1; # +# Let us check if we properly treat wrong datetimes and produce proper warnings +# (for both strings and numbers) +# +create table t1 (ix timestamp); +insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000); +select ix+0 from t1; +delete from t1; +insert into t1 values ("00000000000000"),("20030101010160"),("20030101016001"),("20030101240101"),("20030132010101"),("20031301010101"),("20031200000000"),("20030000000000"); +select ix+0 from t1; +delete from t1; +insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); +select ix+0 from t1; +drop table t1; + +# # Test for TIMESTAMP column with default now() and on update now() clauses # diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index f6006a87d47..b21f635162f 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -527,3 +527,11 @@ CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i)); --error 1054 explain (select * from t1) union (select * from t2) order by not_existing_column; drop table t1, t2; + +# +# length detecting +# +CREATE TABLE t1 (uid int(1)); +INSERT INTO t1 SELECT 150; +SELECT 'a' UNION SELECT uid FROM t1; +drop table t1; diff --git a/mysys/charset-def.c b/mysys/charset-def.c index a89cf866933..73e36688594 100644 --- a/mysys/charset-def.c +++ b/mysys/charset-def.c @@ -22,6 +22,42 @@ init_compiled_charsets() that only adds those that he wants */ +#ifdef HAVE_CHARSET_ucs2 +extern CHARSET_INFO my_charset_ucs2_general_uca; +extern CHARSET_INFO my_charset_ucs2_icelandic_uca_ci; +extern CHARSET_INFO my_charset_ucs2_latvian_uca_ci; +extern CHARSET_INFO my_charset_ucs2_romanian_uca_ci; +extern CHARSET_INFO my_charset_ucs2_slovenian_uca_ci; +extern CHARSET_INFO my_charset_ucs2_polish_uca_ci; +extern CHARSET_INFO my_charset_ucs2_estonian_uca_ci; +extern CHARSET_INFO my_charset_ucs2_spanish_uca_ci; +extern CHARSET_INFO my_charset_ucs2_swedish_uca_ci; +extern CHARSET_INFO my_charset_ucs2_turkish_uca_ci; +extern CHARSET_INFO my_charset_ucs2_czech_uca_ci; +extern CHARSET_INFO my_charset_ucs2_danish_uca_ci; +extern CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci; +extern CHARSET_INFO my_charset_ucs2_slovak_uca_ci; +extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci; +#endif + +#ifdef HAVE_CHARSET_utf8 +extern CHARSET_INFO my_charset_utf8_general_uca_ci; +extern CHARSET_INFO my_charset_utf8_icelandic_uca_ci; +extern CHARSET_INFO my_charset_utf8_latvian_uca_ci; +extern CHARSET_INFO my_charset_utf8_romanian_uca_ci; +extern CHARSET_INFO my_charset_utf8_slovenian_uca_ci; +extern CHARSET_INFO my_charset_utf8_polish_uca_ci; +extern CHARSET_INFO my_charset_utf8_estonian_uca_ci; +extern CHARSET_INFO my_charset_utf8_spanish_uca_ci; +extern CHARSET_INFO my_charset_utf8_swedish_uca_ci; +extern CHARSET_INFO my_charset_utf8_turkish_uca_ci; +extern CHARSET_INFO my_charset_utf8_czech_uca_ci; +extern CHARSET_INFO my_charset_utf8_danish_uca_ci; +extern CHARSET_INFO my_charset_utf8_lithuanian_uca_ci; +extern CHARSET_INFO my_charset_utf8_slovak_uca_ci; +extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci; +#endif + my_bool init_compiled_charsets(myf flags __attribute__((unused))) { CHARSET_INFO *cs; @@ -74,6 +110,20 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_ucs2_general_ci); add_compiled_collation(&my_charset_ucs2_bin); add_compiled_collation(&my_charset_ucs2_general_uca); + add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci); + add_compiled_collation(&my_charset_ucs2_latvian_uca_ci); + add_compiled_collation(&my_charset_ucs2_romanian_uca_ci); + add_compiled_collation(&my_charset_ucs2_slovenian_uca_ci); + add_compiled_collation(&my_charset_ucs2_polish_uca_ci); + add_compiled_collation(&my_charset_ucs2_estonian_uca_ci); + add_compiled_collation(&my_charset_ucs2_spanish_uca_ci); + add_compiled_collation(&my_charset_ucs2_swedish_uca_ci); + add_compiled_collation(&my_charset_ucs2_turkish_uca_ci); + add_compiled_collation(&my_charset_ucs2_czech_uca_ci); + add_compiled_collation(&my_charset_ucs2_danish_uca_ci); + add_compiled_collation(&my_charset_ucs2_lithuanian_uca_ci); + add_compiled_collation(&my_charset_ucs2_slovak_uca_ci); + add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci); #endif #ifdef HAVE_CHARSET_ujis @@ -84,6 +134,21 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) #ifdef HAVE_CHARSET_utf8 add_compiled_collation(&my_charset_utf8_general_ci); add_compiled_collation(&my_charset_utf8_bin); + add_compiled_collation(&my_charset_utf8_general_uca_ci); + add_compiled_collation(&my_charset_utf8_icelandic_uca_ci); + add_compiled_collation(&my_charset_utf8_latvian_uca_ci); + add_compiled_collation(&my_charset_utf8_romanian_uca_ci); + add_compiled_collation(&my_charset_utf8_slovenian_uca_ci); + add_compiled_collation(&my_charset_utf8_polish_uca_ci); + add_compiled_collation(&my_charset_utf8_estonian_uca_ci); + add_compiled_collation(&my_charset_utf8_spanish_uca_ci); + add_compiled_collation(&my_charset_utf8_swedish_uca_ci); + add_compiled_collation(&my_charset_utf8_turkish_uca_ci); + add_compiled_collation(&my_charset_utf8_czech_uca_ci); + add_compiled_collation(&my_charset_utf8_danish_uca_ci); + add_compiled_collation(&my_charset_utf8_lithuanian_uca_ci); + add_compiled_collation(&my_charset_utf8_slovak_uca_ci); + add_compiled_collation(&my_charset_utf8_spanish2_uca_ci); #endif /* Copy compiled charsets */ diff --git a/mysys/charset.c b/mysys/charset.c index 7eccf2dab68..1388fc40c6d 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -23,354 +23,6 @@ /* - Collation language is implemented according to - subset of ICU Collation Customization (tailorings): - http://oss.software.ibm.com/icu/userguide/Collate_Customization.html - - Collation language elements: - Delimiters: - space - skipped - - <char> := A-Z | a-z | \uXXXX - - Shift command: - <shift> := & - reset at this letter. - - Diff command: - <d1> := < - Identifies a primary difference. - <d2> := << - Identifies a secondary difference. - <d3> := <<< - Idenfifies a tertiary difference. - - - Collation rules: - <ruleset> := <rule> { <ruleset> } - - <rule> := <d1> <string> - | <d2> <string> - | <d3> <string> - | <shift> <char> - - <string> := <char> [ <string> ] - - An example, Polish collation: - - &A < \u0105 <<< \u0104 - &C < \u0107 <<< \u0106 - &E < \u0119 <<< \u0118 - &L < \u0142 <<< \u0141 - &N < \u0144 <<< \u0143 - &O < \u00F3 <<< \u00D3 - &S < \u015B <<< \u015A - &Z < \u017A <<< \u017B -*/ - - -typedef enum my_coll_lexem_num_en -{ - MY_COLL_LEXEM_EOF = 0, - MY_COLL_LEXEM_DIFF = 1, - MY_COLL_LEXEM_SHIFT = 4, - MY_COLL_LEXEM_CHAR = 5, - MY_COLL_LEXEM_ERROR = 6 -} my_coll_lexem_num; - - -typedef struct my_coll_lexem_st -{ - const char *beg; - const char *end; - const char *prev; - int diff; - int code; -} MY_COLL_LEXEM; - - -/* - Initialize collation rule lexical anilizer - - SYNOPSIS - my_coll_lexem_init - lexem Lex analizer to init - str Const string to parse - strend End of the string - USAGE - - RETURN VALUES - N/A -*/ - -static void my_coll_lexem_init(MY_COLL_LEXEM *lexem, - const char *str, const char *strend) -{ - lexem->beg= str; - lexem->prev= str; - lexem->end= strend; - lexem->diff= 0; - lexem->code= 0; -} - - -/* - Print collation customization expression parse error, with context. - - SYNOPSIS - my_coll_lexem_print_error - lexem Lex analizer to take context from - errstr sting to write error to - errsize errstr size - txt error message - USAGE - - RETURN VALUES - N/A -*/ - -static void my_coll_lexem_print_error(MY_COLL_LEXEM *lexem, - char *errstr, size_t errsize, - const char *txt) -{ - char tail[30]; - size_t len= lexem->end - lexem->prev; - strmake (tail, lexem->prev, min(len, sizeof(tail)-1)); - errstr[errsize-1]= '\0'; - my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail); -} - - -/* - Convert a hex digit into its numeric value - - SYNOPSIS - ch2x - ch hex digit to convert - USAGE - - RETURN VALUES - an integer value in the range 0..15 - -1 on error -*/ - -static int ch2x(int ch) -{ - if (ch >= '0' && ch <= '9') - return ch - '0'; - - if (ch >= 'a' && ch <= 'f') - return 10 + ch - 'a'; - - if (ch >= 'A' && ch <= 'F') - return 10 + ch - 'A'; - - return -1; -} - - -/* - Collation language lexical parser: - Scans the next lexem. - - SYNOPSIS - my_coll_lexem_next - lexem Lex analizer, previously initialized by - my_coll_lexem_init. - USAGE - Call this function in a loop - - RETURN VALUES - Lexem number: eof, diff, shift, char or error. -*/ - -static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem) -{ - for ( ;lexem->beg < lexem->end ; lexem->beg++) - { - lexem->prev= lexem->beg; - if (lexem->beg[0] == ' ' || lexem->beg[0] == '\t' || - lexem->beg[0] == '\r' || lexem->beg[0] == '\n') - continue; - - if (lexem->beg[0] == '&') - { - lexem->beg++; - return MY_COLL_LEXEM_SHIFT; - } - - if (lexem->beg[0] == '<') - { - for (lexem->beg++, lexem->diff=1; - (lexem->beg < lexem->end) && - (lexem->beg[0] == '<') && (lexem->diff<3); - lexem->beg++, lexem->diff++); - return MY_COLL_LEXEM_DIFF; - } - - if ((lexem->beg[0] >= 'a' && lexem->beg[0] <= 'z') || - (lexem->beg[0] >= 'A' && lexem->beg[0] <= 'Z')) - { - lexem->code= lexem->beg[0]; - lexem->beg++; - return MY_COLL_LEXEM_CHAR; - } - - if ((lexem->beg[0] == '\\') && - (lexem->beg+2 < lexem->end) && - (lexem->beg[1] == 'u')) - { - int ch; - - lexem->code= 0; - for (lexem->beg+=2; - (lexem->beg < lexem->end) && ((ch= ch2x(lexem->beg[0])) >= 0) ; - lexem->beg++) - { - lexem->code= (lexem->code << 4) + ch; - } - return MY_COLL_LEXEM_CHAR; - } - - return MY_COLL_LEXEM_ERROR; - } - return MY_COLL_LEXEM_EOF; -} - - -/* - Collation rule item -*/ - -typedef struct my_coll_rule_item_st -{ - uint base; /* Base character */ - uint curr; /* Current character */ - int diff[3]; /* Primary, Secondary and Tertiary difference */ -} MY_COLL_RULE; - - -/* - Collation language syntax parser. - Uses lexical parser. - - SYNOPSIS - my_coll_rule_parse - rule Collation rule list to load to. - str A string containin collation language expression. - strend End of the string. - USAGE - - RETURN VALUES - 0 - OK - 1 - ERROR, e.g. too many items. -*/ - -static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems, - const char *str, const char *strend, - char *errstr, size_t errsize) -{ - MY_COLL_LEXEM lexem; - my_coll_lexem_num lexnum; - my_coll_lexem_num prevlexnum= MY_COLL_LEXEM_ERROR; - MY_COLL_RULE item; - int state= 0; - size_t nitems= 0; - - /* Init all variables */ - errstr[0]= '\0'; - bzero(&item, sizeof(item)); - my_coll_lexem_init(&lexem, str, strend); - - while ((lexnum= my_coll_lexem_next(&lexem))) - { - if (lexnum == MY_COLL_LEXEM_ERROR) - { - my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Unknown character"); - return -1; - } - - switch (state) { - case 0: - if (lexnum != MY_COLL_LEXEM_SHIFT) - { - my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& expected"); - return -1; - } - prevlexnum= lexnum; - state= 2; - continue; - - case 1: - if (lexnum != MY_COLL_LEXEM_SHIFT && lexnum != MY_COLL_LEXEM_DIFF) - { - my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& or < expected"); - return -1; - } - prevlexnum= lexnum; - state= 2; - continue; - - case 2: - if (lexnum != MY_COLL_LEXEM_CHAR) - { - my_coll_lexem_print_error(&lexem,errstr,errsize-1,"character expected"); - return -1; - } - - if (prevlexnum == MY_COLL_LEXEM_SHIFT) - { - item.base= lexem.code; - item.diff[0]= 0; - item.diff[1]= 0; - item.diff[2]= 0; - } - else if (prevlexnum == MY_COLL_LEXEM_DIFF) - { - item.curr= lexem.code; - if (lexem.diff == 3) - { - item.diff[2]++; - } - else if (lexem.diff == 2) - { - item.diff[1]++; - item.diff[2]= 0; - } - else if (lexem.diff == 1) - { - item.diff[0]++; - item.diff[1]= 0; - item.diff[2]= 0; - } - if (nitems >= mitems) - { - my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Too many rules"); - return -1; - } - rule[nitems++]= item; - } - else - { - my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Should never happen"); - return -1; - } - state= 1; - continue; - } - } - return (size_t) nitems; -} - - -typedef struct -{ - int nchars; - MY_UNI_IDX uidx; -} uni_idx; - -#define PLANE_SIZE 0x100 -#define PLANE_NUM 0x100 -#define PLANE_NUMBER(x) (((x)>>8) % PLANE_NUM) - - -/* The code below implements this functionality: - Initializing charset related structures @@ -386,32 +38,21 @@ my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2) } -static void set_max_sort_char(CHARSET_INFO *cs) -{ - uchar max_char; - uint i; - - if (!cs->sort_order) - return; - - max_char=cs->sort_order[(uchar) cs->max_sort_char]; - for (i= 0; i < 256; i++) - { - if ((uchar) cs->sort_order[i] > max_char) - { - max_char=(uchar) cs->sort_order[i]; - cs->max_sort_char= i; - } - } -} - - -static void init_state_maps(CHARSET_INFO *cs) +static my_bool init_state_maps(CHARSET_INFO *cs) { uint i; - uchar *state_map= cs->state_map; - uchar *ident_map= cs->ident_map; + uchar *state_map; + uchar *ident_map; + + if (!(cs->state_map= (uchar*) my_once_alloc(256, MYF(MY_WME)))) + return 1; + + if (!(cs->ident_map= (uchar*) my_once_alloc(256, MYF(MY_WME)))) + return 1; + state_map= cs->state_map; + ident_map= cs->ident_map; + /* Fill state_map with states to get a faster parser */ for (i=0; i < 256 ; i++) { @@ -458,6 +99,7 @@ static void init_state_maps(CHARSET_INFO *cs) state_map[(uchar)'x']= state_map[(uchar)'X']= (uchar) MY_LEX_IDENT_OR_HEX; state_map[(uchar)'b']= state_map[(uchar)'b']= (uchar) MY_LEX_IDENT_OR_BIN; state_map[(uchar)'n']= state_map[(uchar)'N']= (uchar) MY_LEX_IDENT_OR_NCHAR; + return 0; } @@ -469,98 +111,11 @@ static void simple_cs_init_functions(CHARSET_INFO *cs) cs->coll= &my_collation_8bit_simple_ci_handler; cs->cset= &my_charset_8bit_handler; - cs->mbminlen= 1; - cs->mbmaxlen= 1; } -static int pcmp(const void * f, const void * s) -{ - const uni_idx *F= (const uni_idx*) f; - const uni_idx *S= (const uni_idx*) s; - int res; - - if (!(res=((S->nchars)-(F->nchars)))) - res=((F->uidx.from)-(S->uidx.to)); - return res; -} - -static my_bool create_fromuni(CHARSET_INFO *cs) -{ - uni_idx idx[PLANE_NUM]; - int i,n; - - /* Clear plane statistics */ - bzero(idx,sizeof(idx)); - - /* Count number of characters in each plane */ - for (i=0; i< 0x100; i++) - { - uint16 wc=cs->tab_to_uni[i]; - int pl= PLANE_NUMBER(wc); - - if (wc || !i) - { - if (!idx[pl].nchars) - { - idx[pl].uidx.from=wc; - idx[pl].uidx.to=wc; - }else - { - idx[pl].uidx.from=wc<idx[pl].uidx.from?wc:idx[pl].uidx.from; - idx[pl].uidx.to=wc>idx[pl].uidx.to?wc:idx[pl].uidx.to; - } - idx[pl].nchars++; - } - } - - /* Sort planes in descending order */ - qsort(&idx,PLANE_NUM,sizeof(uni_idx),&pcmp); - - for (i=0; i < PLANE_NUM; i++) - { - int ch,numchars; - - /* Skip empty plane */ - if (!idx[i].nchars) - break; - - numchars=idx[i].uidx.to-idx[i].uidx.from+1; - if (!(idx[i].uidx.tab=(uchar*) my_once_alloc(numchars * - sizeof(*idx[i].uidx.tab), - MYF(MY_WME)))) - return TRUE; - - bzero(idx[i].uidx.tab,numchars*sizeof(*idx[i].uidx.tab)); - - for (ch=1; ch < PLANE_SIZE; ch++) - { - uint16 wc=cs->tab_to_uni[ch]; - if (wc >= idx[i].uidx.from && wc <= idx[i].uidx.to && wc) - { - int ofs= wc - idx[i].uidx.from; - idx[i].uidx.tab[ofs]= ch; - } - } - } - - /* Allocate and fill reverse table for each plane */ - n=i; - if (!(cs->tab_from_uni= (MY_UNI_IDX*) my_once_alloc(sizeof(MY_UNI_IDX)*(n+1), - MYF(MY_WME)))) - return TRUE; - - for (i=0; i< n; i++) - cs->tab_from_uni[i]= idx[i].uidx; - - /* Set end-of-list marker */ - bzero(&cs->tab_from_uni[i],sizeof(MY_UNI_IDX)); - return FALSE; -} - - -static int simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) +static int cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) { to->number= from->number ? from->number : to->number; @@ -582,7 +137,8 @@ static int simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) MY_CS_CTYPE_TABLE_SIZE, MYF(MY_WME)))) goto err; - init_state_maps(to); + if (init_state_maps(to)) + goto err; } if (from->to_lower) if (!(to->to_lower= (uchar*) my_once_memdup((char*) from->to_lower, @@ -601,7 +157,7 @@ static int simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) MY_CS_SORT_ORDER_TABLE_SIZE, MYF(MY_WME)))) goto err; - set_max_sort_char(to); + } if (from->tab_to_uni) { @@ -609,11 +165,10 @@ static int simple_cs_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) if (!(to->tab_to_uni= (uint16*) my_once_memdup((char*)from->tab_to_uni, sz, MYF(MY_WME)))) goto err; - if (create_fromuni(to)) - goto err; } - to->mbminlen= 1; - to->mbmaxlen= 1; + if (from->tailoring) + if (!(to->tailoring= my_once_strdup(from->tailoring,MYF(MY_WME)))) + goto err; return 0; @@ -622,143 +177,6 @@ err: } -#ifdef HAVE_CHARSET_ucs2 - -#define MY_MAX_COLL_RULE 64 - -/* - This function copies an UCS2 collation from - the default Unicode Collation Algorithm (UCA) - weights applying tailorings, i.e. a set of - alternative weights for some characters. - - The default UCA weights are stored in my_charset_ucs2_general_uca. - They consist of 256 pages, 256 character each. - - If a page is not overwritten by tailoring rules, - it is copies as is from UCA as is. - - If a page contains some overwritten characters, it is - allocated. Untouched characters are copied from the - default weights. -*/ - -static int ucs2_copy_data(CHARSET_INFO *to, CHARSET_INFO *from) -{ - MY_COLL_RULE rule[MY_MAX_COLL_RULE]; - char errstr[128]; - uchar *newlengths; - uint16 **newweights; - const uchar *deflengths= my_charset_ucs2_general_uca.sort_order; - uint16 **defweights= my_charset_ucs2_general_uca.sort_order_big; - int rc, i; - - to->number= from->number ? from->number : to->number; - - if (from->csname) - if (!(to->csname= my_once_strdup(from->csname,MYF(MY_WME)))) - goto err; - - if (from->name) - if (!(to->name= my_once_strdup(from->name,MYF(MY_WME)))) - goto err; - - if (from->comment) - if (!(to->comment= my_once_strdup(from->comment,MYF(MY_WME)))) - goto err; - - to->strxfrm_multiply= my_charset_ucs2_general_uca.strxfrm_multiply; - to->min_sort_char= my_charset_ucs2_general_uca.min_sort_char; - to->max_sort_char= my_charset_ucs2_general_uca.max_sort_char; - to->mbminlen= 2; - to->mbmaxlen= 2; - - - /* Parse ICU Collation Customization expression */ - if ((rc= my_coll_rule_parse(rule, MY_MAX_COLL_RULE, - from->sort_order, - from->sort_order + strlen(from->sort_order), - errstr, sizeof(errstr))) <= 0) - { - /* - TODO: add error message reporting. - printf("Error: %d '%s'\n", rc, errstr); - */ - return 1; - } - - - if (!(newweights= (uint16**) my_once_alloc(256*sizeof(uint16*),MYF(MY_WME)))) - goto err; - bzero(newweights, 256*sizeof(uint16*)); - - if (!(newlengths= (uchar*) my_once_memdup(deflengths,256,MYF(MY_WME)))) - goto err; - - /* - Calculate maximum lenghts for the pages - which will be overwritten. - */ - for (i=0; i < rc; i++) - { - uint pageb= (rule[i].base >> 8) & 0xFF; - uint pagec= (rule[i].curr >> 8) & 0xFF; - - if (newlengths[pagec] < deflengths[pageb]) - newlengths[pagec]= deflengths[pageb]; - } - - for (i=0; i < rc; i++) - { - uint pageb= (rule[i].base >> 8) & 0xFF; - uint pagec= (rule[i].curr >> 8) & 0xFF; - uint chb, chc; - - if (!newweights[pagec]) - { - /* Alloc new page and copy the default UCA weights */ - uint size= 256*newlengths[pagec]*sizeof(uint16); - - if (!(newweights[pagec]= (uint16*) my_once_alloc(size,MYF(MY_WME)))) - goto err; - bzero((void*) newweights[pagec], size); - - for (chc=0 ; chc < 256; chc++) - { - memcpy(newweights[pagec] + chc*newlengths[pagec], - defweights[pagec] + chc*deflengths[pagec], - deflengths[pagec]*sizeof(uint16)); - } - } - - /* - Aply the alternative rule: - shift to the base character and primary difference. - */ - chc= rule[i].curr & 0xFF; - chb= rule[i].base & 0xFF; - memcpy(newweights[pagec] + chc*newlengths[pagec], - defweights[pageb] + chb*deflengths[pageb], - deflengths[pageb]*sizeof(uint16)); - /* Apply primary difference */ - newweights[pagec][chc*newlengths[pagec]]+= rule[i].diff[0]; - } - - /* Copy non-overwritten pages from the default UCA weights */ - for (i= 0; i < 256 ; i++) - if (!newweights[i]) - newweights[i]= defweights[i]; - - to->sort_order= newlengths; - to->sort_order_big= newweights; - - return 0; - -err: - return 1; -} -#endif - static my_bool simple_cs_is_full(CHARSET_INFO *cs) { @@ -791,22 +209,28 @@ static int add_collation(CHARSET_INFO *cs) if (!(all_charsets[cs->number]->state & MY_CS_COMPILED)) { + CHARSET_INFO *new= all_charsets[cs->number]; + if (cs_copy_data(all_charsets[cs->number],cs)) + return MY_XML_ERROR; + if (!strcmp(cs->csname,"ucs2") ) { #ifdef HAVE_CHARSET_ucs2 - CHARSET_INFO *new= all_charsets[cs->number]; new->cset= my_charset_ucs2_general_uca.cset; new->coll= my_charset_ucs2_general_uca.coll; - if (ucs2_copy_data(new, cs)) - return MY_XML_ERROR; + new->strxfrm_multiply= my_charset_ucs2_general_uca.strxfrm_multiply; + new->min_sort_char= my_charset_ucs2_general_uca.min_sort_char; + new->max_sort_char= my_charset_ucs2_general_uca.max_sort_char; + new->mbminlen= 2; + new->mbmaxlen= 2; new->state |= MY_CS_AVAILABLE | MY_CS_LOADED; #endif } else { simple_cs_init_functions(all_charsets[cs->number]); - if (simple_cs_copy_data(all_charsets[cs->number],cs)) - return MY_XML_ERROR; + new->mbminlen= 1; + new->mbmaxlen= 1; if (simple_cs_is_full(all_charsets[cs->number])) { all_charsets[cs->number]->state |= MY_CS_LOADED; @@ -922,6 +346,10 @@ void add_compiled_collation(CHARSET_INFO *cs) cs->state|= MY_CS_AVAILABLE; } +static void *cs_alloc(uint size) +{ + return my_once_alloc(size, MYF(MY_WME)); +} #ifdef __NETWARE__ @@ -955,9 +383,9 @@ static my_bool init_available_charsets(myf myflags) { if (*cs) { - set_max_sort_char(*cs); if (cs[0]->ctype) - init_state_maps(*cs); + if (init_state_maps(*cs)) + *cs= NULL; } } @@ -1041,6 +469,14 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) } cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL; } + if (cs && !(cs->state & MY_CS_READY)) + { + if ((cs->cset->init && cs->cset->init(cs, cs_alloc)) || + (cs->coll->init && cs->coll->init(cs, cs_alloc))) + cs= NULL; + else + cs->state|= MY_CS_READY; + } pthread_mutex_unlock(&THR_LOCK_charset); return cs; } diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 7b5371c4289..f16f2b7ab72 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -55,7 +55,6 @@ TODO: #include "mysys_err.h" static void my_aiowait(my_aio_result *result); #endif -#include <assert.h> #include <errno.h> #ifdef THREAD diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 70b2f288538..3755bcdb53d 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -23,7 +23,6 @@ #include <m_string.h> #include <stdarg.h> #include <m_ctype.h> -#include <assert.h> my_off_t my_b_append_tell(IO_CACHE* info) { diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 168483f276b..32b3154b8ed 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -44,7 +44,6 @@ #include "my_static.h" #include <m_string.h> #include <errno.h> -#include <assert.h> #include <stdarg.h> /* diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c index e2ad71654dc..0b337a74c19 100644 --- a/mysys/mf_tempfile.c +++ b/mysys/mf_tempfile.c @@ -83,7 +83,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, (*free)(res); file=my_create(to, 0, mode, MyFlags); } -#elif defined(HAVE_MKSTEMP) +#elif defined(HAVE_MKSTEMP) && !defined(__NETWARE__) { char prefix_buff[30]; uint pfx_len; diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index 0f8984e6b3d..3a09255b0b0 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -35,7 +35,6 @@ #include "mysys_priv.h" #include <my_bitmap.h> -#include <assert.h> #include <m_string.h> diff --git a/mysys/my_error.c b/mysys/my_error.c index 9789de9d58a..8a377f63c7e 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -33,6 +33,12 @@ char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; nr Errno MyFlags Flags ... variable list + NOTE + The following subset of printf format is supported: + "%[0-9.-]*l?[sdu]", where all length flags are parsed but ignored. + + Additionally "%.*s" is supported and "%.*[ud]" is correctly parsed but + the length value is ignored. */ int my_error(int nr,myf MyFlags, ...) @@ -43,7 +49,10 @@ int my_error(int nr,myf MyFlags, ...) reg2 char *endpos; char * par; char ebuff[ERRMSGSIZE+20]; + int prec_chars; /* output precision */ + my_bool prec_supplied; DBUG_ENTER("my_error"); + LINT_INIT(prec_chars); /* protected by prec_supplied */ va_start(ap,MyFlags); DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno)); @@ -59,7 +68,6 @@ int my_error(int nr,myf MyFlags, ...) if (tpos[0] != '%') { *endpos++= *tpos++; /* Copy ordinary char */ - olen++; continue; } if (*++tpos == '%') /* test if %% */ @@ -68,43 +76,71 @@ int my_error(int nr,myf MyFlags, ...) } else { - /* Skip if max size is used (to be compatible with printf) */ - while (my_isdigit(&my_charset_latin1, *tpos) || *tpos == '.' || *tpos == '-') - tpos++; - if (*tpos == 'l') /* Skip 'l' argument */ - tpos++; + /* + Skip size/precision flags to be compatible with printf. + The only size/precision flag supported is "%.*s". + If "%.*u" or "%.*d" are encountered, the precision number is read + from the variable argument list but its value is ignored. + */ + prec_supplied= 0; + if (*tpos== '.') + { + tpos++; + olen--; + if (*tpos == '*') + { + tpos++; + olen--; + prec_chars= va_arg(ap, int); /* get length parameter */ + prec_supplied= 1; + } + } + + if (!prec_supplied) + { + while (my_isdigit(&my_charset_latin1, *tpos) || *tpos == '.' || + *tpos == '-') + tpos++; + + if (*tpos == 'l') /* Skip 'l' argument */ + tpos++; + } + if (*tpos == 's') /* String parameter */ { - par = va_arg(ap, char *); - plen = (uint) strlen(par); + par= va_arg(ap, char *); + plen= (uint) strlen(par); + if (prec_supplied && prec_chars > 0) + plen= min((uint)prec_chars, plen); if (olen + plen < ERRMSGSIZE+2) /* Replace if possible */ { - endpos=strmov(endpos,par); - tpos++; - olen+=plen-2; - continue; + strmake(endpos, par, plen); + endpos+= plen; + tpos++; + olen+= plen-2; + continue; } } else if (*tpos == 'd' || *tpos == 'u') /* Integer parameter */ { register int iarg; - iarg = va_arg(ap, int); + iarg= va_arg(ap, int); if (*tpos == 'd') plen= (uint) (int10_to_str((long) iarg, endpos, -10) - endpos); else plen= (uint) (int10_to_str((long) (uint) iarg, endpos, 10) - endpos); if (olen + plen < ERRMSGSIZE+2) /* Replace parameter if possible */ { - endpos+=plen; + endpos+= plen; tpos++; - olen+=plen-2; + olen+= plen-2; continue; } } } - *endpos++='%'; /* % used as % or unknown code */ + *endpos++= '%'; /* % used as % or unknown code */ } - *endpos='\0'; /* End of errmessage */ + *endpos= '\0'; /* End of errmessage */ va_end(ap); DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags)); } diff --git a/mysys/my_gethostbyname.c b/mysys/my_gethostbyname.c index 5044a505054..27281f3489d 100644 --- a/mysys/my_gethostbyname.c +++ b/mysys/my_gethostbyname.c @@ -18,7 +18,6 @@ /* Thread safe version of gethostbyname_r() */ #include "mysys_priv.h" -#include <assert.h> #if !defined(MSDOS) && !defined(__WIN__) #include <netdb.h> #endif diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 8d0b05d55f7..d7a9babe5e7 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -18,7 +18,6 @@ #include <m_string.h> #include <stdlib.h> #include <my_getopt.h> -#include <assert.h> #include <my_sys.h> #include <mysys_err.h> diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index d721418ffa1..37517fb8327 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -23,7 +23,6 @@ #include <signal.h> #include <m_string.h> #include <thr_alarm.h> -#include <assert.h> #if (defined(__BSD__) || defined(_BSDI_VERSION)) && !defined(HAVE_mit_thread) #define SCHED_POLICY SCHED_RR diff --git a/mysys/my_seek.c b/mysys/my_seek.c index ec24a26b3d9..6af65d70fd0 100644 --- a/mysys/my_seek.c +++ b/mysys/my_seek.c @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mysys_priv.h" -#include <assert.h> /* Seek to position in file */ /*ARGSUSED*/ diff --git a/mysys/rijndael.c b/mysys/rijndael.c index dd0c45445d5..43cd14101ca 100644 --- a/mysys/rijndael.c +++ b/mysys/rijndael.c @@ -26,7 +26,6 @@ */ #include <my_global.h> -#include <assert.h> #include "rijndael.h" /* diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 54aa4d421f6..84a8e779ae1 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -27,7 +27,6 @@ #include <m_string.h> #include <queues.h> #include "thr_alarm.h" -#include <assert.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> /* AIX needs this for fd_set */ diff --git a/ndb/Makefile.am b/ndb/Makefile.am index 6737cee5bbc..82f424fcfb4 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -1,4 +1,5 @@ -SUBDIRS = src test tools . include +SUBDIRS = src tools . include @ndb_opt_subdirs@ +DIST_SUBDIRS = src tools include test docs EXTRA_DIST = config include $(top_srcdir)/ndb/config/common.mk.am diff --git a/ndb/bin/mysqlcluster b/ndb/bin/mysqlcluster deleted file mode 100755 index 81fc7308942..00000000000 --- a/ndb/bin/mysqlcluster +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then - echo "MYSQLCLUSTER_TOP not set or directory does not exist" - exit 1 -fi -if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then - echo "$MYSQLCLUSTER_TOP/ndb directory does not exist" - exit 1 -fi - -mysql --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $* diff --git a/ndb/bin/mysqlcluster_install_db b/ndb/bin/mysqlcluster_install_db deleted file mode 100755 index 6fe95ff105d..00000000000 --- a/ndb/bin/mysqlcluster_install_db +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh - -NDB_HOME= -export NDB_CONNECTSTRING -if [ -z "$MYSQLCLUSTER_TOP" ]; then - echo "MYSQLCLUSTER_TOP not set" - exit 1 -fi -if [ -d "$MYSQLCLUSTER_TOP" ]; then :; else - echo "$MYSQLCLUSTER_TOP directory does not exist" - exit 1 -fi -if [ -d "$MYSQLCLUSTER_TOP/ndb" ]; then :; else - echo "$MYSQLCLUSTER_TOP/ndb directory does not exist" - exit 1 -fi - -start_default_ndbcluster() { - -# configurable parameters, make sure to change in mysqlcluterd as well -MYSQLCLUSTER_FILESYSTEM=$MYSQLCLUSTER_TOP/data/mysqlclusterfs -MYSQLCLUSTER_PORT_BASE="22" # using ports MYSQLCLUSTER_PORT_BASE{"00","01", etc} -# end configurable parameters - -# do some checks - -NDB_CONNECTSTRING= - -[ -d "$MYSQLCLUSTER_FILESYSTEM" ] || mkdir "$MYSQLCLUSTER_FILESYSTEM" -if [ -d "$MYSQLCLUSTER_FILESYSTEM" ]; then :; else - echo "$MYSQLCLUSTER_FILESYSTEM filesystem directory does not exist" - exit 1 -fi - - -# set som help variables - -NDB_HOST="localhost" -NDB_PORT=$MYSQLCLUSTER_PORT_BASE"00" -NDB_CONNECTSTRING_BASE="host=$NDB_HOST:$NDB_PORT;nodeid=" - - -# Edit file system path and ports in config file - -cd $MYSQLCLUSTER_FILESYSTEM -sed \ - -e s,"WRITE_PATH_TO_FILESYSTEM_2_HERE",$MYSQLCLUSTER_FILESYSTEM,g \ - -e s,"CHOOSE_PORT_BASE",$MYSQLCLUSTER_PORT_BASE,g \ - < $MYSQLCLUSTER_TOP/ndb/demos/config-templates/config_template-install.ini \ - > config.ini - - -# Start management server as deamon - -NDB_ID="1" -NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID -#xterm -e mgmtsrvr -c $MYSQLCLUSTER_FILESYSTEM/config.ini & -if mgmtsrvr -d -c $MYSQLCLUSTER_FILESYSTEM/config.ini ; then :; else - echo "Unable to start mgmtsrvr" - exit 1 -fi - - -# Start database node - -cd $MYSQLCLUSTER_FILESYSTEM # the output from the database node gets where it starts -NDB_ID="2" -NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID -#xterm -T "NDB Cluster DB Node" -geometry 80x10 -xrm *.hold:true -e ndb -i & -ndb -d -i & - -# Start xterm for application programs - -NDB_ID="3" -NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID -#xterm -T "NDB Cluster API Node" -geometry 80x10 & -echo set before running ndbApi programs > export NDB_CONNECTSTRING=$NDB_CONNECTSTRING - -# Start management client - -#xterm -T "NDB Management Client" -geometry 80x10 -xrm *.hold:true -e mgmtclient $NDB_HOST $NDB_PORT & -echo "NDB Management Client starts with: mgmtclient $NDB_HOST $NDB_PORT" - -# test if Ndb Cluster starts properly - -NDB_ID="11" -NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID -if list_tables | grep "NDBT_ProgramExit: 0 - OK"; then :; else - echo "Ndbcluster startup failed" - exit 1 -fi -} - -start_mysql_install_db() { - # run install of regular MySQL Server - - cd $MYSQLCLUSTER_TOP - scripts/mysql_install_db --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $* -} - -if test "$1" = "ndb_started" -then - shift - mgmt_host=$1 - shift - mgmt_port=$1 - shift - if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then - echo "syntax: ndb_started hostname port" - exit 1 - fi - NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11" - echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING - start_mysql_install_db $* -else - start_default_ndbcluster - start_mysql_install_db -fi - diff --git a/ndb/bin/mysqlclusterd b/ndb/bin/mysqlclusterd deleted file mode 100755 index 3b4deb3ed48..00000000000 --- a/ndb/bin/mysqlclusterd +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -# configurable parameters -MYSQLCLUSTER_PORT_BASE="22" -# end configurable parameters - -if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then - echo "MYSQLCLUSTER_TOP not set or directory does not exist" - exit 1 -fi -if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then - echo "$MYSQLCLUSTER_TOP/ndb directory does not exist" - exit 1 -fi - -if test "$1" = "ndb_started" -then - shift - mgmt_host=$1 - shift - mgmt_port=$1 - shift - if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then - echo "syntax: ndb_started hostname port" - exit 1 - fi - NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11" - echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING -else - NDB_CONNECTSTRING="host=localhost:"$MYSQLCLUSTER_PORT_BASE"00;nodeid=11" -fi -export NDB_CONNECTSTRING - -mysqld --default-table-type=ndbcluster --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $* diff --git a/ndb/config/common.mk.am b/ndb/config/common.mk.am index 593e00d8959..869e2fae91d 100644 --- a/ndb/config/common.mk.am +++ b/ndb/config/common.mk.am @@ -9,5 +9,4 @@ mgmapiincludedir = "$(pkgincludedir)/ndb/mgmapi" INCLUDES = $(INCLUDES_LOC) LDADD = $(top_srcdir)/ndb/src/common/portlib/gcc.cpp $(LDADD_LOC) DEFS = @DEFS@ @NDB_DEFS@ $(DEFS_LOC) $(NDB_EXTRA_FLAGS) -# ndb cannot be compiled with -fno-implicit-templaces -NDB_CXXFLAGS=-fimplicit-templates +NDB_CXXFLAGS=@ndb_cxxflags_fix@ $(NDB_CXXFLAGS_LOC) diff --git a/ndb/config/old_files/Defs.DEBUG.mk b/ndb/config/old_files/Defs.DEBUG.mk deleted file mode 100644 index 309ae90a0ba..00000000000 --- a/ndb/config/old_files/Defs.DEBUG.mk +++ /dev/null @@ -1,4 +0,0 @@ - -VERSION_FLAGS := -DNDB_DEBUG -DUSE_EMULATED_JAM -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD -#-DDEBUG_TRANSPORTER - diff --git a/ndb/config/old_files/Defs.HPUX.HPPA.GCC.mk b/ndb/config/old_files/Defs.HPUX.HPPA.GCC.mk deleted file mode 100644 index 895c7672071..00000000000 --- a/ndb/config/old_files/Defs.HPUX.HPPA.GCC.mk +++ /dev/null @@ -1,50 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := g++ -CC := gcc -AR_RCS := ar rcs -SO := ld -b -o - -SHLIBEXT := sl - -MAKEDEPEND := g++ -M -PIC := -fPIC - -RPCGENFLAGS := -MA -C -N -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -CCFLAGS_WARNINGS = -Wno-long-long -W -Wall -pedantic -# -Wno-sign-compare Use this flag if you are annoyed with all the warnings -CCFLAGS_TOP = -DHPUX -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = -lpthread -lnsl -lrt - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - diff --git a/ndb/config/old_files/Defs.IBMAIX.POWERPC.GCC.mk b/ndb/config/old_files/Defs.IBMAIX.POWERPC.GCC.mk deleted file mode 100644 index ae975fb2cb8..00000000000 --- a/ndb/config/old_files/Defs.IBMAIX.POWERPC.GCC.mk +++ /dev/null @@ -1,49 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := g++ -CC := gcc -AR_RCS := $(PURE) ar rcs -SO := g++ -shared -o - -MAKEDEPEND := g++ -M -PIC := -fPIC - -RPCGENFLAGS := -M -C -N - -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -CCFLAGS_WARNINGS = -Wno-long-long -Wall #-pedantic -# Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -CCFLAGS_TOP += -fno-rtti - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = -lpthread -lrt - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) diff --git a/ndb/config/old_files/Defs.LINUX.x86.GCC.mk b/ndb/config/old_files/Defs.LINUX.x86.GCC.mk deleted file mode 100644 index 6167a30ff23..00000000000 --- a/ndb/config/old_files/Defs.LINUX.x86.GCC.mk +++ /dev/null @@ -1,60 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := gcc$(GCC_VERSION) -CC := gcc$(GCC_VERSION) -AR_RCS := $(PURE) ar rcs -SO := gcc$(GCC_VERSION) -shared -lpthread -o -#SO := gcc$(GCC_VERSION) -shared -o - -MAKEDEPEND := gcc$(GCC_VERSION) -M -#MAKEDEPEND := gcc$(GCC_VERSION) -M -nostdinc -nostdinc++ -PIC := -fPIC - -RPCGENFLAGS := -M -C -N - -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -# gcc3.3 __THROW problem if -pedantic and -O2 -ifeq ($(NDB_VERSION),DEBUG) -CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic -else -CCFLAGS_WARNINGS = -Wno-long-long -Wall -endif -# Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -#CCFLAGS_TOP = -DSAFE_MUTEX -CCFLAGS_TOP += -fno-rtti -fno-exceptions - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(CC) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - -LDFLAGS_LAST = -lrt -lpthread $(NDB_TOP)/src/common/portlib/gcc.cpp -#LDFLAGS_LAST = -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp $(NDB_TOP)/../mysys/libmysys.a $(NDB_TOP)/../dbug/libdbug.a $(NDB_TOP)/../regex/libregex.a $(NDB_TOP)/../strings/libmystrings.a -lpthread diff --git a/ndb/config/old_files/Defs.LINUX.x86.ICC.mk b/ndb/config/old_files/Defs.LINUX.x86.ICC.mk deleted file mode 100644 index 8e8540409da..00000000000 --- a/ndb/config/old_files/Defs.LINUX.x86.ICC.mk +++ /dev/null @@ -1,54 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := icc -CC := icc -AR_RCS := $(PURE) ar rcs -SO := g++$(GCC_VERSION) -shared -lpthread -o - -MAKEDEPEND := g++$(GCC_VERSION) -M -PIC := -fPIC - -RPCGENFLAGS := -M -C -N - -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -# gcc3.3 __THROW problem if -pedantic and -O2 -ifeq ($(NDB_VERSION),DEBUG) -CCFLAGS_WARNINGS = -else -CCFLAGS_WARNINGS = -endif -# Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -CCFLAGS_TOP += - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = -lpthread -lrt - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) diff --git a/ndb/config/old_files/Defs.LINUX.x86_64.GCC.mk b/ndb/config/old_files/Defs.LINUX.x86_64.GCC.mk deleted file mode 100644 index a238d29ef4c..00000000000 --- a/ndb/config/old_files/Defs.LINUX.x86_64.GCC.mk +++ /dev/null @@ -1,54 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := g++ -CC := gcc -AR_RCS := $(PURE) ar rcs -SO := g++ -shared -lpthread -o - -MAKEDEPEND := g++ -M -PIC := -fPIC - -RPCGENFLAGS := -M -C -N - -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -# gcc3.3 __THROW problem if -pedantic and -O2 -ifeq ($(NDB_VERSION),DEBUG) -CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic -else -CCFLAGS_WARNINGS = -Wno-long-long -Wall -endif -# Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -CCFLAGS_TOP += -fno-rtti -fno-exceptions -m64 - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = -lpthread -lrt - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) diff --git a/ndb/config/old_files/Defs.MACOSX.POWERPC.GCC.mk b/ndb/config/old_files/Defs.MACOSX.POWERPC.GCC.mk deleted file mode 100644 index bb73e9bcc61..00000000000 --- a/ndb/config/old_files/Defs.MACOSX.POWERPC.GCC.mk +++ /dev/null @@ -1,58 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := gcc -CC := gcc -CXX := gcc -AR_RCS := $(PURE) ar rcs -#SO := g++ -dynamiclib -Wl,-segprot,__TEXT,rwx,rwx -o -SO := gcc -dynamiclib -o - -SHLIBEXT := dylib - -MAKEDEPEND := gcc -M -PIC := -fPIC - -RPCGENFLAGS := -M -C -N - -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -CCFLAGS_WARNINGS = -Wno-long-long -Wall -Winline #-Werror#-pedantic -# Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_BIG_ENDIAN -CXX_FLAGS_TOP = -fno-rtti -felide-constructors -fno-exceptions -fno-omit-fram-pointer -C_FLAGS_TOP += -fno-omit-frame-pointer - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(CXXFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(C_FLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - -#LDFLAGS_LAST = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -LDFLAGS_LAST = -lstdc++ - diff --git a/ndb/config/old_files/Defs.OSE.PPC750.DIAB.mk b/ndb/config/old_files/Defs.OSE.PPC750.DIAB.mk deleted file mode 100644 index 8773021a152..00000000000 --- a/ndb/config/old_files/Defs.OSE.PPC750.DIAB.mk +++ /dev/null @@ -1,47 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := dplus -CC := dcc -AR_RCS := $(PURE) ar rcs -SO := dar -r - -MAKEDEPEND := g++ -M -nostdinc -PIC := - -RPCGENFLAGS := -MA -C -N - -### -# -# Flags -# -CCFLAGS_INCLUDE = -I/vobs/cello/cls/rtosi_if/include -I/vobs/cello/cls/rtosi_if/include.mp750 -I/vobs/cello/cls/rtosi_if/include.ppc -CCFLAGS_TOP = -tPPC750EH -DBIG_ENDIAN -D_BIG_ENDIAN -DPPC -DPPC750 -DOSE_DELTA -DMP -Xlint -Xforce-prototypes -DINLINE=__inline__ -Xansi -Xsmall-data=0 -Xsmall-const=0 -Xstrings-in-text - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -XO -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -XO -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_INCLUDE) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_INCLUDE) - -LDFLAGS_TOP = - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - - - diff --git a/ndb/config/old_files/Defs.RELEASE.mk b/ndb/config/old_files/Defs.RELEASE.mk deleted file mode 100644 index fad72d53a43..00000000000 --- a/ndb/config/old_files/Defs.RELEASE.mk +++ /dev/null @@ -1,3 +0,0 @@ - -VERSION_FLAGS := -DNDB_RELEASE -DUSE_EMULATED_JAM -DNDEBUG - diff --git a/ndb/config/old_files/Defs.RELEASE_TRACE.mk b/ndb/config/old_files/Defs.RELEASE_TRACE.mk deleted file mode 100644 index 06726f282e4..00000000000 --- a/ndb/config/old_files/Defs.RELEASE_TRACE.mk +++ /dev/null @@ -1,3 +0,0 @@ - -VERSION_FLAGS := -DNDB_RELEASE -DUSE_EMULATED_JAM -DNDEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD - diff --git a/ndb/config/old_files/Defs.SIMCELLO.SOFTOSE.GCC.mk b/ndb/config/old_files/Defs.SIMCELLO.SOFTOSE.GCC.mk deleted file mode 100644 index 8d73e7a752b..00000000000 --- a/ndb/config/old_files/Defs.SIMCELLO.SOFTOSE.GCC.mk +++ /dev/null @@ -1,53 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := g++ -CC := gcc -AR_RCS := $(PURE) ar rcs -SO := g++ -shared -o - -MAKEDEPEND := g++ -M -PIC := -fPIC - -### -# -# Flags -# -NDB_STRDUP := Y -CCFLAGS_WARNINGS = -Wall -pedantic -Wno-sign-compare -CC_FLAGS_OSE = -DSPARC -DSIM -DOSE_DELTA -DMP -CCFLAGS_TOP = $(CC_FLAGS_OSE) $(CC_FLAGS_WARNINGS) -DNDB_STRDUP - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -g -else -VERSION_FLAGS += -g -endif -endif - - -CCFLAGS_LOC_OSE= -I/vobs/cello/cls/rtosi_if/include.sparc - - -CCFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDLIBS_LOC = -L$(NDB_TOP)/lib -L$(OSE_LOC)/sfk-solaris2/lib -L$(OSE_LOC)/sfk-solaris2/krn-solaris2/lib - -LDLIBS_TOP = - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(LDFLAGS) - - - diff --git a/ndb/config/old_files/Defs.SOFTOSE.SPARC.GCC.mk b/ndb/config/old_files/Defs.SOFTOSE.SPARC.GCC.mk deleted file mode 100644 index 6788fa956bf..00000000000 --- a/ndb/config/old_files/Defs.SOFTOSE.SPARC.GCC.mk +++ /dev/null @@ -1,57 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := g++ -CC := gcc -AR_RCS := $(PURE) ar rcs -SO := g++ -shared -o - -MAKEDEPEND := g++ -M -PIC := -fPIC - -### -# -# Flags -# -NDB_STRDUP := Y -CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic -Wno-sign-compare -ansi -CC_FLAGS_OSE = -DUSE_OSEDEF_H -DOSE_DELTA -DOS_DEBUG -DBIG_ENDIAN -CCFLAGS_TOP = $(CC_FLAGS_OSE) $(CC_FLAGS_WARNINGS) -DNDB_STRDUP - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -g -else -VERSION_FLAGS += -g -DOS_DEBUG -endif -endif - -OSE_LOC = /opt/as/OSE/OSE4.3.1 - -CCFLAGS_LOC_OSESTD = -I$(OSE_LOC)/sfk-solaris2/std-include -CCFLAGS_LOC_OSE = -I$(OSE_LOC)/sfk-solaris2/include -I$(OSE_LOC)/sfk-solaris2/krn-solaris2/include -I$(NDB_TOP)/src/env/softose - - -CCFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC_OSESTD) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC_OSE) $(CCFLAGS_LOC_OSESTD) $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDLIBS_LOC = -L$(NDB_TOP)/lib -L$(OSE_LOC)/sfk-solaris2/lib -L$(OSE_LOC)/sfk-solaris2/krn-solaris2/lib - -LDLIBS_TOP = - -LDLIBS_LAST = -lsoftose_env -lsoftose_krn -llnh -lefs -lshell -lfss -ltosv -lrtc -lheap -linetutil -linetapi -lsoftose -lsoftose_env -lsoftose_krn -losepthread -lrtc -lnsl -lsocket -lpthread -lcrt -lm - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(LDFLAGS) - - - diff --git a/ndb/config/old_files/Defs.SOLARIS.SPARC.FORTE6.mk b/ndb/config/old_files/Defs.SOLARIS.SPARC.FORTE6.mk deleted file mode 100644 index 8a95205703d..00000000000 --- a/ndb/config/old_files/Defs.SOLARIS.SPARC.FORTE6.mk +++ /dev/null @@ -1,54 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := CC -CC := /opt/as/forte6/SUNWspro/bin/cc -AR_RCS := $(PURE) CC -xar -o -SO := CC -G -z text -o - -MAKEDEPEND := CC -xM1 -PIC := -KPIC -ETAGS := etags -CTAGS := ctags - -RPCGENFLAGS := -MA -C -N - -### -# -# Flags - -CCFLAGS_TOP = -mt -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS - -ifneq ($(PURE),) - CCFLAGS_TOP += -xs - CCFLAGS_TOP += -DNDB_PURIFY -endif - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -xO3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -xO3 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) - -LDFLAGS_TOP = -L/opt/as/forte6/SUNWspro/WS6/lib -lpthread -lsocket -lnsl -lrt - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) -xildoff $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - - - - diff --git a/ndb/config/old_files/Defs.SOLARIS.SPARC.GCC.mk b/ndb/config/old_files/Defs.SOLARIS.SPARC.GCC.mk deleted file mode 100644 index 25920515278..00000000000 --- a/ndb/config/old_files/Defs.SOLARIS.SPARC.GCC.mk +++ /dev/null @@ -1,54 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -CXX := gcc -C++ := g++ -CC := gcc -AR_RCS := ar rcs -SO := gcc -G -o - -#GXX_VERSION := $(shell gcc --version | sed -e 's,.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*,\1,1' -e q) - -MAKEDEPEND := g++ -M -PIC := -fPIC - -RPCGENFLAGS := -MA -C -N -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -CCFLAGS_WARNINGS = -Wno-long-long -W -Wall -pedantic -# -Wno-sign-compare Use this flag if you are annoyed with all the warnings -CCFLAGS_TOP = -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER -CCFLAGS_TOP += -fno-rtti - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(CXX) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - -LDFLAGS_LAST = -lpthread -lsocket -lnsl -lrt -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic - diff --git a/ndb/config/old_files/Defs.SOLARIS.SPARC_64.GCC.mk b/ndb/config/old_files/Defs.SOLARIS.SPARC_64.GCC.mk deleted file mode 100644 index 2b8b9d4cc24..00000000000 --- a/ndb/config/old_files/Defs.SOLARIS.SPARC_64.GCC.mk +++ /dev/null @@ -1,53 +0,0 @@ -### -# -# Note: LD_LIBRARY_PATH must be set for /usr/local/lib/sparcv9 to dynamically link -# to 64-bit libraries -# -# Defines -SHELL := /bin/sh - -C++ := g++ -m64 -CC := gcc -m64 -AR_RCS := ar rcs -SO := g++ -m64 -shared -o - -MAKEDEPEND := g++ -M -PIC := -fPIC - -RPCGENFLAGS := -MA -C -N -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -CCFLAGS_WARNINGS = -Wno-long-long -W -Wall -pedantic -# -Wno-sign-compare Use this flag if you are annoyed with all the warnings -CCFLAGS_TOP = -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER -CCFLAGS_TOP += -fno-rtti - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O2 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = -lpthread -lsocket -lnsl -lrt - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - - diff --git a/ndb/config/old_files/Defs.SOLARIS6.SPARC.GCC.mk b/ndb/config/old_files/Defs.SOLARIS6.SPARC.GCC.mk deleted file mode 100644 index f1c570ba101..00000000000 --- a/ndb/config/old_files/Defs.SOLARIS6.SPARC.GCC.mk +++ /dev/null @@ -1,53 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := g++ -CC := gcc -AR_RCS := $(PURE) ar rcs -SO := g++ -shared -o - -MAKEDEPEND := g++ -M -PIC := -fPIC - -RPCGENFLAGS := -MA -C -N - -### -# -# Flags -# -CCFLAGS_WARNINGS = -Wno-long-long -Wall -pedantic -# -Wno-sign-compare Use this flag if you are annoyed with all the warnings -CCFLAGS_TOP = -DSOLARIS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DNO_COMMAND_HANDLER - -# SOLARIS 6 should use the same settings as SOLARIS7 -# if something in the SOLARIS 7 port does not work for SOLARIS 6 -# it can be ifdefed using -# if ! defined NDB_SOLRIS6 -CCFLAGS_TOP = -DNDB_SOLARIS - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = -lpthread -lsocket -lnsl -lposix4 - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) - - diff --git a/ndb/config/old_files/Defs.TRU64X.ALPHA.GCC.mk b/ndb/config/old_files/Defs.TRU64X.ALPHA.GCC.mk deleted file mode 100644 index ae975fb2cb8..00000000000 --- a/ndb/config/old_files/Defs.TRU64X.ALPHA.GCC.mk +++ /dev/null @@ -1,49 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - -C++ := g++ -CC := gcc -AR_RCS := $(PURE) ar rcs -SO := g++ -shared -o - -MAKEDEPEND := g++ -M -PIC := -fPIC - -RPCGENFLAGS := -M -C -N - -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -CCFLAGS_WARNINGS = -Wno-long-long -Wall #-pedantic -# Add these for more warnings -Weffc++ -W -CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -CCFLAGS_TOP += -fno-rtti - -ifeq (RELEASE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -VERSION_FLAGS += -O3 -g -else -VERSION_FLAGS += -g -endif -endif - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = -lpthread -lrt - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -LINK.cc = $(PURE) $(C++) $(CCFLAGS) $(LDFLAGS) - -LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS) diff --git a/ndb/config/old_files/Defs.WIN32.x86.VC7.mk b/ndb/config/old_files/Defs.WIN32.x86.VC7.mk deleted file mode 100644 index e66dacb78e7..00000000000 --- a/ndb/config/old_files/Defs.WIN32.x86.VC7.mk +++ /dev/null @@ -1,61 +0,0 @@ -### -# -# Defines -SHELL := /bin/sh - - -DEFINES = -D_WIN32 -D_M_IX86=600 -D_MSC_EXTENSIONS=0 -U_cdecl -D_MT -# -MAKEDEPEND = g++ -M --nostdinc --nostdinc++ -I"`cygpath -u "$(MSVCDIR)\include"`" -I"`cygpath -u "$(MSVCDIR)\PlatformSDK\include"`" $(DEFINES) -PIC = -D_LIB -NON_PIC = -D_LIB - -RPCGENFLAGS := -M -C -N - -ETAGS := etags -CTAGS := ctags - -### -# -# Flags -# -CCFLAGS_WARNINGS = -CCFLAGS_TOP = -CCFLAGS_LOC = -CCFLAGS_WIN = -DWIN32 -D_WIN32_WINNT=0x0500 -DWINVER=0x0500 -D_MBCS -DNO_COMMAND_HANDLER -CCFLAGS_WIN += -W3 -EHsc -#CCFLAGS_WIN += -clr - -ifeq (RELEASE, $(NDB_VERSION)) -CCFLAGS_WIN += -MT -O2 -Ob1 -DNO_DEBUG_MESSAGES -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -CCFLAGS_WIN += -MT -O2 -Ob1 -DNO_DEBUG_MESSAGES -else -CCFLAGS_WIN += -MTd -Zi -Od -GS -D_DEBUG -endif -endif - -C++ = cl -nologo $(CCFLAGS_WIN) -CC = cl -nologo $(CCFLAGS_WIN) - -CCFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) -CFLAGS = $(CCFLAGS_LOC) $(CCFLAGS_TOP) $(USER_FLAGS) $(VERSION_FLAGS) $(CCFLAGS_WARNINGS) - -LDFLAGS_TOP = - -LDFLAGS = $(LDFLAGS_LOC) $(LDFLAGS_TOP) - -LDLIBS = $(LDLIBS_LOC) $(LDLIBS_TOP) - -WIN_LIBS := Ws2_32.lib Advapi32.lib - -ifeq (RELEASE, $(NDB_VERSION)) -LINK.cc = link -INCREMENTAL:NO -NOLOGO -LARGEADDRESSAWARE $(WIN_LIBS) -else -ifeq (RELEASE_TRACE, $(NDB_VERSION)) -LINK.cc = link -INCREMENTAL:NO -NOLOGO -LARGEADDRESSAWARE $(WIN_LIBS) -else -LINK.cc = link -INCREMENTAL -NOLOGO -DEBUG -LARGEADDRESSAWARE $(WIN_LIBS) -endif -endif diff --git a/ndb/config/old_files/GuessConfig.sh b/ndb/config/old_files/GuessConfig.sh deleted file mode 100755 index 8c7886401ba..00000000000 --- a/ndb/config/old_files/GuessConfig.sh +++ /dev/null @@ -1,116 +0,0 @@ -#! /bin/sh - -if [ -z "$NDB_TOP" ] -then - echo "You have not set NDB_TOP. Exiting" 1>&2 - exit 1 -fi - -if [ -z "$NDB_SCI" ] -then - NDB_SCI=N -fi - -if [ -z "$NDB_SHM" ] -then - NDB_SHM=N -fi - -os=`uname -s` -case $os in -Linux) - NDB_OS=LINUX - NDB_ARCH=x86 - NDB_COMPILER=GCC - ;; -Darwin) - NDB_OS=MACOSX - NDB_ARCH=POWERPC - NDB_COMPILER=GCC - ;; -HP-UX) - NDB_OS=HPUX - NDB_ARCH=HPPA - NDB_COMPILER=GCC - ;; -CYGWIN_NT-5.0) - NDB_OS=WIN32 - NDB_ARCH=x86 - NDB_COMPILER=VC7 - ;; -*) - if [ "$os" = "SunOS" ] && [ `uname -r` = "5.6" ] - then - NDB_OS=OSE - NDB_ARCH=PPC750 - NDB_COMPILER=DIAB - else - NDB_OS=SOLARIS - NDB_ARCH=SPARC - NDB_COMPILER=GCC - fi;; -esac - -if [ -z "$NDB_ODBC" ] -then - NDB_ODBC=N -fi - - -mch=`uname -m` -case $mch in -x86_64) - NDB_ARCH=x86_64 - ;; -*) - ;; -esac - -if [ -f $NDB_TOP/config/Makefile ] -then -TERMCAP_LIB=`grep TERMCAP_LIB $NDB_TOP/config/Makefile | sed -e s,"TERMCAP_LIB.*=.*-l","",g` -fi -if [ "$TERMCAP_LIB" = "" ] -then -TERMCAP_LIB=termcap -fi - -# defaults -NDB_VERSION=DEBUG -PACKAGE= -VERSION= - -parse_arguments() { - for arg do - case "$arg" in - -GCC) NDB_COMPILER=GCC ;; - -R) NDB_VERSION=RELEASE ;; - -D) NDB_VERSION=DEBUG ;; - --PACKAGE=*) PACKAGE=`echo "$arg" | sed -e "s;--PACKAGE=;;"` ;; - --VERSION=*) VERSION=`echo "$arg" | sed -e "s;--VERSION=;;"` ;; - *) - echo "Unknown argument '$arg'" - exit 1 - ;; - esac - done -} - -parse_arguments "$@" - -( - echo "# This file was automatically generated `date`" - echo "NDB_OS := $NDB_OS" - echo "NDB_ARCH := $NDB_ARCH" - echo "NDB_COMPILER := $NDB_COMPILER" - echo "NDB_VERSION := $NDB_VERSION" - echo "NDB_SCI := $NDB_SCI" - echo "NDB_SHM := $NDB_SHM" - echo "NDB_ODBC := $NDB_ODBC" - echo "TERMCAP_LIB := $TERMCAP_LIB" - echo "PACKAGE := $PACKAGE" - echo "VERSION := $VERSION" -) > $NDB_TOP/config/config.mk - -exit 0 - diff --git a/ndb/config/old_files/Makefile.am b/ndb/config/old_files/Makefile.am deleted file mode 100644 index b5fd81814a1..00000000000 --- a/ndb/config/old_files/Makefile.am +++ /dev/null @@ -1,31 +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 - -# Process this file with automake to create Makefile.in - -AUTOMAKE_OPTIONS = foreign - -# These are built from source in the Docs directory -EXTRA_DIST = -SUBDIRS = - -# Relink after clean -linked_sources = - -CLEANFILES = $(linked_sources) - -# This is just so that the linking is done early. -config.h: diff --git a/ndb/config/old_files/acinclude.m4 b/ndb/config/old_files/acinclude.m4 deleted file mode 100644 index b9edaf801ed..00000000000 --- a/ndb/config/old_files/acinclude.m4 +++ /dev/null @@ -1,1513 +0,0 @@ -# Local macros for automake & autoconf - -AC_DEFUN(MYSQL_CHECK_LIBEDIT_INTERFACE,[ - AC_CACHE_CHECK([libedit variant of rl_completion_entry_function], mysql_cv_libedit_interface, - AC_TRY_COMPILE( - [ - #include "stdio.h" - #include "readline/readline.h" - ], - [ - char res= *(*rl_completion_entry_function)(0,0); - completion_matches(0,0); - ], - [ - mysql_cv_libedit_interface=yes - AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE) - ], - [mysql_cv_libedit_interface=no] - ) - ) -]) - -AC_DEFUN(MYSQL_CHECK_NEW_RL_INTERFACE,[ - AC_CACHE_CHECK([defined rl_compentry_func_t and rl_completion_func_t], mysql_cv_new_rl_interface, - AC_TRY_COMPILE( - [ - #include "stdio.h" - #include "readline/readline.h" - ], - [ - rl_completion_func_t *func1= (rl_completion_func_t*)0; - rl_compentry_func_t *func2= (rl_compentry_func_t*)0; - ], - [ - mysql_cv_new_rl_interface=yes - AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE) - ], - [mysql_cv_new_rl_interface=no] - ) - ) -]) - -# A local version of AC_CHECK_SIZEOF that includes sys/types.h -dnl MYSQL_CHECK_SIZEOF(TYPE [, CROSS-SIZE]) -AC_DEFUN(MYSQL_CHECK_SIZEOF, -[changequote(<<, >>)dnl -dnl The name to #define. -define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl -dnl The cache variable name. -define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $1) -AC_CACHE_VAL(AC_CV_NAME, -[AC_TRY_RUN([#include <stdio.h> -#include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> -#endif -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof($1)); - exit(0); -}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl -]) - -#---START: Used in for client configure -AC_DEFUN(MYSQL_TYPE_ACCEPT, -[ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -if test "$ac_cv_prog_gxx" = "yes" -then - CXXFLAGS=`echo $CXXFLAGS -Werror | sed 's/-fbranch-probabilities//'` -fi -mysql_cv_btype_last_arg_accept=none -[AC_TRY_COMPILE([#if defined(inline) -#undef inline -#endif -#include <stdlib.h> -#include <sys/types.h> -#include <sys/socket.h> -], -[int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0); return (a != 0);], -mysql_cv_btype_last_arg_accept=socklen_t)] -if test "$mysql_cv_btype_last_arg_accept" = "none"; then -[AC_TRY_COMPILE([#if defined(inline) -#undef inline -#endif -#include <stdlib.h> -#include <sys/types.h> -#include <sys/socket.h> -], -[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); return (a != 0);], -mysql_cv_btype_last_arg_accept=size_t)] -fi -if test "$mysql_cv_btype_last_arg_accept" = "none"; then -mysql_cv_btype_last_arg_accept=int -fi) -AC_LANG_RESTORE -AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $mysql_cv_btype_last_arg_accept) -CXXFLAGS="$ac_save_CXXFLAGS" -]) -#---END: - -dnl Find type of qsort -AC_DEFUN(MYSQL_TYPE_QSORT, -[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort, -[AC_TRY_COMPILE([#include <stdlib.h> -#ifdef __cplusplus -extern "C" -#endif -void qsort(void *base, size_t nel, size_t width, - int (*compar) (const void *, const void *)); -], -[int i;], mysql_cv_type_qsort=void, mysql_cv_type_qsort=int)]) -AC_DEFINE_UNQUOTED(RETQSORTTYPE, $mysql_cv_type_qsort) -if test "$mysql_cv_type_qsort" = "void" -then - AC_DEFINE_UNQUOTED(QSORT_TYPE_IS_VOID, 1) -fi -]) - -AC_DEFUN(MYSQL_TIMESPEC_TS, -[AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts, -[AC_TRY_COMPILE([#include <pthread.h> -#ifdef __cplusplus -extern "C" -#endif -], -[struct timespec abstime; - -abstime.ts_sec = time(NULL)+1; -abstime.ts_nsec = 0; -], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)]) -if test "$mysql_cv_timespec_ts" = "yes" -then - AC_DEFINE(HAVE_TIMESPEC_TS_SEC) -fi -]) - -AC_DEFUN(MYSQL_TZNAME, -[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname, -[AC_TRY_COMPILE([#include <time.h> -#ifdef __cplusplus -extern "C" -#endif -], -[ tzset(); - return tzname[0] != 0; -], mysql_cv_tzname=yes, mysql_cv_tzname=no)]) -if test "$mysql_cv_tzname" = "yes" -then - AC_DEFINE(HAVE_TZNAME) -fi -]) - -AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [ -save_LIBS="$LIBS" -LIBS="-l$1 $LIBS" -AC_CACHE_CHECK([if libz with compress], mysql_cv_compress, -[AC_TRY_RUN([#include <zlib.h> -#ifdef __cplusplus -extern "C" -#endif -int main(int argv, char **argc) -{ - return 0; -} - -int link_test() -{ - return compress(0, (unsigned long*) 0, "", 0); -} -], mysql_cv_compress=yes, mysql_cv_compress=no)]) -if test "$mysql_cv_compress" = "yes" -then - AC_DEFINE(HAVE_COMPRESS) -else - LIBS="$save_LIBS" -fi -]) - -#---START: Used in for client configure -AC_DEFUN(MYSQL_CHECK_ULONG, -[AC_MSG_CHECKING(for type ulong) -AC_CACHE_VAL(ac_cv_ulong, -[AC_TRY_RUN([#include <stdio.h> -#include <sys/types.h> -main() -{ - ulong foo; - foo++; - exit(0); -}], ac_cv_ulong=yes, ac_cv_ulong=no, ac_cv_ulong=no)]) -AC_MSG_RESULT($ac_cv_ulong) -if test "$ac_cv_ulong" = "yes" -then - AC_DEFINE(HAVE_ULONG) -fi -]) - -AC_DEFUN(MYSQL_CHECK_UCHAR, -[AC_MSG_CHECKING(for type uchar) -AC_CACHE_VAL(ac_cv_uchar, -[AC_TRY_RUN([#include <stdio.h> -#include <sys/types.h> -main() -{ - uchar foo; - foo++; - exit(0); -}], ac_cv_uchar=yes, ac_cv_uchar=no, ac_cv_uchar=no)]) -AC_MSG_RESULT($ac_cv_uchar) -if test "$ac_cv_uchar" = "yes" -then - AC_DEFINE(HAVE_UCHAR) -fi -]) - -AC_DEFUN(MYSQL_CHECK_UINT, -[AC_MSG_CHECKING(for type uint) -AC_CACHE_VAL(ac_cv_uint, -[AC_TRY_RUN([#include <stdio.h> -#include <sys/types.h> -main() -{ - uint foo; - foo++; - exit(0); -}], ac_cv_uint=yes, ac_cv_uint=no, ac_cv_uint=no)]) -AC_MSG_RESULT($ac_cv_uint) -if test "$ac_cv_uint" = "yes" -then - AC_DEFINE(HAVE_UINT) -fi -]) - - -AC_DEFUN(MYSQL_CHECK_IN_ADDR_T, -[AC_MSG_CHECKING(for type in_addr_t) -AC_CACHE_VAL(ac_cv_in_addr_t, -[AC_TRY_RUN([#include <stdio.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> - -int main(int argc, char **argv) -{ - in_addr_t foo; - exit(0); -}], ac_cv_in_addr_t=yes, ac_cv_in_addr_t=no, ac_cv_in_addr_t=no)]) -AC_MSG_RESULT($ac_cv_in_addr_t) -if test "$ac_cv_in_addr_t" = "yes" -then - AC_DEFINE(HAVE_IN_ADDR_T) -fi -]) - - -AC_DEFUN(MYSQL_PTHREAD_YIELD, -[AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg, -[AC_TRY_LINK([#define _GNU_SOURCE -#include <pthread.h> -#ifdef __cplusplus -extern "C" -#endif -], -[ - pthread_yield(); -], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)]) -if test "$ac_cv_pthread_yield_zero_arg" = "yes" -then - AC_DEFINE(HAVE_PTHREAD_YIELD_ZERO_ARG) -fi -] -[AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg, -[AC_TRY_LINK([#define _GNU_SOURCE -#include <pthread.h> -#ifdef __cplusplus -extern "C" -#endif -], -[ - pthread_yield(0); -], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)]) -if test "$ac_cv_pthread_yield_one_arg" = "yes" -then - AC_DEFINE(HAVE_PTHREAD_YIELD_ONE_ARG) -fi -] -) - - - -#---END: - -AC_DEFUN(MYSQL_CHECK_FP_EXCEPT, -[AC_MSG_CHECKING(for type fp_except) -AC_CACHE_VAL(ac_cv_fp_except, -[AC_TRY_RUN([#include <stdio.h> -#include <sys/types.h> -#include <ieeefp.h> -main() -{ - fp_except foo; - foo++; - exit(0); -}], ac_cv_fp_except=yes, ac_cv_fp_except=no, ac_cv_fp_except=no)]) -AC_MSG_RESULT($ac_cv_fp_except) -if test "$ac_cv_fp_except" = "yes" -then - AC_DEFINE(HAVE_FP_EXCEPT) -fi -]) - -# From fileutils-3.14/aclocal.m4 - -# @defmac AC_PROG_CC_STDC -# @maindex PROG_CC_STDC -# @ovindex CC -# If the C compiler in not in ANSI C mode by default, try to add an option -# to output variable @code{CC} to make it so. This macro tries various -# options that select ANSI C on some system or another. It considers the -# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and -# handles function prototypes correctly. -# -# Patched by monty to only check if __STDC__ is defined. With the original -# check it's impossible to get things to work with the Sunpro compiler from -# Workshop 4.2 -# -# If you use this macro, you should check after calling it whether the C -# compiler has been set to accept ANSI C; if not, the shell variable -# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source -# code in ANSI C, you can make an un-ANSIfied copy of it by using the -# program @code{ansi2knr}, which comes with Ghostscript. -# @end defmac - -AC_DEFUN(AM_PROG_CC_STDC, -[AC_REQUIRE([AC_PROG_CC]) -AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) -AC_CACHE_VAL(am_cv_prog_cc_stdc, -[am_cv_prog_cc_stdc=no -ac_save_CC="$CC" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -# removed "-Xc -D__EXTENSIONS__" beacause sun c++ does not like it. -for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -do - CC="$ac_save_CC $ac_arg" - AC_TRY_COMPILE( -[#if !defined(__STDC__) -choke me -#endif -/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */ -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/stat.h> -#endif -], [ -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);};], -[am_cv_prog_cc_stdc="$ac_arg"; break]) -done -CC="$ac_save_CC" -]) -AC_MSG_RESULT($am_cv_prog_cc_stdc) -case "x$am_cv_prog_cc_stdc" in - x|xno) ;; - *) CC="$CC $am_cv_prog_cc_stdc" ;; -esac -]) - -# -# Check to make sure that the build environment is sane. -# - -AC_DEFUN(AM_SANITY_CHECK, -[AC_MSG_CHECKING([whether build environment is sane]) -sleep 1 -echo timestamp > conftestfile -# Do this in a subshell so we don't clobber the current shell's -# arguments. FIXME: maybe try `-L' hack like GETLOADAVG test? -if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -rm -f conftest* -AC_MSG_RESULT(yes)]) - -# Orginal from bash-2.0 aclocal.m4, Changed to use termcap last by monty. - -AC_DEFUN(MYSQL_CHECK_LIB_TERMCAP, -[ -AC_CACHE_VAL(mysql_cv_termcap_lib, -[AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses, - [AC_CHECK_LIB(curses, tgetent, mysql_cv_termcap_lib=libcurses, - [AC_CHECK_LIB(termcap, tgetent, mysql_cv_termcap_lib=libtermcap, - mysql_cv_termcap_lib=NOT_FOUND)])])]) -AC_MSG_CHECKING(for termcap functions library) -if test "$mysql_cv_termcap_lib" = "NOT_FOUND"; then -AC_MSG_ERROR([No curses/termcap library found]) -elif test "$mysql_cv_termcap_lib" = "libtermcap"; then -TERMCAP_LIB=-ltermcap -elif test "$mysql_cv_termcap_lib" = "libncurses"; then -TERMCAP_LIB=-lncurses -else -TERMCAP_LIB=-lcurses -fi -AC_MSG_RESULT($TERMCAP_LIB) -]) - -dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) -AC_DEFUN(MYSQL_SIGNAL_CHECK, -[AC_REQUIRE([AC_TYPE_SIGNAL]) -AC_MSG_CHECKING(for type of signal functions) -AC_CACHE_VAL(mysql_cv_signal_vintage, -[ - AC_TRY_LINK([#include <signal.h>],[ - sigset_t ss; - struct sigaction sa; - sigemptyset(&ss); sigsuspend(&ss); - sigaction(SIGINT, &sa, (struct sigaction *) 0); - sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); - ], mysql_cv_signal_vintage=posix, - [ - AC_TRY_LINK([#include <signal.h>], [ - int mask = sigmask(SIGINT); - sigsetmask(mask); sigblock(mask); sigpause(mask); - ], mysql_cv_signal_vintage=4.2bsd, - [ - AC_TRY_LINK([ - #include <signal.h> - RETSIGTYPE foo() { }], [ - int mask = sigmask(SIGINT); - sigset(SIGINT, foo); sigrelse(SIGINT); - sighold(SIGINT); sigpause(SIGINT); - ], mysql_cv_signal_vintage=svr3, mysql_cv_signal_vintage=v7 - )] - )] -) -]) -AC_MSG_RESULT($mysql_cv_signal_vintage) -if test "$mysql_cv_signal_vintage" = posix; then -AC_DEFINE(HAVE_POSIX_SIGNALS) -elif test "$mysql_cv_signal_vintage" = "4.2bsd"; then -AC_DEFINE(HAVE_BSD_SIGNALS) -elif test "$mysql_cv_signal_vintage" = svr3; then -AC_DEFINE(HAVE_USG_SIGHOLD) -fi -]) - -AC_DEFUN(MYSQL_CHECK_GETPW_FUNCS, -[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions) -AC_CACHE_VAL(mysql_cv_can_redecl_getpw, -[AC_TRY_COMPILE([#include <sys/types.h> -#include <pwd.h> -extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();], - mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)]) -AC_MSG_RESULT($mysql_cv_can_redecl_getpw) -if test "$mysql_cv_can_redecl_getpw" = "no"; then -AC_DEFINE(HAVE_GETPW_DECLS) -fi -]) - -AC_DEFUN(MYSQL_HAVE_TIOCGWINSZ, -[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h) -AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl, -[AC_TRY_COMPILE([#include <sys/types.h> -#include <sys/ioctl.h>], [int x = TIOCGWINSZ;], - mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)]) -AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl) -if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then -AC_DEFINE(GWINSZ_IN_SYS_IOCTL) -fi -]) - -AC_DEFUN(MYSQL_HAVE_FIONREAD, -[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h) -AC_CACHE_VAL(mysql_cv_fionread_in_ioctl, -[AC_TRY_COMPILE([#include <sys/types.h> -#include <sys/ioctl.h>], [int x = FIONREAD;], - mysql_cv_fionread_in_ioctl=yes,mysql_cv_fionread_in_ioctl=no)]) -AC_MSG_RESULT($mysql_cv_fionread_in_ioctl) -if test "$mysql_cv_fionread_in_ioctl" = "yes"; then -AC_DEFINE(FIONREAD_IN_SYS_IOCTL) -fi -]) - -AC_DEFUN(MYSQL_HAVE_TIOCSTAT, -[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h) -AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl, -[AC_TRY_COMPILE([#include <sys/types.h> -#include <sys/ioctl.h>], [int x = TIOCSTAT;], - mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)]) -AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl) -if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then -AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL) -fi -]) - -AC_DEFUN(MYSQL_STRUCT_DIRENT_D_INO, -[AC_REQUIRE([AC_HEADER_DIRENT]) -AC_MSG_CHECKING(if struct dirent has a d_ino member) -AC_CACHE_VAL(mysql_cv_dirent_has_dino, -[AC_TRY_COMPILE([ -#include <stdio.h> -#include <sys/types.h> -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif /* HAVE_UNISTD_H */ -#if defined(HAVE_DIRENT_H) -# include <dirent.h> -#else -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include <sys/ndir.h> -# endif /* SYSNDIR */ -# ifdef HAVE_SYS_DIR_H -# include <sys/dir.h> -# endif /* SYSDIR */ -# ifdef HAVE_NDIR_H -# include <ndir.h> -# endif -#endif /* HAVE_DIRENT_H */ -],[ -struct dirent d; int z; z = d.d_ino; -], mysql_cv_dirent_has_dino=yes, mysql_cv_dirent_has_dino=no)]) -AC_MSG_RESULT($mysql_cv_dirent_has_dino) -if test "$mysql_cv_dirent_has_dino" = "yes"; then -AC_DEFINE(STRUCT_DIRENT_HAS_D_INO) -fi -]) - -AC_DEFUN(MYSQL_TYPE_SIGHANDLER, -[AC_MSG_CHECKING([whether signal handlers are of type void]) -AC_CACHE_VAL(mysql_cv_void_sighandler, -[AC_TRY_COMPILE([#include <sys/types.h> -#include <signal.h> -#ifdef signal -#undef signal -#endif -#ifdef __cplusplus -extern "C" -#endif -void (*signal ()) ();], -[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnl -AC_MSG_RESULT($mysql_cv_void_sighandler) -if test "$mysql_cv_void_sighandler" = "yes"; then -AC_DEFINE(VOID_SIGHANDLER) -fi -]) - -AC_DEFUN(MYSQL_CXX_BOOL, -[ -AC_REQUIRE([AC_PROG_CXX]) -AC_MSG_CHECKING(if ${CXX} supports bool types) -AC_CACHE_VAL(mysql_cv_have_bool, -[ -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_TRY_COMPILE(,[bool b = true;], -mysql_cv_have_bool=yes, -mysql_cv_have_bool=no) -AC_LANG_RESTORE -]) -AC_MSG_RESULT($mysql_cv_have_bool) -if test "$mysql_cv_have_bool" = yes; then -AC_DEFINE(HAVE_BOOL) -fi -])dnl - -AC_DEFUN(MYSQL_STACK_DIRECTION, - [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, - [AC_TRY_RUN([#include <stdlib.h> - int find_stack_direction () - { - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; - } - int main () - { - exit (find_stack_direction() < 0); - }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, - ac_cv_c_stack_direction=0)]) - AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) -])dnl - -AC_DEFUN(MYSQL_FUNC_ALLOCA, -[ -# Since we have heard that alloca fails on IRIX never define it on a -# SGI machine -if test ! "$host_vendor" = "sgi" -then - AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally. - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works - # for constant arguments. Useless! - AC_CACHE_CHECK([for working alloca.h], ac_cv_header_alloca_h, - [AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));], - ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)]) - if test "$ac_cv_header_alloca_h" = "yes" - then - AC_DEFINE(HAVE_ALLOCA) - fi - - AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works, - [AC_TRY_LINK([ - #ifdef __GNUC__ - # define alloca __builtin_alloca - #else - # if HAVE_ALLOCA_H - # include <alloca.h> - # else - # ifdef _AIX - #pragma alloca - # else - # ifndef alloca /* predefined by HP cc +Olibcalls */ - char *alloca (); - # endif - # endif - # endif - #endif - ], [char *p = (char *) alloca(1);], - ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)]) - if test "$ac_cv_func_alloca_works" = "yes"; then - AC_DEFINE(HAVE_ALLOCA) - fi - - if test "$ac_cv_func_alloca_works" = "no"; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.o - AC_DEFINE(C_ALLOCA) - - AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray, - [AC_EGREP_CPP(webecray, - [#if defined(CRAY) && ! defined(CRAY2) - webecray - #else - wenotbecray - #endif - ], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) - if test "$ac_cv_os_cray" = "yes"; then - for ac_func in _getb67 GETB67 getb67; do - AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func) - break]) - done - fi - fi - AC_SUBST(ALLOCA)dnl -else - AC_MSG_RESULT("Skipped alloca tests") -fi -]) - -AC_DEFUN(MYSQL_CHECK_LONGLONG_TO_FLOAT, -[ -AC_MSG_CHECKING(if conversion of longlong to float works) -AC_CACHE_VAL(ac_cv_conv_longlong_to_float, -[AC_TRY_RUN([#include <stdio.h> -typedef long long longlong; -main() -{ - longlong ll=1; - float f; - FILE *file=fopen("conftestval", "w"); - f = (float) ll; - fprintf(file,"%g\n",f); - fclose(file); - exit (0); -}], ac_cv_conv_longlong_to_float=`cat conftestval`, ac_cv_conv_longlong_to_float=0, ifelse([$2], , , ac_cv_conv_longlong_to_float=$2))])dnl -if test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes" -then - ac_cv_conv_longlong_to_float=yes -else - ac_cv_conv_longlong_to_float=no -fi -AC_MSG_RESULT($ac_cv_conv_longlong_to_float) -]) - -AC_DEFUN(MYSQL_CHECK_CPU, -[AC_CACHE_CHECK([if compiler supports optimizations for current cpu], -mysql_cv_cpu,[ - -ac_save_CFLAGS="$CFLAGS" -if test -r /proc/cpuinfo ; then - cpuinfo="cat /proc/cpuinfo" - cpu_family=`$cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` - cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` -fi -if test "$cpu_vendor" = "AuthenticAMD"; then - if test $cpu_family -ge 6; then - cpu_set="athlon pentiumpro k5 pentium i486 i386"; - elif test $cpu_family -eq 5; then - cpu_set="k5 pentium i486 i386"; - elif test $cpu_family -eq 4; then - cpu_set="i486 i386" - else - cpu_set="i386" - fi -elif test "$cpu_vendor" = "GenuineIntel"; then - if test $cpu_family -ge 6; then - cpu_set="pentiumpro pentium i486 i386"; - elif test $cpu_family -eq 5; then - cpu_set="pentium i486 i386"; - elif test $cpu_family -eq 4; then - cpu_set="i486 i386" - else - cpu_set="i386" - fi -fi - -for ac_arg in $cpu_set; -do - CFLAGS="$ac_save_CFLAGS -mcpu=$ac_arg -march=$ac_arg -DCPU=$ac_arg" - AC_TRY_COMPILE([],[int i],mysql_cv_cpu=$ac_arg; break;, mysql_cv_cpu="unknown") -done - -if test "$mysql_cv_cpu" = "unknown" -then - CFLAGS="$ac_save_CFLAGS" - AC_MSG_RESULT(none) -else - AC_MSG_RESULT($mysql_cv_cpu) -fi -]])) - -AC_DEFUN(MYSQL_CHECK_VIO, [ - AC_ARG_WITH([vio], - [ --with-vio Include the Virtual IO support], - [vio="$withval"], - [vio=no]) - - if test "$vio" = "yes" - then - vio_dir="vio" - vio_libs="../vio/libvio.la" - AC_DEFINE(HAVE_VIO) - else - vio_dir="" - vio_libs="" - fi - AC_SUBST([vio_dir]) - AC_SUBST([vio_libs]) -]) - -AC_DEFUN(MYSQL_FIND_OPENSSL, [ - incs="$1" - libs="$2" - case "$incs---$libs" in - ---) - for d in /usr/ssl/include /usr/local/ssl/include /usr/include \ -/usr/include/ssl /opt/ssl/include /opt/openssl/include \ -/usr/local/ssl/include /usr/local/include ; do - if test -f $d/openssl/ssl.h ; then - OPENSSL_INCLUDE=-I$d - fi - done - - for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \ -/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib /usr/local/lib/ ; do - if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl.dylib ; then - OPENSSL_LIB=$d - fi - done - ;; - ---* | *---) - AC_MSG_ERROR([if either 'includes' or 'libs' is specified, both must be specified]) - ;; - * ) - if test -f $incs/openssl/ssl.h ; then - OPENSSL_INCLUDE=-I$incs - fi - if test -f $libs/libssl.a || test -f $libs/libssl.so || test -f $libs/libssl.dylib ; then - OPENSSL_LIB=$libs - fi - ;; - esac - - # On RedHat 9 we need kerberos to compile openssl - for d in /usr/kerberos/include - do - if test -f $d/krb5.h ; then - OPENSSL_KERBEROS_INCLUDE="$d" - fi - done - - - if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INCLUDE" ; then - echo "Could not find an installation of OpenSSL" - if test -n "$OPENSSL_LIB" ; then - if test "$IS_LINUX" = "true"; then - echo "Looks like you've forgotten to install OpenSSL development RPM" - fi - fi - exit 1 - fi - -]) - -AC_DEFUN(MYSQL_CHECK_OPENSSL, [ -AC_MSG_CHECKING(for OpenSSL) - AC_ARG_WITH([openssl], - [ --with-openssl Include the OpenSSL support], - [openssl="$withval"], - [openssl=no]) - - AC_ARG_WITH([openssl-includes], - [ - --with-openssl-includes=DIR - Find OpenSSL headers in DIR], - [openssl_includes="$withval"], - [openssl_includes=""]) - - AC_ARG_WITH([openssl-libs], - [ - --with-openssl-libs=DIR - Find OpenSSL libraries in DIR], - [openssl_libs="$withval"], - [openssl_libs=""]) - - if test "$openssl" = "yes" - then - MYSQL_FIND_OPENSSL([$openssl_includes], [$openssl_libs]) - #force VIO use - vio_dir="vio" - vio_libs="../vio/libvio.la" - AC_DEFINE(HAVE_VIO) - AC_MSG_RESULT(yes) - openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto" - # Don't set openssl_includes to /usr/include as this gives us a lot of - # compiler warnings when using gcc 3.x - openssl_includes="" - if test "$OPENSSL_INCLUDE" != "-I/usr/include" - then - openssl_includes="$OPENSSL_INCLUDE" - fi - if test "$OPENSSL_KERBEROS_INCLUDE" - then - openssl_includes="$openssl_includes -I$OPENSSL_KERBEROS_INCLUDE" - fi - AC_DEFINE(HAVE_OPENSSL) - - # openssl-devel-0.9.6 requires dlopen() and we can't link staticly - # on many platforms (We should actually test this here, but it's quite - # hard) to do as we are doing libtool for linking. - using_static="" - case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in - *-all-static*) using_static="yes" ;; - esac - if test "$using_static" = "yes" - then - echo "You can't use the --all-static link option when using openssl." - exit 1 - fi - NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs" - else - AC_MSG_RESULT(no) - fi - AC_SUBST(openssl_libs) - AC_SUBST(openssl_includes) -]) - - -AC_DEFUN(MYSQL_CHECK_MYSQLFS, [ - AC_ARG_WITH([mysqlfs], - [ - --with-mysqlfs Include the corba-based MySQL file system], - [mysqlfs="$withval"], - [mysqlfs=no]) - -dnl Call MYSQL_CHECK_ORBIT even if mysqlfs == no, so that @orbit_*@ -dnl get substituted. - MYSQL_CHECK_ORBIT - - AC_MSG_CHECKING(if we should build MySQLFS) - fs_dirs="" - if test "$mysqlfs" = "yes" - then - if test -n "$orbit_exec_prefix" - then - fs_dirs=fs - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT(disabled because ORBIT, the CORBA ORB, was not found) - fi - else - AC_MSG_RESULT([no]) - fi - AC_SUBST([fs_dirs]) -]) - -AC_DEFUN(MYSQL_CHECK_ORBIT, [ -AC_MSG_CHECKING(for ORBit) -orbit_config_path=`which orbit-config` -if test -n "$orbit_config_path" -a $? = 0 -then - orbit_exec_prefix=`orbit-config --exec-prefix` - orbit_includes=`orbit-config --cflags server` - orbit_libs=`orbit-config --libs server` - orbit_idl="$orbit_exec_prefix/bin/orbit-idl" - AC_MSG_RESULT(found!) - AC_DEFINE(HAVE_ORBIT) -else - orbit_exec_prefix= - orbit_includes= - orbit_libs= - orbit_idl= - AC_MSG_RESULT(not found) -fi -AC_SUBST(orbit_includes) -AC_SUBST(orbit_libs) -AC_SUBST(orbit_idl) -]) - -AC_DEFUN([MYSQL_CHECK_ISAM], [ - AC_ARG_WITH([isam], [ - --with-isam Enable the ISAM table type], - [with_isam="$withval"], - [with_isam=no]) - - isam_libs= - if test X"$with_isam" = X"yes" - then - AC_DEFINE(HAVE_ISAM) - isam_libs="\$(top_builddir)/isam/libnisam.a\ - \$(top_builddir)/merge/libmerge.a" - fi - AC_SUBST(isam_libs) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_BDB -dnl Sets HAVE_BERKELEY_DB if inst library is found -dnl Makes sure db version is correct. -dnl Looks in $srcdir for Berkeley distribution if not told otherwise -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_CHECK_BDB], [ - AC_ARG_WITH([berkeley-db], - [ - --with-berkeley-db[=DIR] - Use BerkeleyDB located in DIR], - [bdb="$withval"], - [bdb=no]) - - AC_ARG_WITH([berkeley-db-includes], - [ - --with-berkeley-db-includes=DIR - Find Berkeley DB headers in DIR], - [bdb_includes="$withval"], - [bdb_includes=default]) - - AC_ARG_WITH([berkeley-db-libs], - [ - --with-berkeley-db-libs=DIR - Find Berkeley DB libraries in DIR], - [bdb_libs="$withval"], - [bdb_libs=default]) - - AC_MSG_CHECKING([for BerkeleyDB]) - -dnl SORT OUT THE SUPPLIED ARGUMENTS TO DETERMINE WHAT TO DO -dnl echo "DBG1: bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'" - have_berkeley_db=no - case "$bdb" in - no ) - mode=no - AC_MSG_RESULT([no]) - ;; - yes | default ) - case "$bdb_includes---$bdb_libs" in - default---default ) - mode=search-$bdb - AC_MSG_RESULT([searching...]) - ;; - default---* | *---default | yes---* | *---yes ) - AC_MSG_ERROR([if either 'includes' or 'libs' is specified, both must be specified]) - ;; - * ) - mode=supplied-two - AC_MSG_RESULT([supplied]) - ;; - esac - ;; - * ) - mode=supplied-one - AC_MSG_RESULT([supplied]) - ;; - esac - -dnl echo "DBG2: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'" - - case $mode in - no ) - bdb_includes= - bdb_libs= - bdb_libs_with_path= - ;; - supplied-two ) - MYSQL_CHECK_INSTALLED_BDB([$bdb_includes], [$bdb_libs]) - case $bdb_dir_ok in - installed ) mode=yes ;; - * ) AC_MSG_ERROR([didn't find valid BerkeleyDB: $bdb_dir_ok]) ;; - esac - ;; - supplied-one ) - MYSQL_CHECK_BDB_DIR([$bdb]) - case $bdb_dir_ok in - source ) mode=compile ;; - installed ) mode=yes ;; - * ) AC_MSG_ERROR([didn't find valid BerkeleyDB: $bdb_dir_ok]) ;; - esac - ;; - search-* ) - MYSQL_SEARCH_FOR_BDB - case $bdb_dir_ok in - source ) mode=compile ;; - installed ) mode=yes ;; - * ) - # not found - case $mode in - *-yes ) AC_MSG_ERROR([no suitable BerkeleyDB found]) ;; - * ) mode=no ;; - esac - bdb_includes= - bdb_libs= - bdb_libs_with_path= - ;; - esac - ;; - *) - AC_MSG_ERROR([impossible case condition '$mode': please report this to bugs@lists.mysql.com]) - ;; - esac - -dnl echo "DBG3: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'" - case $mode in - no ) - AC_MSG_RESULT([Not using Berkeley DB]) - ;; - yes ) - have_berkeley_db="yes" - AC_MSG_RESULT([Using Berkeley DB in '$bdb_includes']) - ;; - compile ) - have_berkeley_db="$bdb" - AC_MSG_RESULT([Compiling Berekeley DB in '$have_berkeley_db']) - ;; - * ) - AC_MSG_ERROR([impossible case condition '$mode': please report this to bugs@lists.mysql.com]) - ;; - esac - - AC_SUBST(bdb_includes) - AC_SUBST(bdb_libs) - AC_SUBST(bdb_libs_with_path) -]) - -AC_DEFUN([MYSQL_CHECK_INSTALLED_BDB], [ -dnl echo ["MYSQL_CHECK_INSTALLED_BDB ($1) ($2)"] - inc="$1" - lib="$2" - if test -f "$inc/db.h" - then - MYSQL_CHECK_BDB_VERSION([$inc/db.h], - [.*#define[ ]*], [[ ][ ]*]) - - if test X"$bdb_version_ok" = Xyes; then - save_LDFLAGS="$LDFLAGS" - LDFLAGS="-L$lib $LDFLAGS" - AC_CHECK_LIB(db,db_env_create, [ - bdb_dir_ok=installed - MYSQL_TOP_BUILDDIR([inc]) - MYSQL_TOP_BUILDDIR([lib]) - bdb_includes="-I$inc" - bdb_libs="-L$lib -ldb" - bdb_libs_with_path="$lib/libdb.a" - ]) - LDFLAGS="$save_LDFLAGS" - else - bdb_dir_ok="$bdb_version_ok" - fi - else - bdb_dir_ok="no db.h file in '$inc'" - fi -]) - -AC_DEFUN([MYSQL_CHECK_BDB_DIR], [ -dnl ([$bdb]) -dnl echo ["MYSQL_CHECK_BDB_DIR ($1)"] - dir="$1" - - MYSQL_CHECK_INSTALLED_BDB([$dir/include], [$dir/lib]) - - if test X"$bdb_dir_ok" != Xinstalled; then - # test to see if it's a source dir - rel="$dir/dist/RELEASE" - if test -f "$rel"; then - MYSQL_CHECK_BDB_VERSION([$rel], [], [=]) - if test X"$bdb_version_ok" = Xyes; then - bdb_dir_ok=source - bdb="$dir" - MYSQL_TOP_BUILDDIR([dir]) - bdb_includes="-I$dir/build_unix" - bdb_libs="-L$dir/build_unix -ldb" - bdb_libs_with_path="$dir/build_unix/libdb.a" - else - bdb_dir_ok="$bdb_version_ok" - fi - else - bdb_dir_ok="'$dir' doesn't look like a BDB directory ($bdb_dir_ok)" - fi - fi -]) - -AC_DEFUN([MYSQL_SEARCH_FOR_BDB], [ -dnl echo ["MYSQL_SEARCH_FOR_BDB"] - bdb_dir_ok="no BerkeleyDB found" - - for test_dir in $srcdir/bdb $srcdir/db-*.*.* /usr/local/BerkeleyDB*; do -dnl echo "-----------> Looking at ($test_dir; `cd $test_dir && pwd`)" - MYSQL_CHECK_BDB_DIR([$test_dir]) - if test X"$bdb_dir_ok" = Xsource || test X"$bdb_dir_ok" = Xinstalled; then -dnl echo "-----------> Found it ($bdb), ($srcdir)" -dnl This is needed so that 'make distcheck' works properly (VPATH build). -dnl VPATH build won't work if bdb is not under the source tree; but in -dnl that case, hopefully people will just make and install inside the -dnl tree, or install BDB first, and then use the installed version. - case "$bdb" in - "$srcdir/"* ) bdb=`echo "$bdb" | sed -e "s,^$srcdir/,,"` ;; - esac - break - fi - done -]) - -dnl MYSQL_CHECK_BDB_VERSION takes 3 arguments: -dnl 1) the file to look in -dnl 2) the search pattern before DB_VERSION_XXX -dnl 3) the search pattern between DB_VERSION_XXX and the number -dnl It assumes that the number is the last thing on the line -AC_DEFUN([MYSQL_CHECK_BDB_VERSION], [ - db_major=`sed -e '/^[$2]DB_VERSION_MAJOR[$3]/ !d' -e 's///' [$1]` - db_minor=`sed -e '/^[$2]DB_VERSION_MINOR[$3]/ !d' -e 's///' [$1]` - db_patch=`sed -e '/^[$2]DB_VERSION_PATCH[$3]/ !d' -e 's///' [$1]` - test -z "$db_major" && db_major=0 - test -z "$db_minor" && db_minor=0 - test -z "$db_patch" && db_patch=0 - - # This is ugly, but about as good as it can get -# mysql_bdb= -# if test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 3 -# then -# mysql_bdb=h -# elif test $db_major -eq 3 && test $db_minor -eq 2 && test $db_patch -eq 9 -# then -# want_bdb_version="3.2.9a" # hopefully this will stay up-to-date -# mysql_bdb=a -# fi - -dnl RAM: -want_bdb_version="4.1.24" -bdb_version_ok=yes - -# if test -n "$mysql_bdb" && \ -# grep "DB_VERSION_STRING.*:.*$mysql_bdb: " [$1] > /dev/null -# then -# bdb_version_ok=yes -# else -# bdb_version_ok="invalid version $db_major.$db_minor.$db_patch" -# bdb_version_ok="$bdb_version_ok (must be version 3.2.3h or $want_bdb_version)" -# fi -]) - -AC_DEFUN([MYSQL_TOP_BUILDDIR], [ - case "$[$1]" in - /* ) ;; # don't do anything with an absolute path - "$srcdir"/* ) - # If BDB is under the source directory, we need to look under the - # build directory for bdb/build_unix. - # NOTE: I'm being lazy, and assuming the user did not specify - # something like --with-berkeley-db=bdb (it would be missing "./"). - [$1]="\$(top_builddir)/"`echo "$[$1]" | sed -e "s,^$srcdir/,,"` - ;; - * ) - AC_MSG_ERROR([The BDB directory must be directly under the MySQL source directory, or be specified using the full path. ('$srcdir'; '$[$1]')]) - ;; - esac - if test X"$[$1]" != "/" - then - [$1]=`echo $[$1] | sed -e 's,/$,,'` - fi -]) - -dnl --------------------------------------------------------------------------- -dnl END OF MYSQL_CHECK_BDB SECTION -dnl --------------------------------------------------------------------------- - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_INNODB -dnl Sets HAVE_INNOBASE_DB if --with-innodb is used -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_CHECK_INNODB], [ - AC_ARG_WITH([innodb], - [ - --without-innodb Do not include the InnoDB table handler], - [innodb="$withval"], - [innodb=yes]) - - AC_MSG_CHECKING([for Innodb]) - - have_innodb=no - innodb_includes= - innodb_libs= - case "$innodb" in - yes ) - AC_MSG_RESULT([Using Innodb]) - AC_DEFINE(HAVE_INNOBASE_DB) - have_innodb="yes" - innodb_includes="-I../innobase/include" - innodb_system_libs="" -dnl Some libs are listed several times, in order for gcc to sort out -dnl circular references. - innodb_libs="\ - \$(top_builddir)/innobase/usr/libusr.a\ - \$(top_builddir)/innobase/srv/libsrv.a\ - \$(top_builddir)/innobase/dict/libdict.a\ - \$(top_builddir)/innobase/que/libque.a\ - \$(top_builddir)/innobase/srv/libsrv.a\ - \$(top_builddir)/innobase/ibuf/libibuf.a\ - \$(top_builddir)/innobase/row/librow.a\ - \$(top_builddir)/innobase/pars/libpars.a\ - \$(top_builddir)/innobase/btr/libbtr.a\ - \$(top_builddir)/innobase/trx/libtrx.a\ - \$(top_builddir)/innobase/read/libread.a\ - \$(top_builddir)/innobase/usr/libusr.a\ - \$(top_builddir)/innobase/buf/libbuf.a\ - \$(top_builddir)/innobase/ibuf/libibuf.a\ - \$(top_builddir)/innobase/eval/libeval.a\ - \$(top_builddir)/innobase/log/liblog.a\ - \$(top_builddir)/innobase/fsp/libfsp.a\ - \$(top_builddir)/innobase/fut/libfut.a\ - \$(top_builddir)/innobase/fil/libfil.a\ - \$(top_builddir)/innobase/lock/liblock.a\ - \$(top_builddir)/innobase/mtr/libmtr.a\ - \$(top_builddir)/innobase/page/libpage.a\ - \$(top_builddir)/innobase/rem/librem.a\ - \$(top_builddir)/innobase/thr/libthr.a\ - \$(top_builddir)/innobase/sync/libsync.a\ - \$(top_builddir)/innobase/data/libdata.a\ - \$(top_builddir)/innobase/mach/libmach.a\ - \$(top_builddir)/innobase/ha/libha.a\ - \$(top_builddir)/innobase/dyn/libdyn.a\ - \$(top_builddir)/innobase/mem/libmem.a\ - \$(top_builddir)/innobase/sync/libsync.a\ - \$(top_builddir)/innobase/ut/libut.a\ - \$(top_builddir)/innobase/os/libos.a\ - \$(top_builddir)/innobase/ut/libut.a" - - AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"]) - ;; - * ) - AC_MSG_RESULT([Not using Innodb]) - ;; - esac - - AC_SUBST(innodb_includes) - AC_SUBST(innodb_libs) - AC_SUBST(innodb_system_libs) -]) - -dnl --------------------------------------------------------------------------- -dnl END OF MYSQL_CHECK_INNODB SECTION -dnl --------------------------------------------------------------------------- - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_NDBCLUSTER -dnl Sets HAVE_NDBCLUSTER_DB if --with-ndbcluster is used -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ - AC_ARG_WITH([ndbcluster], - [ - --without-ndbcluster Do not include the Ndb Cluster table handler], - [ndbcluster="$withval"], - [ndbcluster=yes]) - - AC_MSG_CHECKING([for Ndb Cluster]) - - have_ndbcluster=no - ndbcluster_includes= - ndbcluster_libs= - case "$ndbcluster" in - yes ) - AC_MSG_RESULT([Using Ndb Cluster]) - AC_DEFINE(HAVE_NDBCLUSTER_DB) - have_ndbcluster="yes" - ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi" - ndbcluster_libs="\$(top_builddir)/ndb/lib/libNDB_API.a" - ndbcluster_system_libs="" - esac - - AC_SUBST(ndbcluster_includes) - AC_SUBST(ndbcluster_libs) - AC_SUBST(ndbcluster_system_libs) -]) - -dnl --------------------------------------------------------------------------- -dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION -dnl --------------------------------------------------------------------------- - -dnl By default, many hosts won't let programs access large files; -dnl one must use special compiler options to get large-file access to work. -dnl For more details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert <eggert@twinsun.com>. - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME) -AC_DEFUN(AC_SYS_LARGEFILE_FLAGS, - [AC_CACHE_CHECK([for $1 value to request large file support], - ac_cv_sys_largefile_$1, - [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2 - then - ac_cv_sys_largefile_$1=`cat conftest.1` - else - ac_cv_sys_largefile_$1=no - ifelse($1, CFLAGS, - [case "$host_os" in - # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1. -changequote(, )dnl - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) -changequote([, ])dnl - if test "$GCC" = yes; then - case `$CC --version 2>/dev/null` in - 2.95.*) ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ ;; - esac - fi - ;; - # IRIX 6.2 and later require cc -n32. -changequote(, )dnl - irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) -changequote([, ])dnl - if test "$GCC" != yes; then - ac_cv_sys_largefile_CFLAGS=-n32 - fi - esac - if test "$ac_cv_sys_largefile_CFLAGS" != no; then - ac_save_CC="$CC" - CC="$CC $ac_cv_sys_largefile_CFLAGS" - AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) - CC="$ac_save_CC" - fi]) - fi - rm -f conftest*])]) - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL) -AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND, - [case $2 in - no) ;; - ?*) - case "[$]$1" in - '') $1=$2 ;; - *) $1=[$]$1' '$2 ;; - esac ;; - esac]) - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) -AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, - [AC_CACHE_CHECK([for $1], $2, - [$2=no -changequote(, )dnl - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - -D$1) - $2=1 ;; - -D$1=*) - $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; - esac - done - $4 -changequote([, ])dnl - ]) - if test "[$]$2" != no; then - AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) - fi]) - -AC_DEFUN(MYSQL_SYS_LARGEFILE, - [AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(largefile, - [ --disable-largefile Omit support for large files]) - if test "$enable_largefile" != no; then - AC_CHECK_TOOL(GETCONF, getconf) - AC_SYS_LARGEFILE_FLAGS(CFLAGS) - AC_SYS_LARGEFILE_FLAGS(LDFLAGS) - AC_SYS_LARGEFILE_FLAGS(LIBS) - - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - no) ;; - -D_FILE_OFFSET_BITS=*) ;; - -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; - -D_LARGE_FILES | -D_LARGE_FILES=*) ;; - -D?* | -I?*) - AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; - *) - AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; - esac - done - AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") - AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") - - AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_file_offset_bits=64 ;; - # We can't declare _FILE_OFFSET_BITS here as this will cause - # compile errors as AC_PROG_CC adds include files in confdefs.h - # We solve this (until autoconf is fixed) by instead declaring it - # as define instead - solaris2.[8,9]) - CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" - CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64" - ac_cv_sys_file_offset_bits=no ;; - esac]) - AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, - ac_cv_sys_largefile_source, - [Define to make fseeko etc. visible, on some hosts.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_largefile_source=1 ;; - esac]) - AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, - ac_cv_sys_large_files, - [Define for large files, on AIX-style hosts.], - [case "$host_os" in - # AIX 4.2 and later - aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) - ac_cv_sys_large_files=1 ;; - esac]) - fi - ]) - - -# Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not -# include #stdlib.h as default as this breaks things on Solaris -# (Conflicts with pthreads and big file handling) - -m4_define([_AC_PROG_CXX_EXIT_DECLARATION], -[for ac_declaration in \ - ''\ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' \ - '#include <stdlib.h>' -do - _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <stdlib.h> -$ac_declaration], - [exit (42);])], - [], - [continue]) - _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration], - [exit (42);])], - [break]) -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi -])# _AC_PROG_CXX_EXIT_DECLARATION - -dnl --------------------------------------------------------------------------- - diff --git a/ndb/config/old_files/config.h.in b/ndb/config/old_files/config.h.in deleted file mode 100644 index 82749d5ece6..00000000000 --- a/ndb/config/old_files/config.h.in +++ /dev/null @@ -1,993 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ -/* acconfig.h - This file is in the public domain. - - Descriptive text for the C preprocessor macros that - the distributed Autoconf macros can define. - No software package will use all of them; autoheader copies the ones - your configure.in uses into your configuration header file templates. - - The entries are in sort -df order: alphabetical, case insensitive, - ignoring punctuation (such as underscores). Although this order - can split up related entries, it makes it easier to check whether - a given entry is in the file. - - Leave the following blank line there!! Autoheader needs it. */ - - -#undef C_ALLOCA - -#undef CRAY_STACKSEG_END - -/* Define the default charset name */ -#undef MYSQL_DEFAULT_CHARSET_NAME - -/* Define the default charset name */ -#undef MYSQL_DEFAULT_COLLATION_NAME - -/* Version of .frm files */ -#undef DOT_FRM_VERSION - -/* If LOAD DATA LOCAL INFILE should be enabled by default */ -#undef ENABLED_LOCAL_INFILE - -/* READLINE: */ -#undef FIONREAD_IN_SYS_IOCTL - -/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */ -#undef GWINSZ_IN_SYS_IOCTL - -/* Handing of large files on Solaris 2.6 */ -#undef _FILE_OFFSET_BITS - -/* Do we have FIONREAD */ -#undef FIONREAD_IN_SYS_IOCTL - -/* Do we need to define _GNU_SOURCE */ -#undef _GNU_SOURCE - -/* atomic_add() from <asm/atomic.h> (Linux only) */ -#undef HAVE_ATOMIC_ADD - -/* atomic_sub() from <asm/atomic.h> (Linux only) */ -#undef HAVE_ATOMIC_SUB - -/* If we have a working alloca() implementation */ -#undef HAVE_ALLOCA - -/* bool is not defined by all C++ compilators */ -#undef HAVE_BOOL - -/* Have berkeley db installed */ -#undef HAVE_BERKELEY_DB - -/* DSB style signals ? */ -#undef HAVE_BSD_SIGNALS - -/* Can netinet be included */ -#undef HAVE_BROKEN_NETINET_INCLUDES - -/* READLINE: */ -#undef HAVE_BSD_SIGNALS - -/* Define charsets you want */ -#undef HAVE_CHARSET_armscii8 -#undef HAVE_CHARSET_ascii -#undef HAVE_CHARSET_big5 -#undef HAVE_CHARSET_cp1250 -#undef HAVE_CHARSET_cp1251 -#undef HAVE_CHARSET_cp1256 -#undef HAVE_CHARSET_cp1257 -#undef HAVE_CHARSET_cp850 -#undef HAVE_CHARSET_cp852 -#undef HAVE_CHARSET_cp866 -#undef HAVE_CHARSET_dec8 -#undef HAVE_CHARSET_euckr -#undef HAVE_CHARSET_gb2312 -#undef HAVE_CHARSET_gbk -#undef HAVE_CHARSET_greek -#undef HAVE_CHARSET_hebrew -#undef HAVE_CHARSET_hp8 -#undef HAVE_CHARSET_keybcs2 -#undef HAVE_CHARSET_koi8r -#undef HAVE_CHARSET_koi8u -#undef HAVE_CHARSET_latin1 -#undef HAVE_CHARSET_latin2 -#undef HAVE_CHARSET_latin5 -#undef HAVE_CHARSET_latin7 -#undef HAVE_CHARSET_macce -#undef HAVE_CHARSET_macroman -#undef HAVE_CHARSET_sjis -#undef HAVE_CHARSET_swe7 -#undef HAVE_CHARSET_tis620 -#undef HAVE_CHARSET_ucs2 -#undef HAVE_CHARSET_ujis -#undef HAVE_CHARSET_utf8 - -/* ZLIB and compress: */ -#undef HAVE_COMPRESS - -/* Define if we are using OSF1 DEC threads */ -#undef HAVE_DEC_THREADS - -/* Define if we are using OSF1 DEC threads on 3.2 */ -#undef HAVE_DEC_3_2_THREADS - -/* fp_except from ieeefp.h */ -#undef HAVE_FP_EXCEPT - -/* READLINE: */ -#undef HAVE_GETPW_DECLS - -/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines - this with 6 arguments */ -#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE - -/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */ -#undef HAVE_GETHOSTBYNAME_R_RETURN_INT - -/* Define if int8, int16 and int32 types exist */ -#undef HAVE_INT_8_16_32 - -/* Using Innobase DB */ -#undef HAVE_INNOBASE_DB - -/* Using old ISAM tables */ -#undef HAVE_ISAM - -/* Define if we have GNU readline */ -#undef HAVE_LIBREADLINE - -/* Define if have -lwrap */ -#undef HAVE_LIBWRAP - -/* Define if we are using Xavier Leroy's LinuxThreads */ -#undef HAVE_LINUXTHREADS - -/* Do we have lstat */ -#undef HAVE_LSTAT - -/* Do we use user level threads */ -#undef HAVE_mit_thread - -/* Using Ndb Cluster DB */ -#undef HAVE_NDBCLUSTER_DB - -/* For some non posix threads */ -#undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC - -/* For some non posix threads */ -#undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT - -/* READLINE: */ -#undef HAVE_POSIX_SIGNALS - -/* Well.. */ -#undef HAVE_POSIX_SIGSETJMP - -/* sigwait with one argument */ -#undef HAVE_NONPOSIX_SIGWAIT - -/* ORBIT */ -#undef HAVE_ORBIT - -/* pthread_attr_setscope */ -#undef HAVE_PTHREAD_ATTR_SETSCOPE - -/* pthread_yield that doesn't take any arguments */ -#undef HAVE_PTHREAD_YIELD_ZERO_ARG - -/* pthread_yield function with one argument */ -#undef HAVE_PTHREAD_YIELD_ONE_ARG - -/* POSIX readdir_r */ -#undef HAVE_READDIR_R - -/* Have Gemini db installed */ -#undef HAVE_GEMINI_DB - -/* POSIX sigwait */ -#undef HAVE_SIGWAIT - -/* crypt */ -#undef HAVE_CRYPT - -/* If we want to have query cache */ -#undef HAVE_QUERY_CACHE - -/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines - this with 8 arguments */ -#undef HAVE_SOLARIS_STYLE_GETHOST - -/* MIT pthreads does not support connecting with unix sockets */ -#undef HAVE_THREADS_WITHOUT_SOCKETS - -/* Timespec has a ts_sec instead of tv_sev */ -#undef HAVE_TIMESPEC_TS_SEC - -/* Have the tzname variable */ -#undef HAVE_TZNAME - -/* Define if the system files define uchar */ -#undef HAVE_UCHAR - -/* Define if the system files define uint */ -#undef HAVE_UINT - -/* Define if the system files define ulong */ -#undef HAVE_ULONG - -/* Define if the system files define in_addr_t */ -#undef HAVE_IN_ADDR_T - -/* UNIXWARE7 threads are not posix */ -#undef HAVE_UNIXWARE7_THREADS - -/* new UNIXWARE7 threads that are not yet posix */ -#undef HAVE_UNIXWARE7_POSIX - -/* OpenSSL */ -#undef HAVE_OPENSSL - -/* READLINE: */ -#undef HAVE_USG_SIGHOLD - -/* Virtual IO */ -#undef HAVE_VIO - -/* Handling of large files on Solaris 2.6 */ -#undef _LARGEFILE_SOURCE - -/* Handling of large files on Solaris 2.6 */ -#undef _LARGEFILE64_SOURCE - -/* Define if want -lwrap */ -#undef LIBWRAP - -/* Define to machine type name eg sun10 */ -#undef MACHINE_TYPE - -#undef MUST_REINSTALL_SIGHANDLERS - -/* Defined to used character set */ -#undef MY_CHARSET_CURRENT - -/* READLINE: no sys file*/ -#undef NO_SYS_FILE - -/* Program name */ -#undef PACKAGE - -/* mysql client protocoll version */ -#undef PROTOCOL_VERSION - -/* Define if qsort returns void */ -#undef QSORT_TYPE_IS_VOID - -/* Define as the return type of qsort (int or void). */ -#undef RETQSORTTYPE - -/* Size of off_t */ -#undef SIZEOF_OFF_T - -/* Define as the base type of the last arg to accept */ -#undef SOCKET_SIZE_TYPE - -/* Last argument to get/setsockopt */ -#undef SOCKOPT_OPTLEN_TYPE - -#undef SPEED_T_IN_SYS_TYPES -#undef SPRINTF_RETURNS_PTR -#undef SPRINTF_RETURNS_INT -#undef SPRINTF_RETURNS_GARBAGE - -/* Needed to get large file support on HPUX 10.20 */ -#undef __STDC_EXT__ - -#undef STACK_DIRECTION - -#undef STRCOLL_BROKEN - -#undef STRUCT_DIRENT_HAS_D_FILENO -#undef STRUCT_DIRENT_HAS_D_INO - -#undef STRUCT_WINSIZE_IN_SYS_IOCTL -#undef STRUCT_WINSIZE_IN_TERMIOS - -/* Define to name of system eg solaris*/ -#undef SYSTEM_TYPE - -/* Define if you want to have threaded code. This may be undef on client code */ -#undef THREAD - -/* Should be client be thread safe */ -#undef THREAD_SAFE_CLIENT - -/* READLINE: */ -#undef TIOCSTAT_IN_SYS_IOCTL - -/* Use multi-byte character routines */ -#undef USE_MB -#undef USE_MB_IDENT - -/* the pstack backtrace library */ -#undef USE_PSTACK - -/* Use MySQL RAID */ -#undef USE_RAID - -/* Program version */ -#undef VERSION - -/* READLINE: */ -#undef VOID_SIGHANDLER - -/* used libedit interface (can we dereference result of rl_completion_entry_function?) */ -#undef USE_LIBEDIT_INTERFACE - -/* used new readline interface (does rl_completion_func_t and rl_compentry_func_t defined?) */ -#undef USE_NEW_READLINE_INTERFACE - -/* macro for libedit */ -#undef HAVE_VIS_H -#undef HAVE_FGETLN -#undef HAVE_ISSETUGID -#undef HAVE_STRLCPY -#undef HAVE_GETLINE -#undef HAVE_FLOCKFILE -#undef HAVE_SYS_TYPES_H -#undef HAVE_SYS_CDEFS_H - - -/* Leave that blank line there!! Autoheader needs it. - If you're adding to this file, keep in mind: - The entries are in sort -df order: alphabetical, case insensitive, - ignoring punctuation (such as underscores). */ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the <arpa/inet.h> header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the <asm/termbits.h> header file. */ -#undef HAVE_ASM_TERMBITS_H - -/* Define to 1 if you have the `bcmp' function. */ -#undef HAVE_BCMP - -/* Define to 1 if you have the `bfill' function. */ -#undef HAVE_BFILL - -/* Define to 1 if you have the `bmove' function. */ -#undef HAVE_BMOVE - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - -/* Define to 1 if you have the `chsize' function. */ -#undef HAVE_CHSIZE - -/* Define to 1 if you have the `clock_gettime' function. */ -#undef HAVE_CLOCK_GETTIME - -/* Define to 1 if you have the <crypt.h> header file. */ -#undef HAVE_CRYPT_H - -/* Define to 1 if you have the <curses.h> header file. */ -#undef HAVE_CURSES_H - -/* Define to 1 if you have the `cuserid' function. */ -#undef HAVE_CUSERID - -/* Define to 1 if you have the <dirent.h> header file. */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the `dlerror' function. */ -#undef HAVE_DLERROR - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `dlopen' function. */ -#undef HAVE_DLOPEN - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `fchmod' function. */ -#undef HAVE_FCHMOD - -/* Define to 1 if you have the `fcntl' function. */ -#undef HAVE_FCNTL - -/* Define to 1 if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `fconvert' function. */ -#undef HAVE_FCONVERT - -/* Define to 1 if you have the `fdatasync' function. */ -#undef HAVE_FDATASYNC - -/* Define to 1 if you have the `fgetln' function. */ -#undef HAVE_FGETLN - -/* Define to 1 if you have the `finite' function. */ -#undef HAVE_FINITE - -/* Define to 1 if you have the <floatingpoint.h> header file. */ -#undef HAVE_FLOATINGPOINT_H - -/* Define to 1 if you have the <float.h> header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `flockfile' function. */ -#undef HAVE_FLOCKFILE - -/* Define to 1 if you have the `fpresetsticky' function. */ -#undef HAVE_FPRESETSTICKY - -/* Define to 1 if you have the `fpsetmask' function. */ -#undef HAVE_FPSETMASK - -/* Define to 1 if you have the `fsync' function. */ -#undef HAVE_FSYNC - -/* Define to 1 if you have the `ftruncate' function. */ -#undef HAVE_FTRUNCATE - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `gethostbyaddr_r' function. */ -#undef HAVE_GETHOSTBYADDR_R - -/* Define to 1 if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - -/* Define to 1 if you have the `getline' function. */ -#undef HAVE_GETLINE - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `getpass' function. */ -#undef HAVE_GETPASS - -/* Define to 1 if you have the `getpassphrase' function. */ -#undef HAVE_GETPASSPHRASE - -/* Define to 1 if you have the `getpwnam' function. */ -#undef HAVE_GETPWNAM - -/* Define to 1 if you have the `getpwuid' function. */ -#undef HAVE_GETPWUID - -/* Define to 1 if you have the `getrlimit' function. */ -#undef HAVE_GETRLIMIT - -/* Define to 1 if you have the `getrusage' function. */ -#undef HAVE_GETRUSAGE - -/* Define to 1 if you have the `getwd' function. */ -#undef HAVE_GETWD - -/* Define to 1 if you have the `gmtime_r' function. */ -#undef HAVE_GMTIME_R - -/* Define to 1 if you have the <grp.h> header file. */ -#undef HAVE_GRP_H - -/* Define to 1 if you have the <ieeefp.h> header file. */ -#undef HAVE_IEEEFP_H - -/* Define to 1 if you have the `index' function. */ -#undef HAVE_INDEX - -/* Define to 1 if you have the `initgroups' function. */ -#undef HAVE_INITGROUPS - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* isinf() macro or function */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - -/* Define to 1 if you have the `issetugid' function. */ -#undef HAVE_ISSETUGID - -/* Define to 1 if you have the `bind' library (-lbind). */ -#undef HAVE_LIBBIND - -/* Define to 1 if you have the `compat' library (-lcompat). */ -#undef HAVE_LIBCOMPAT - -/* Define to 1 if you have the `crypt' library (-lcrypt). */ -#undef HAVE_LIBCRYPT - -/* Define to 1 if you have the `c_r' library (-lc_r). */ -#undef HAVE_LIBC_R - -/* Define to 1 if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - -/* Define to 1 if you have the `gen' library (-lgen). */ -#undef HAVE_LIBGEN - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define to 1 if you have the `nsl_r' library (-lnsl_r). */ -#undef HAVE_LIBNSL_R - -/* Define to 1 if you have the `posix4' library (-lposix4). */ -#undef HAVE_LIBPOSIX4 - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - -/* Define to 1 if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define to 1 if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the <linux/config.h> header file. */ -#undef HAVE_LINUX_CONFIG_H - -/* Define to 1 if you have the <locale.h> header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define to 1 if you have the `locking' function. */ -#undef HAVE_LOCKING - -/* Define to 1 if you have the `longjmp' function. */ -#undef HAVE_LONGJMP - -/* Define to 1 if you have the `lrand48' function. */ -#undef HAVE_LRAND48 - -/* Define to 1 if you have the `lstat' function. */ -#undef HAVE_LSTAT - -/* Define to 1 if you have the `madvise' function. */ -#undef HAVE_MADVISE - -/* Define to 1 if you have the `mallinfo' function. */ -#undef HAVE_MALLINFO - -/* Define to 1 if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the `memcpy' function. */ -#undef HAVE_MEMCPY - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP - -/* Define to 1 if you have the `mlockall' function. */ -#undef HAVE_MLOCKALL - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the <ndir.h> header file. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the <netinet/in.h> header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the <paths.h> header file. */ -#undef HAVE_PATHS_H - -/* Define to 1 if you have the `perror' function. */ -#undef HAVE_PERROR - -/* Define to 1 if you have the `poll' function. */ -#undef HAVE_POLL - -/* Define to 1 if you have the `pread' function. */ -#undef HAVE_PREAD - -/* Define to 1 if you have the `pthread_attr_create' function. */ -#undef HAVE_PTHREAD_ATTR_CREATE - -/* Define to 1 if you have the `pthread_attr_getstacksize' function. */ -#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE - -/* Define to 1 if you have the `pthread_attr_setprio' function. */ -#undef HAVE_PTHREAD_ATTR_SETPRIO - -/* Define to 1 if you have the `pthread_attr_setschedparam' function. */ -#undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM - -/* Define to 1 if you have the `pthread_attr_setstacksize' function. */ -#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE - -/* Define to 1 if you have the `pthread_condattr_create' function. */ -#undef HAVE_PTHREAD_CONDATTR_CREATE - -/* Define to 1 if you have the `pthread_getsequence_np' function. */ -#undef HAVE_PTHREAD_GETSEQUENCE_NP - -/* Define to 1 if you have the `pthread_init' function. */ -#undef HAVE_PTHREAD_INIT - -/* Define to 1 if you have the `pthread_key_delete' function. */ -#undef HAVE_PTHREAD_KEY_DELETE - -/* Define to 1 if you have the `pthread_rwlock_rdlock' function. */ -#undef HAVE_PTHREAD_RWLOCK_RDLOCK - -/* Define to 1 if you have the `pthread_setprio' function. */ -#undef HAVE_PTHREAD_SETPRIO - -/* Define to 1 if you have the `pthread_setprio_np' function. */ -#undef HAVE_PTHREAD_SETPRIO_NP - -/* Define to 1 if you have the `pthread_setschedparam' function. */ -#undef HAVE_PTHREAD_SETSCHEDPARAM - -/* Define to 1 if you have the `pthread_sigmask' function. */ -#undef HAVE_PTHREAD_SIGMASK - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the <pwd.h> header file. */ -#undef HAVE_PWD_H - -/* Define to 1 if you have the `readlink' function. */ -#undef HAVE_READLINK - -/* Define to 1 if you have the `realpath' function. */ -#undef HAVE_REALPATH - -/* Define to 1 if you have the `regcomp' function. */ -#undef HAVE_REGCOMP - -/* Define to 1 if you have the `rename' function. */ -#undef HAVE_RENAME - -/* Define to 1 if system calls automatically restart after interruption by a - signal. */ -#undef HAVE_RESTARTABLE_SYSCALLS - -/* Define to 1 if you have the `re_comp' function. */ -#undef HAVE_RE_COMP - -/* Define to 1 if you have the `rint' function. */ -#undef HAVE_RINT - -/* Define to 1 if you have the `rwlock_init' function. */ -#undef HAVE_RWLOCK_INIT - -/* Define to 1 if you have the <sched.h> header file. */ -#undef HAVE_SCHED_H - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the <select.h> header file. */ -#undef HAVE_SELECT_H - -/* Define to 1 if you have the <semaphore.h> header file. */ -#undef HAVE_SEMAPHORE_H - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - -/* Define to 1 if you have the `setupterm' function. */ -#undef HAVE_SETUPTERM - -/* Define to 1 if you have the `sighold' function. */ -#undef HAVE_SIGHOLD - -/* Define to 1 if you have the `sigset' function. */ -#undef HAVE_SIGSET - -/* Define to 1 if you have the `sigthreadmask' function. */ -#undef HAVE_SIGTHREADMASK - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* Define to 1 if you have the <stdarg.h> header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if you have the <stddef.h> header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `stpcpy' function. */ -#undef HAVE_STPCPY - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strcoll' function. */ -#undef HAVE_STRCOLL - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strlcat' function. */ -#undef HAVE_STRLCAT - -/* Define to 1 if you have the `strlcpy' function. */ -#undef HAVE_STRLCPY - -/* Define to 1 if you have the `strnlen' function. */ -#undef HAVE_STRNLEN - -/* Define to 1 if you have the `strpbrk' function. */ -#undef HAVE_STRPBRK - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtok_r' function. */ -#undef HAVE_STRTOK_R - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the `strtoll' function. */ -#undef HAVE_STRTOLL - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the `strtoull' function. */ -#undef HAVE_STRTOULL - -/* Define to 1 if `st_rdev' is member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_RDEV - -/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use - `HAVE_STRUCT_STAT_ST_RDEV' instead. */ -#undef HAVE_ST_RDEV - -/* Define to 1 if you have the <synch.h> header file. */ -#undef HAVE_SYNCH_H - -/* Define to 1 if you have the <sys/cdefs.h> header file. */ -#undef HAVE_SYS_CDEFS_H - -/* Define to 1 if you have the <sys/dir.h> header file. */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the <sys/file.h> header file. */ -#undef HAVE_SYS_FILE_H - -/* Define to 1 if you have the <sys/ioctl.h> header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the <sys/malloc.h> header file. */ -#undef HAVE_SYS_MALLOC_H - -/* Define to 1 if you have the <sys/mman.h> header file. */ -#undef HAVE_SYS_MMAN_H - -/* Define to 1 if you have the <sys/ndir.h> header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the <sys/ptem.h> header file. */ -#undef HAVE_SYS_PTEM_H - -/* Define to 1 if you have the <sys/pte.h> header file. */ -#undef HAVE_SYS_PTE_H - -/* Define to 1 if you have the <sys/select.h> header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/stream.h> header file. */ -#undef HAVE_SYS_STREAM_H - -/* Define to 1 if you have the <sys/timeb.h> header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <sys/un.h> header file. */ -#undef HAVE_SYS_UN_H - -/* Define to 1 if you have the <sys/utime.h> header file. */ -#undef HAVE_SYS_UTIME_H - -/* Define to 1 if you have the <sys/vadvise.h> header file. */ -#undef HAVE_SYS_VADVISE_H - -/* Define to 1 if you have the <sys/wait.h> header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the `tcgetattr' function. */ -#undef HAVE_TCGETATTR - -/* Define to 1 if you have the `tell' function. */ -#undef HAVE_TELL - -/* Define to 1 if you have the `tempnam' function. */ -#undef HAVE_TEMPNAM - -/* Define to 1 if you have the <termbits.h> header file. */ -#undef HAVE_TERMBITS_H - -/* Define to 1 if you have the <termcap.h> header file. */ -#undef HAVE_TERMCAP_H - -/* Define to 1 if you have the <termios.h> header file. */ -#undef HAVE_TERMIOS_H - -/* Define to 1 if you have the <termio.h> header file. */ -#undef HAVE_TERMIO_H - -/* Define to 1 if you have the <term.h> header file. */ -#undef HAVE_TERM_H - -/* Define to 1 if you have the `thr_setconcurrency' function. */ -#undef HAVE_THR_SETCONCURRENCY - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the <utime.h> header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ -#undef HAVE_UTIME_NULL - -/* Define to 1 if you have the <varargs.h> header file. */ -#undef HAVE_VARARGS_H - -/* Define to 1 if you have the `vidattr' function. */ -#undef HAVE_VIDATTR - -/* Define to 1 if you have the <vis.h> header file. */ -#undef HAVE_VIS_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* The size of a `char', as computed by sizeof. */ -#undef SIZEOF_CHAR - -/* The size of a `char*', as computed by sizeof. */ -#undef SIZEOF_CHARP - -/* The size of a `int', as computed by sizeof. */ -#undef SIZEOF_INT - -/* The size of a `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of a `long long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -#undef TIME_WITH_SYS_TIME - -/* Define to 1 if your <sys/time.h> declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* Version number of package */ -#undef VERSION - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define to make fseeko etc. visible, on some hosts. */ -#undef _LARGEFILE_SOURCE - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#undef inline - -/* Define to `long' if <sys/types.h> does not define. */ -#undef off_t - -/* Define to `unsigned' if <sys/types.h> does not define. */ -#undef size_t diff --git a/ndb/config/old_files/configure.in b/ndb/config/old_files/configure.in deleted file mode 100644 index 4fa5ccdb672..00000000000 --- a/ndb/config/old_files/configure.in +++ /dev/null @@ -1,2085 +0,0 @@ -dnl -*- ksh -*- -dnl Process this file with autoconf to produce a configure script. - -AC_INIT(../../sql/mysqld.cc) -AC_CANONICAL_SYSTEM -# The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 4.1.2-3.4.3-alpha) -AM_CONFIG_HEADER(config.h) - -PROTOCOL_VERSION=10 -DOT_FRM_VERSION=6 -# See the libtool docs for information on how to do shared lib versions. -SHARED_LIB_VERSION=14:0:0 - -# Set all version vars based on $VERSION. How do we do this more elegant ? -# Remember that regexps needs to quote [ and ] since this is run through m4 -MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` -MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"` -MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` - -# The port should be constant for a LONG time -MYSQL_TCP_PORT_DEFAULT=3306 -MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock" - -##### -##### - -AC_SUBST(MYSQL_NO_DASH_VERSION) -AC_SUBST(MYSQL_BASE_VERSION) -AC_SUBST(MYSQL_VERSION_ID) -AC_SUBST(PROTOCOL_VERSION) -AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, $PROTOCOL_VERSION) -AC_SUBST(DOT_FRM_VERSION) -AC_DEFINE_UNQUOTED(DOT_FRM_VERSION, $DOT_FRM_VERSION) -AC_SUBST(SHARED_LIB_VERSION) - -# Canonicalize the configuration name. -SYSTEM_TYPE="$host_vendor-$host_os" -MACHINE_TYPE="$host_cpu" -AC_SUBST(SYSTEM_TYPE) -AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE") -AC_SUBST(MACHINE_TYPE) -AC_DEFINE_UNQUOTED(MACHINE_TYPE, "$MACHINE_TYPE") - -# Detect intel x86 like processor -BASE_MACHINE_TYPE=$MACHINE_TYPE -case $MACHINE_TYPE in - i?86) BASE_MACHINE_TYPE=i386 ;; -esac - -# Save some variables and the command line options for mysqlbug -SAVE_ASFLAGS="$ASFLAGS" -SAVE_CFLAGS="$CFLAGS" -SAVE_CXXFLAGS="$CXXFLAGS" -SAVE_LDFLAGS="$LDFLAGS" -SAVE_CXXLDFLAGS="$CXXLDFLAGS" -CONF_COMMAND="$0 $ac_configure_args" -AC_SUBST(CONF_COMMAND) -AC_SUBST(SAVE_ASFLAGS) -AC_SUBST(SAVE_CFLAGS) -AC_SUBST(SAVE_CXXFLAGS) -AC_SUBST(SAVE_LDFLAGS) -AC_SUBST(SAVE_CXXLDFLAGS) -AC_SUBST(CXXLDFLAGS) - -AC_PREREQ(2.12)dnl Minimum Autoconf version required. - -AM_MAINTAINER_MODE -#AC_ARG_PROGRAM # Automaticly invoked by AM_INIT_AUTOMAKE -AM_SANITY_CHECK -# This is needed is SUBDIRS is set -AC_PROG_MAKE_SET - -# This is need before AC_PROG_CC -# - -if test "x${CFLAGS-}" = x ; then - cflags_is_set=no -else - cflags_is_set=yes -fi - -if test "x${CPPFLAGS-}" = x ; then - cppflags_is_set=no -else - cppflags_is_set=yes -fi - -if test "x${LDFLAGS-}" = x ; then - ldflags_is_set=no -else - ldflags_is_set=yes -fi - -# The following hack should ensure that configure doesn't add optimizing -# or debugging flags to CFLAGS or CXXFLAGS -CFLAGS="$CFLAGS " -CXXFLAGS="$CXXFLAGS " - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_CC -AC_PROG_CXX -AC_PROG_CPP - -# Print version of CC and CXX compiler (if they support --version) -case $SYSTEM_TYPE in - *netware*) -CC_VERSION=`$CC -version | grep -i version` - ;; - *) -CC_VERSION=`$CC --version | sed 1q` - ;; -esac -if test $? -eq "0" -then - AC_MSG_CHECKING("C Compiler version"); - AC_MSG_RESULT("$CC $CC_VERSION") -else -CC_VERSION="" -fi -case $SYSTEM_TYPE in - *netware*) -CXX_VERSION=`$CXX -version | grep -i version` - ;; - *) -CXX_VERSION=`$CXX --version | sed 1q` - ;; -esac -if test $? -eq "0" -then - AC_MSG_CHECKING("C++ compiler version"); - AC_MSG_RESULT("$CXX $CXX_VERSION") -else -CXX_VERSION="" -fi -AC_SUBST(CXX_VERSION) -AC_SUBST(CC_VERSION) - -# Fix for sgi gcc / sgiCC which tries to emulate gcc -if test "$CC" = "sgicc" -then - ac_cv_prog_gcc="no" -fi -if test "$CXX" = "sgi++" -then - GXX="no" -fi - -if test "$ac_cv_prog_gcc" = "yes" -then - AS="$CC -c" - AC_SUBST(AS) -else - AC_PATH_PROG(AS, as, as) -fi -# Still need ranlib for readline; local static use only so no libtool. -AC_PROG_RANLIB -# We use libtool -#AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL - -# Ensure that we have --preserve-dup-deps defines, otherwise we get link -# problems of 'mysql' with CXX=g++ -LIBTOOL="$LIBTOOL --preserve-dup-deps" -AC_SUBST(LIBTOOL)dnl - -#AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_DISABLE_FAST_INSTALL AC_DISABLE_SHARED AC_DISABLE_STATIC - -# AC_PROG_INSTALL -AC_PROG_INSTALL -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -# Not critical since the generated file is distributed -AC_PROG_YACC -AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf) -AC_CHECK_PROG(DVIS, tex, manual.dvi) - -AC_MSG_CHECKING("return type of sprintf") - -#check the return type of sprintf -case $SYSTEM_TYPE in - *netware*) - AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int") - ;; - *) -AC_TRY_RUN([ - int main() - { - char* s = "hello"; - char buf[6]; - if((int)sprintf(buf, s) == strlen(s)) - return 0; - - return -1; - } - ], -AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int"), - AC_TRY_RUN([ - int main() - { - char* s = "hello"; - char buf[6]; - if((char*)sprintf(buf,s) == buf + strlen(s)) - return 0; - return -1; - } -], AC_DEFINE(SPRINTF_RETURNS_PTR) AC_MSG_RESULT("ptr"), - AC_DEFINE(SPRINTF_RETURNS_GARBAGE) AC_MSG_RESULT("garbage"))) - ;; -esac - - -# option, cache_name, variable, -# code to execute if yes, code to exectute if fail -AC_DEFUN(AC_SYS_COMPILER_FLAG, -[ - AC_MSG_CHECKING($1) - OLD_CFLAGS="[$]CFLAGS" - AC_CACHE_VAL(mysql_cv_option_$2, - [ - CFLAGS="[$]OLD_CFLAGS $1" - AC_TRY_RUN([int main(){exit(0);}],mysql_cv_option_$2=yes,mysql_cv_option_$2=no,mysql_cv_option_$2=no) - ]) - - CFLAGS="[$]OLD_CFLAGS" - - if test x"[$]mysql_cv_option_$2" = "xyes" ; then - $3="[$]$3 $1" - AC_MSG_RESULT(yes) - $5 - else - AC_MSG_RESULT(no) - $4 - fi -]) - -# arch, option, cache_name, variable -AC_DEFUN(AC_SYS_CPU_COMPILER_FLAG, -[ - if test "`uname -m 2>/dev/null`" = "$1" ; then - AC_SYS_COMPILER_FLAG($2,$3,$4) - fi -]) - -# os, option, cache_name, variable -AC_DEFUN(AC_SYS_OS_COMPILER_FLAG, -[ - if test "x$mysql_cv_sys_os" = "x$1" ; then - AC_SYS_COMPILER_FLAG($2,$3,$4) - fi -]) - -# We need some special hacks when running slowaris -AC_PATH_PROG(uname_prog, uname, no) - -# We should go through this and put all the explictly system dependent -# stuff in one place -AC_MSG_CHECKING(operating system) -AC_CACHE_VAL(mysql_cv_sys_os, -[ -if test "$uname_prog" != "no"; then - mysql_cv_sys_os="`uname`" -else - mysql_cv_sys_os="Not Solaris" -fi -]) -AC_MSG_RESULT($mysql_cv_sys_os) - -# This should be rewritten to use $target_os -case "$target_os" in - sco3.2v5*) - CFLAGS="$CFLAGS -DSCO" - CXXFLAGS="$CXXFLAGS -DSCO" - LD='$(CC) $(CFLAGS)' - case "$CFLAGS" in - *-belf*) - AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ - case "$LDFLAGS" in - *-belf*) ;; - *) echo "Adding -belf option to ldflags." - LDFLAGS="$LDFLAGS -belf" - ;; - esac - ]) - ;; - *) - AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ - case "$LDFLAGS" in - *-belf*) ;; - *) - echo "Adding -belf option to ldflags." - LDFLAGS="$LDFLAGS -belf" - ;; - esac - ]) - ;; - esac - ;; - sysv5UnixWare*) - if test "$GCC" != "yes"; then - # We are using built-in inline function - CFLAGS="$CFLAGS -Kalloca" - fi - CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA" - ;; - sysv5OpenUNIX8*) - if test "$GCC" != "yes"; then - # We are using built-in inline function - CFLAGS="$CFLAGS -Kalloca" - fi - CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA" - ;; -esac -AC_SUBST(CC) -AC_SUBST(CFLAGS) -AC_SUBST(CXX) -AC_SUBST(CXXFLAGS) -AC_SUBST(LD) -AC_SUBST(INSTALL_SCRIPT) - -export CC CXX CFLAGS LD LDFLAGS AR - -if test "$GXX" = "yes" -then - # mysqld requires -fno-implicit-templates. - # Disable exceptions as they seams to create problems with gcc and threads. - # mysqld doesn't use run-time-type-checking, so we disable it. - CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" - - # If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux, - # we will gets some problems when linking static programs. - # The following code is used to fix this problem. - - if test "$CXX" = "gcc" -o "$CXX" = "ccache gcc" - then - if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1 - then - CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL" - fi - fi -fi - -# Avoid bug in fcntl on some versions of linux -AC_MSG_CHECKING("if we should use 'skip-locking' as default for $target_os") -# Any wariation of Linux -if expr "$target_os" : "[[Ll]]inux.*" > /dev/null -then - MYSQLD_DEFAULT_SWITCHES="--skip-locking" - IS_LINUX="true" - AC_MSG_RESULT("yes"); -else - MYSQLD_DEFAULT_SWITCHES="" - IS_LINUX="false" - AC_MSG_RESULT("no"); -fi -AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -AC_SUBST(IS_LINUX) - -dnl Find paths to some shell programs -AC_PATH_PROG(LN, ln, ln) -# This must be able to take a -f flag like normal unix ln. -AC_PATH_PROG(LN_CP_F, ln, ln) -if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then -# If ln -f does not exists use -s (AFS systems) -if test -n "$LN_CP_F"; then - LN_CP_F="$LN_CP_F -s" -fi -fi - -AC_PATH_PROG(MV, mv, mv) -AC_PATH_PROG(RM, rm, rm) -AC_PATH_PROG(CP, cp, cp) -AC_PATH_PROG(SED, sed, sed) -AC_PATH_PROG(CMP, cmp, cmp) -AC_PATH_PROG(CHMOD, chmod, chmod) -AC_PATH_PROG(HOSTNAME, hostname, hostname) -# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and -# fall back to 'tar' otherwise and hope that it's a GNU tar as well -AC_CHECK_PROGS(TAR, gnutar gtar tar) - -dnl We use a path for perl so the script startup works -dnl We make sure to use perl, not perl5, in hopes that the RPMs will -dnl not depend on the perl5 binary being installed (probably a bug in RPM) -AC_PATH_PROG(PERL, perl, no) -if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1 -then - PERL5=$PERL -else - AC_PATH_PROG(PERL5, perl5, no) - if test "$PERL5" != no - then - PERL=$PERL5 - ac_cv_path_PERL=$ac_cv_path_PERL5 - fi -fi - -AC_SUBST(HOSTNAME) -AC_SUBST(PERL) -AC_SUBST(PERL5) - -# Lock for PS -AC_PATH_PROG(PS, ps, ps) -AC_MSG_CHECKING("how to check if pid exists") -PS=$ac_cv_path_PS -# Linux style -if $PS p $$ 2> /dev/null | grep $0 > /dev/null -then - FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null" -# Solaris -elif $PS -p $$ 2> /dev/null | grep $0 > /dev/null -then - FIND_PROC="$PS -p \$\$PID | grep mysqld > /dev/null" -# BSD style -elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null -then - FIND_PROC="$PS -uaxww | grep mysqld | grep \" \$\$PID \" > /dev/null" -# SysV style -elif $PS -ef 2> /dev/null | grep $0 > /dev/null -then - FIND_PROC="$PS -ef | grep mysqld | grep \" \$\$PID \" > /dev/null" -# Do anybody use this? -elif $PS $$ 2> /dev/null | grep $0 > /dev/null -then - FIND_PROC="$PS \$\$PID | grep mysqld > /dev/null" -else - case $SYSTEM_TYPE in - *freebsd*) - FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null" - ;; - *darwin*) - FIND_PROC="$PS -uaxww | grep mysqld | grep \" \$\$PID \" > /dev/null" - ;; - *cygwin*) - FIND_PROC="$PS -e | grep mysqld | grep \" \$\$PID \" > /dev/null" - ;; - *netware* | *modesto*) - FIND_PROC= - ;; - *) - AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.]) - esac -fi -AC_SUBST(FIND_PROC) -AC_MSG_RESULT("$FIND_PROC") - -# Check if a pid is valid -AC_PATH_PROG(KILL, kill, kill) -AC_MSG_CHECKING("for kill switches") -if $ac_cv_path_KILL -0 $$ -then - CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null" -elif kill -s 0 $$ -then - CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null" -else - AC_MSG_WARN([kill -0 to check for pid seems to fail]) - CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null" -fi -AC_SUBST(CHECK_PID) -AC_MSG_RESULT("$CHECK_PID") - -# We need a ANSI C compiler -AM_PROG_CC_STDC - -# We need an assembler, too -AM_PROG_AS - -if test "$am_cv_prog_cc_stdc" = "no" -then - AC_MSG_ERROR([MySQL requires a ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.]) -fi - -NOINST_LDFLAGS= - -static_nss="" -STATIC_NSS_FLAGS="" -OTHER_LIBC_LIB="" -AC_ARG_WITH(other-libc, - [ --with-other-libc=DIR Link against libc and other standard libraries - installed in the specified non-standard location - overriding default. Originally added to be able to - link against glibc 2.2 without making the user - upgrade the standard libc installation.], - [ - other_libc_include="$withval/include" - other_libc_lib="$withval/lib" - with_other_libc="yes" - enable_shared="no" - all_is_static="yes" - CFLAGS="$CFLAGS -I$other_libc_include" - # There seems to be a feature in gcc that treats system and libc headers - # silently when they violatate ANSI C++ standard, but it is strict otherwise - # since gcc cannot now recognize that our headers are libc, we work around - # by telling it to be permissive. Note that this option only works with - # new versions of gcc (2.95.x and above) - CXXFLAGS="$CXXFLAGS -fpermissive -I$other_libc_include" - if test -f "$other_libc_lib/libnss_files.a" - then - # libc has been compiled with --enable-static-nss - # we need special flags, but we will have to add those later - STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv" - STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS" - OTHER_LIBC_LIB="-static -L$other_libc_lib" - static_nss=1 - else - # this is a dirty hack. We if we detect static nss glibc in the special - # location, we do not re-direct the linker to get libraries from there - # during check. The reason is that if we did, we would have to find a - # way to append the special static nss flags to LIBS every time we do - # any check - this is definitely feasible, but not worthwhile the risk - # of breaking other things. So for our purposes it would be sufficient - # to assume that whoever is using static NSS knows what he is doing and - # has sensible libraries in the regular location - LDFLAGS="$LDFLAGS -static -L$other_libc_lib " - fi - - # When linking against custom libc installed separately, we want to force - # all binary builds to be static, including the build done by configure - # itself to test for system features. - with_mysqld_ldflags="-all-static" - with_client_ldflags="-all-static" - NOINST_LDFLAGS="-all-static" - ], - [ - other_libc_include= - other_libc_lib= - with_other_libc="no" - ] -) -AC_SUBST(NOINST_LDFLAGS) - -# -# Check if we are using Linux and a glibc compiled with static nss -# (this is true on the MySQL build machines to avoid NSS problems) -# - -if test "$IS_LINUX" = "true" -a "$static_nss" = "" -then - tmp=`nm /usr/lib/libc.a | grep _nss_files_getaliasent_r` - if test -n "$tmp" - then - STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv" - STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS" - static_nss=1 - fi -fi - - -AC_ARG_WITH(server-suffix, - [ --with-server-suffix Append value to the version string.], - [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ], - [ MYSQL_SERVER_SUFFIX= ] - ) -AC_SUBST(MYSQL_SERVER_SUFFIX) - -# Set flags if we wants to have MIT threads. -AC_ARG_WITH(mit-threads, - [ --with-mit-threads Always use included thread lib.], - [ with_mit_threads=$withval ], - [ with_mit_threads=no ] - ) - -if test "$with_mit_threads" = "yes" -then - enable_largefile="no" # Will not work on Linux. -fi - -# Set flags if we want to force to use pthreads -AC_ARG_WITH(pthread, - [ --with-pthread Force use of pthread library.], - [ with_pthread=$withval ], - [ with_pthread=no ] - ) - -# Force use of thread libs LIBS -AC_ARG_WITH(named-thread-libs, - [ --with-named-thread-libs=ARG - Use specified thread libraries instead of - those automatically found by configure.], - [ with_named_thread=$withval ], - [ with_named_thread=no ] - ) - -# Force use of a curses libs -AC_ARG_WITH(named-curses-libs, - [ --with-named-curses-libs=ARG - Use specified curses libraries instead of - those automatically found by configure.], - [ with_named_curses=$withval ], - [ with_named_curses=no ] - ) - -# Force use of a zlib (compress) -AC_ARG_WITH(named-z-libs, - [ --with-named-z-libs=ARG - Use specified zlib libraries instead of - those automatically found by configure.], - [ with_named_zlib=$withval ], - [ with_named_zlib=z ] - ) - -# Make thread safe client -AC_ARG_ENABLE(thread-safe-client, - [ --enable-thread-safe-client - Compile the client with threads.], - [ THREAD_SAFE_CLIENT=$enableval ], - [ THREAD_SAFE_CLIENT=no ] - ) - -# compile with strings functions in assembler -AC_ARG_ENABLE(assembler, - [ --enable-assembler Use assembler versions of some string - functions if available.], - [ ENABLE_ASSEMBLER=$enableval ], - [ ENABLE_ASSEMBLER=no ] - ) - -AC_MSG_CHECKING(if we should use assembler functions) -# For now we only support assembler on i386 and sparc systems -AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386") -AM_CONDITIONAL(ASSEMBLER_sparc32, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparc") -AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9") -AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "" -o "$ASSEMBLER_sparc32_TRUE" = "") - -if test "$ASSEMBLER_TRUE" = "" -then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - - -AC_MSG_CHECKING(if we should use RAID) -AC_ARG_WITH(raid, - [ --with-raid Enable RAID Support], - [ USE_RAID=$withval ], - [ USE_RAID=no ] - ) -if test "$USE_RAID" = "yes" -then - AC_MSG_RESULT([yes]) - AC_DEFINE([USE_RAID]) -else - AC_MSG_RESULT([no]) -fi - -# Use this to set the place used for unix socket used to local communication. -AC_ARG_WITH(unix-socket-path, - [ --with-unix-socket-path=SOCKET - Where to put the unix-domain socket. SOCKET must be - an absolute file name.], - [ MYSQL_UNIX_ADDR=$withval ], - [ MYSQL_UNIX_ADDR=$MYSQL_UNIX_ADDR_DEFAULT ] - ) -AC_SUBST(MYSQL_UNIX_ADDR) - -AC_ARG_WITH(tcp-port, - [ --with-tcp-port=port-number - Which port to use for MySQL services (default 3306)], - [ MYSQL_TCP_PORT=$withval ], - [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT ] - ) -AC_SUBST(MYSQL_TCP_PORT) -# We might want to document the assigned port in the manual. -AC_SUBST(MYSQL_TCP_PORT_DEFAULT) - -# Use this to set the place used for unix socket used to local communication. -AC_ARG_WITH(mysqld-user, - [ --with-mysqld-user=username - What user the mysqld daemon shall be run as.], - [ MYSQLD_USER=$withval ], - [ MYSQLD_USER=mysql ] - ) -AC_SUBST(MYSQLD_USER) - -# If we should allow LOAD DATA LOCAL -AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default) -AC_ARG_ENABLE(local-infile, - [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)], - [ ENABLED_LOCAL_INFILE=$enableval ], - [ ENABLED_LOCAL_INFILE=no ] - ) -if test "$ENABLED_LOCAL_INFILE" = "yes" -then - AC_MSG_RESULT([yes]) - AC_DEFINE([ENABLED_LOCAL_INFILE]) -else - AC_MSG_RESULT([no]) -fi - -MYSQL_SYS_LARGEFILE - -# Types that must be checked AFTER large file support is checked -AC_TYPE_SIZE_T - -#-------------------------------------------------------------------- -# Check for system header files -#-------------------------------------------------------------------- - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ - memory.h pwd.h select.h \ - stdlib.h stddef.h \ - strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ - sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ - unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ - sys/ioctl.h malloc.h sys/malloc.h linux/config.h) - -#-------------------------------------------------------------------- -# Check for system libraries. Adds the library to $LIBS -# and defines HAVE_LIBM etc -#-------------------------------------------------------------------- - -AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity)) - -AC_CHECK_LIB(nsl_r, gethostbyname_r, [], - AC_CHECK_LIB(nsl, gethostbyname_r)) -AC_CHECK_FUNC(gethostbyname_r) - -AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) -AC_CHECK_FUNC(yp_get_default_domain, , - AC_CHECK_LIB(nsl, yp_get_default_domain)) -AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open)) -# This may get things to compile even if bind-8 is installed -AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind)) -# For crypt() on Linux -AC_CHECK_LIB(crypt, crypt) -AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT)) - -# For sem_xxx functions on Solaris 2.6 -AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init)) - -# For compress in zlib -MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib) - -#-------------------------------------------------------------------- -# Check for TCP wrapper support -#-------------------------------------------------------------------- - -AC_ARG_WITH(libwrap, -[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[ - case "$with_libwrap" in - no) : ;; - yes|*) - _cppflags=${CPPFLAGS} - _ldflags=${LDFLAGS} - - if test "$with_libwrap" != "yes"; then - CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include" - LDFLAGS="${LDFLAGS} -L$with_libwrap/lib" - fi - - _libs=${LIBS} - AC_CHECK_HEADER(tcpd.h, - LIBS="-lwrap $LIBS" - AC_MSG_CHECKING(for TCP wrappers library -lwrap) - AC_TRY_LINK([#include <tcpd.h> -int allow_severity = 0; -int deny_severity = 0; - -struct request_info *req; -],[hosts_access (req)], - AC_MSG_RESULT(yes) - AC_DEFINE(LIBWRAP) - AC_DEFINE(HAVE_LIBWRAP) - if test "$with_libwrap" != "yes"; then - WRAPLIBS="-L${with_libwrap}/lib" - fi - WRAPLIBS="${WRAPLIBS} -lwrap", - AC_MSG_RESULT(no) - CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}), - CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}) - LDFLAGS=${_ldflags} LIBS=${_libs} - ;; - esac -]) -AC_SUBST(WRAPLIBS) - -if test "$IS_LINUX" = "true"; then - AC_MSG_CHECKING([for atomic operations]) - - atom_ops= - AC_TRY_RUN([ -#include <asm/atomic.h> -int main() -{ - atomic_t v; - - atomic_set(&v, 23); - atomic_add(5, &v); - return atomic_read(&v) == 28 ? 0 : -1; -} - ], AC_DEFINE(HAVE_ATOMIC_ADD) atom_ops="${atom_ops}atomic_add ", - ) - AC_TRY_RUN([ -#include <asm/atomic.h> -int main() -{ - atomic_t v; - - atomic_set(&v, 23); - atomic_sub(5, &v); - return atomic_read(&v) == 18 ? 0 : -1; -} - ], AC_DEFINE(HAVE_ATOMIC_SUB) atom_ops="${atom_ops}atomic_sub ", - ) - - if test -z "$atom_ops"; then atom_ops="no"; fi - AC_MSG_RESULT($atom_ops) - - AC_ARG_WITH(pstack, - [ --with-pstack Use the pstack backtrace library], - [ USE_PSTACK=$withval ], - [ USE_PSTACK=no ]) - pstack_libs= - pstack_dirs= - if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no" - then - have_libiberty= have_libbfd= - my_save_LIBS="$LIBS" -dnl I have no idea if this is a good test - can not find docs for libiberty - AC_CHECK_LIB([iberty], [fdmatch], - [have_libiberty=yes - AC_CHECK_LIB([bfd], [bfd_openr], [have_libbfd=yes], , [-liberty])]) - LIBS="$my_save_LIBS" - - if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes - then - pstack_dirs='$(top_srcdir)'/pstack - pstack_libs="../pstack/libpstack.a -lbfd -liberty" - # We must link staticly when using pstack - with_mysqld_ldflags="-all-static" - AC_SUBST([pstack_dirs]) - AC_SUBST([pstack_libs]) - AC_DEFINE([USE_PSTACK]) -dnl This check isn't needed, but might be nice to give some feedback.... -dnl AC_CHECK_HEADER(libiberty.h, -dnl have_libiberty_h=yes, -dnl have_libiberty_h=no) - else - USE_PSTACK="no" - fi - else - USE_PSTACK="no" - fi -fi -AM_CONDITIONAL(COMPILE_PSTACK, test "$USE_PSTACK" = "yes") -AC_MSG_CHECKING([if we should use pstack]) -AC_MSG_RESULT([$USE_PSTACK]) - -# Check for gtty if termio.h doesn't exists -if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no" -then - AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty)) -fi -# We make a special variable for client library's to avoid including -# thread libs in the client. -NON_THREADED_CLIENT_LIBS="$LIBS" - -AC_MSG_CHECKING([for int8]) -case $SYSTEM_TYPE in - *netware) - AC_MSG_RESULT([no]) - ;; - *) -AC_TRY_RUN([ -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#ifdef HAVE_STDDEF_H -#include <stddef.h> -#endif - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -int main() -{ - int8 i; - return 0; -} -], AC_DEFINE(HAVE_INT_8_16_32) AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) -) - ;; -esac - -# -# Some system specific hacks -# - -MAX_C_OPTIMIZE="-O3" -MAX_CXX_OPTIMIZE="-O3" - -case $SYSTEM_TYPE in - *solaris2.7*) - # Solaris 2.7 has a broken /usr/include/widec.h - # Make a fixed copy in ./include - echo "Fixing broken include files for $SYSTEM_TYPE" - echo " - Creating local copy of widec.h" - if test ! -d include - then - mkdir ./include - fi - builddir=`pwd` - sed -e "s|^#if[ ]*!defined(lint) && !defined(__lint)|#if !defined\(lint\) \&\& !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h - CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - ;; - *solaris2.8*) - # Solaris 2.8 has a broken /usr/include/widec.h - # Make a fixed copy in ./include - echo "Fixing broken include files for $SYSTEM_TYPE" - echo " - Creating local copy of widec.h" - if test ! -d include - then - mkdir ./include - fi - builddir=`pwd` - sed -e "s|^#if[ ]*!defined(__lint)|#if !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h - CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - ;; - *solaris2.5.1*) - echo "Enabling getpass() workaround for Solaris 2.5.1" - CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS -DHAVE_RWLOCK_T"; - CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T -DSOLARIS" - ;; - *solaris*) - CFLAGS="$CFLAGS -DHAVE_RWLOCK_T" - CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T" - ;; - *SunOS*) - echo "Enabling getpass() workaround for SunOS" - CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS"; - ;; - *hpux10.20*) - echo "Enabling workarounds for hpux 10.20" - CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX" - CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX" - if test "$with_named_thread" = "no" - then - echo "Using --with-named-thread=-lpthread" - with_named_thread="-lcma" - fi - ;; - *hpux11.*) - echo "Enabling workarounds for hpux 11" - CFLAGS="$CFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" - CXXFLAGS="$CXXFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" - if test "$with_named_thread" = "no" - then - echo "Using --with-named-thread=-lpthread" - with_named_thread="-lpthread" - fi - # Fixes for HPUX 11.0 compiler - if test "$ac_cv_prog_gcc" = "no" - then - CFLAGS="$CFLAGS -DHAVE_BROKEN_INLINE" - CXXFLAGS="$CXXFLAGS +O2" - MAX_C_OPTIMIZE="" - MAX_CXX_OPTIMIZE="" - fi - ;; - *rhapsody*) - if test "$ac_cv_prog_gcc" = "yes" - then - CPPFLAGS="$CPPFLAGS -traditional-cpp " - CFLAGS="-DHAVE_CTHREADS_WRAPPER -DDO_NOT_REMOVE_THREAD_WRAPPERS" - CXXFLAGS="-DHAVE_CTHREADS_WRAPPER" - if test $with_named_curses = "no" - then - with_named_curses="" - fi - fi - ;; - *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" - CFLAGS="$CFLAGS $FLAGS" - CXXFLAGS="$CXXFLAGS $FLAGS" - MAX_C_OPTIMIZE="-O" - with_named_curses="" - fi - ;; - *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" - CFLAGS="$CFLAGS $FLAGS" - CXXFLAGS="$CXXFLAGS $FLAGS" - MAX_C_OPTIMIZE="-O" - fi - ;; - *darwin7*) - if test "$ac_cv_prog_gcc" = "yes" - then - FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ" - CFLAGS="$CFLAGS $FLAGS" - CXXFLAGS="$CXXFLAGS $FLAGS" - MAX_C_OPTIMIZE="-O" - fi - ;; - *freebsd*) - echo "Adding fix for interrupted reads" - OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'` - if test "$OSVERSION" -gt "480100" && \ - test "$OSVERSION" -lt "500000" || \ - test "$OSVERSION" -gt "500109" - then - CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000" - else - CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH" - CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH" - fi - ;; - *netbsd*) - echo "Adding flag -Dunix" - CFLAGS="$CFLAGS -Dunix" - CXXFLAGS="$CXXFLAGS -Dunix" - OVERRIDE_MT_LD_ADD="\$(top_srcdir)/mit-pthreads/obj/libpthread.a" - ;; - *bsdi*) - echo "Adding fix for BSDI" - CFLAGS="$CFLAGS -D__BSD__ -DHAVE_BROKEN_REALPATH" - AC_DEFINE_UNQUOTED(SOCKOPT_OPTLEN_TYPE, size_t) - ;; - *sgi-irix6*) - if test "$with_named_thread" = "no" - then - echo "Using --with-named-thread=-lpthread" - with_named_thread="-lpthread" - fi - CXXFLAGS="$CXXFLAGS -D_BOOL" - ;; - *aix4.3*) - echo "Adding defines for AIX" - CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ" - CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ" - ;; -dnl Is this the right match for DEC OSF on alpha? - *dec-osf*) - if test "$ac_cv_prog_gcc" = "yes" && test "$host_cpu" = "alpha" - then - echo "Adding defines for DEC OSF on alpha" - CFLAGS="$CFLAGS -mieee" - CXXFLAGS="$CXXFLAGS -mieee" - fi - echo "Adding defines for OSF1" - # gethostbyname_r is deprecated and doesn't work ok on OSF1 - CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" - CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" - ;; - *netware*) - # No need for curses library so set it to null - with_named_curses="" - - # No thread library - in LibC - with_named_thread="" - - # - # Edit Makefile.in files. - # - echo -n "configuring Makefile.in files for NetWare... " - for file in sql/Makefile.in libmysql/Makefile.in libmysql_r/Makefile.in sql/share/Makefile.in strings/Makefile.in client/Makefile.in - do - # echo "#### $file ####" - filedir="`dirname $file`" - filebase="`basename $file`" - filesed=$filedir/$filebase.sed - # - # Backup and always use original file - # - if test -f $file.bk - then - cp -fp $file.bk $file - else - cp -fp $file $file.bk - fi - case $file in - 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) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)" - cat > $filesed << EOF -s,\(^.*\$(MAKE) gen_lex_hash\),#\1, -s,\(\./gen_lex_hash\),\1.linux, -s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES % -EOF - ;; - sql/share/Makefile.in) - cat > $filesed << EOF -s,\(extra/comp_err\),\1.linux, -EOF - ;; - libmysql/Makefile.in) - cat > $filesed << EOF -s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2, -s,\(: conf_to_src\),\1.linux, -EOF - ;; - libmysql_r/Makefile.in) - cat > $filesed << EOF -s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2, -s,\(: conf_to_src\),\1.linux, -EOF - ;; - strings/Makefile.in) - cat > $filesed << EOF -s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2, -s,\(: conf_to_src\),\1.linux, -EOF - ;; - client/Makefile.in) - # - cat > $filesed << EOF -s,libmysqlclient.la,.libs/libmysqlclient.a, -EOF - ;; - esac - if `sed -f $filesed $file > $file.nw`;\ - then - mv -f $file.nw $file - rm -f $filesed - else - exit 1 - fi - # wait for file system changes to complete - sleep 1 - done - echo "done" - - # - # Make sure the following files are writable. - # - # When the files are retrieved from some source code control systems they are read-only. - # - echo -n "making sure specific build files are writable... " - for file in \ - Docs/include.texi \ - Docs/mysql.info \ - Docs/manual.txt \ - Docs/manual_toc.html \ - Docs/manual.html \ - Docs/INSTALL-BINARY \ - INSTALL-SOURCE \ - COPYING \ - COPYING.LIB \ - MIRRORS - do - if test -e $file; then - chmod +w $file - fi - done - echo "done" - - ;; -esac - - -#---START: Used in for client configure -# Check if we threads are in libc or if we should use -# -lpthread, -lpthreads or mit-pthreads -# We have to check libc last because else it fails on Solaris 2.6 - -with_posix_threads="no" -# Hack for DEC-UNIX (OSF1) -if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -then - # Look for LinuxThreads. - AC_MSG_CHECKING("LinuxThreads") - res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` - if test "$res" -gt 0 - then - AC_MSG_RESULT("Found") - AC_DEFINE(HAVE_LINUXTHREADS) - # Linux 2.0 sanity check - AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], , - AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) - # RedHat 5.0 does not work with dynamic linking of this. -static also - # gives a speed increase in linux so it does not hurt on other systems. - with_named_thread="-lpthread" - else - AC_MSG_RESULT("Not found") - # If this is a linux machine we should barf - if test "$IS_LINUX" = "true" - then - AC_MSG_ERROR([This is a linux system and Linuxthreads was not -found. On linux Linuxthreads should be used. Please install Linuxthreads -(or a new glibc) and try again. See the Installation chapter in the -Reference Manual for more information.]) - else - AC_MSG_CHECKING("DEC threads") - if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a - then - with_named_thread="-lpthread -lmach -lexc" - CFLAGS="$CFLAGS -D_REENTRANT" - CXXFLAGS="$CXXFLAGS -D_REENTRANT" - AC_DEFINE(HAVE_DEC_THREADS) - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - AC_MSG_CHECKING("DEC 3.2 threads") - if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a - then - with_named_thread="-lpthreads -lmach -lc_r" - AC_DEFINE(HAVE_DEC_THREADS) - AC_DEFINE(HAVE_DEC_3_2_THREADS) - with_osf32_threads="yes" - MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority" - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - fi - fi - fi - fi -fi - - -dnl This is needed because -lsocket has to come after the thread -dnl library on SCO. -AC_DEFUN([MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK], [ - LIBS=`echo " $LIBS " | sed -e 's/ -lsocket / /g'` -]) -# Hack for SCO UNIX -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING("SCO threads") - if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null - then - if test -f /usr/lib/libgthreads.a -o -f /usr/lib/libgthreads.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - with_named_thread="-lgthreads -lsocket -lgthreads" - # sched.h conflicts with fsu-threads - touch ./include/sched.h - - # We must have gcc - if expr "$CC" : ".*gcc.*" - then - AC_MSG_RESULT("yes") - else - AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]); - fi - AC_MSG_RESULT("yes") - elif test -f /usr/local/lib/libpthread.a -o -f /usr/local/lib/libpthread.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - with_named_thread="-lpthread -lsocket" - # sched.h conflicts with fsu-threads - # touch ./include/sched.h - - AC_MSG_CHECKING("for gcc") - # We must have gcc - if expr "$CC" : ".*gcc.*" - then - AC_MSG_RESULT("yes") - else - AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]); - fi - AC_MSG_RESULT("yes") - # Hack for SCO UnixWare 7.1.x - # - elif test "$with_named_thread" = "no" - then - AC_MSG_RESULT("no") - AC_MSG_CHECKING("SCO UnixWare 7.1.x native threads") - if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null - then - if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - if expr "$CC" : ".*gcc.*" - then - with_named_thread="-pthread -lsocket -lnsl" - else - with_named_thread="-Kthread -lsocket -lnsl" - fi - if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null - then - AC_DEFINE(HAVE_UNIXWARE7_THREADS) - else - AC_DEFINE(HAVE_UNIXWARE7_POSIX) - fi - AC_MSG_RESULT("yes") - # We must have cc - AC_MSG_CHECKING("for gcc") - if expr "$CC" : ".*gcc.*" - then - CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - else - CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - fi - else - { echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; }; - fi - else - AC_MSG_RESULT("no") - fi - else - AC_MSG_ERROR([On SCO UNIX MySQL requires that the FSUThreads package is installed. See the Installation chapter in the Reference Manual.]); - fi - else - AC_MSG_RESULT("no") - fi -fi -# Hack for SCO UnixWare7 -# -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING("SCO UnixWare7 native threads") - if expr "$SYSTEM_TYPE" : ".*UnixWare*" > /dev/null - then - if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - if expr "$CC" : ".*gcc.*" - then - with_named_thread="-pthread -lsocket -lnsl" - else - with_named_thread="-Kthread -lsocket -lnsl" - fi - if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null - then - AC_DEFINE(HAVE_UNIXWARE7_THREADS) - else - AC_DEFINE(HAVE_UNIXWARE7_POSIX) - fi - # We must have cc - AC_MSG_CHECKING("for gcc") - if expr "$CC" : ".*gcc.*" - then - CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - else - CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - fi - AC_MSG_RESULT("yes") - else - { echo "configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual." 1>&2; exit 1; }; - fi - else - AC_MSG_RESULT("no") - fi -fi - -# Hack for Caldera OpenUNIX8 -# -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING("OpenUNIX8 native threads") - if expr "$SYSTEM_TYPE" : ".*OpenUNIX*" > /dev/null - then - if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - if expr "$CC" : ".*gcc.*" - then - with_named_thread="-pthread -lsocket -lnsl" - else - with_named_thread="-Kthread -lsocket -lnsl" - fi - if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null - then - AC_DEFINE(HAVE_UNIXWARE7_THREADS) - else - AC_DEFINE(HAVE_UNIXWARE7_POSIX) - fi - # We must have cc - AC_MSG_CHECKING("for gcc") - if expr "$CC" : ".*gcc.*" - then - CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - else - CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - fi - AC_MSG_RESULT("yes") - else - { echo "configure: error: Can't find thread libs on Caldera OpenUNIX 8. See the Installation chapter in the Reference Manual." 1>&2; exit 1; }; - fi - else - AC_MSG_RESULT("no") - fi -fi - -# Hack for Siemens UNIX -if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -then - AC_MSG_CHECKING("Siemens threads") - if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4" - then - LIBS="-lxnet $LIBS" - NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS -lxnet" - with_named_thread="-Kthread $LDFLAGS -lxnet" - LD_FLAGS="" - CFLAGS="-Kthread $CFLAGS" - CXXFLAGS="-Kthread $CXXFLAGS" - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - fi -fi - -# Use library named -lpthread -if test "$with_named_thread" = "no" -a "$with_pthread" = "yes" -then - with_named_thread="-lpthread" -fi - -#---END: - -# Hack for Solaris >= 2.5 -# We want both the new and the old interface - -if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -then - AC_MSG_CHECKING("Solaris threads") - if test -f /usr/lib/libpthread.so -a -f /usr/lib/libthread.so - then - with_named_thread="-lpthread -lthread" - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - fi -fi - -TOOLS_LIBS="$NON_THREADED_CLIENT_LIBS" - -# Should we use named pthread library ? -AC_MSG_CHECKING("named thread libs:") -if test "$with_named_thread" != "no" -then - LIBS="$with_named_thread $LIBS $with_named_thread" - TOOLS_LIBS="$with_named_thread $TOOLS_LIBS $with_named_thread" - with_posix_threads="yes" - with_mit_threads="no" - AC_MSG_RESULT("$with_named_thread") -else - AC_MSG_RESULT("no") - if test "$with_mit_threads" = "no" - then - # pthread_create is in standard libraries (As in BSDI 3.0) - AC_MSG_CHECKING("for pthread_create in -libc"); - AC_TRY_LINK( - [#include <pthread.h>], - [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - if test "$with_posix_threads" = "no" - then - AC_MSG_CHECKING("for pthread_create in -lpthread"); - ac_save_LIBS="$LIBS" - ac_save_TOOLS_LIBS="$TOOLS_LIBS" - LIBS="$LIBS -lpthread" - TOOLS_LIBS="$TOOLS_LIBS -lpthread" - AC_TRY_LINK( - [#include <pthread.h>], - [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - if test "$with_posix_threads" = "no" - then - LIBS=" $ac_save_LIBS -lpthreads" - TOOLS_LIBS=" $ac_save_TOOLS_LIBS -lpthreads" - AC_MSG_CHECKING("for pthread_create in -lpthreads"); - AC_TRY_LINK( - [#include <pthread.h>], - [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - if test "$with_posix_threads" = "no" - then - # This is for FreeBSD - LIBS="$ac_save_LIBS -pthread" - TOOLS_LIBS="$ac_save_TOOLS_LIBS -pthread" - AC_MSG_CHECKING("for pthread_create in -pthread"); - AC_TRY_LINK( - [#include <pthread.h>], - [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - if test "$with_posix_threads" = "no" - then - with_mit_threads="yes" - LIBS="$ac_save_LIBS" - TOOLS_LIBS="$ac_save_TOOLS_LIBS" - fi - fi - fi - fi - fi -fi - -#---START: Used in for client configure -# Must be checked after, because strtok_r may be in -lpthread -# On AIX strtok_r is in libc_r - -my_save_LIBS="$LIBS" -AC_CHECK_LIB(pthread,strtok_r) -LIBS="$my_save_LIBS" -if test "$ac_cv_lib_pthread_strtok_r" = "no" -then - AC_CHECK_LIB(c_r,strtok_r) - case "$with_osf32_threads---$target_os" in - # Don't keep -lc_r in LIBS; -pthread handles it magically - yes---* | *---freebsd* | *---hpux*) LIBS="$my_save_LIBS" ;; - - esac - AC_CHECK_FUNCS(strtok_r pthread_init) -else - AC_CHECK_FUNCS(strtok_r) -fi -#---END: - -# Check for dlopen, needed for user definable functions -# This must be checked after threads on AIX -# We only need this for mysqld, not for the clients. - -my_save_LIBS="$LIBS" -LIBS="" -AC_CHECK_LIB(dl,dlopen) -LIBDL=$LIBS -LIBS="$my_save_LIBS" -AC_SUBST(LIBDL) - -# System characteristics -case $SYSTEM_TYPE in - *netware* | *modesto*) ;; - *) -AC_SYS_RESTARTABLE_SYSCALLS - ;; -esac - -# Build optimized or debug version ? -# First check for gcc and g++ -if test "$ac_cv_prog_gcc" = "yes" -then - DEBUG_CFLAGS="-g" - DEBUG_OPTIMIZE_CC="-O" - OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" -else - DEBUG_CFLAGS="-g" - DEBUG_OPTIMIZE_CC="" - OPTIMIZE_CFLAGS="-O" -fi -if test "$ac_cv_prog_cxx_g" = "yes" -then - DEBUG_CXXFLAGS="-g" - DEBUG_OPTIMIZE_CXX="-O" - OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE" -else - DEBUG_CXXFLAGS="-g" - DEBUG_OPTIMIZE_CXX="" - OPTIMIZE_CXXFLAGS="-O" -fi - -if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then - DEBUG_CFLAGS="$DEBUG_CFLAGS -DDEBUG -sym internal,codeview4" - DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -DDEBUG -sym internal,codeview4" - OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -DNDEBUG" - OPTIMIZE_CXXFLAGS="$OPTIMIZE_CXXFLAGS -DNDEBUG" -fi - -AC_ARG_WITH(debug, - [ --without-debug Build a production version without debugging code], - [with_debug=$withval], - [with_debug=no]) -if test "$with_debug" = "yes" -then - # Medium debug. - CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" -elif test "$with_debug" = "full" -then - # Full debug. Very slow in some cases - CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" -else - # Optimized version. No debug - CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" - CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS" -fi - -# Force static compilation to avoid linking problems/get more speed -AC_ARG_WITH(mysqld-ldflags, - [ --with-mysqld-ldflags Extra linking arguments for mysqld], - [MYSQLD_EXTRA_LDFLAGS=$withval], - [MYSQLD_EXTRA_LDFLAGS=]) -AC_SUBST(MYSQLD_EXTRA_LDFLAGS) - -AC_ARG_WITH(client-ldflags, - [ --with-client-ldflags Extra linking arguments for clients], - [CLIENT_EXTRA_LDFLAGS=$withval], - [CLIENT_EXTRA_LDFLAGS=]) -AC_SUBST(CLIENT_EXTRA_LDFLAGS) - -AC_ARG_WITH(lib-ccflags, - [ --with-lib-ccflags Extra CC options for libraries], - [LIB_EXTRA_CCFLAGS=$withval], - [LIB_EXTRA_CCFLAGS=]) -AC_SUBST(LIB_EXTRA_CCFLAGS) - -# Avoid stupid bug on some OS -AC_ARG_WITH(low-memory, - [ --with-low-memory Try to use less memory to compile to avoid - memory limitations.], - [with_lowmem=$withval], - [with_lowmem=no]) -if test "$with_lowmem" = "yes" -then - if test "$ac_cv_prog_gcc" = "yes" - then - LM_CFLAGS="-fno-inline" - else - LM_CFLAGS="-O0" - fi -else - LM_CFLAGS="" -fi -AC_SUBST(LM_CFLAGS) - -AC_ARG_WITH(comment, - [ --with-comment Comment about compilation environment.], - [with_comment=$withval], - [with_comment=no]) -if test "$with_comment" != "no" -then - COMPILATION_COMMENT=$with_comment -else - COMPILATION_COMMENT="Source distribution" -fi -AC_SUBST(COMPILATION_COMMENT) - -AC_MSG_CHECKING("need of special linking flags") -if test "$IS_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" -then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") -else - AC_MSG_RESULT("none") -fi - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_C_INLINE -AC_TYPE_OFF_T -AC_STRUCT_ST_RDEV -AC_HEADER_TIME -AC_STRUCT_TM -# AC_CHECK_SIZEOF return 0 when it does not find the size of a -# type. We want a error instead. -AC_CHECK_SIZEOF(char, 1) -if test "$ac_cv_sizeof_char" -eq 0 -then - AC_MSG_ERROR([No size for char type. -A likely cause for this could be that there isn't any -static libraries installed. You can verify this by checking if you have libm.a -in /lib, /usr/lib or some other standard place. If this is the problem, -install the static libraries and try again. If this isn't the problem, -examine config.log for possible errors. If you want to report this, use -'scripts/mysqlbug' and include at least the last 20 rows from config.log!]) -fi -AC_CHECK_SIZEOF(char*, 4) -AC_CHECK_SIZEOF(int, 4) -if test "$ac_cv_sizeof_int" -eq 0 -then - AC_MSG_ERROR("No size for int type.") -fi -AC_CHECK_SIZEOF(long, 4) -if test "$ac_cv_sizeof_long" -eq 0 -then - AC_MSG_ERROR("No size for long type.") -fi -AC_CHECK_SIZEOF(long long, 8) -if test "$ac_cv_sizeof_long_long" -eq 0 -then - AC_MSG_ERROR("MySQL needs a long long type.") -fi -# off_t is not a builtin type -MYSQL_CHECK_SIZEOF(off_t, 4) -if test "$ac_cv_sizeof_off_t" -eq 0 -then - AC_MSG_ERROR("MySQL needs a off_t type.") -fi -# This always gives a warning. Ignore it unless you are cross compiling -AC_C_BIGENDIAN -#---START: Used in for client configure -# Check base type of last arg to accept -MYSQL_TYPE_ACCEPT - -#---END: -# Find where the stack goes -MYSQL_STACK_DIRECTION -# We want to skip alloca on irix unconditionally. It may work on some version.. -MYSQL_FUNC_ALLOCA -# Do struct timespec have members tv_sec or ts_sec -MYSQL_TIMESPEC_TS -# Do we have the tzname variable -MYSQL_TZNAME -# Do the system files define ulong -MYSQL_CHECK_ULONG -# Do the system files define uchar -MYSQL_CHECK_UCHAR -# Do the system files define uint -MYSQL_CHECK_UINT -# Check for fp_except in ieeefp.h -MYSQL_CHECK_FP_EXCEPT -# Check for IN_ADDR_T -MYSQL_CHECK_IN_ADDR_T -# Do the c++ compiler have a bool type -MYSQL_CXX_BOOL -# Check some common bugs with gcc 2.8.# on sparc -if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then -MYSQL_CHECK_LONGLONG_TO_FLOAT -if test "$ac_cv_conv_longlong_to_float" != "yes" -then - AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float! -If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try -again]); -fi -fi -MYSQL_PTHREAD_YIELD - -###################################################################### -# For readline/libedit (We simply move the mimimum amount of stuff from -# the readline/libedit configure.in here) - -dnl Checks for header files. -AC_CHECK_HEADERS(malloc.h sys/cdefs.h) - -dnl Checks for library functions. -AC_FUNC_ALLOCA -AC_PROG_GCC_TRADITIONAL -AC_TYPE_SIGNAL -AC_CHECK_FUNCS(re_comp regcomp strdup) - -AC_CHECK_HEADERS(vis.h) -AC_CHECK_FUNCS(strlcat strlcpy) -AC_CHECK_FUNCS(issetugid) -AC_CHECK_FUNCS(fgetln) -AC_CHECK_FUNCS(getline flockfile) - -# from old readline settting: - -MAKE_SHELL=/bin/sh -AC_SUBST(MAKE_SHELL) - -# Already-done: stdlib.h string.h unistd.h termios.h -AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \ - sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \ - sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \ -paths.h semaphore.h) - -# Already-done: strcasecmp -AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr) - -AC_STAT_MACROS_BROKEN -MYSQL_SIGNAL_CHECK -MYSQL_CHECK_GETPW_FUNCS -MYSQL_HAVE_TIOCGWINSZ -MYSQL_HAVE_FIONREAD -MYSQL_HAVE_TIOCSTAT -MYSQL_STRUCT_DIRENT_D_INO -MYSQL_TYPE_SIGHANDLER -if test "$with_named_curses" = "no" -then - MYSQL_CHECK_LIB_TERMCAP -else - TERMCAP_LIB="$with_named_curses" -fi -AC_SUBST(TERMCAP_LIB) - -# End of readline/libedit stuff -######################################################################### - -dnl Checks for library functions. - -# -# The following code disables intrinsic function support while we test for -# library functions. This is to avoid configure problems with Intel ecc -# compiler - -ORG_CFLAGS="$CFLAGS" -if test "$GCC" != "yes"; then - AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[]) -fi - -AC_FUNC_MMAP -AC_TYPE_SIGNAL -MYSQL_TYPE_QSORT -AC_FUNC_UTIME_NULL -AC_FUNC_VPRINTF - -AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ - fconvert fdatasync finite fpresetsticky fpsetmask fsync ftruncate \ - getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ - getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \ - localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \ - mkstemp mlockall perror poll pread pthread_attr_create clock_gettime \ - pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \ - pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ - pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ - pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ - realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \ - snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ - strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) - -# isinf() could be a function or a macro (HPUX) -AC_MSG_CHECKING(for isinf with <math.h>) -AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)], - AC_MSG_RESULT(yes) AC_DEFINE(HAVE_ISINF,,[isinf() macro or function]), - AC_MSG_RESULT(no)) - -CFLAGS="$ORG_CFLAGS" - -# Sanity check: We chould not have any fseeko symbol unless -# large_file_support=yes -AC_CHECK_FUNC(fseeko, -[if test "$large_file_support" = no -a "$IS_LINUX" = "true"; -then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!"); -fi] -) - -my_save_LIBS="$LIBS" -LIBS="$LIBS $LIBDL" -AC_CHECK_FUNCS(dlopen dlerror) -LIBS="$my_save_LIBS" - -# Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments) -ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS - -# Do not treat warnings as errors if we are linking against other libc -# this is to work around gcc not being permissive on non-system includes -# with respect to ANSI C++ -# We also remove the -fbranch-probabilities option as this will give warnings -# about not profiled code, which confuses configure -if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" -then - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'` -fi - -AC_TRY_COMPILE( -[#undef inline -#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#include <pthread.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h>], -[int skr; - struct hostent *foo = gethostbyaddr_r((const char *) 0, - 0, 0, (struct hostent *) 0, (char *) NULL, 0, &skr); return (foo == 0);], -mysql_cv_gethost_style=solaris, mysql_cv_gethost_style=other)) -AC_LANG_RESTORE -CXXFLAGS="$ac_save_CXXFLAGS" -if test "$mysql_cv_gethost_style" = "solaris" -then - AC_DEFINE(HAVE_SOLARIS_STYLE_GETHOST) -fi - -#---START: Used in for client configure - -# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris) -ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([style of gethostname_r routines], mysql_cv_gethostname_style, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" -then - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'` -fi -AC_TRY_COMPILE( -[#undef inline -#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#include <pthread.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h>], -[int skr; - - skr = gethostbyname_r((const char *) 0, - (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);], -mysql_cv_gethostname_style=glibc2, mysql_cv_gethostname_style=other)) -AC_LANG_RESTORE -CXXFLAGS="$ac_save_CXXFLAGS" -if test "$mysql_cv_gethostname_style" = "glibc2" -then - AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) -fi - -# Check 3rd argument of getthostbyname_r -ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([3 argument to gethostname_r routines], mysql_cv_gethostname_arg, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" -then - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed 's/-fbranch-probabilities//'` -fi -AC_TRY_COMPILE( -[#undef inline -#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#include <pthread.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h>], -[int skr; - - skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);], -mysql_cv_gethostname_arg=hostent_data, mysql_cv_gethostname_arg=char)) -AC_LANG_RESTORE -CXXFLAGS="$ac_save_CXXFLAGS" -if test "$mysql_cv_gethostname_arg" = "hostent_data" -then - AC_DEFINE(HAVE_GETHOSTBYNAME_R_RETURN_INT) -fi - - -if test "$with_mit_threads" = "no" -then - # Check definition of pthread_getspecific - AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args, - AC_TRY_COMPILE( -[#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include <pthread.h> ], -[ void *pthread_getspecific(pthread_key_t key); -pthread_getspecific((pthread_key_t) NULL); ], -mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other)) - if test "$mysql_cv_getspecific_args" = "other" - then - AC_DEFINE(HAVE_NONPOSIX_PTHREAD_GETSPECIFIC) - fi - - # Check definition of pthread_mutex_init - AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args, - AC_TRY_COMPILE( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include <pthread.h> ], -[ - pthread_mutexattr_t attr; - pthread_mutex_t mp; - pthread_mutex_init(&mp,&attr); ], -mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other)) - if test "$mysql_cv_mutex_init_args" = "other" - then - AC_DEFINE(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT) - fi -fi -#---END: - -#---START: Used in for client configure -# Check definition of readdir_r -AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include <pthread.h> -#include <dirent.h>], -[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); -readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ], -mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other)) -if test "$mysql_cv_readdir_r" = "POSIX" -then - AC_DEFINE(HAVE_READDIR_R) -fi - -# Check definition of posix sigwait() -AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include <pthread.h> -#include <signal.h>], -[#ifndef _AIX -sigset_t set; -int sig; -sigwait(&set,&sig); -#endif], -mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other)) -if test "$mysql_cv_sigwait" = "POSIX" -then - AC_DEFINE(HAVE_SIGWAIT) -fi - -if test "$mysql_cv_sigwait" != "POSIX" -then -unset mysql_cv_sigwait -# Check definition of posix sigwait() -AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include <pthread.h> -#include <signal.h>], -[sigset_t set; -int sig; -sigwait(&set);], -mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other)) -if test "$mysql_cv_sigwait" = "NONPOSIX" -then - AC_DEFINE(HAVE_NONPOSIX_SIGWAIT) -fi -fi -#---END: - -# Check if pthread_attr_setscope() exists -AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include <pthread.h>], -[pthread_attr_t thr_attr; -pthread_attr_setscope(&thr_attr,0);], -mysql_cv_pthread_attr_setscope=yes, mysql_cv_pthread_attr_setscope=no)) -if test "$mysql_cv_pthread_attr_setscope" = "yes" -then - AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCOPE) -fi - -# Check for bad includes -AC_MSG_CHECKING("can netinet files be included") -AC_TRY_COMPILE( -[#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in_systm.h> -#include <netinet/in.h> -#include <netinet/ip.h> -#include <netinet/tcp.h>], -[ printf("1\n"); ], -netinet_inc=yes, netinet_inc=no) -if test "$netinet_inc" = "no" -then - AC_DEFINE(HAVE_BROKEN_NETINET_INCLUDES) -fi -AC_MSG_RESULT("$netinet_inc") - -# Some usefull subst -AC_SUBST(CC) -AC_SUBST(GXX) - -# Output results -AC_OUTPUT(Makefile dnl - , , [ - test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h - ]) diff --git a/ndb/config/type_ndbapitest.mk.am b/ndb/config/type_ndbapitest.mk.am index 1156a3174c4..3132dd30f0b 100644 --- a/ndb/config/type_ndbapitest.mk.am +++ b/ndb/config/type_ndbapitest.mk.am @@ -1,6 +1,6 @@ -LDADD += $(top_srcdir)/ndb/test/src/libNDBT.a \ - $(top_srcdir)/ndb/src/libndbclient.la +LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \ + $(top_builddir)/ndb/src/libndbclient.la INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ diff --git a/ndb/config/type_ndbapitools.mk.am b/ndb/config/type_ndbapitools.mk.am index 1156a3174c4..a8b511d3637 100644 --- a/ndb/config/type_ndbapitools.mk.am +++ b/ndb/config/type_ndbapitools.mk.am @@ -1,6 +1,5 @@ -LDADD += $(top_srcdir)/ndb/test/src/libNDBT.a \ - $(top_srcdir)/ndb/src/libndbclient.la +LDADD += $(top_builddir)/ndb/src/libndbclient.la INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ diff --git a/ndb/docs/Makefile b/ndb/docs/Makefile deleted file mode 100644 index a2139b66044..00000000000 --- a/ndb/docs/Makefile +++ /dev/null @@ -1,97 +0,0 @@ -include .defs.mk -# -# hack before full autoconf -replace-targets := all clean -first-docs: all - -include $(NDB_TOP)/Epilogue.mk - -all: ndbapidoc mgmapidoc - -DOXYGEN = doxygen -DOXYTOP = $(shell cd $(NDB_TOP); pwd)/docs -DOXYDIR = $(DOXYTOP)/doxygen -DOXYTMP = $(DOXYTOP)/.doxytmp -DOXYOUT = $(DOXYTOP)/.doxyout - -clean: - rm -rf ndbapi.pdf ndbapi.html mgmapi.pdf mgmapi.html - rm -rf $(DOXYTMP) $(DOXYOUT) - -### -# -# NDB API Programmer's Guide -# -ndbapidoc: ndbapi.pdf - -ndbapi.pdf: $(NDB_TOP)/include/ndb_version.h - @set -x; \ - rm -rf ndbapi.pdf ndbapi.html; \ - rm -rf $(DOXYTMP) $(DOXYOUT); \ - mkdir -p $(DOXYTMP) $(DOXYOUT); \ - (cd $(NDB_TOP)/include/ndbapi && \ - find . -type f -print | \ - grep -v /SCCS | \ - cpio -pdm $(DOXYTMP)); \ - (cd $(NDB_TOP)/examples && \ - cp -p */*.[ch]pp $(DOXYTMP)); \ - $(DOXYDIR)/predoxy.pl; \ - mv footer.html $(DOXYTMP); \ - (cd $(DOXYTMP) && \ - $(DOXYGEN) $(DOXYDIR)/Doxyfile.ndbapi); \ - $(DOXYDIR)/postdoxy.pl $(DOXYOUT)/ndbapi.latex "NDB API Programmer Guide"; \ - (cd $(DOXYOUT) && \ - find ndbapi.html -print | cpio -pdm $(DOXYTOP)); \ - (cd $(DOXYOUT)/ndbapi.latex && \ - pdflatex refman.tex && makeindex refman && pdflatex refman.tex && \ - cp -p refman.pdf $(DOXYTOP)/ndbapi.pdf); - -### -# -# MGM API Guide -# -mgmapidoc: mgmapi.pdf - -mgmapi.pdf: $(NDB_TOP)/include/ndb_version.h - @set -x; \ - rm -rf mgmapi.pdf mgmapi.html; \ - rm -rf $(DOXYTMP) $(DOXYOUT); \ - mkdir -p $(DOXYTMP) $(DOXYOUT); \ - (cd $(NDB_TOP)/include/mgmapi && \ - find . -type f -print | \ - grep -v /SCCS | \ - cpio -pdm $(DOXYTMP)); \ - $(DOXYDIR)/predoxy.pl; \ - mv footer.html $(DOXYTMP); \ - (cd $(DOXYTMP) && \ - $(DOXYGEN) $(DOXYDIR)/Doxyfile.mgmapi); \ - $(DOXYDIR)/postdoxy.pl $(OUTDIR)/mgmapi.latex "NDB Cluster MGM API Guide"; \ - (cd $(DOXYOUT) && \ - find mgmapi.html -print | cpio -pdm $(DOXYTOP)); \ - (cd $(DOXYOUT)/mgmapi.latex && \ - pdflatex refman.tex && makeindex refman && pdflatex refman.tex && \ - cp -p refman.pdf $(DOXYTOP)/mgmapi.pdf); - -### -# -# Complete Source Browser except for -# ndbapi odbc test tools win32 lib examples docs CVS config bin -# include/ndbapi -# include/newtonapi src/newtonapi -# include/mgmapi src/mgmapi -# src/client -ndbdoc: DUMMY - mkdir -p $(OUTDIR) - cd $(NDB_TOP) ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.ndb - -### -# -# odbcdoc - Complete Source Browser for NDB ODBC (src/client/odbc) - -odbcdoc: DUMMY - mkdir -p $(OUTDIR) - cd $(NDB_TOP) ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.odbc - -testdoc: DUMMY - mkdir -p $(OUTDIR) - cd $(NDB_TOP) ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am new file mode 100644 index 00000000000..554b2fb256e --- /dev/null +++ b/ndb/docs/Makefile.am @@ -0,0 +1,102 @@ +DOXYDIR = doxygen +noinst_HEADERS = $(DOXYDIR)/predoxy.pl $(DOXYDIR)/postdoxy.pl $(DOXYDIR)/Doxyfile.ndbapi $(DOXYDIR)/Doxyfile.mgmapi $(DOXYDIR)/header.ndbapi.tex $(DOXYDIR)/header.mgmapi.tex + +all: do-check ndbapidoc mgmapidoc + +DOXYTMP = .doxytmp +DOXYOUT = .doxyout + +NDB_RELEASE = @NDB_VERSION_MAJOR@.@NDB_VERSION_MINOR@.@NDB_VERSION_BUILD@-@NDB_VERSION_STATUS@ + +clean: + rm -rf ndbapi.pdf ndbapi.html mgmapi.pdf mgmapi.html + rm -rf $(DOXYTMP) $(DOXYOUT) + +do-check: + @set -x; \ + if test @PERL@ = no ; then \ + echo "Perl needed to make docs"; \ + exit 1; \ + fi; \ + if test @DOXYGEN@ = no ; then \ + echo "Doxygen needed to make docs"; \ + exit 1; \ + fi; \ + if test @PDFLATEX@ = no ; then \ + echo "Pdflatex needed to make docs"; \ + exit 1; \ + fi; \ + if test @MAKEINDEX@ = no ; then \ + echo "Makeindex needed to make docs"; \ + exit 1; \ + fi; +### +# +# NDB API Programmer's Guide +# +ndbapidoc: ndbapi.pdf + +ndbapi.pdf: $(noinst_HEADERS) + @set -x; \ + export NDB_RELEASE=$(NDB_RELEASE) \ + @RM@ -f ndbapi.pdf ndbapi.html; \ + @RM@ -rf $(DOXYTMP) $(DOXYOUT); \ + mkdir -p $(DOXYTMP) $(DOXYOUT); \ + @CP@ $(top_srcdir)/ndb/include/ndbapi/* $(DOXYTMP); \ + @CP@ $(top_srcdir)/ndb/examples/*/*.[ch]pp $(DOXYTMP); \ + @PERL@ $(DOXYDIR)/predoxy.pl; \ + mv footer.html $(DOXYTMP); \ + (cd $(DOXYTMP) ; @DOXYGEN@ ../$(DOXYDIR)/Doxyfile.ndbapi); \ + @PERL@ $(DOXYDIR)/postdoxy.pl $(DOXYOUT)/ndbapi.latex "NDB API Programmer Guide"; \ + (cd $(DOXYOUT) && \ + find ndbapi.html -print | cpio -pdm ..); \ + (cd $(DOXYOUT)/ndbapi.latex && \ + @PDFLATEX@ refman.tex && @MAKEINDEX@ refman && @PDFLATEX@ refman.tex && \ + cp -p refman.pdf ../../ndbapi.pdf); + +### +# +# MGM API Guide +# +mgmapidoc: mgmapi.pdf + +mgmapi.pdf: $(noinst_HEADERS) + @set -x; \ + export NDB_RELEASE=$(NDB_RELEASE) \ + @RM@ -f mgmapi.pdf mgmapi.html; \ + @RM@ -rf $(DOXYTMP) $(DOXYOUT); \ + mkdir -p $(DOXYTMP) $(DOXYOUT); \ + @CP@ $(top_srcdir)/ndb/include/mgmapi/* $(DOXYTMP); \ + @PERL@ $(DOXYDIR)/predoxy.pl; \ + mv footer.html $(DOXYTMP); \ + (cd $(DOXYTMP) ; @DOXYGEN@ ../$(DOXYDIR)/Doxyfile.mgmapi); \ + @PERL@ $(DOXYDIR)/postdoxy.pl $(DOXYOUT)/mgmapi.latex "NDB Cluster MGM API Guide"; \ + (cd $(DOXYOUT) && \ + find mgmapi.html -print | cpio -pdm ..); \ + (cd $(DOXYOUT)/mgmapi.latex && \ + @PDFLATEX@ refman.tex && @MAKEINDEX@ refman && @PDFLATEX@ refman.tex && \ + cp -p refman.pdf ../../mgmapi.pdf); + +### +# +# Complete Source Browser except for +# ndbapi odbc test tools win32 lib examples docs CVS config bin +# include/ndbapi +# include/newtonapi src/newtonapi +# include/mgmapi src/mgmapi +# src/client +ndbdoc: DUMMY + mkdir -p $(OUTDIR) + cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.ndb + +### +# +# odbcdoc - Complete Source Browser for NDB ODBC (src/client/odbc) + +odbcdoc: DUMMY + mkdir -p $(OUTDIR) + cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.odbc + +testdoc: DUMMY + mkdir -p $(OUTDIR) + cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test diff --git a/ndb/docs/doxygen/postdoxy.pl b/ndb/docs/doxygen/postdoxy.pl index 95062d1899f..ad0edb44a31 100755 --- a/ndb/docs/doxygen/postdoxy.pl +++ b/ndb/docs/doxygen/postdoxy.pl @@ -1,4 +1,3 @@ -#!/usr/local/bin/perl # # Written by Lars Thalmann, lars@mysql.com, 2003. # diff --git a/ndb/docs/doxygen/predoxy.pl b/ndb/docs/doxygen/predoxy.pl index 461ad02478a..8dad1d964d0 100755 --- a/ndb/docs/doxygen/predoxy.pl +++ b/ndb/docs/doxygen/predoxy.pl @@ -1,4 +1,3 @@ -#!/usr/local/bin/perl # # Written by Lars Thalmann, lars@mysql.com, 2003. # diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index a77255842ba..2565a78238b 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -16,14 +16,13 @@ ndbapi/NdbError.hpp \ ndbapi/NdbEventOperation.hpp \ ndbapi/NdbIndexOperation.hpp \ ndbapi/NdbOperation.hpp \ +ndbapi/NdbBlob.hpp \ ndbapi/NdbPool.hpp \ ndbapi/NdbRecAttr.hpp \ ndbapi/NdbReceiver.hpp \ ndbapi/NdbResultSet.hpp \ ndbapi/NdbScanFilter.hpp \ ndbapi/NdbScanOperation.hpp \ -ndbapi/NdbSchemaCon.hpp \ -ndbapi/NdbSchemaOp.hpp \ ndbapi/ndberror.h mgmapiinclude_HEADERS = \ diff --git a/ndb/include/kernel/ndb_limits.h b/ndb/include/kernel/ndb_limits.h index 65f729af1f2..68ffe310328 100644 --- a/ndb/include/kernel/ndb_limits.h +++ b/ndb/include/kernel/ndb_limits.h @@ -91,4 +91,9 @@ #define MAX_TTREE_PREF_SIZE 4 // words in min/max prefix each #define MAX_TTREE_NODE_SLACK 3 // diff between max and min occupancy +/* + * Blobs. + */ +#define NDB_BLOB_HEAD_SIZE 2 // sizeof(NdbBlob::Head) >> 2 + #endif diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 791388d5df8..67610f9d2be 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -307,7 +307,9 @@ public: ExtBinary = NdbSqlUtil::Type::Binary, ExtVarbinary = NdbSqlUtil::Type::Varbinary, ExtDatetime = NdbSqlUtil::Type::Datetime, - ExtTimespec = NdbSqlUtil::Type::Timespec + ExtTimespec = NdbSqlUtil::Type::Timespec, + ExtBlob = NdbSqlUtil::Type::Blob, + ExtClob = NdbSqlUtil::Type::Clob }; // Attribute data interpretation @@ -430,6 +432,13 @@ public: AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 12 * AttributeExtLength; return true; + case DictTabInfo::ExtBlob: + case DictTabInfo::ExtClob: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + // head + inline part [ attr precision ] + AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + AttributeExtPrecision; + return true; }; return false; } diff --git a/ndb/include/kernel/signaldata/TcKeyConf.hpp b/ndb/include/kernel/signaldata/TcKeyConf.hpp index bfd684b4af4..27ff344f793 100644 --- a/ndb/include/kernel/signaldata/TcKeyConf.hpp +++ b/ndb/include/kernel/signaldata/TcKeyConf.hpp @@ -111,7 +111,7 @@ inline void TcKeyConf::setNoOfOperations(Uint32 & confInfo, Uint32 noOfOps){ ASSERT_MAX(noOfOps, 65535, "TcKeyConf::setNoOfOperations"); - confInfo |= noOfOps; + confInfo = (confInfo & 0xFFFF0000) | noOfOps; } inline diff --git a/ndb/include/kernel/signaldata/TupAccess.hpp b/ndb/include/kernel/signaldata/TupAccess.hpp index 5cfb8c0d153..ab56a73322c 100644 --- a/ndb/include/kernel/signaldata/TupAccess.hpp +++ b/ndb/include/kernel/signaldata/TupAccess.hpp @@ -129,6 +129,8 @@ private: /* * Operate on entire tuple. Used by TUX where the table has a single * Uint32 array attribute representing an index tree node. + * + * XXX this signal is no longer used by TUX and can be removed */ class TupStoreTh { friend class Dbtup; diff --git a/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp index ffde2217893..fc88dacd48f 100644 --- a/ndb/include/kernel/signaldata/TupFrag.hpp +++ b/ndb/include/kernel/signaldata/TupFrag.hpp @@ -69,7 +69,7 @@ class TuxFragReq { friend class Dblqh; friend class Dbtux; public: - STATIC_CONST( SignalLength = 9 ); + STATIC_CONST( SignalLength = 14 ); private: Uint32 userPtr; Uint32 userRef; @@ -80,6 +80,9 @@ private: Uint32 fragOff; Uint32 tableType; Uint32 primaryTableId; + Uint32 tupIndexFragPtrI; + Uint32 tupTableFragPtrI[2]; + Uint32 accTableFragPtrI[2]; }; class TuxFragConf { diff --git a/ndb/include/kernel/signaldata/TuxMaint.hpp b/ndb/include/kernel/signaldata/TuxMaint.hpp index 44deb33be80..9fee031dc41 100644 --- a/ndb/include/kernel/signaldata/TuxMaint.hpp +++ b/ndb/include/kernel/signaldata/TuxMaint.hpp @@ -39,7 +39,7 @@ public: SearchError = 895, // add + found or remove + not found NoMemError = 827 }; - STATIC_CONST( SignalLength = 7 ); + STATIC_CONST( SignalLength = 8 ); private: /* * Error code set by TUX. Zero means no error. @@ -52,10 +52,11 @@ private: Uint32 indexId; Uint32 fragId; /* - * Tuple version identified by logical address of "original" tuple and - * version number. + * Tuple version identified by physical address of "original" tuple + * and version number. */ - Uint32 tupAddr; + Uint32 pageId; + Uint32 pageOffset; Uint32 tupVersion; /* * Operation code and flags. diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 9ad0967854f..d3bb44c1523 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -74,6 +74,8 @@ #define CFG_LOGLEVEL_GREP 146 #define CFG_LOG_DESTINATION 147 +#define CFG_DB_DISCLESS 148 + #define CFG_NODE_ARBIT_RANK 200 #define CFG_NODE_ARBIT_DELAY 201 diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index bd1e4954f14..f871acbc075 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -25,7 +25,13 @@ #endif #include <sys/param.h> #ifdef HAVE_SYS_STAT_H -#include <sys/stat.h> + #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE) + #undef _INCLUDE_AES_SOURCE + #include <sys/stat.h> + #define _INCLUDE_AES_SOURCE + #else + #include <sys/stat.h> + #endif #endif #include <sys/resource.h> #ifdef HAVE_SYS_WAIT_H diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 5e7b952cfc5..87ebd3d6c6b 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -33,7 +33,7 @@ typedef unsigned int UintR; #ifdef __SIZE_TYPE__ typedef __SIZE_TYPE__ UintPtr; #else -#include <my_config.h> +#include <my_global.h> #ifdef HAVE_STDINT_H #include <stdint.h> #endif diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h index 9bb6af59590..56362020ebf 100644 --- a/ndb/include/ndb_version.h +++ b/ndb/include/ndb_version.h @@ -17,19 +17,11 @@ #ifndef NDB_VERSION_H #define NDB_VERSION_H +#include <ndb_global.h> #include <version.h> #define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) -/** - * version of this build - */ - -#define NDB_VERSION_MAJOR 3 -#define NDB_VERSION_MINOR 5 -#define NDB_VERSION_BUILD 0 -#define NDB_VERSION_STATUS "alpha" - #define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) #define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS)) diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index cde67e9c2fa..27da5c3fa39 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -879,6 +879,7 @@ class NdbScanReceiver; class Table; class BaseString; class NdbEventOperation; +class NdbBlob; typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*); @@ -964,6 +965,7 @@ class Ndb friend class NdbIndexOperation; friend class NdbDictionaryImpl; friend class NdbDictInterface; + friend class NdbBlob; public: /** @@ -1452,6 +1454,7 @@ private: NdbIndexOperation* getIndexOperation();// Get an index operation from idle class NdbGlobalEventBufferHandle* getGlobalEventBufferHandle(); + NdbBlob* getNdbBlob();// Get a blob handle etc void releaseSignal(NdbApiSignal* anApiSignal); void releaseSignalsInList(NdbApiSignal** pList); @@ -1463,6 +1466,7 @@ private: void releaseRecAttr (NdbRecAttr* aRecAttr); void releaseOperation(NdbOperation* anOperation); void releaseScanOperation(NdbScanOperation* aScanOperation); + void releaseNdbBlob(NdbBlob* aBlob); void check_send_timeout(); void remove_sent_list(Uint32); @@ -1505,6 +1509,7 @@ private: void freeNdbSubroutine();// Free the first idle NdbSubroutine obj void freeNdbCall(); // Free the first idle NdbCall obj void freeNdbScanRec(); // Free the first idle NdbScanRec obj + void freeNdbBlob(); // Free the first etc NdbConnection* getNdbCon(); // Get a connection from idle list @@ -1613,6 +1618,7 @@ private: NdbSubroutine* theSubroutineList; // First subroutine descriptor in NdbCall* theCallList; // First call descriptor in list NdbScanReceiver* theScanList; + NdbBlob* theNdbBlobIdleList; Uint32 theMyRef; // My block reference Uint32 theNode; // The node number of our node diff --git a/ndb/include/ndbapi/NdbApi.hpp b/ndb/include/ndbapi/NdbApi.hpp index b9b52708789..515f39433e4 100644 --- a/ndb/include/ndbapi/NdbApi.hpp +++ b/ndb/include/ndbapi/NdbApi.hpp @@ -28,4 +28,5 @@ #include "NdbDictionary.hpp" #include "NdbEventOperation.hpp" #include "NdbPool.hpp" +#include "NdbBlob.hpp" #endif diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp new file mode 100644 index 00000000000..9398f77c474 --- /dev/null +++ b/ndb/include/ndbapi/NdbBlob.hpp @@ -0,0 +1,293 @@ +/* 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 */ + +#ifndef NdbBlob_H +#define NdbBlob_H + +#include <ndb_types.h> +#include <NdbDictionary.hpp> +#include <NdbConnection.hpp> +#include <NdbError.hpp> + +class Ndb; +class NdbConnection; +class NdbOperation; +class NdbRecAttr; +class NdbTableImpl; +class NdbColumnImpl; + +/** + * @class NdbBlob + * @brief Blob handle + * + * Blob data is stored in 2 places: + * + * - "header" and "inline bytes" stored in the blob attribute + * - "blob parts" stored in a separate table NDB$BLOB_<t>_<v>_<c> + * + * Inline and part sizes can be set via NdbDictionary::Column methods + * when the table is created. + * + * NdbBlob is a blob handle. To access blob data, the handle must be + * created using NdbOperation::getBlobHandle in operation prepare phase. + * The handle has following states: + * + * - prepared: before the operation is executed + * - active: after execute or next result but before transaction commit + * - closed: after transaction commit + * - invalid: after rollback or transaction close + * + * NdbBlob supports 2 styles of data access: + * + * - in prepare phase, NdbBlob methods getValue and setValue are used to + * prepare a read or write of a single blob value of known size + * + * - in active phase, NdbBlob methods readData and writeData are used to + * read or write blob data of undetermined size + * + * NdbBlob methods return -1 on error and 0 on success, and use output + * parameters when necessary. + * + * Notes: + * - table and its blob part tables are not created atomically + * - blob data operations take effect at next transaction execute + * - NdbBlob may need to do implicit executes on the transaction + * - read and write of complete parts is much more efficient + * - scan must use the "new" interface NdbScanOperation + * - scan with blobs applies hold-read-lock (at minimum) + * - to update a blob in a read op requires exclusive tuple lock + * - update op in scan must do its own getBlobHandle + * - delete creates implicit, not-accessible blob handles + * - NdbOperation::writeTuple does not support blobs + * - there is no support for an asynchronous interface + * + * Bugs / limitations: + * - scan must use exclusive locking for now + * + * Todo: + * - add scan method hold-read-lock-until-next + return-keyinfo + * - better check of keyinfo length when setting keys + * - better check of allowed blob op vs locking mode + */ +class NdbBlob { +public: + enum State { + Idle = 0, + Prepared = 1, + Active = 2, + Closed = 3, + Invalid = 9 + }; + State getState(); + /** + * Prepare to read blob value. The value is available after execute. + * Use isNull to check for NULL and getLength to get the real length + * and to check for truncation. Sets current read/write position to + * after the data read. + */ + int getValue(void* data, Uint32 bytes); + /** + * Prepare to insert or update blob value. An existing longer blob + * value will be truncated. The data buffer must remain valid until + * execute. Sets current read/write position to after the data. Set + * data to null pointer (0) to create a NULL value. + */ + int setValue(const void* data, Uint32 bytes); + /** + * Check if blob is null. + */ + int getNull(bool& isNull); + /** + * Set blob to NULL. + */ + int setNull(); + /** + * Get current length in bytes. Use isNull to distinguish between + * length 0 blob and NULL blob. + */ + int getLength(Uint64& length); + /** + * Truncate blob to given length. Has no effect if the length is + * larger than current length. + */ + int truncate(Uint64 length = 0); + /** + * Get current read/write position. + */ + int getPos(Uint64& pos); + /** + * Set read/write position. Must be between 0 and current length. + * "Sparse blobs" are not supported. + */ + int setPos(Uint64 pos); + /** + * Read at current position and set new position to first byte after + * the data read. A read past blob end returns actual number of bytes + * read in the in/out bytes parameter. + */ + int readData(void* data, Uint32& bytes); + /** + * Read at given position. Does not use or update current position. + */ + int readData(Uint64 pos, void* data, Uint32& bytes); + /** + * Write at current position and set new position to first byte after + * the data written. A write past blob end extends the blob value. + */ + int writeData(const void* data, Uint32 bytes); + /** + * Write at given position. Does not use or update current position. + */ + int writeData(Uint64 pos, const void* data, Uint32 bytes); + /** + * Return the blob column. + */ + const NdbDictionary::Column* getColumn(); + /** + * Get blob parts table name. Useful only to test programs. + */ + static const unsigned BlobTableNameSize = 40; + static int getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName); + /** + * Return error object. The error may be blob specific (below) or may + * be copied from a failed implicit operation. + */ + const NdbError& getNdbError() const; + // "Invalid blob attributes or invalid blob parts table" + static const int ErrTable = 4263; + // "Invalid usage of blob attribute" + static const int ErrUsage = 4264; + // "Method is not valid in current blob state" + static const int ErrState = 4265; + // "Invalid blob seek position" + static const int ErrSeek = 4266; + // "Corrupted blob value" + static const int ErrCorrupt = 4267; + // "Error in blob head update forced rollback of transaction" + static const int ErrAbort = 4268; + // "Unknown blob error" + static const int ErrUnknown = 4269; + +private: + friend class Ndb; + friend class NdbConnection; + friend class NdbOperation; + friend class NdbScanOperation; + friend class NdbDictionaryImpl; + // state + State theState; + void setState(State newState); + // define blob table + static void getBlobTableName(char* btname, const NdbTableImpl* t, const NdbColumnImpl* c); + static void getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c); + // table name + char theBlobTableName[BlobTableNameSize]; + // ndb api stuff + Ndb* theNdb; + NdbConnection* theNdbCon; + NdbOperation* theNdbOp; + NdbTableImpl* theTable; + NdbTableImpl* theAccessTable; + const NdbColumnImpl* theColumn; + char theFillChar; + // sizes + Uint32 theInlineSize; + Uint32 thePartSize; + Uint32 theStripeSize; + // getValue/setValue + bool theGetFlag; + char* theGetBuf; + bool theSetFlag; + const char* theSetBuf; + Uint32 theGetSetBytes; + // head + struct Head { + Uint64 length; + }; + // buffers + struct Buf { + char* data; + unsigned size; + unsigned maxsize; + Buf(); + ~Buf(); + void alloc(unsigned n); + }; + Buf theKeyBuf; + Buf theAccessKeyBuf; + Buf theHeadInlineBuf; + Buf thePartBuf; + Head* theHead; + char* theInlineData; + NdbRecAttr* theHeadInlineRecAttr; + bool theHeadInlineUpdateFlag; + bool theNewPartFlag; + // length and read/write position + int theNullFlag; + Uint64 theLength; + Uint64 thePos; + // errors + NdbError theError; + // for keeping in lists + NdbBlob* theNext; + // initialization + NdbBlob(); + void init(); + void release(); + // classify operations + bool isTableOp(); + bool isIndexOp(); + bool isKeyOp(); + bool isReadOp(); + bool isInsertOp(); + bool isUpdateOp(); + bool isDeleteOp(); + bool isScanOp(); + // computations + Uint32 getPartNumber(Uint64 pos); + Uint32 getPartCount(); + Uint32 getDistKey(Uint32 part); + // getters and setters + int getTableKeyValue(NdbOperation* anOp); + int setTableKeyValue(NdbOperation* anOp); + int setAccessKeyValue(NdbOperation* anOp); + int setPartKeyValue(NdbOperation* anOp, Uint32 part); + int getHeadInlineValue(NdbOperation* anOp); + void getHeadFromRecAttr(); + int setHeadInlineValue(NdbOperation* anOp); + // data operations + int readDataPrivate(Uint64 pos, char* buf, Uint32& bytes); + int writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes); + int readParts(char* buf, Uint32 part, Uint32 count); + int insertParts(const char* buf, Uint32 part, Uint32 count); + int updateParts(const char* buf, Uint32 part, Uint32 count); + int deleteParts(Uint32 part, Uint32 count); + // blob handle maintenance + int atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn); + int preExecute(ExecType anExecType, bool& batch); + int postExecute(ExecType anExecType); + int preCommit(); + int atNextResult(); + // errors + void setErrorCode(int anErrorCode, bool invalidFlag = true); + void setErrorCode(NdbOperation* anOp, bool invalidFlag = true); + void setErrorCode(NdbConnection* aCon, bool invalidFlag = true); +#ifdef VM_TRACE + friend class NdbOut& operator<<(NdbOut&, const NdbBlob&); +#endif +}; + +#endif diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index d8c395162f6..c620578cabd 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -28,6 +28,7 @@ class NdbIndexOperation; class NdbApiSignal; class Ndb; class NdbScanReceiver; +class NdbBlob; /** @@ -160,6 +161,7 @@ class NdbConnection friend class NdbScanOperation; friend class NdbIndexOperation; friend class NdbScanReceiver; + friend class NdbBlob; public: @@ -536,6 +538,10 @@ private: ~NdbConnection(); void init(); // Initialize connection object for new transaction + + int executeNoBlobs(ExecType execType, + AbortOption abortOption = AbortOnError, + int force = 0 ); /** * Set Connected node id @@ -625,10 +631,12 @@ private: void setOperationErrorCodeAbort(int anErrorCode); int checkMagicNumber(); // Verify correct object - NdbOperation* getNdbOperation(class NdbTableImpl* aTable); + NdbOperation* getNdbOperation(class NdbTableImpl* aTable, + NdbOperation* aNextOp = 0); NdbScanOperation* getNdbScanOperation(class NdbTableImpl* aTable); NdbIndexOperation* getNdbIndexOperation(class NdbIndexImpl* anIndex, - class NdbTableImpl* aTable); + class NdbTableImpl* aTable, + NdbOperation* aNextOp = 0); void handleExecuteCompletion(); @@ -730,6 +738,8 @@ private: // nextScanResult. NdbOperation* theScanningOp; // The operation actually performing the scan Uint32 theBuddyConPtr; + // optim: any blobs + bool theBlobFlag; static void sendTC_COMMIT_ACK(NdbApiSignal *, Uint32 transId1, Uint32 transId2, diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index a8a3bc86786..3b38e33ec91 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -182,7 +182,8 @@ public: Varbinary, ///< Max len Datetime, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes ) Timespec, ///< Precision down to 1 nsec(sizeof(Datetime) == 12 bytes ) - Blob ///< Binary large object (see NdbBlob) + Blob, ///< Binary large object (see NdbBlob) + Clob ///< Text blob }; /** @@ -297,7 +298,34 @@ public: * Array length for column or max length for variable length arrays. */ int getLength() const; - + + /** + * For blob, set or get "inline size" i.e. number of initial bytes + * to store in table's blob attribute. This part is normally in + * main memory and can be indexed and interpreted. + */ + void setInlineSize(int size) { setPrecision(size); } + int getInlineSize() const { return getPrecision(); } + + /** + * For blob, set or get "part size" i.e. number of bytes to store in + * each tuple of the "blob table". Must be less than 64k. + */ + void setPartSize(int size) { setScale(size); } + int getPartSize() const { return getScale(); } + + /** + * For blob, set or get "stripe size" i.e. number of consecutive + * <em>parts</em> to store in each node group. + */ + void setStripeSize(int size) { setLength(size); } + int getStripeSize() const { return getLength(); } + + /** + * Get size of element + */ + int Column::getSize() const; + /** * Set distribution key * @@ -349,6 +377,7 @@ public: #endif private: + friend class NdbRecAttr; friend class NdbColumnImpl; class NdbColumnImpl & m_impl; Column(NdbColumnImpl&); @@ -1023,6 +1052,7 @@ public: private: friend class NdbDictionaryImpl; friend class UtilTransactions; + friend class NdbBlob; class NdbDictionaryImpl & m_impl; Dictionary(NdbDictionaryImpl&); const Table * getIndexTable(const char * indexName, @@ -1030,4 +1060,6 @@ public: }; }; +class NdbOut& operator <<(class NdbOut& ndbout, const NdbDictionary::Column::Type type); + #endif diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index 5fa903994b7..cfa656cb2d5 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -28,6 +28,7 @@ class NdbRecAttr; class NdbOperation; class NdbConnection; class NdbColumnImpl; +class NdbBlob; /** * @class NdbOperation @@ -41,7 +42,8 @@ class NdbOperation friend class NdbScanReceiver; friend class NdbScanFilter; friend class NdbScanFilterImpl; - + friend class NdbBlob; + public: /** * @name Define Standard Operation Type @@ -525,6 +527,17 @@ public: virtual int setValue(Uint32 anAttrId, Int64 aValue); virtual int setValue(Uint32 anAttrId, float aValue); virtual int setValue(Uint32 anAttrId, double aValue); + + /** + * This method replaces getValue/setValue for blobs. It creates + * a blob handle NdbBlob. A second call with same argument returns + * the previously created handle. The handle is linked to the + * operation and is maintained automatically. + * + * See NdbBlob for details. + */ + virtual NdbBlob* getBlobHandle(const char* anAttrName); + virtual NdbBlob* getBlobHandle(Uint32 anAttrId); /** @} *********************************************************************/ /** @@ -832,6 +845,11 @@ public: */ int getNdbErrorLine(); + /** + * Get table name of this operation. + */ + const char* getTableName() const; + /** @} *********************************************************************/ /** @@ -953,6 +971,7 @@ protected: Uint32 len); NdbRecAttr* getValue(const NdbColumnImpl* anAttrObject, char* aValue = 0); int setValue(const NdbColumnImpl* anAttrObject, const char* aValue, Uint32 len); + NdbBlob* getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* anAttrObject); int incValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); int incValue(const NdbColumnImpl* anAttrObject, Uint64 aValue); int subValue(const NdbColumnImpl* anAttrObject, Uint32 aValue); @@ -997,6 +1016,10 @@ protected: NdbOperation* takeOverScanOp(OperationType opType, NdbConnection* updateTrans); + // get table or index key from prepared signals + int getKeyFromTCREQ(Uint32* data, unsigned size); + int getKeyFromKEYINFO20(Uint32* data, unsigned size); + /****************************************************************************** * These are the private variables that are defined in the operation objects. *****************************************************************************/ @@ -1095,6 +1118,8 @@ protected: // saveBoundATTRINFO() moves ATTRINFO here when setBound() is ready NdbApiSignal* theBoundATTRINFO; Uint32 theTotalBoundAI_Len; + // Blobs in this operation + NdbBlob* theBlobList; }; diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 0960c035abe..36b54035d96 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -20,7 +20,6 @@ #include <NdbDictionary.hpp> class NdbOperation; -class AttrInfo; /** * @class NdbRecAttr @@ -77,7 +76,8 @@ class NdbRecAttr friend class NdbEventOperationImpl; friend class NdbScanReceiver; friend class Ndb; - + friend class NdbOut& operator<<(class NdbOut&, const class AttributeS&); + public: /** * @name Getting meta information @@ -254,6 +254,7 @@ private: void next(NdbRecAttr* aRecAttr); NdbRecAttr* next() const; + int setup(const class NdbDictionary::Column* col, char* aValue); int setup(const class NdbColumnImpl* anAttrInfo, char* aValue); /* Set up attributes and buffers */ bool copyoutRequired() const; /* Need to copy data to application */ @@ -475,5 +476,7 @@ NdbRecAttr::isNULL() const return theNULLind; } +class NdbOut& operator <<(class NdbOut&, const NdbRecAttr &); + #endif diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index f83669fb616..151dc5bb99f 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -33,6 +33,8 @@ #include <NdbOperation.hpp> #include <NdbCursorOperation.hpp> +class NdbBlob; + /** * @class NdbScanOperation * @brief Class of scan operations for use in transactions. @@ -82,6 +84,10 @@ public: int setValue(Uint32 anAttrId, float aValue); int setValue(Uint32 anAttrId, double aValue); #endif + + NdbBlob* getBlobHandle(const char* anAttrName); + NdbBlob* getBlobHandle(Uint32 anAttrId); + private: NdbScanOperation(Ndb* aNdb); diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index 75a1c291594..8755c13e9bb 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -203,13 +203,13 @@ BaseString::empty() const inline void BaseString::ndb_toupper() { for(unsigned i = 0; i < length(); i++) - m_chr[i] = ::toupper(m_chr[i]); + m_chr[i] = toupper(m_chr[i]); } inline void BaseString::ndb_tolower() { for(unsigned i = 0; i < length(); i++) - m_chr[i] = ::tolower(m_chr[i]); + m_chr[i] = tolower(m_chr[i]); } inline bool diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index bb573eea17b..841da513d4a 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -19,6 +19,7 @@ #include <string.h> #include <ndb_types.h> +#include <kernel/ndb_limits.h> class NdbSqlUtil { public: @@ -77,7 +78,9 @@ public: Binary, // Len Varbinary, // Max len Datetime, // Precision down to 1 sec (size 8 bytes) - Timespec // Precision down to 1 nsec (size 12 bytes) + Timespec, // Precision down to 1 nsec (size 12 bytes) + Blob, // Blob + Clob // Text blob }; Enum m_typeId; Cmp* m_cmp; // set to NULL if cmp not implemented @@ -121,6 +124,8 @@ private: static Cmp cmpVarbinary; static Cmp cmpDatetime; static Cmp cmpTimespec; + static Cmp cmpBlob; + static Cmp cmpClob; }; inline int @@ -145,7 +150,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Tinyunsigned: { if (size >= 1) { @@ -160,7 +164,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Smallint: { if (size >= 1) { @@ -175,7 +178,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Smallunsigned: { if (size >= 1) { @@ -190,7 +192,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Mediumint: // XXX fix these break; case Type::Mediumunsigned: @@ -209,7 +210,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Unsigned: { if (size >= 1) { @@ -224,7 +224,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Bigint: { if (size >= 2) { @@ -241,7 +240,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Bigunsigned: { if (size >= 2) { @@ -258,7 +256,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Float: { if (size >= 1) { @@ -273,7 +270,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Double: { if (size >= 2) { @@ -290,7 +286,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Decimal: break; case Type::Char: @@ -305,7 +300,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, int k = memcmp(u1.v, u2.v, size << 2); return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown; } - break; case Type::Varchar: { /* @@ -323,7 +317,6 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Binary: // XXX fix these break; case Type::Varbinary: @@ -347,9 +340,24 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, } return CmpUnknown; } - break; case Type::Timespec: // XXX fix this break; + case Type::Blob: // XXX fix + break; + case Type::Clob: + { + // skip blob head, the rest is varchar + const unsigned skip = NDB_BLOB_HEAD_SIZE; + if (size >= skip + 1) { + union { const Uint32* p; const char* v; } u1, u2; + u1.p = p1 + skip; + u2.p = p2 + skip; + // length in first 2 bytes + int k = strncmp(u1.v + 2, u2.v + 2, ((size - skip) << 2) - 2); + return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown; + } + return CmpUnknown; + } } return CmpError; } diff --git a/ndb/include/util/Parser.hpp b/ndb/include/util/Parser.hpp index 9c2f02b6024..65cf24db633 100644 --- a/ndb/include/util/Parser.hpp +++ b/ndb/include/util/Parser.hpp @@ -165,6 +165,7 @@ Parser<T>::Parser(const ParserRow<T> rows[], class InputStream & in, template<class T> inline Parser<T>::~Parser(){ + delete impl; } template<class T> diff --git a/ndb/old_files/BinDist.sh b/ndb/old_files/BinDist.sh deleted file mode 100644 index 3574b0d64ce..00000000000 --- a/ndb/old_files/BinDist.sh +++ /dev/null @@ -1,120 +0,0 @@ -# -# Invoked from scripts/make_binary_distribution as "sh BinDist.sh". -# Prints list of dirs and files to include under mysql/ndb. -# - -# release notes - -grep -v '^#' <<__END__ -#ReleaseNotes.html -mysqlclusterenv.sh -__END__ - -# subset of bins, libs, includes - -grep -v '^#' <<__END__ -bin/ -bin/ndb -bin/mgmtsrvr -bin/mgmtclient -bin/mysqlcluster -bin/mysqlcluster_install_db -bin/mysqlclusterd -bin/restore -bin/ndb_rep -bin/desc -bin/flexBench -bin/select_all -bin/select_count -bin/delete_all -#bin/ndbsql -bin/drop_tab -bin/drop_index -bin/list_tables -bin/waiter -lib/ -lib/libNEWTON_API.a -lib/libNEWTON_API.so -lib/libNDB_API.a -lib/libNDB_API.so -lib/libMGM_API.a -lib/libMGM_API.so -#lib/libNDB_ODBC.so -lib/libMGM_API_pic.a -lib/libNDB_API_pic.a -include/ -include/ndb_types.h -include/ndb_version.h -include/mgmapi/ -include/mgmapi/mgmapi.h -include/mgmapi/mgmapi_debug.h -include/ndbapi/ -include/ndbapi/ndbapi_limits.h -include/ndbapi/Ndb.hpp -include/ndbapi/NdbApi.hpp -include/ndbapi/NdbConnection.hpp -include/ndbapi/NdbCursorOperation.hpp -include/ndbapi/NdbDictionary.hpp -include/ndbapi/NdbError.hpp -include/ndbapi/NdbEventOperation.hpp -include/ndbapi/NdbIndexOperation.hpp -include/ndbapi/NdbOperation.hpp -include/ndbapi/NdbPool.hpp -include/ndbapi/NdbRecAttr.hpp -include/ndbapi/NdbReceiver.hpp -include/ndbapi/NdbResultSet.hpp -include/ndbapi/NdbScanFilter.hpp -include/ndbapi/NdbScanOperation.hpp -include/ndbapi/NdbSchemaCon.hpp -include/ndbapi/NdbSchemaOp.hpp -include/newtonapi/dba.h -include/newtonapi/defs/pcn_types.h -__END__ - -#if [ -f /usr/local/lib/libstdc++.a ]; then -# cp /usr/local/lib/libstdc++.a lib/. -# echo lib/libstdc++.a -#fi -#if [ -f /usr/local/lib/libstdc++.so.5 ]; then -# cp /usr/local/lib/libstdc++.so.5 lib/. -# echo lib/libstdc++.so.5 -#fi -#if [ -f /usr/local/lib/libgcc_s.so.1 ]; then -# cp /usr/local/lib/libgcc_s.so.1 lib/. -# echo lib/libgcc_s.so.1 -#fi - -# docs - -#find docs/*.html docs/*.pdf -print | sort -t/ - -# demos - -find demos -print | grep -v /SCCS | sort -t/ - -# examples - -grep -v '^#' <<__END__ -examples/ -examples/Makefile -examples/ndbapi_example1/ -examples/ndbapi_example1/Makefile -examples/ndbapi_example1/ndbapi_example1.cpp -examples/ndbapi_example2/ -examples/ndbapi_example2/Makefile -examples/ndbapi_example2/ndbapi_example2.cpp -examples/ndbapi_example3/ -examples/ndbapi_example3/Makefile -examples/ndbapi_example3/ndbapi_example3.cpp -examples/ndbapi_example4/ -examples/ndbapi_example4/Makefile -examples/ndbapi_example4/ndbapi_example4.cpp -examples/ndbapi_example5/ -examples/ndbapi_example5/Makefile -examples/ndbapi_example5/ndbapi_example5.cpp -examples/select_all/ -examples/select_all/Makefile -examples/select_all/select_all.cpp -__END__ - -exit 0 diff --git a/ndb/old_files/Defs.mk b/ndb/old_files/Defs.mk deleted file mode 100644 index ac4507562fd..00000000000 --- a/ndb/old_files/Defs.mk +++ /dev/null @@ -1,64 +0,0 @@ -include $(NDB_TOP)/config/config.mk -include $(NDB_TOP)/config/Defs.$(NDB_VERSION).mk -include $(NDB_TOP)/config/Defs.$(NDB_OS).$(NDB_ARCH).$(NDB_COMPILER).mk - -ifeq ($(NDB_OS), WIN32) -# Windows specific definitions -OBJEXT := obj -LIBEXT := lib -LIBPREFIX := -fixpath = `cygpath -w $1` -ar_rcs = lib -out:`cygpath -w $1` $2 -link_so = link -DLL -OUT:`cygpath -w $1` $(WIN_LIBS) $2 -#check-odbc = Y -USE_EDITLINE := N -#STRCASECMP is defined in include/portlib/PortDefs.h to _strcmpi -else -#Common definitions for almost all non-Windows environments -OBJEXT := o -LIBEXT := a -LIBPREFIX := lib -fixpath = $1 -ar_rcs = $(AR_RCS) $1 $2 -#check-odbc = $(findstring sqlext.h, $(wildcard /usr/include/sqlext.h) $(wildcard /usr/local/include/sqlext.h)) -endif - -ifeq ($(NDB_OS), WIN32) -SHLIBEXT := dll -endif - -ifeq ($(NDB_OS), LINUX) -SHLIBEXT := so -endif - -ifeq ($(NDB_OS), SOLARIS) -SHLIBEXT := so -endif - -ifeq ($(NDB_OS), HPUX) -SHLIBEXT := sl -endif - -ifeq ($(NDB_OS), MACOSX) -SHLIBEXT := dylib -endif - -ifeq ($(NDB_OS), OSE) -SHLIBEXT := so -endif - -ifeq ($(NDB_OS), SOFTOSE) -SHLIBEXT := so -endif - -ifeq ($(NDB_SCI), Y) -CCFLAGS_TOP += -DHAVE_NDB_SCI -endif - -ifeq ($(NDB_SHM), Y) -CCFLAGS_TOP += -DHAVE_NDB_SHM -endif - -ifneq ($(findstring OSE, $(NDB_OS)),) -USE_EDITLINE := N -endif diff --git a/ndb/old_files/Epilogue.mk b/ndb/old_files/Epilogue.mk deleted file mode 100644 index 36d9ebd6751..00000000000 --- a/ndb/old_files/Epilogue.mk +++ /dev/null @@ -1,878 +0,0 @@ -# .KEEP_STATE: -# bk test !!! - -### -# For building some intermediary targets in /tmp (only useful on solaris) -ifneq ($(NDB_BUILDROOT),) -NDB_TOPABS := $(shell cd $(NDB_TOP) && /bin/pwd) -NDB_BUILDDIR := $(subst $(NDB_TOPABS),$(NDB_BUILDROOT),$(CURDIR))/ -ifeq ($(wildcard $(NDB_BUILDDIR)),) -dummy := $(shell mkdir -p $(NDB_BUILDDIR)) -endif -endif - -### -CCFLAGS_TOP += -DNDB_$(NDB_OS) -DNDB_$(NDB_ARCH) -DNDB_$(NDB_COMPILER) - -ifdef BIN_TARGET -BIN_EXE = Y -endif - -### -# -# OS specifics -# - -# Disable shared libraries on HP-UX for the time being. -ifeq ($(NDB_OS), HPUX) - SO_LIB := N - PIC_LIB := N - PIC_ARCHIVE := N - NONPIC_ARCHIVE := Y -endif - -ifeq ($(NDB_OS), OSE) - SO_LIB := N - PIC_LIB := N - PIC_ARCHIVE := N - NONPIC_ARCHIVE := Y - -ifdef BIN_TARGET - BIN_LIB_TARGET := lib$(BIN_TARGET).a - BIN_TARGET := lib$(BIN_TARGET).a -endif -endif - -ifeq ($(NDB_OS), SOFTOSE) - SO_LIB := N - PIC_LIB := N - PIC_ARCHIVE := N - -ifdef BIN_TARGET - BIN_EXE_TARGET := $(BIN_TARGET) - BIN_LIB_TARGET := lib$(BIN_TARGET).a - EXTRA_MAIN := osemain.o -endif -endif - -ifeq ($(filter OSE, $(NDB_OS)),) - BIN_EXE_TARGET := $(BIN_TARGET) -endif - - -ifeq ($(NDB_OS), MACOSX) -.LIBPATTERNS= lib%.dylib lib%.a -endif - -### -# -# - -### -# External dependencies definition : the place we store libraries -# we get from outside the NDB development group. -EXTERNAL_DEPENDS_TOP=$(NDB_TOP)/src/external/$(NDB_OS).$(NDB_ARCH) - - -### -# -# TYPE Handling - -# -# TYPE := kernel -# -ifneq ($(filter kernel, $(TYPE)),) -CCFLAGS_LOC += \ - -I$(call fixpath,$(NDB_TOP)/src/kernel/vm) \ - -I$(call fixpath,$(NDB_TOP)/src/kernel/error) \ - -I$(call fixpath,$(NDB_TOP)/src/kernel) \ - -I$(call fixpath,$(NDB_TOP)/include/kernel) \ - -I$(call fixpath,$(NDB_TOP)/include/transporter) \ - -I$(call fixpath,$(NDB_TOP)/include/debugger) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/include/util) \ - -I$(call fixpath,$(NDB_TOP)/include/portlib) \ - -I$(call fixpath,$(NDB_TOP)/include/logger) -endif - -# -# TYPE := ndbapi -# -ifneq ($(filter ndbapi, $(TYPE)),) -CCFLAGS_LOC += \ - -I$(call fixpath,$(NDB_TOP)/include/kernel) \ - -I$(call fixpath,$(NDB_TOP)/include/transporter) \ - -I$(call fixpath,$(NDB_TOP)/include/debugger) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/include/util) \ - -I$(call fixpath,$(NDB_TOP)/include/portlib) \ - -I$(call fixpath,$(NDB_TOP)/include/logger) -endif - -# -# TYPE := ndbapiclient -# -ifneq ($(filter ndbapiclient, $(TYPE)),) -CCFLAGS_LOC += \ - -I$(call fixpath,$(NDB_TOP)/include/ndbapi) - -BIN_TARGET_LIBS += NDB_API -endif - -# -# TYPE := mgmapiclient -# -ifneq ($(filter mgmapiclient, $(TYPE)),) -CCFLAGS_LOC += \ - -I$(call fixpath,$(NDB_TOP)/include/mgmapi) - -BIN_TARGET_LIBS += MGM_API -endif - -# -# TYPE := ndbapitest -# -ifneq ($(filter ndbapitest, $(TYPE)),) -CCFLAGS_LOC += \ - -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/include/util) \ - -I$(call fixpath,$(NDB_TOP)/include/portlib) \ - -I$(call fixpath,$(NDB_TOP)/test/include) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmapi) - -BIN_TARGET_LIBS += NDBT -LDFLAGS_LOC += -lNDB_API -lMGM_API -lm - -endif - -# -# TYPE := signalsender -# -ifneq ($(filter signalsender, $(TYPE)),) -CCFLAGS_LOC += \ - -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/src/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/src/ndbapi/signal-sender) \ - -I$(call fixpath,$(NDB_TOP)/include/util) \ - -I$(call fixpath,$(NDB_TOP)/include/portlib) \ - -I$(call fixpath,$(NDB_TOP)/include/transporter) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/include/kernel) - -BIN_TARGET_LIBS += NDB_API -BIN_TARGET_ARCHIVES += editline signal-sender - -endif - - -# -# TYPE := repserver -# -ifneq ($(filter repserver, $(TYPE)),) -CCFLAGS_LOC += \ - -I$(call fixpath,$(NDB_TOP)/include/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/src) \ - -I$(call fixpath,$(NDB_TOP)/src/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/src/ndbapi/signal-sender) \ - -I$(call fixpath,$(NDB_TOP)/include/util) \ - -I$(call fixpath,$(NDB_TOP)/include/portlib) \ - -I$(call fixpath,$(NDB_TOP)/include/transporter) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/include/kernel) -endif - -# -# TYPE := odbcclient -# - -ifneq ($(filter odbcclient, $(TYPE)),) -TYPE += util -LDFLAGS_LOC += -lm -#ifneq ($(call check-odbc),) -ifneq ($(NDB_ODBC),N) -ifeq ($(NDB_OS), SOLARIS) -CCFLAGS_LOC += -I/usr/local/include -BIN_TARGET_LIBS_DIRS += /usr/local/lib -BIN_TARGET_LIBS += odbc odbcinst NDBT -endif -ifeq ($(NDB_OS), LINUX) -BIN_TARGET_LIBS += odbc odbcinst NDBT -endif -ifeq ($(NDB_OS), MACOSX) -BIN_TARGET_LIBS += odbc odbcinst NDBT -endif -ifeq ($(NDB_OS), IBMAIX) -BIN_TARGET_LIBS += odbc odbcinst NDBT -endif -ifeq ($(NDB_OS), TRU64X) -BIN_TARGET_LIBS += odbc odbcinst NDBT -endif -else -BIN_EXE = N -endif -endif - -# -# TYPE := * -# -# -# TYPE := util -# -ifneq ($(filter util, $(TYPE)),) -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/util) \ - -I$(call fixpath,$(NDB_TOP)/include/portlib) \ - -I$(call fixpath,$(NDB_TOP)/include/logger) -BIN_TARGET_LIBS += logger general portlib -endif - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include) -I$(call fixpath,$(NDB_TOP)/../include) - -ifeq ($(NDB_SCI), Y) -BIN_TARGET_LIBS += sisci -BIN_TARGET_LIBS_DIRS += $(EXTERNAL_DEPENDS_TOP)/sci/lib - -CCFLAGS_LOC += -I$(call fixpath,$(EXTERNAL_DEPENDS_TOP)/sci/include) -endif - -# -# TYPE Handling -### - -### -# -# First rule -# -first: - $(MAKE) libs - $(MAKE) bins - -ifeq ($(findstring all,$(replace-targets)),) -all: first -endif - -### -# -# Nice to have rules -api: libs - $(MAKE) -C $(NDB_TOP)/src/ndbapi bins - -mgm: libs - $(MAKE) -C $(NDB_TOP)/src/mgmsrv bins - -ndb: libs - $(MAKE) -C $(NDB_TOP)/src/kernel/ndb-main bins - -apitest: first - $(MAKE) -C $(NDB_TOP)/test/ndbapi all - -#-lNDBT: -# $(MAKE) -C $(NDB_TOP)/test/src all -# -#-lNDB_API: libs -# $(MAKE) -C $(NDB_TOP)/src/ndbapi bins - -# -# Libs/Bins -# -ifdef PREREQ_LOC -_libs:: $(PREREQ_LOC) -_bins:: $(PREREQ_LOC) -endif - -L_DIRS := $(LIB_DIRS) $(DIRS) -B_DIRS := $(BIN_DIRS) $(DIRS) -A_DIRS := $(LIB_DIRS) $(BIN_DIRS) $(DIRS) - -_libs:: - -_bins:: - -libs: _libs $(patsubst %, _libs_%, $(L_DIRS)) -$(patsubst %, _libs_%, $(L_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _libs_%,%,$@) libs - -bins: _bins $(patsubst %, _bins_%, $(B_DIRS)) -$(patsubst %, _bins_%, $(B_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _bins_%,%,$@) bins - -### -# -# Links -_links: - -$(NDB_TOP)/tools/make-links.sh $(NDB_TOP)/include `pwd` - -links: _links $(patsubst %, _links_%, $(A_DIRS)) -$(patsubst %, _links_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _links_%,%,$@) links - - -#### -# -# OSE build_spec ( -ifdef SOURCES -BS := Y -endif - -ifdef SOURCES_c -BS := Y -endif - -_build_spec: Makefile -ifdef BS - @echo "TYPE = SWU" > build.spec - @echo "include $(NDB_TOP)/Ndb.mk" >> build.spec -# @for i in $(CCFLAGS_LOC); do echo "INC += $$i" >> build.spec ; done - @for i in $(patsubst -I%, %, $(CCFLAGS_LOC)); do echo "INC += $$i" >> build.spec ; done - @echo "INC += /vobs/cello/cls/rtosi_if/include" >> build.spec - @echo "INC += /vobs/cello/cls/rtosi_if/include.@@@" >> build.spec - @echo "INC += /vobs/cello/cls/rtosi_if/include.<<<" >> build.spec -endif - -build_spec: _build_spec $(patsubst %, _build_spec_%, $(A_DIRS)) -$(patsubst %, _build_spec_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _build_spec_%,%,$@) build_spec - -### -# -# Phony targets - -.PHONY: $(A_DIRS) - -### -# -# Dummy rule - -DUMMY: - -### -# -# Definitions of... - -PIC_DIR := $(NDB_BUILDDIR).pic -A_TMP_DIR := $(NDB_BUILDDIR).a_tmp -SO_TMP_DIR := $(NDB_BUILDDIR).so_tmp -PIC_TMP_DIR := $(NDB_BUILDDIR).pic_tmp - -$(PIC_DIR): - mkdir -p $(PIC_DIR) - -SRC_C := $(filter %.C, $(SOURCES)) -SRC_CPP := $(filter %.cpp, $(SOURCES)) -SRC_CC := $(filter %.cc, $(SOURCES)) -SRC_c := $(filter %.c, $(SOURCES)) $(filter %.c, $(SOURCES.c)) -SRC_YPP := $(filter %.ypp, $(SOURCES)) -SRC_LPP := $(filter %.lpp, $(SOURCES)) - -OBJECTS := $(SRC_C:%.C=%.$(OBJEXT)) \ - $(SRC_CPP:%.cpp=%.$(OBJEXT)) \ - $(SRC_CC:%.cc=%.$(OBJEXT)) \ - $(SRC_c:%.c=%.$(OBJEXT)) \ - $(SRC_YPP:%.ypp=%.tab.$(OBJEXT)) \ - $(SRC_LPP:%.lpp=%.yy.$(OBJEXT)) \ - $(OBJECTS_LOC) - -PIC_OBJS := $(OBJECTS:%=$(PIC_DIR)/%) - -LIB_DIR := $(NDB_TOP)/lib -BIN_DIR := $(NDB_TOP)/bin - -### -# -# ARCHIVE_TARGET -# -ifdef ARCHIVE_TARGET - -ifndef NONPIC_ARCHIVE -NONPIC_ARCHIVE := Y -endif - -ifeq ($(NONPIC_ARCHIVE), Y) -_libs:: $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET).$(LIBEXT) -$(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET).$(LIBEXT) : $(OBJECTS) - $(call ar_rcs,$@,$(OBJECTS)) - -endif # NONPIC_ARCHIVE := Y - -ifeq ($(PIC_ARCHIVE), Y) -_libs:: $(PIC_DIR) $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET)_pic.$(LIBEXT) -$(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET)_pic.$(LIBEXT) : $(PIC_OBJS) - cd $(PIC_DIR) && $(call ar_rcs,../$@,$(OBJECTS)) - -PIC_DEP := Y - -endif # PIC_ARCHIVE := Y - -endif # ARCHIVE_TARGET - -### -# -# LIB_TARGET -# -ifdef LIB_TARGET - -ifeq ($(A_LIB), Y) - -A_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%.$(LIBEXT)) - -_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(LIBEXT) -$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(LIBEXT) : $(A_LIB_ARCHIVES) - @rm -rf $(A_TMP_DIR) && mkdir $(A_TMP_DIR) - cd $(A_TMP_DIR) && for i in $^; do ar -x ../$$i; done && $(call ar_rcs,../$@,*.$(OBJEXT)) - $(NDB_TOP)/home/bin/ndb_deploy $@ -endif # A_LIB := Y - -ifeq ($(SO_LIB), Y) -ifneq ($(NDB_OS), WIN32) -SO_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%_pic.$(LIBEXT)) - -_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT) -$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT) : $(SO_LIB_ARCHIVES) - @rm -rf $(SO_TMP_DIR) && mkdir $(SO_TMP_DIR) - cd $(SO_TMP_DIR) && for i in $^; do ar -x ../$$i; done -ifneq ($(NDB_OS), MACOSX) - $(SO) $@.new $(SO_TMP_DIR)/*.$(OBJEXT) -L$(LIB_DIR) $(LIB_TARGET_LIBS) $(LDFLAGS_LAST) - rm -f $@; mv $@.new $@ -else - $(SO) $@ $(SO_TMP_DIR)/*.$(OBJEXT) -L$(LIB_DIR) $(LIB_TARGET_LIBS) $(LDFLAGS_LAST) -endif -ifeq ($(NDB_VERSION), RELEASE) -ifneq ($(NDB_OS), MACOSX) - strip $@ -endif -endif - $(NDB_TOP)/home/bin/ndb_deploy $@ -else # WIN32 -SO_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%_pic.$(LIBEXT)) - -_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT) -$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT) : $(SO_LIB_ARCHIVES) - @rm -rf $(SO_TMP_DIR) && mkdir $(SO_TMP_DIR) - cd $(SO_TMP_DIR) && for i in $^; do ar -x ../$$i; done - $(call link_so,$@.new,$(SO_TMP_DIR)/*.$(OBJEXT)) - rm -f $@; mv $@.new $@ -#ifeq ($(NDB_VERSION), RELEASE) -# strip $@ -#endif - -endif -endif # SO_LIB := Y - -ifeq ($(PIC_LIB), Y) - -PIC_LIB_ARCHIVES := $(LIB_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%_pic.$(LIBEXT)) - -_bins:: $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET)_pic.$(LIBEXT) -$(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET)_pic.$(LIBEXT) : $(PIC_LIB_ARCHIVES) - @rm -rf $(PIC_TMP_DIR) && mkdir $(PIC_TMP_DIR) - cd $(PIC_TMP_DIR) && for i in $^; do ar -x ../$$i; done && $(call ar_rcs,../$@,*.$(OBJEXT)) - -endif # PIC_LIB := Y - -endif # LIB_TARGET - -### -# -# BIN_TARGET -# -ifeq ($(BIN_EXE), Y) -ifneq ($(NDB_OS), WIN32) -BIN_LIBS := $(BIN_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%.$(LIBEXT)) -BIN_LIBS += $(BIN_TARGET_LIBS:%=-l%) - -BIN_DEPS := $(OBJECTS) $(EXTRA_MAIN) $(BIN_LIBS) -BIN_LIB_DIRS := $(BIN_TARGET_LIBS_DIRS:%=-L%) - -BIN_FLAGS := $(BIN_LIB_DIRS) $(BIN_DEPS) - -VPATH := $(LIB_DIR) $(BIN_TARGET_LIBS_DIRS) -_bins:: $(BIN_DIR)/$(BIN_TARGET) -$(BIN_DIR)/$(BIN_TARGET) : $(BIN_DEPS) - $(LINK.cc) $(LDFLAGS) $(LDLIBS) -L$(LIB_DIR) $(BIN_FLAGS) -o $@.new $(LDFLAGS_LAST) - rm -f $@; mv $@.new $@ -ifeq ($(NDB_VERSION), RELEASE) -ifneq ($(NDB_OS), MACOSX) - strip $@ -endif -endif - $(NDB_TOP)/home/bin/ndb_deploy $@ -else # WIN32 -BIN_LIBS := $(foreach lib,$(BIN_TARGET_ARCHIVES),$(call fixpath,$(LIB_DIR)/$(LIBPREFIX)$(lib).$(LIBEXT))) -BIN_LIBS += $(BIN_TARGET_LIBS:%=$(LIBPREFIX)%.$(LIBEXT)) - -BIN_DEPS := $(OBJECTS) $(BIN_TARGET_ARCHIVES:%=$(LIB_DIR)/$(LIBPREFIX)%.$(LIBEXT)) -BIN_LIB_DIRS := -libpath:$(call fixpath,$(LIB_DIR)) $(BIN_TARGET_LIBS_DIRS:%=-libpath:%) - -BIN_FLAGS := $(BIN_LIB_DIRS) - -VPATH := $(LIB_DIR) $(BIN_TARGET_LIBS_DIRS) -_bins:: $(BIN_DIR)/$(BIN_TARGET).exe -$(BIN_DIR)/$(BIN_TARGET).exe : $(BIN_DEPS) - $(LINK.cc) -out:$(call fixpath,$@.new) $(OBJECTS) $(BIN_FLAGS) $(BIN_LIBS) - rm -f $@; mv $@.new $@ -ifeq ($(NDB_VERSION), RELEASE) - strip $@ -endif - -endif -endif - -### -# -# SOURCES.sh -# -ifdef SOURCES.sh - -BIN_SRC := $(SOURCES.sh:%=$(BIN_DIR)/%) - -_bins:: $(BIN_SRC) - -$(BIN_SRC) : $(SOURCES.sh) - rm -f $(^:%=$(BIN_DIR)/%) - cp $^ $(BIN_DIR) -endif - -# -# Compile rules PIC objects -# -ifeq ($(NDB_OS), WIN32) -OUT := -Fo -else -OUT := -o -endif - -$(PIC_DIR)/%.$(OBJEXT): %.C - $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(PIC) $< - -$(PIC_DIR)/%.$(OBJEXT): %.cpp - $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(PIC) $< - -$(PIC_DIR)/%.$(OBJEXT): %.cc - $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(PIC) $< - -$(PIC_DIR)/%.$(OBJEXT): %.c - $(CC) $(OUT)$@ -c $(CFLAGS) $(CFLAGS_$<) $(PIC) $< - -# -# Compile rules -# -%.$(OBJEXT) : %.cpp - $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -%.$(OBJEXT) : %.C - $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -%.$(OBJEXT) : %.cc - $(C++) $(OUT)$@ -c $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -%.$(OBJEXT) : %.c - $(CC) $(OUT)$@ -c $(CFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -%.s : %.C - $(C++) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -%.s : %.cpp - $(C++) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -%.s : %.cc - $(C++) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -%.s : %.c - $(CC) -S $(CCFLAGS) $(CFLAGS_$<) $(NON_PIC) $< - -BISON = bison -BISONHACK = : -%.tab.cpp %.tab.hpp : %.ypp - $(BISON) $< - $(BISONHACK) $*.tab.cpp $*.tab.hpp - -FLEX = flex -FLEXHACK = : -%.yy.cpp : %.lpp - $(FLEX) -o$@ $< - $(FLEXHACK) $@ - -### -# -# Defines regarding dependencies - -DEPMK := $(NDB_BUILDDIR).depend.mk - -DEPDIR := $(NDB_BUILDDIR).depend - -DEPENDENCIES := $(SRC_C:%.C=$(DEPDIR)/%.d) \ - $(SRC_CC:%.cc=$(DEPDIR)/%.d) \ - $(SRC_CPP:%.cpp=$(DEPDIR)/%.d) \ - $(SRC_c:%.c=$(DEPDIR)/%.d) \ - $(SRC_YPP:%.ypp=$(DEPDIR)/%.tab.d) \ - $(SRC_LPP:%.lpp=$(DEPDIR)/%.yy.d) - -### -# -# Dependency rule - -_depend: $(DEPMK) - -depend: _depend $(patsubst %, _depend_%, $(A_DIRS)) - -$(patsubst %, _depend_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _depend_%,%,$@) depend - -### -# -# Clean dependencies - -_clean_dep: - -rm -rf $(DEPMK) $(DEPDIR)/* - -clean_dep: _clean_dep $(patsubst %, _clean_dep_%, $(A_DIRS)) - -$(patsubst %, _clean_dep_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _clean_dep_%,%,$@) clean_dep - -### -# -# Generate dependencies - -$(DEPDIR): - -@mkdir -p $(DEPDIR) - -$(DEPDIR)/%.d: %.C - @echo Generating depend for $< - @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@ - -$(DEPDIR)/%.d: %.c - @echo Generating depend for $< - @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@ - -$(DEPDIR)/%.d: %.cpp - @echo Generating depend for $< - @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@ - -$(DEPDIR)/%.d: %.cc - @echo Generating depend for $< - @$(MAKEDEPEND) $(CCFLAGS) $(CFLAGS_$<) $< >$@ - -ifeq ($(NDB_OS), WIN32) -ifndef PIC_DEP -DEP_PTN := -e 's/\(.*\)\.o[ :]*/\1.$(OBJEXT) $(DEPDIR)\/\1.d : /g' -else -DEP_PTN := -e 's/\(.*\)\.o[ :]*/\1.$(OBJEXT) $(PIC_DIR)\/\1.$(OBJEXT) $(DEPDIR)\/\1.d : /g' -endif -else -ifndef PIC_DEP -DEP_PTN := -e 's!\(.*\)\.$(OBJEXT)[ :]*!\1.$(OBJEXT) $(DEPDIR)\/\1.d : !g' -else -DEP_PTN := -e 's!\(.*\)\.$(OBJEXT)[ :]*!\1.$(OBJEXT) $(PIC_DIR)\/\1.$(OBJEXT) $(DEPDIR)\/\1.d : !g' -endif -endif -#DEP_PTN += -e 's!/usr/include/[-+a-zA-Z0-9_/.]*!!g' -#DEP_PTN += -e 's!/usr/local/lib/gcc-lib/[-+a-zA-Z0-9_/.]*!!g' - -$(DEPMK): $(DEPDIR) $(SRC_YPP:%.ypp=%.tab.hpp) $(SRC_LPP:%.lpp=%.yy.cpp) $(DEPENDENCIES) $(wildcard $(NDB_TOP)/.update.d) - @echo "updating .depend.mk" - @sed $(DEP_PTN) /dev/null $(DEPENDENCIES) >$(DEPMK) - -### -# -# clean -# -_clean: - -rm -rf SunWS_cache $(PIC_DIR)/SunWS_cache -ifeq ($(NONPIC_ARCHIVE), Y) - -rm -f $(OBJECTS) $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET).$(LIBEXT) -endif -ifeq ($(PIC_ARCHIVE), Y) - -rm -f $(PIC_OBJS) $(LIB_DIR)/$(LIBPREFIX)$(ARCHIVE_TARGET)_pic.$(LIBEXT) -endif -ifdef BIN_TARGET - -rm -f $(OBJECTS) -endif -ifdef LIB_TARGET -ifeq ($(A_LIB), Y) - -rm -f $(A_TMP_DIR)/* -endif -ifeq ($(SO_LIB), Y) - -rm -f $(SO_TMP_DIR)/* -endif -ifeq ($(PIC_LIB), Y) - -rm -f $(PIC_TMP_DIR)/* -endif -endif -ifneq ($(SRC_YPP),) - -rm -f $(SRC_YPP:%.ypp=%.tab.[hc]pp) $(SRC_YPP:%.ypp=%.output) -endif -ifneq ($(SRC_LPP),) - -rm -f $(SRC_LPP:%.lpp=%.yy.*) -endif -ifdef CLEAN_LOC - -rm -f $(CLEAN_LOC) -endif - -### -# -# clean all -# -clobber: cleanall -_cleanall: _clean clean_links - -rm -f osemain.con osemain.c -ifdef LIB_TARGET -ifeq ($(A_LIB), Y) - -rm -f $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(LIBEXT) -endif -ifeq ($(SO_LIB), Y) - -rm -f $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET).$(SHLIBEXT) -endif -ifeq ($(PIC_LIB), Y) - -rm -f $(LIB_DIR)/$(LIBPREFIX)$(LIB_TARGET)_pic.$(LIBEXT) -endif -endif -ifdef BIN_TARGET - -rm -f $(BIN_DIR)/$(BIN_TARGET) -endif - -clean_links: - -### -# -# Dist clean -# -_distclean: _tidy - rm -rf $(DEPDIR) $(PIC_DIR) $(PIC_TMP_DIR) $(SO_TMP_DIR) $(A_TMP_DIR) Sources build.spec - -### -# -# tidy -# -_tidy: _cleanall _clean_dep - -rm -f *~ *.$(OBJEXT) *.$(LIBEXT) *.${SHLIBEXT} - -# -# clean cleanall tidy - recursion -# -ifeq ($(findstring clean,$(replace-targets)),) -clean: _clean $(patsubst %, _clean_%, $(A_DIRS)) -endif - -$(patsubst %, _clean_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _clean_%,%,$@) clean - -cleanall: _cleanall $(patsubst %, _cleanall_%, $(A_DIRS)) - -$(patsubst %, _cleanall_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _cleanall_%,%,$@) cleanall - -tidy: _tidy $(patsubst %, _tidy_%, $(A_DIRS)) - -$(patsubst %, _tidy_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _tidy_%,%,$@) tidy - -distclean: _distclean $(patsubst %, _distclean_%, $(A_DIRS)) - -$(patsubst %, _distclean_%, $(A_DIRS)) : DUMMY - $(MAKE) -C $(patsubst _distclean_%,%,$@) distclean - -### -# -# Guess configuration - -$(NDB_TOP)/config/config.mk: $(NDB_TOP)/config/GuessConfig.sh - $(NDB_TOP)/config/GuessConfig.sh -D - -$(NDB_TOP)/config/Defs....mk: $(NDB_TOP)/config/config.mk -$(NDB_TOP)/config/Defs..mk: $(NDB_TOP)/config/config.mk - -### -# Soft ose envirment stuff -# -osemain.con: $(NDB_TOP)/src/env/softose/osemain_con.org - cp $< $@ - echo "PRI_PROC(init_$(BIN_TARGET), init_$(BIN_TARGET), 65535, 3, ndb, 0, NULL)" >> $@ - -osemain.c: $(OSE_LOC)/sfk-solaris2/krn-solaris2/src/osemain.c - ln -s $< $@ - -osemain.o : osemain.con - -$(DEPDIR)/osemain.d : osemain.con - -### -# -# These target dont want dependencies - -NO_DEP=clean clobber cleanall tidy clean_dep $(DEPDIR) build_spec \ - $(NDB_TOP)/config/config.mk distclean osemain.con osemain.c - -ifeq ($(filter $(NO_DEP), $(MAKECMDGOALS)),) -ifneq ($(strip $(DEPENDENCIES)),) - include $(DEPMK) -endif -endif - -### -# -# Auxiliary targets - -sources: Sources - -Sources: Makefile - @rm -f $@ - @for f in Makefile $(A_DIRS) $(SOURCES) $(SOURCES.c); do echo $$f; done >$@ - -### -# -# TAG generation for emacs and vi folks -# -# In emacs "Esc- ." or "M- ." to find a symbol location -# In vi use the :\tag command -# by convention: -# TAGS is used with emacs -# tags is used with vi -# -# Hopefully the make is being done from $(NDB_TOP)/src -# and your TAGS/tags file then is in the same directory. - -TAGS: DUMMY - rm -f TAGS - find $(NDB_TOP) -name "*.[ch]" | xargs $(ETAGS) --append - find $(NDB_TOP) -name "*.[ch]pp" | xargs $(ETAGS) --append - -tags: DUMMY - rm -f tags - find $(NDB_TOP) -name "*.[ch]" | xargs $(CTAGS) --append - find $(NDB_TOP) -name "*.[ch]pp" | xargs $(CTAGS) --append - -install: - - -ebrowse: DUMMY - cd $(NDB_TOP); rm -f EBROWSE - cd $(NDB_TOP); find . -name "*.hpp" -or -name "*.cpp" -or -name "*.h" -or -name "*.c" > tmpfile~ - cd $(NDB_TOP); ebrowse --file tmpfile~ - cd $(NDB_TOP); rm -f tmpfile~ - -srcdir = $(NDB_TOP) -top_distdir = $(NDB_TOP)/.. -mkinstalldirs := /bin/sh ../mkinstalldirs -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)/ndb - -distdir: - $(mkinstalldirs) $(distdir) - @list='$(shell /bin/sh SrcDist.sh)'; for file in $$list; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -f $$d/$$file; then \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done diff --git a/ndb/old_files/Makefile b/ndb/old_files/Makefile deleted file mode 100644 index 8788eae885d..00000000000 --- a/ndb/old_files/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -include .defs.mk - -DIRS := src test tools examples - -# hack before full autoconf -replace-targets := all clean -NDB_RELEASE := $(shell ../scripts/mysql_config --version) - -all: - $(MAKE) -j 1 -C src - $(MAKE) -j 1 -C test/src - $(MAKE) -j 1 -C tools - $(MAKE) -j 1 -C test/ndbapi/flexBench - $(MAKE) -j 1 -C test/tools/waiter - -include $(NDB_TOP)/Epilogue.mk - -_libs_test : _bins_src -_libs_tools : _libs_test -_libs_examples : _bins_src -_bins_src : _libs_src -_bins_tools : _bins_src - -# always release compile except for ndbapi static lib -old-all: - $(MAKE) -C src/ndbapi libs - $(MAKE) libs NDB_VERSION=RELEASE - $(MAKE) bins NDB_VERSION=RELEASE -ifeq ($(NDB_OS),LINUX) - NDB_RELEASE=$(NDB_RELEASE) $(MAKE) -j1 -C docs all </dev/null || : -endif - -# old distclean matches clean better -clean: distclean - $(MAKE) -C docs clean - -nuke-deps: - find . -name '.depend*' | xargs rm -rf - -vim-tags: - bk sfiles -g | ctags --c-types=+p --extra=+fq -L - - -cvs-update: -ifeq ($(NDB_VERSION),main) - -cvs update -d -else -ifeq ($(NDB_TAG),HEAD) - -cvs -q update - -cd include && cvs -q update -d - -cd src && cvs -q update -d - -cd test && cvs -q update -d - -cd tools && cvs -q update -d -else - -cvs -q update -r $(NDB_TAG) - -cd include && cvs -q update -d -r $(NDB_TAG) - -cd src && cvs -q update -d -r $(NDB_TAG) - -cd test && cvs -q update -d -r $(NDB_TAG) - -cd tools && cvs -q update -d -r $(NDB_TAG) -endif -endif - make nuke-deps - make vim-tags - make TAGS - -bk-update: - bk pull - make nuke-deps - make vim-tags - make TAGS diff --git a/ndb/old_files/README b/ndb/old_files/README deleted file mode 100644 index 3b21fca1d48..00000000000 --- a/ndb/old_files/README +++ /dev/null @@ -1,7 +0,0 @@ -INSTALLATION -To compile a pentium version of MySQL Cluster from this BK clone do: - -shell> cd /home/bk/mysql-4.1-ndb -shell> BUILD/compile-pentium-debug -c --prefix=/usr/local/mysql-4.1-ndb -shell> make - diff --git a/ndb/old_files/SrcDist.sh b/ndb/old_files/SrcDist.sh deleted file mode 100644 index 03e697b1475..00000000000 --- a/ndb/old_files/SrcDist.sh +++ /dev/null @@ -1,87 +0,0 @@ -# -# Invoked from make distdir. -# Prints list of dirs and files to include under mysql/ndb. -# - -# top dir - -grep -v '^#' <<__END__ -#ReleaseNotes.html -.defs.mk -Defs.mk -configure -Makefile -Epilogue.mk -SrcDist.sh -BinDist.sh -mysqlclusterenv.sh -__END__ - -# subset of bins, libs - -grep -v '^#' <<__END__ -bin/ -bin/mysqlcluster -bin/mysqlcluster_install_db -bin/mysqlclusterd -lib/ -__END__ - -# docs - -#find docs/*.html docs/*.pdf -print - -# include - -find include -print | grep -v /SCCS - -# config - -find config -print | grep -v /SCCS - -# tools - -find tools -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend' | grep -v tools/ndbsql - -# home - -find home -print | grep -v /SCCS - -# test - -find test -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend' | grep -v test/odbc - -# src - -find src -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend' | grep -v src/client/odbc | grep -v cpcc-win32 - -# demos - -find demos -print | grep -v /SCCS | grep -v '\.o' | grep -v '\.depend' - -# examples - -grep -v '^#' <<__END__ -examples/ -examples/Makefile -examples/ndbapi_example1/ -examples/ndbapi_example1/Makefile -examples/ndbapi_example1/ndbapi_example1.cpp -examples/ndbapi_example2/ -examples/ndbapi_example2/Makefile -examples/ndbapi_example2/ndbapi_example2.cpp -examples/ndbapi_example3/ -examples/ndbapi_example3/Makefile -examples/ndbapi_example3/ndbapi_example3.cpp -examples/ndbapi_example4/ -examples/ndbapi_example4/Makefile -examples/ndbapi_example4/ndbapi_example4.cpp -examples/ndbapi_example5/ -examples/ndbapi_example5/Makefile -examples/ndbapi_example5/ndbapi_example5.cpp -examples/select_all/ -examples/select_all/Makefile -examples/select_all/select_all.cpp -__END__ - -exit 0 diff --git a/ndb/old_files/configure b/ndb/old_files/configure deleted file mode 100755 index f0fc197f45e..00000000000 --- a/ndb/old_files/configure +++ /dev/null @@ -1,33 +0,0 @@ -#! /bin/sh - -if [ $# -gt 0 -a "$1" = "-p" ] -then - shift - NDB_TOP=$1 - shift -else - NDB_TOP=`pwd` -fi - -cd $NDB_TOP -NDB_TOP=`pwd` - -for i in `find . -name 'Makefile' -exec dirname {} \;` -do - cd $i - rel_path=. - while [ $NDB_TOP != `pwd` ] - do - rel_path=$rel_path"/.." - cd .. - done - - ( - echo "NDB_TOP=$rel_path" - echo "include $rel_path/Defs.mk" - ) > $i/.defs.mk -done - -( cd config ; aclocal ; automake ; aclocal ; autoconf ; ./configure ) -export NDB_TOP -. config/GuessConfig.sh $* diff --git a/ndb/old_files/env.sh b/ndb/old_files/env.sh deleted file mode 100644 index c84a61b2c6f..00000000000 --- a/ndb/old_files/env.sh +++ /dev/null @@ -1,8 +0,0 @@ -# - -NDB_TOP=`pwd` -export NDB_TOP - -NDB_PROJ_HOME=$NDB_TOP/home -export NDB_PROJ_HOME - diff --git a/ndb/old_files/mysqlclusterenv.sh b/ndb/old_files/mysqlclusterenv.sh deleted file mode 100644 index e151186d01e..00000000000 --- a/ndb/old_files/mysqlclusterenv.sh +++ /dev/null @@ -1,51 +0,0 @@ -# Sets necessary environment variables for mysqlcluster install scripts -mytop= -if [ -f bin/mysql ]; then - mytop=`/bin/pwd` -elif [ -f bin/ndb ]; then - mytop=`dirname \`/bin/pwd\`` -fi -if [ "$mytop" ]; then - MYSQLCLUSTER_TOP=$mytop - PATH=$MYSQLCLUSTER_TOP/bin:$MYSQLCLUSTER_TOP/ndb/bin:$PATH - LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/lib:$LD_LIBRARY_PATH - LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/ndb/lib:$LD_LIBRARY_PATH - export MYSQLCLUSTER_TOP PATH LD_LIBRARY_PATH -else -if [ -d SCCS ]; then -if [ -f ndb/mysqlclusterenv.sh ]; then - mytop=`/bin/pwd` -elif [ -f mysqlclusterenv.sh ]; then - mytop=`dirname \`/bin/pwd\`` -fi -fi -if [ "$mytop" ]; then -# we're in the development tree - if [ "$REAL_EMAIL" ]; then :; else -#Guessing REAL_EMAIL - REAL_EMAIL=`whoami`@mysql.com - export REAL_EMAIL - echo Setting REAL_EMAIL=$REAL_EMAIL - fi - - MYSQLCLUSTER_TOP=$mytop - - NDB_TOP=$MYSQLCLUSTER_TOP/ndb - export NDB_TOP - - NDB_PROJ_HOME=$NDB_TOP/home - export NDB_PROJ_HOME - - PATH=$MYSQLCLUSTER_TOP/ndb/bin:$MYSQLCLUSTER_TOP/ndb/home/bin:$PATH - PATH=$MYSQLCLUSTER_TOP/client:$PATH - PATH=$MYSQLCLUSTER_TOP/sql:$PATH - LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/libmysql:$LD_LIBRARY_PATH - LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/libmysqld:$LD_LIBRARY_PATH - LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/ndb/lib:$LD_LIBRARY_PATH - LD_LIBRARY_PATH=$MYSQLCLUSTER_TOP/libmysql_r/.libs:$LD_LIBRARY_PATH - export MYSQLCLUSTER_TOP PATH LD_LIBRARY_PATH -else - echo "Please source this file (mysqlclusterenv.sh) from installation top directory" -fi -fi -mytop= diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index 69eb4f53d7f..bed43438e91 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -7,12 +7,12 @@ ndblib_LTLIBRARIES = libndbclient.la libndbclient_la_SOURCES = libndbclient_la_LIBADD = \ - $(top_srcdir)/ndb/src/ndbapi/libndbapi.la \ - $(top_srcdir)/ndb/src/common/transporter/libtransporter.la \ - $(top_srcdir)/ndb/src/common/debugger/libtrace.la \ - $(top_srcdir)/ndb/src/common/debugger/signaldata/libsignaldataprint.la \ - $(top_srcdir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \ - $(top_srcdir)/ndb/src/mgmapi/libmgmapi.la \ - $(top_srcdir)/ndb/src/common/logger/liblogger.la \ - $(top_srcdir)/ndb/src/common/portlib/unix/libportlib.la \ - $(top_srcdir)/ndb/src/common/util/libgeneral.la + ndbapi/libndbapi.la \ + common/transporter/libtransporter.la \ + common/debugger/libtrace.la \ + common/debugger/signaldata/libsignaldataprint.la \ + common/mgmcommon/libmgmsrvcommon.la \ + mgmapi/libmgmapi.la \ + common/logger/liblogger.la \ + common/portlib/libportlib.la \ + common/util/libgeneral.la diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am index 9ccf6f4350c..7fcf2cab636 100644 --- a/ndb/src/common/Makefile.am +++ b/ndb/src/common/Makefile.am @@ -8,6 +8,6 @@ libcommon_la_LIBADD = \ debugger/libtrace.la \ debugger/signaldata/libsignaldataprint.la \ mgmcommon/libmgmsrvcommon.la \ - portlib/unix/libportlib.la \ + portlib/libportlib.la \ logger/liblogger.la \ util/libgeneral.la diff --git a/ndb/src/common/debugger/signaldata/BackupImpl.cpp b/ndb/src/common/debugger/signaldata/BackupImpl.cpp index be9e43e3df1..bdc34d614cf 100644 --- a/ndb/src/common/debugger/signaldata/BackupImpl.cpp +++ b/ndb/src/common/debugger/signaldata/BackupImpl.cpp @@ -24,7 +24,7 @@ printDEFINE_BACKUP_REQ(FILE * out, const Uint32 * data, Uint32 len, Uint16 bno){ sig->backupPtr, sig->backupId, sig->clientRef, sig->clientData); fprintf(out, " backupKey: [ %08x%08x ] DataLength: %d\n", sig->backupKey[0], sig->backupKey[1], sig->backupDataLen); - char buf[sig->nodes.TextLength + 1]; + char buf[_NDB_NODE_BITMASK_SIZE * 8 + 1]; fprintf(out, " Nodes: %s\n", sig->nodes.getText(buf)); return true; } diff --git a/ndb/src/common/debugger/signaldata/CreateTrig.cpp b/ndb/src/common/debugger/signaldata/CreateTrig.cpp index d8360dec4d5..ddd45080cba 100644 --- a/ndb/src/common/debugger/signaldata/CreateTrig.cpp +++ b/ndb/src/common/debugger/signaldata/CreateTrig.cpp @@ -87,7 +87,7 @@ bool printCREATE_TRIG_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uin fprintf(output, "Monitor all attributes: %s ", (sig->getMonitorAllAttributes())?"true":"false"); const AttributeMask& attributeMask = sig->getAttributeMask(); - char buf[attributeMask.TextLength + 1]; + char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1]; fprintf(output, "Attribute mask: %s", attributeMask.getText(buf)); fprintf(output, "\n"); diff --git a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp index ad9cb623c17..9b32fab87ba 100644 --- a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp @@ -59,10 +59,10 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData, sig->numberOfPages); fprintf(output, " pageData: "); - + unsigned int i; switch(sig->getFormatFlag(sig->operationFlag)){ case FsReadWriteReq::fsFormatListOfPairs: - for (unsigned int i = 0; i < sig->numberOfPages*2; i += 2){ + for (i= 0; i < sig->numberOfPages*2; i += 2){ fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[i], sig->data.pageData[i + 1]); } @@ -72,7 +72,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData, sig->data.pageData[1]); break; case FsReadWriteReq::fsFormatListOfMemPages: - for (unsigned int i = 0; i < (sig->numberOfPages + 1); i++){ + for (i= 0; i < (sig->numberOfPages + 1); i++){ fprintf(output, " H\'%.8x, ", sig->data.pageData[i]); } break; diff --git a/ndb/src/common/debugger/signaldata/TuxMaint.cpp b/ndb/src/common/debugger/signaldata/TuxMaint.cpp index 06ac475382c..ba6a299b77d 100644 --- a/ndb/src/common/debugger/signaldata/TuxMaint.cpp +++ b/ndb/src/common/debugger/signaldata/TuxMaint.cpp @@ -24,10 +24,10 @@ printTUX_MAINT_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn) //const bool inOut = rbn & (1 << 15); const TuxMaintReq* const sig = (const TuxMaintReq*)theData; fprintf(output, " errorCode=%d\n", sig->errorCode); - fprintf(output, " table: id=%d", sig->tableId); - fprintf(output, " index: id=%d", sig->indexId); - fprintf(output, " fragment: id=%d\n", sig->fragId); - fprintf(output, " tuple: addr=0x%x version=%d\n", sig->tupAddr, sig->tupVersion); + fprintf(output, " table: id=%u", sig->tableId); + fprintf(output, " index: id=%u", sig->indexId); + fprintf(output, " fragment: id=%u\n", sig->fragId); + fprintf(output, " tuple: loc=%u.%u version=%u\n", sig->pageId, sig->pageOffset, sig->tupVersion); const Uint32 opCode = sig->opInfo & 0xFF; const Uint32 opFlag = sig->opInfo >> 8; switch (opCode ) { diff --git a/ndb/src/common/mgmcommon/ConfigInfo.cpp b/ndb/src/common/mgmcommon/ConfigInfo.cpp index 57d1a2fe8fd..c2b5fdabf01 100644 --- a/ndb/src/common/mgmcommon/ConfigInfo.cpp +++ b/ndb/src/common/mgmcommon/ConfigInfo.cpp @@ -143,6 +143,19 @@ ConfigInfo::m_SectionRules[] = { }; const int ConfigInfo::m_NoOfRules = sizeof(m_SectionRules)/sizeof(SectionRule); +/**************************************************************************** + * Config Rules declarations + ****************************************************************************/ +bool addNodeConnections(Vector<ConfigInfo::ConfigRuleSection>§ions, + struct InitConfigFileParser::Context &ctx, + const char * ruleData); + +const ConfigInfo::ConfigRule +ConfigInfo::m_ConfigRules[] = { + { addNodeConnections, 0 }, + { 0, 0 } +}; + struct DepricationTransform { const char * m_section; const char * m_oldName; @@ -602,7 +615,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::INT64, 3000 * 8192, 128 * 8192, - 192000 * 8192 }, + ((Uint64)192000) * ((Uint64)8192) }, { KEY_INTERNAL, @@ -638,7 +651,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::INT64, 10000 * 8192, 128 * 8192, - 400000 * 8192 }, + ((Uint64)400000) * ((Uint64)8192) }, { KEY_INTERNAL, @@ -888,6 +901,19 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { 1, 0x7FFFFFFF }, + + { + CFG_DB_DISCLESS, + "Discless", + "DB", + "Run wo/ disk", + ConfigInfo::USED, + true, + ConfigInfo::BOOL, + 0, + 0, + 1}, + { CFG_DB_ARBIT_TIMEOUT, "ArbitrationTimeout", @@ -1512,7 +1538,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::USED, false, ConfigInfo::INT, - MANDATORY, + 2202, 0, 0x7FFFFFFF }, @@ -2446,6 +2472,8 @@ void ConfigInfo::print(const Properties * section, } ndbout << endl; break; + case ConfigInfo::SECTION: + break; } } @@ -2495,13 +2523,15 @@ fixNodeHostname(InitConfigFileParser::Context & ctx, const char * data){ ctx.reportError("Computer \"%s\" not declared" "- [%s] starting at line: %d", compId, ctx.fname, ctx.m_sectionLineno); + return false; } const char * hostname; if(!computer->get("HostName", &hostname)){ - ctx.reportError("HostName missing in [COMPUTER] Id: %s" - "- [%s] starting at line: %d", + ctx.reportError("HostName missing in [COMPUTER] (Id: %d) " + " - [%s] starting at line: %d", compId, ctx.fname, ctx.m_sectionLineno); + return false; } require(ctx.m_currentSection->put("HostName", hostname)); @@ -2643,6 +2673,8 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, ctx.m_currentSection->put(name, val); break; } + case ConfigInfo::SECTION: + break; } } } @@ -2693,13 +2725,13 @@ checkMandatory(InitConfigFileParser::Context & ctx, const char * data){ * Transform a string "NodeidX" (e.g. "uppsala.32") * into a Uint32 "NodeIdX" (e.g. 32) and a string "SystemX" (e.g. "uppsala"). */ -bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data){ - +bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data) +{ char buf[] = "NodeIdX"; buf[6] = data[sizeof("NodeI")]; char sysbuf[] = "SystemX"; sysbuf[6] = data[sizeof("NodeI")]; const char* nodeId; require(ctx.m_currentSection->get(buf, &nodeId)); - + char tmpLine[MAX_LINE_LENGTH]; strncpy(tmpLine, nodeId, MAX_LINE_LENGTH); char* token1 = strtok(tmpLine, "."); @@ -2720,7 +2752,6 @@ bool fixNodeId(InitConfigFileParser::Context & ctx, const char * data){ require(ctx.m_currentSection->put(buf, id, true)); require(ctx.m_currentSection->put(sysbuf, token1)); } - return true; } @@ -2843,9 +2874,9 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ Uint32 adder = 0; ctx.m_userProperties.get("PortNumberAdder", &adder); Uint32 base = 0; - if(!ctx.m_userDefaults->get("PortNumber", &base) && + if(!(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base)) && !ctx.m_systemDefaults->get("PortNumber", &base)){ - return true; + return false; } ctx.m_currentSection->put("PortNumber", base + adder); adder++; @@ -3125,3 +3156,88 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ } while(0); return true; } + +bool +addNodeConnections(Vector<ConfigInfo::ConfigRuleSection>§ions, + struct InitConfigFileParser::Context &ctx, + const char * ruleData) +{ + Properties * props= ctx.m_config; + Properties p_connections; + Properties p_connections2; + + for (Uint32 i = 0;; i++){ + const Properties * tmp; + Uint32 nodeId1, nodeId2; + + if(!props->get("Connection", i, &tmp)) break; + + if(!tmp->get("NodeId1", &nodeId1)) continue; + p_connections.put("", nodeId1, nodeId1); + if(!tmp->get("NodeId2", &nodeId2)) continue; + p_connections.put("", nodeId2, nodeId2); + + p_connections2.put("", nodeId1 + nodeId2<<16, nodeId1); + p_connections2.put("", nodeId2 + nodeId1<<16, nodeId2); + } + + Uint32 nNodes; + ctx.m_userProperties.get("NoOfNodes", &nNodes); + + Properties p_db_nodes; + Properties p_api_mgm_nodes; + + Uint32 i_db= 0, i_api_mgm= 0; + for (Uint32 i= 0, n= 0; n < nNodes; i++){ + const Properties * tmp; + if(!props->get("Node", i, &tmp)) continue; + n++; + + const char * type; + if(!tmp->get("Type", &type)) continue; + + if (strcmp(type,"DB") == 0) + p_db_nodes.put("", i_db++, i); + else if (strcmp(type,"API") == 0 || + strcmp(type,"MGM") == 0) + p_api_mgm_nodes.put("", i_api_mgm++, i); + } + + Uint32 nodeId1, nodeId2, dummy; + + for (Uint32 i= 0; p_db_nodes.get("", i, &nodeId1); i++){ + for (Uint32 j= i+1;; j++){ + if(!p_db_nodes.get("", j, &nodeId2)) break; + if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { + ConfigInfo::ConfigRuleSection s; + s.m_sectionType= BaseString("TCP"); + s.m_sectionData= new Properties; + char buf[16]; + snprintf(buf, sizeof(buf), "%u", nodeId1); + s.m_sectionData->put("NodeId1", buf); + snprintf(buf, sizeof(buf), "%u", nodeId2); + s.m_sectionData->put("NodeId2", buf); + sections.push_back(s); + } + } + } + + for (Uint32 i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){ + if(!p_connections.get("", nodeId1, &dummy)) { + for (Uint32 j= 0;; j++){ + if(!p_db_nodes.get("", j, &nodeId2)) break; + ConfigInfo::ConfigRuleSection s; + s.m_sectionType= BaseString("TCP"); + s.m_sectionData= new Properties; + char buf[16]; + snprintf(buf, sizeof(buf), "%u", nodeId1); + s.m_sectionData->put("NodeId1", buf); + snprintf(buf, sizeof(buf), "%u", nodeId2); + s.m_sectionData->put("NodeId2", buf); + sections.push_back(s); + } + } + } + + return true; +} diff --git a/ndb/src/common/mgmcommon/ConfigInfo.hpp b/ndb/src/common/mgmcommon/ConfigInfo.hpp index b5e011ed398..79c17b436fe 100644 --- a/ndb/src/common/mgmcommon/ConfigInfo.hpp +++ b/ndb/src/common/mgmcommon/ConfigInfo.hpp @@ -71,6 +71,21 @@ public: const char * m_ruleData; }; + /** + * Entry for config rule + */ + struct ConfigRuleSection { + BaseString m_sectionType; + Properties * m_sectionData; + }; + + struct ConfigRule { + bool (* m_configRule)(Vector<ConfigRuleSection>&, + struct InitConfigFileParser::Context &, + const char * m_ruleData); + const char * m_ruleData; + }; + ConfigInfo(); /** @@ -113,6 +128,7 @@ private: public: static const SectionRule m_SectionRules[]; + static const ConfigRule m_ConfigRules[]; static const int m_NoOfRules; }; diff --git a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp index d01b8189545..d52bc54db52 100644 --- a/ndb/src/common/mgmcommon/InitConfigFileParser.cpp +++ b/ndb/src/common/mgmcommon/InitConfigFileParser.cpp @@ -22,7 +22,7 @@ #include <NdbOut.hpp> #include "ConfigInfo.hpp" -const int MAX_LINE_LENGTH = 120; // Max length of line of text in config file +const int MAX_LINE_LENGTH = 1024; // Max length of line of text in config file static void trim(char *); static void require(bool v) { if(!v) abort();} @@ -163,6 +163,30 @@ InitConfigFileParser::parseConfig(FILE * file) { return 0; } + for(size_t i = 0; ConfigInfo::m_ConfigRules[i].m_configRule != 0; i++){ + ctx.type = InitConfigFileParser::Undefined; + ctx.m_currentSection = 0; + ctx.m_userDefaults = 0; + ctx.m_currentInfo = 0; + ctx.m_systemDefaults = 0; + + Vector<ConfigInfo::ConfigRuleSection> tmp; + if(!(* ConfigInfo::m_ConfigRules[i].m_configRule)(tmp, ctx, + ConfigInfo::m_ConfigRules[i].m_ruleData)) + return 0; + + for(size_t j = 0; j<tmp.size(); j++){ + snprintf(ctx.fname, sizeof(ctx.fname), tmp[j].m_sectionType.c_str()); + ctx.type = InitConfigFileParser::Section; + ctx.m_currentSection = tmp[j].m_sectionData; + ctx.m_userDefaults = getSection(ctx.fname, ctx.m_defaults); + ctx.m_currentInfo = m_info->getInfo(ctx.fname); + ctx.m_systemDefaults = m_info->getDefaults(ctx.fname); + if(!storeSection(ctx)) + return 0; + } + } + Uint32 nConnections = 0; Uint32 nComputers = 0; Uint32 nNodes = 0; @@ -305,7 +329,7 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, } if (!m_info->verify(ctx.m_currentInfo, fname, value_int)) { ctx.reportError("Illegal value %s for parameter %s.\n" - "Legal values are between %d and %d", value, fname, + "Legal values are between %Lu and %Lu", value, fname, m_info->getMin(ctx.m_currentInfo, fname), m_info->getMax(ctx.m_currentInfo, fname)); return false; @@ -499,28 +523,22 @@ bool InitConfigFileParser::storeSection(Context& ctx){ if(ctx.m_currentSection == NULL) return true; - for(int i = strlen(ctx.fname) - 1; i>=0; i--){ ctx.fname[i] = toupper(ctx.fname[i]); } - snprintf(ctx.pname, sizeof(ctx.pname), ctx.fname); - char buf[255]; if(ctx.type == InitConfigFileParser::Section) snprintf(buf, sizeof(buf), "%s", ctx.fname); if(ctx.type == InitConfigFileParser::DefaultSection) snprintf(buf, sizeof(buf), "%s DEFAULT", ctx.fname); - snprintf(ctx.fname, sizeof(ctx.fname), buf); if(ctx.type == InitConfigFileParser::Section){ for(int i = 0; i<m_info->m_NoOfRules; i++){ const ConfigInfo::SectionRule & rule = m_info->m_SectionRules[i]; - if(!strcmp(rule.m_section, "*") || !strcmp(rule.m_section, ctx.fname)){ - if(!(* rule.m_sectionRule)(ctx, rule.m_ruleData)){ + if(!strcmp(rule.m_section, "*") || !strcmp(rule.m_section, ctx.fname)) + if(!(* rule.m_sectionRule)(ctx, rule.m_ruleData)) return false; - } - } } } diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index f39cae194d1..e6ecb30fe04 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -1,5 +1,18 @@ -SUBDIRS = unix - noinst_HEADERS = gcc.cpp -EXTRA_PROGRAMS =
\ No newline at end of file +noinst_LTLIBRARIES = libportlib.la + +libportlib_la_SOURCES = \ + NdbCondition.c NdbMutex.c NdbSleep.c NdbTick.c \ + NdbEnv.c NdbThread.c NdbHost.c NdbTCP.c \ + NdbDaemon.c NdbMem.c + +include $(top_srcdir)/ndb/config/common.mk.am +include $(top_srcdir)/ndb/config/type_util.mk.am + +EXTRA_PROGRAMS = memtest PortLibTest munmaptest + +PortLibTest_SOURCES = NdbPortLibTest.cpp +munmaptest_SOURCES = munmaptest.cpp + +# Don't update the files from bitkeeper diff --git a/ndb/src/common/portlib/unix/NdbCondition.c b/ndb/src/common/portlib/NdbCondition.c index 1d229bdcdef..1d229bdcdef 100644 --- a/ndb/src/common/portlib/unix/NdbCondition.c +++ b/ndb/src/common/portlib/NdbCondition.c diff --git a/ndb/src/common/portlib/unix/NdbDaemon.c b/ndb/src/common/portlib/NdbDaemon.c index d8d33595156..d8d33595156 100644 --- a/ndb/src/common/portlib/unix/NdbDaemon.c +++ b/ndb/src/common/portlib/NdbDaemon.c diff --git a/ndb/src/common/portlib/unix/NdbEnv.c b/ndb/src/common/portlib/NdbEnv.c index d294e0b52ca..d294e0b52ca 100644 --- a/ndb/src/common/portlib/unix/NdbEnv.c +++ b/ndb/src/common/portlib/NdbEnv.c diff --git a/ndb/src/common/portlib/unix/NdbHost.c b/ndb/src/common/portlib/NdbHost.c index 4749bb39ea7..4749bb39ea7 100644 --- a/ndb/src/common/portlib/unix/NdbHost.c +++ b/ndb/src/common/portlib/NdbHost.c diff --git a/ndb/src/common/portlib/unix/NdbMem.c b/ndb/src/common/portlib/NdbMem.c index 0b06e5b23f1..0b06e5b23f1 100644 --- a/ndb/src/common/portlib/unix/NdbMem.c +++ b/ndb/src/common/portlib/NdbMem.c diff --git a/ndb/src/common/portlib/unix/NdbMutex.c b/ndb/src/common/portlib/NdbMutex.c index 50f314d2683..50f314d2683 100644 --- a/ndb/src/common/portlib/unix/NdbMutex.c +++ b/ndb/src/common/portlib/NdbMutex.c diff --git a/ndb/src/common/portlib/test/NdbPortLibTest.cpp b/ndb/src/common/portlib/NdbPortLibTest.cpp index 55b9ccec5f2..55b9ccec5f2 100644 --- a/ndb/src/common/portlib/test/NdbPortLibTest.cpp +++ b/ndb/src/common/portlib/NdbPortLibTest.cpp diff --git a/ndb/src/common/portlib/unix/NdbSleep.c b/ndb/src/common/portlib/NdbSleep.c index 8702a25d1b1..8702a25d1b1 100644 --- a/ndb/src/common/portlib/unix/NdbSleep.c +++ b/ndb/src/common/portlib/NdbSleep.c diff --git a/ndb/src/common/portlib/unix/NdbTCP.c b/ndb/src/common/portlib/NdbTCP.c index 287dc6c2ecd..287dc6c2ecd 100644 --- a/ndb/src/common/portlib/unix/NdbTCP.c +++ b/ndb/src/common/portlib/NdbTCP.c diff --git a/ndb/src/common/portlib/unix/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index b023e851d29..8683a37edcb 100644 --- a/ndb/src/common/portlib/unix/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -58,7 +58,9 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, pthread_attr_setguardsize(&thread_attr, 2048); #endif +#ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */ pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); +#endif result = pthread_create(&tmpThread->thread, &thread_attr, p_thread_func, diff --git a/ndb/src/common/portlib/unix/NdbTick.c b/ndb/src/common/portlib/NdbTick.c index d8f0b6ec27a..d8f0b6ec27a 100644 --- a/ndb/src/common/portlib/unix/NdbTick.c +++ b/ndb/src/common/portlib/NdbTick.c diff --git a/ndb/src/common/portlib/memtest/memtest.c b/ndb/src/common/portlib/memtest.c index 059a4ec025e..059a4ec025e 100644 --- a/ndb/src/common/portlib/memtest/memtest.c +++ b/ndb/src/common/portlib/memtest.c diff --git a/ndb/src/common/portlib/mmstest/mmslist.cpp b/ndb/src/common/portlib/mmslist.cpp index 05538785293..05538785293 100644 --- a/ndb/src/common/portlib/mmstest/mmslist.cpp +++ b/ndb/src/common/portlib/mmslist.cpp diff --git a/ndb/src/common/portlib/mmstest/mmstest.cpp b/ndb/src/common/portlib/mmstest.cpp index 9cc7d810985..9cc7d810985 100644 --- a/ndb/src/common/portlib/mmstest/mmstest.cpp +++ b/ndb/src/common/portlib/mmstest.cpp diff --git a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp b/ndb/src/common/portlib/munmaptest.cpp index b1d84131810..b1d84131810 100644 --- a/ndb/src/common/portlib/memtest/munmaptest/munmaptest.cpp +++ b/ndb/src/common/portlib/munmaptest.cpp diff --git a/ndb/src/common/portlib/memtest/Makefile b/ndb/src/common/portlib/old_dirs/memtest/Makefile index 716cdbdea82..716cdbdea82 100644 --- a/ndb/src/common/portlib/memtest/Makefile +++ b/ndb/src/common/portlib/old_dirs/memtest/Makefile diff --git a/ndb/src/common/portlib/memtest/munmaptest/Makefile b/ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile index ea8c5238d1c..ea8c5238d1c 100644 --- a/ndb/src/common/portlib/memtest/munmaptest/Makefile +++ b/ndb/src/common/portlib/old_dirs/memtest/munmaptest/Makefile diff --git a/ndb/src/common/portlib/ose/Makefile b/ndb/src/common/portlib/old_dirs/ose/Makefile index 4ef93b7824a..4ef93b7824a 100644 --- a/ndb/src/common/portlib/ose/Makefile +++ b/ndb/src/common/portlib/old_dirs/ose/Makefile diff --git a/ndb/src/common/portlib/ose/NdbCondition.c b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c index 73a2dbc5d66..73a2dbc5d66 100644 --- a/ndb/src/common/portlib/ose/NdbCondition.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbCondition.c diff --git a/ndb/src/common/portlib/ose/NdbConditionOSE.h b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h index bd0306261cc..bd0306261cc 100644 --- a/ndb/src/common/portlib/ose/NdbConditionOSE.h +++ b/ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h diff --git a/ndb/src/common/portlib/ose/NdbEnv.c b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c index e2ac4d879d2..e2ac4d879d2 100644 --- a/ndb/src/common/portlib/ose/NdbEnv.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbEnv.c diff --git a/ndb/src/common/portlib/ose/NdbHost.c b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c index f5e1e511c16..f5e1e511c16 100644 --- a/ndb/src/common/portlib/ose/NdbHost.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbHost.c diff --git a/ndb/src/common/portlib/ose/NdbMem.c b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c index 0e38024bbb4..0e38024bbb4 100644 --- a/ndb/src/common/portlib/ose/NdbMem.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem.c diff --git a/ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp index cad22c0474b..cad22c0474b 100644 --- a/ndb/src/common/portlib/ose/NdbMem_SoftOse.cpp +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp diff --git a/ndb/src/common/portlib/ose/NdbMutex.c b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c index 253c0e412ff..253c0e412ff 100644 --- a/ndb/src/common/portlib/ose/NdbMutex.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbMutex.c diff --git a/ndb/src/common/portlib/ose/NdbOut.cpp b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp index eb81bc9d971..eb81bc9d971 100644 --- a/ndb/src/common/portlib/ose/NdbOut.cpp +++ b/ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp diff --git a/ndb/src/common/portlib/ose/NdbSleep.c b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c index 70fd83117ef..70fd83117ef 100644 --- a/ndb/src/common/portlib/ose/NdbSleep.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbSleep.c diff --git a/ndb/src/common/portlib/ose/NdbTCP.c b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c index 9994697b3f8..9994697b3f8 100644 --- a/ndb/src/common/portlib/ose/NdbTCP.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbTCP.c diff --git a/ndb/src/common/portlib/ose/NdbThread.c b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c index e46903a5cce..e46903a5cce 100644 --- a/ndb/src/common/portlib/ose/NdbThread.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbThread.c diff --git a/ndb/src/common/portlib/ose/NdbTick.c b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c index c3deae2bec3..c3deae2bec3 100644 --- a/ndb/src/common/portlib/ose/NdbTick.c +++ b/ndb/src/common/portlib/old_dirs/ose/NdbTick.c diff --git a/ndb/src/common/portlib/test/Makefile b/ndb/src/common/portlib/old_dirs/test/Makefile index 4edc98ede75..4edc98ede75 100644 --- a/ndb/src/common/portlib/test/Makefile +++ b/ndb/src/common/portlib/old_dirs/test/Makefile diff --git a/ndb/src/common/portlib/unix/Makefile_old b/ndb/src/common/portlib/old_dirs/unix/Makefile_old index 452196d9f08..452196d9f08 100644 --- a/ndb/src/common/portlib/unix/Makefile_old +++ b/ndb/src/common/portlib/old_dirs/unix/Makefile_old diff --git a/ndb/src/common/portlib/win32/Makefile b/ndb/src/common/portlib/old_dirs/win32/Makefile index bb29ac5547e..bb29ac5547e 100644 --- a/ndb/src/common/portlib/win32/Makefile +++ b/ndb/src/common/portlib/old_dirs/win32/Makefile diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c index 77869b673de..77869b673de 100644 --- a/ndb/src/common/portlib/win32/NdbCondition.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbCondition.c diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c index 972fb1b88d8..972fb1b88d8 100644 --- a/ndb/src/common/portlib/win32/NdbDaemon.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c index 0df703a5e97..0df703a5e97 100644 --- a/ndb/src/common/portlib/win32/NdbEnv.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbEnv.c diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c index f91dd1a531c..f91dd1a531c 100644 --- a/ndb/src/common/portlib/win32/NdbHost.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbHost.c diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c index ab7123b0a29..ab7123b0a29 100644 --- a/ndb/src/common/portlib/win32/NdbMem.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbMem.c diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c index e797024d5bb..e797024d5bb 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbMutex.c diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c index ac0f44dd07f..ac0f44dd07f 100644 --- a/ndb/src/common/portlib/win32/NdbSleep.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbSleep.c diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c index 483a53bd606..483a53bd606 100644 --- a/ndb/src/common/portlib/win32/NdbTCP.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbTCP.c diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c index 1f052f034e8..1f052f034e8 100644 --- a/ndb/src/common/portlib/win32/NdbThread.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbThread.c diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c index e3a67d8437d..e3a67d8437d 100644 --- a/ndb/src/common/portlib/win32/NdbTick.c +++ b/ndb/src/common/portlib/old_dirs/win32/NdbTick.c diff --git a/ndb/src/common/portlib/unix/Makefile.am b/ndb/src/common/portlib/unix/Makefile.am deleted file mode 100644 index f50d46c1873..00000000000 --- a/ndb/src/common/portlib/unix/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ - -noinst_LTLIBRARIES = libportlib.la - -libportlib_la_SOURCES = \ - NdbCondition.c NdbMutex.c NdbSleep.c NdbTick.c \ - NdbEnv.c NdbThread.c NdbHost.c NdbTCP.c \ - NdbDaemon.c NdbMem.c - -include $(top_srcdir)/ndb/config/common.mk.am -include $(top_srcdir)/ndb/config/type_util.mk.am - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/ndb/src/common/util/ConfigValues.cpp b/ndb/src/common/util/ConfigValues.cpp index 948b96135fd..18ecf4bcdc4 100644 --- a/ndb/src/common/util/ConfigValues.cpp +++ b/ndb/src/common/util/ConfigValues.cpp @@ -193,7 +193,7 @@ ConfigValues::Iterator::set(Uint32 key, const char * value){ char * & str = m_cfg.getString(m_cfg.m_values[pos+1]); free(str); - str = strdup(value); + str = strdup(value ? value : ""); return true; } @@ -457,7 +457,7 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){ case ConfigValues::StringType:{ Uint32 index = m_cfg->m_stringCount++; m_cfg->m_values[pos+1] = index; - m_cfg->getString(index) = strdup(entry.m_string); + m_cfg->getString(index) = strdup(entry.m_string ? entry.m_string : ""); m_freeKeys--; m_freeData -= sizeof(char *); DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value(%d): %s\n", diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index e91ade374cf..e34d6d18539 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -155,6 +155,14 @@ NdbSqlUtil::m_typeList[] = { { Type::Timespec, NULL // cmpTimespec + }, + { + Type::Blob, + NULL // cmpDatetime + }, + { + Type::Clob, + cmpClob } }; @@ -284,6 +292,18 @@ NdbSqlUtil::cmpTimespec(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 return cmp(Type::Timespec, p1, p2, full, size); } +int +NdbSqlUtil::cmpBlob(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + return cmp(Type::Blob, p1, p2, full, size); +} + +int +NdbSqlUtil::cmpClob(const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + return cmp(Type::Clob, p1, p2, full, size); +} + #ifdef NDB_SQL_UTIL_TEST #include <NdbTick.h> diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am index 090f115301d..6345bae9bbe 100644 --- a/ndb/src/cw/cpcd/Makefile.am +++ b/ndb/src/cw/cpcd/Makefile.am @@ -3,12 +3,12 @@ ndbtools_PROGRAMS = ndb_cpcd ndb_cpcd_SOURCES = main.cpp CPCD.cpp Process.cpp APIService.cpp Monitor.cpp common.cpp -LDADD_LOC = $(top_srcdir)/ndb/src/libndbclient.la +LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am -AM_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 7f2f33bd8e5..b2aa5f2e074 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -45,14 +45,14 @@ LDADD += \ blocks/dbtux/libdbtux.a \ vm/libkernel.a \ error/liberror.a \ - $(top_srcdir)/ndb/src/common/transporter/libtransporter.la \ - $(top_srcdir)/ndb/src/common/debugger/libtrace.la \ - $(top_srcdir)/ndb/src/common/debugger/signaldata/libsignaldataprint.la \ - $(top_srcdir)/ndb/src/common/logger/liblogger.la \ - $(top_srcdir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \ - $(top_srcdir)/ndb/src/mgmapi/libmgmapi.la \ - $(top_srcdir)/ndb/src/common/portlib/unix/libportlib.la \ - $(top_srcdir)/ndb/src/common/util/libgeneral.la + $(top_builddir)/ndb/src/common/transporter/libtransporter.la \ + $(top_builddir)/ndb/src/common/debugger/libtrace.la \ + $(top_builddir)/ndb/src/common/debugger/signaldata/libsignaldataprint.la \ + $(top_builddir)/ndb/src/common/logger/liblogger.la \ + $(top_builddir)/ndb/src/common/mgmcommon/libmgmsrvcommon.la \ + $(top_builddir)/ndb/src/mgmapi/libmgmapi.la \ + $(top_builddir)/ndb/src/common/portlib/libportlib.la \ + $(top_builddir)/ndb/src/common/util/libgeneral.la # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/src/kernel/SimBlockList.cpp b/ndb/src/kernel/SimBlockList.cpp index bc6262e0723..c41b17e1919 100644 --- a/ndb/src/kernel/SimBlockList.cpp +++ b/ndb/src/kernel/SimBlockList.cpp @@ -72,14 +72,15 @@ SimBlockList::load(const Configuration & conf){ SimulatedBlock * fs = 0; { - char buf[100]; - if(NdbEnv_GetEnv("NDB_NOFS", buf, 100) == 0){ - fs = new (A_VALUE) Ndbfs(conf); - } else { + Uint32 dl; + const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator(); + if(p && !ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) && dl){ fs = new (A_VALUE) VoidFs(conf); + } else { + fs = new (A_VALUE) Ndbfs(conf); } } - + theList[0] = new (A_VALUE) Dbacc(conf); theList[1] = new (A_VALUE) Cmvmi(conf); theList[2] = fs; diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/src/kernel/blocks/backup/restore/Makefile.am index a3ff9402bb2..e0429c60723 100644 --- a/ndb/src/kernel/blocks/backup/restore/Makefile.am +++ b/ndb/src/kernel/blocks/backup/restore/Makefile.am @@ -1,12 +1,12 @@ ndbtools_PROGRAMS = ndb_restore -ndb_restore_SOURCES = main.cpp Restore.cpp +ndb_restore_SOURCES = main.cpp consumer.cpp consumer_restore.cpp consumer_printer.cpp Restore.cpp -LDADD_LOC = $(top_srcdir)/ndb/src/libndbclient.la +LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la include $(top_srcdir)/ndb/config/common.mk.am INCLUDES += -I.. -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -I$(top_srcdir)/ndb/src/ndbapi -I$(top_srcdir)/ndb/include/ndbapi -I$(top_srcdir)/ndb/include/util -I$(top_srcdir)/ndb/include/portlib -I$(top_srcdir)/ndb/include/kernel -AM_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile_old b/ndb/src/kernel/blocks/backup/restore/Makefile_old deleted file mode 100644 index 4c884525d73..00000000000 --- a/ndb/src/kernel/blocks/backup/restore/Makefile_old +++ /dev/null @@ -1,20 +0,0 @@ -include .defs.mk - -TYPE := * - -BIN_TARGET := restore -BIN_TARGET_LIBS := -BIN_TARGET_ARCHIVES := NDB_API - -CCFLAGS_LOC = -I.. -I$(NDB_TOP)/src/ndbapi -I$(NDB_TOP)/include/ndbapi -I$(NDB_TOP)/include/util -I$(NDB_TOP)/include/portlib -I$(NDB_TOP)/include/kernel - -#ifneq ($(MYSQLCLUSTER_TOP),) -#CCFLAGS_LOC +=-I$(MYSQLCLUSTER_TOP)/include -D USE_MYSQL -#LDFLAGS_LOC += -L$(MYSQLCLUSTER_TOP)/libmysql_r/ -lmysqlclient_r -#endif - -SOURCES = main.cpp Restore.cpp - -include $(NDB_TOP)/Epilogue.mk - - diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/src/kernel/blocks/backup/restore/Restore.cpp index 04f82ce91d0..24d2cfbfe35 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.cpp @@ -33,32 +33,32 @@ Uint32 Twiddle32(Uint32 in); // Byte shift 32-bit data Uint64 Twiddle64(Uint64 in); // Byte shift 64-bit data bool -BackupFile::Twiddle(AttributeS* attr, Uint32 arraySize){ +BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Uint32 arraySize){ if(m_hostByteOrder) return true; if(arraySize == 0){ - arraySize = attr->Desc->arraySize; + arraySize = attr_desc->arraySize; } - switch(attr->Desc->size){ + switch(attr_desc->size){ case 8: return true; case 16: for(unsigned i = 0; i<arraySize; i++){ - attr->Data.u_int16_value[i] = Twiddle16(attr->Data.u_int16_value[i]); + attr_data->u_int16_value[i] = Twiddle16(attr_data->u_int16_value[i]); } return true; case 32: for(unsigned i = 0; i<arraySize; i++){ - attr->Data.u_int32_value[i] = Twiddle32(attr->Data.u_int32_value[i]); + attr_data->u_int32_value[i] = Twiddle32(attr_data->u_int32_value[i]); } return true; case 64: for(unsigned i = 0; i<arraySize; i++){ - attr->Data.u_int64_value[i] = Twiddle64(attr->Data.u_int64_value[i]); + attr_data->u_int64_value[i] = Twiddle64(attr_data->u_int64_value[i]); } return true; default: @@ -82,14 +82,14 @@ RestoreMetaData::RestoreMetaData(const char* path, Uint32 nodeId, Uint32 bNo) { } RestoreMetaData::~RestoreMetaData(){ - for(int i = 0; i<allTables.size(); i++) + for(Uint32 i= 0; i < allTables.size(); i++) delete allTables[i]; allTables.clear(); } const TableS * RestoreMetaData::getTable(Uint32 tableId) const { - for(int i = 0; i<allTables.size(); i++) + for(Uint32 i= 0; i < allTables.size(); i++) if(allTables[i]->getTableId() == tableId) return allTables[i]; return NULL; @@ -104,8 +104,9 @@ int RestoreMetaData::loadContent() { Uint32 noOfTables = readMetaTableList(); - if(noOfTables == 0) - return -3; + if(noOfTables == 0) { + return 1; + } for(Uint32 i = 0; i<noOfTables; i++){ if(!readMetaTableDesc()){ return 0; @@ -121,7 +122,8 @@ RestoreMetaData::readMetaTableList() { Uint32 sectionInfo[2]; - if (fread(§ionInfo, sizeof(sectionInfo), 1, m_file) != 1){ + if (buffer_read(§ionInfo, sizeof(sectionInfo), 1) != 1){ + err << "readMetaTableList read header error" << endl; return 0; } sectionInfo[0] = ntohl(sectionInfo[0]); @@ -129,11 +131,9 @@ RestoreMetaData::readMetaTableList() { const Uint32 tabCount = sectionInfo[1] - 2; - const Uint32 len = 4 * tabCount; - if(createBuffer(len) == 0) - abort(); - - if (fread(m_buffer, 1, len, m_file) != len){ + void *tmp; + if (buffer_get_ptr(&tmp, 4, tabCount) != tabCount){ + err << "readMetaTableList read tabCount error" << endl; return 0; } @@ -146,7 +146,7 @@ RestoreMetaData::readMetaTableDesc() { Uint32 sectionInfo[2]; // Read section header - if (fread(§ionInfo, sizeof(sectionInfo), 1, m_file) != 1){ + if (buffer_read(§ionInfo, sizeof(sectionInfo), 1) != 1){ err << "readMetaTableDesc read header error" << endl; return false; } // if @@ -155,20 +155,15 @@ RestoreMetaData::readMetaTableDesc() { assert(sectionInfo[0] == BackupFormat::TABLE_DESCRIPTION); - // Allocate temporary storage for dictTabInfo buffer - const Uint32 len = (sectionInfo[1] - 2); - if (createBuffer(4 * (len+1)) == NULL) { - err << "readMetaTableDesc allocation error" << endl; - return false; - } // if - // Read dictTabInfo buffer - if (fread(m_buffer, 4, len, m_file) != len){ + const Uint32 len = (sectionInfo[1] - 2); + void *ptr; + if (buffer_get_ptr(&ptr, 4, len) != len){ err << "readMetaTableDesc read error" << endl; return false; } // if - return parseTableDescriptor(m_buffer, len); + return parseTableDescriptor((Uint32*)ptr, len); } bool @@ -176,11 +171,10 @@ RestoreMetaData::readGCPEntry() { Uint32 data[4]; - BackupFormat::CtlFile::GCPEntry * dst = (BackupFormat::CtlFile::GCPEntry *)&data[0]; - if(fread(dst, 4, 4, m_file) != 4){ + if(buffer_read(dst, 4, 4) != 4){ err << "readGCPEntry read error" << endl; return false; } @@ -201,242 +195,118 @@ RestoreMetaData::readGCPEntry() { return true; } +TableS::TableS(NdbTableImpl* tableImpl) + : m_dictTable(tableImpl) +{ + m_dictTable = tableImpl; + m_noOfNullable = m_nullBitmaskSize = 0; -struct tmpTableS { - Uint32 tableId; - Uint32 schemaVersion; - Uint32 noOfAttributes; -}; // tmpTableS - -static const -SimpleProperties::SP2StructMapping -RestoreTabMap[] = { - // Map the basic stuff to begin with - DTIMAP(tmpTableS, TableId, tableId), - DTIMAP(tmpTableS, TableVersion, schemaVersion), - DTIMAP(tmpTableS, NoOfAttributes, noOfAttributes), - - DTIBREAK(AttributeName) -}; // RestoreTabMap - -static const Uint32 -TabMapSize = sizeof(RestoreTabMap) - / sizeof(SimpleProperties::SP2StructMapping); - -/** - * Use a temporary struct to keep variables in AttributeDesc private - * and DTIMAP requires all Uint32 - */ -struct tmpAttrS { - // Just the basic needed stuff is yet implemented - char name[AttrNameLenC]; - Uint32 attrId; - Uint32 type; - Uint32 nullable; - Uint32 key; - Uint32 size; - Uint32 arraySize; -}; + for (int i = 0; i < tableImpl->getNoOfColumns(); i++) + createAttr(tableImpl->getColumn(i)); +} -static const -SimpleProperties::SP2StructMapping -RestoreAttrMap[] = { - // Map the most basic properties - DTIMAP(tmpAttrS, AttributeId, attrId), - DTIMAP(tmpAttrS, AttributeType, type), - DTIMAP(tmpAttrS, AttributeNullableFlag, nullable), - DTIMAP(tmpAttrS, AttributeKeyFlag, key), - DTIMAP(tmpAttrS, AttributeSize, size), - DTIMAP(tmpAttrS, AttributeArraySize, arraySize), - DTIBREAK(AttributeEnd) -}; // RestoreAttrMap -static const Uint32 -AttrMapSize = sizeof(RestoreAttrMap) - / sizeof(SimpleProperties::SP2StructMapping); +TableS::~TableS() +{ + for (Uint32 i= 0; i < allAttributesDesc.size(); i++) + delete allAttributesDesc[i]; +} // Parse dictTabInfo buffer and pushback to to vector storage -// Using SimpleProperties (here we don't need ntohl, ref:ejonore) bool RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len) { - SimplePropertiesLinearReader it(data, len); - SimpleProperties::UnpackStatus spStatus; - - // Parse table name - if (it.getKey() != DictTabInfo::TableName) { - err << "readMetaTableDesc getKey table name error" << endl; - return false; - } // if - - char tableName[MAX_TAB_NAME_SIZE*2]; // * 2 for db and schema.-. - it.getString(tableName); + NdbTableImpl* tableImpl = 0; + int ret = NdbDictInterface::parseTableInfo(&tableImpl, data, len, false); - if (strlen(tableName) == 0) { - err << "readMetaTableDesc getString table name error" << endl; + if (ret != 0) { + err << "parseTableInfo " << " failed" << endl; return false; - } // if + } + if(tableImpl == 0) + return false; + + debug << "parseTableInfo " << tableImpl->getName() << " done" << endl; - TableS * table = new TableS(tableName); + TableS * table = new TableS(tableImpl); if(table == NULL) { return false; } - table->setBackupVersion(m_fileHeader.NdbVersion); - tmpTableS tmpTable; - spStatus = SimpleProperties::unpack(it, &tmpTable, - RestoreTabMap, TabMapSize, true, true); - if ((spStatus != SimpleProperties::Break) || - it.getKey() != DictTabInfo::AttributeName) { - err << "readMetaTableDesc sp.unpack error" << endl; - delete table; - return false; - } // if - debug << "Parsed table id " << tmpTable.tableId << endl; - table->setTableId(tmpTable.tableId); - debug << "Parsed table #attr " << tmpTable.noOfAttributes << endl; + debug << "Parsed table id " << table->getTableId() << endl; + debug << "Parsed table #attr " << table->getNoOfAttributes() << endl; debug << "Parsed table schema version not used " << endl; - for (Uint32 i = 0; i < tmpTable.noOfAttributes; i++) { - if (it.getKey() != DictTabInfo::AttributeName) { - err << "readMetaTableDesc error " << endl; - delete table; - return false; - } // if - - tmpAttrS tmpAttr; - if(it.getValueLen() > AttrNameLenC){ - err << "readMetaTableDesc attribute name too long??" << endl; - delete table; - return false; - } - it.getString(tmpAttr.name); - - spStatus = SimpleProperties::unpack(it, &tmpAttr, RestoreAttrMap, - AttrMapSize, true, true); - if ((spStatus != SimpleProperties::Break) || - (it.getKey() != DictTabInfo::AttributeEnd)) { - err << "readMetaTableDesc sp unpack attribute " << i << " error" - << endl; - delete table; - return false; - } // if - - debug << "Creating attribute " << i << " " << tmpAttr.name << endl; - - bool thisNullable = (bool)(tmpAttr.nullable); // Really not needed (now) - KeyType thisKey = (KeyType)(tmpAttr.key); // These are identical (right now) - // Convert attribute size from enum to Uint32 - // The static consts are really enum taking the value in DictTabInfo - // e.g. 3 is not ...0011 but rather ...0100 - //TODO: rather do a switch if the constants should change - Uint32 thisSize = 1 << tmpAttr.size; - // Convert attribute type to AttrType - AttrType thisType; - switch (tmpAttr.type) { - case 0: // SignedType - thisType = Signed; - break; - case 1: // UnSignedType - thisType = UnSigned; - break; - case 2: // FloatingPointType - thisType = Float; - break; - case 3: // StringType: - debug << "String type detected " << endl; - thisType = String; - break; - default: - // What, default to unsigned? - thisType = UnSigned; - break; - } // switch - /* ndbout_c << " type: " << thisType << " size: " << thisSize <<" arraySize: " - << tmpAttr.arraySize << " nullable: " << thisNullable << " key: " - << thisKey << endl; - */ - table->createAttr(tmpAttr.name, thisType, - thisSize, tmpAttr.arraySize, - thisNullable, thisKey); - if (!it.next()) { - break; - // Check number of created attributes and compare with expected - //ndbout << "readMetaTableDesc expecting more attributes" << endl; - //return false; - } // if - } // for - - debug << "Pushing table " << tableName << endl; + debug << "Pushing table " << table->getTableName() << endl; debug << " with " << table->getNoOfAttributes() << " attributes" << endl; allTables.push_back(table); - NdbTableImpl* tableImpl = 0; - int ret = NdbDictInterface::parseTableInfo(&tableImpl, data, len, false); - - if (ret != 0) { - err << "parseTableInfo " << tableName << " failed" << endl; - return false; - } - if(tableImpl == 0) - return false; - debug << "parseTableInfo " << tableName << " done" << endl; - table->m_dictTable = tableImpl; - return true; } // Constructor -RestoreDataIterator::RestoreDataIterator(const RestoreMetaData & md) - : m_metaData(md) +RestoreDataIterator::RestoreDataIterator(const RestoreMetaData & md, void (* _free_data_callback)()) + : BackupFile(_free_data_callback), m_metaData(md) { debug << "RestoreDataIterator constructor" << endl; setDataFile(md, 0); } -RestoreDataIterator::~RestoreDataIterator(){ +TupleS & TupleS::operator=(const TupleS& tuple) +{ + prepareRecord(*tuple.m_currentTable); + + if (allAttrData) + memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData)); + + return *this; +}; +int TupleS::getNoOfAttributes() const { + if (m_currentTable == 0) + return 0; + return m_currentTable->getNoOfAttributes(); +}; + +const TableS * TupleS::getTable() const { + return m_currentTable; +}; + +const AttributeDesc * TupleS::getDesc(int i) const { + return m_currentTable->allAttributesDesc[i]; } +AttributeData * TupleS::getData(int i) const{ + return &(allAttrData[i]); +}; + bool TupleS::prepareRecord(const TableS & tab){ - m_currentTable = &tab; - for(int i = 0; i<allAttributes.size(); i++) { - if(allAttributes[i] != NULL) - delete allAttributes[i]; - } - allAttributes.clear(); - AttributeS * a; - for(int i = 0; i<tab.getNoOfAttributes(); i++){ - a = new AttributeS; - if(a == NULL) { - ndbout_c("Restore: Failed to allocate memory"); - return false; + if (allAttrData) { + if (getNoOfAttributes() == tab.getNoOfAttributes()) + { + m_currentTable = &tab; + return true; } - a->Desc = tab[i]; - allAttributes.push_back(a); + delete [] allAttrData; + m_currentTable= 0; } + + allAttrData = new AttributeData[tab.getNoOfAttributes()]; + if (allAttrData == 0) + return false; + + m_currentTable = &tab; + return true; } const TupleS * -RestoreDataIterator::getNextTuple(int & res) { - TupleS * tup = new TupleS(); - if(tup == NULL) { - ndbout_c("Restore: Failed to allocate memory"); - res = -1; - return NULL; - } - if(!tup->prepareRecord(* m_currentTable)) { - res =-1; - return NULL; - } - - +RestoreDataIterator::getNextTuple(int & res) +{ Uint32 dataLength = 0; // Read record length - if (fread(&dataLength, sizeof(dataLength), 1, m_file) != 1){ + if (buffer_read(&dataLength, sizeof(dataLength), 1) != 1){ err << "getNextTuple:Error reading length of data part" << endl; - delete tup; res = -1; return NULL; } // if @@ -450,34 +320,34 @@ RestoreDataIterator::getNextTuple(int & res) { // End of this data fragment debug << "End of fragment" << endl; res = 0; - delete tup; return NULL; } // if - - tup->createDataRecord(dataLenBytes); + // Read tuple data - if (fread(tup->getDataRecord(), 1, dataLenBytes, m_file) != dataLenBytes) { + void *_buf_ptr; + if (buffer_get_ptr(&_buf_ptr, 1, dataLenBytes) != dataLenBytes) { err << "getNextTuple:Read error: " << endl; - delete tup; res = -1; return NULL; } - Uint32 * ptr = tup->getDataRecord(); + Uint32 *buf_ptr = (Uint32*)_buf_ptr, *ptr = buf_ptr; ptr += m_currentTable->m_nullBitmaskSize; - for(int i = 0; i < m_currentTable->m_fixedKeys.size(); i++){ - assert(ptr < tup->getDataRecord() + dataLength); - + for(Uint32 i= 0; i < m_currentTable->m_fixedKeys.size(); i++){ + assert(ptr < buf_ptr + dataLength); + const Uint32 attrId = m_currentTable->m_fixedKeys[i]->attrId; - AttributeS * attr = tup->allAttributes[attrId]; - const Uint32 sz = attr->Desc->getSizeInWords(); + AttributeData * attr_data = m_tuple.getData(attrId); + const AttributeDesc * attr_desc = m_tuple.getDesc(attrId); - attr->Data.null = false; - attr->Data.void_value = ptr; + const Uint32 sz = attr_desc->getSizeInWords(); - if(!Twiddle(attr)) + attr_data->null = false; + attr_data->void_value = ptr; + + if(!Twiddle(attr_desc, attr_data)) { res = -1; return NULL; @@ -485,18 +355,20 @@ RestoreDataIterator::getNextTuple(int & res) { ptr += sz; } - for(int i = 0; i<m_currentTable->m_fixedAttribs.size(); i++){ - assert(ptr < tup->getDataRecord() + dataLength); + for(Uint32 i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){ + assert(ptr < buf_ptr + dataLength); const Uint32 attrId = m_currentTable->m_fixedAttribs[i]->attrId; - AttributeS * attr = tup->allAttributes[attrId]; - const Uint32 sz = attr->Desc->getSizeInWords(); + AttributeData * attr_data = m_tuple.getData(attrId); + const AttributeDesc * attr_desc = m_tuple.getDesc(attrId); + + const Uint32 sz = attr_desc->getSizeInWords(); - attr->Data.null = false; - attr->Data.void_value = ptr; + attr_data->null = false; + attr_data->void_value = ptr; - if(!Twiddle(attr)) + if(!Twiddle(attr_desc, attr_data)) { res = -1; return NULL; @@ -505,21 +377,23 @@ RestoreDataIterator::getNextTuple(int & res) { ptr += sz; } - for(int i = 0; i<m_currentTable->m_variableAttribs.size(); i++){ + for(Uint32 i = 0; i < m_currentTable->m_variableAttribs.size(); i++){ const Uint32 attrId = m_currentTable->m_variableAttribs[i]->attrId; - AttributeS * attr = tup->allAttributes[attrId]; + + AttributeData * attr_data = m_tuple.getData(attrId); + const AttributeDesc * attr_desc = m_tuple.getDesc(attrId); - if(attr->Desc->nullable){ - const Uint32 ind = attr->Desc->m_nullBitIndex; + if(attr_desc->m_column->getNullable()){ + const Uint32 ind = attr_desc->m_nullBitIndex; if(BitmaskImpl::get(m_currentTable->m_nullBitmaskSize, - tup->getDataRecord(),ind)){ - attr->Data.null = true; - attr->Data.void_value = NULL; + buf_ptr,ind)){ + attr_data->null = true; + attr_data->void_value = NULL; continue; } } - assert(ptr < tup->getDataRecord() + dataLength); + assert(ptr < buf_ptr + dataLength); typedef BackupFormat::DataFile::VariableData VarData; VarData * data = (VarData *)ptr; @@ -527,15 +401,15 @@ RestoreDataIterator::getNextTuple(int & res) { Uint32 id = ntohl(data->Id); assert(id == attrId); - attr->Data.null = false; - attr->Data.void_value = &data->Data[0]; + attr_data->null = false; + attr_data->void_value = &data->Data[0]; /** * Compute array size */ - const Uint32 arraySize = (4 * sz) / (attr->Desc->size / 8); - assert(arraySize >= attr->Desc->arraySize); - if(!Twiddle(attr, attr->Desc->arraySize)) + const Uint32 arraySize = (4 * sz) / (attr_desc->size / 8); + assert(arraySize >= attr_desc->arraySize); + if(!Twiddle(attr_desc, attr_data, attr_desc->arraySize)) { res = -1; return NULL; @@ -546,15 +420,20 @@ RestoreDataIterator::getNextTuple(int & res) { m_count ++; res = 0; - return tup; + return &m_tuple; } // RestoreDataIterator::getNextTuple -BackupFile::BackupFile(){ +BackupFile::BackupFile(void (* _free_data_callback)()) + : free_data_callback(_free_data_callback) +{ m_file = 0; m_path[0] = 0; m_fileName[0] = 0; - m_buffer = 0; - m_bufferSize = 0; + + m_buffer_sz = 64*1024; + m_buffer = malloc(m_buffer_sz); + m_buffer_ptr = m_buffer; + m_buffer_data_left = 0; } BackupFile::~BackupFile(){ @@ -575,15 +454,54 @@ BackupFile::openFile(){ return m_file != 0; } -Uint32 * -BackupFile::createBuffer(Uint32 bytes){ - if(bytes > m_bufferSize){ - if(m_buffer != 0) - free(m_buffer); - m_bufferSize = m_bufferSize + 2 * bytes; - m_buffer = (Uint32*)malloc(m_bufferSize); +Uint32 BackupFile::buffer_get_ptr_ahead(void **p_buf_ptr, Uint32 size, Uint32 nmemb) +{ + Uint32 sz = size*nmemb; + if (sz > m_buffer_data_left) { + + if (free_data_callback) + (*free_data_callback)(); + + memcpy(m_buffer, m_buffer_ptr, m_buffer_data_left); + + size_t r = fread(((char *)m_buffer) + m_buffer_data_left, 1, m_buffer_sz - m_buffer_data_left, m_file); + m_buffer_data_left += r; + m_buffer_ptr = m_buffer; + + if (sz > m_buffer_data_left) + sz = size * (m_buffer_data_left / size); } - return m_buffer; + + *p_buf_ptr = m_buffer_ptr; + + return sz/size; +} +Uint32 BackupFile::buffer_get_ptr(void **p_buf_ptr, Uint32 size, Uint32 nmemb) +{ + Uint32 r = buffer_get_ptr_ahead(p_buf_ptr, size, nmemb); + + m_buffer_ptr = ((char*)m_buffer_ptr)+(r*size); + m_buffer_data_left -= (r*size); + + return r; +} + +Uint32 BackupFile::buffer_read_ahead(void *ptr, Uint32 size, Uint32 nmemb) +{ + void *buf_ptr; + Uint32 r = buffer_get_ptr_ahead(&buf_ptr, size, nmemb); + memcpy(ptr, buf_ptr, r*size); + + return r; +} + +Uint32 BackupFile::buffer_read(void *ptr, Uint32 size, Uint32 nmemb) +{ + void *buf_ptr; + Uint32 r = buffer_get_ptr(&buf_ptr, size, nmemb); + memcpy(ptr, buf_ptr, r*size); + + return r; } void @@ -644,7 +562,7 @@ BackupFile::readHeader(){ return false; } - if(fread(&m_fileHeader, sizeof(m_fileHeader), 1, m_file) != 1){ + if(buffer_read(&m_fileHeader, sizeof(m_fileHeader), 1) != 1){ err << "readDataFileHeader: Error reading header" << endl; return false; } @@ -692,14 +610,13 @@ BackupFile::validateFooter(){ return true; } -bool -RestoreDataIterator::readFragmentHeader(int & ret) +bool RestoreDataIterator::readFragmentHeader(int & ret) { BackupFormat::DataFile::FragmentHeader Header; debug << "RestoreDataIterator::getNextFragment" << endl; - if (fread(&Header, sizeof(Header), 1, m_file) != 1){ + if (buffer_read(&Header, sizeof(Header), 1) != 1){ ret = 0; return false; } // if @@ -722,6 +639,12 @@ RestoreDataIterator::readFragmentHeader(int & ret) return false; } + if(!m_tuple.prepareRecord(*m_currentTable)) + { + ret =-1; + return false; + } + info << "_____________________________________________________" << endl << "Restoring data in table: " << m_currentTable->getTableName() << "(" << Header.TableId << ") fragment " @@ -729,6 +652,7 @@ RestoreDataIterator::readFragmentHeader(int & ret) m_count = 0; ret = 0; + return true; } // RestoreDataIterator::getNextFragment @@ -737,7 +661,7 @@ bool RestoreDataIterator::validateFragmentFooter() { BackupFormat::DataFile::FragmentFooter footer; - if (fread(&footer, sizeof(footer), 1, m_file) != 1){ + if (buffer_read(&footer, sizeof(footer), 1) != 1){ err << "getFragmentFooter:Error reading fragment footer" << endl; return false; } @@ -755,44 +679,39 @@ RestoreDataIterator::validateFragmentFooter() { return true; } // RestoreDataIterator::getFragmentFooter -void TableS::createAttr(const char* name, - const AttrType type, - const unsigned int size, // in bytes - const unsigned int arraySize, - const bool nullable, - const KeyType key) +AttributeDesc::AttributeDesc(NdbDictionary::Column *c) + : m_column(c) { - AttributeDesc desc; - - strncpy(desc.name, name, AttrNameLenC); - desc.type = type; - desc.size = size; - desc.arraySize = arraySize; - desc.nullable = nullable; - desc.key = key; - desc.attrId = allAttributesDesc.size(); + size = c->getSize()*8; + arraySize = c->getLength(); +} - AttributeDesc * d = new AttributeDesc(desc); +void TableS::createAttr(NdbDictionary::Column *column) +{ + AttributeDesc * d = new AttributeDesc(column); if(d == NULL) { ndbout_c("Restore: Failed to allocate memory"); abort(); } - d->m_table = this; + d->attrId = allAttributesDesc.size(); allAttributesDesc.push_back(d); - if(desc.key != NoKey /* && not variable */){ + if(d->m_column->getPrimaryKey() /* && not variable */) + { m_fixedKeys.push_back(d); return; } - if(!nullable){ + + if(!d->m_column->getNullable()) + { m_fixedAttribs.push_back(d); return; } - if(nullable){ - d->m_nullBitIndex = m_noOfNullable; - m_noOfNullable++; - m_nullBitmaskSize = (m_noOfNullable + 31) / 32; - } + + /* Nullable attr*/ + d->m_nullBitIndex = m_noOfNullable; + m_noOfNullable++; + m_nullBitmaskSize = (m_noOfNullable + 31) / 32; m_variableAttribs.push_back(d); } // TableS::createAttr @@ -850,45 +769,32 @@ RestoreLogIterator::getNextLogEntry(int & res) { // Read record length typedef BackupFormat::LogFile::LogEntry LogE; - Uint32 gcp = 0; - LogE * logE = 0; - Uint32 len = ~0; + Uint32 gcp= 0; + LogE * logE= 0; + Uint32 len= ~0; const Uint32 stopGCP = m_metaData.getStopGCP(); do { - - if(createBuffer(4) == 0) { - res = -1; - return NULL; + if (buffer_read_ahead(&len, sizeof(Uint32), 1) != 1){ + res= -1; + return 0; } - + len= ntohl(len); - if (fread(m_buffer, sizeof(Uint32), 1, m_file) != 1){ - res = -1; - return NULL; + Uint32 data_len = sizeof(Uint32) + len*4; + if (buffer_get_ptr((void **)(&logE), 1, data_len) != data_len) { + res= -2; + return 0; } - m_buffer[0] = ntohl(m_buffer[0]); - len = m_buffer[0]; if(len == 0){ - res = 0; + res= 0; return 0; } - if(createBuffer(4 * (len + 1)) == 0){ - res = -1; - return NULL; - } - - if (fread(&m_buffer[1], 4, len, m_file) != len) { - res = -1; - return NULL; - } - - logE = (LogE *)&m_buffer[0]; - logE->TableId = ntohl(logE->TableId); - logE->TriggerEvent = ntohl(logE->TriggerEvent); + logE->TableId= ntohl(logE->TableId); + logE->TriggerEvent= ntohl(logE->TriggerEvent); - const bool hasGcp = (logE->TriggerEvent & 0x10000) != 0; + const bool hasGcp= (logE->TriggerEvent & 0x10000) != 0; logE->TriggerEvent &= 0xFFFF; if(hasGcp){ @@ -897,9 +803,6 @@ RestoreLogIterator::getNextLogEntry(int & res) { } } while(gcp > stopGCP + 1); - for(int i=0; i<m_logEntry.m_values.size();i++) - delete m_logEntry.m_values[i]; - m_logEntry.m_values.clear(); m_logEntry.m_table = m_metaData.getTable(logE->TableId); switch(logE->TriggerEvent){ case TriggerEvent::TE_INSERT: @@ -917,17 +820,19 @@ RestoreLogIterator::getNextLogEntry(int & res) { } const TableS * tab = m_logEntry.m_table; + m_logEntry.clear(); AttributeHeader * ah = (AttributeHeader *)&logE->Data[0]; AttributeHeader *end = (AttributeHeader *)&logE->Data[len - 2]; AttributeS * attr; while(ah < end){ - attr = new AttributeS; + attr= m_logEntry.add_attr(); if(attr == NULL) { ndbout_c("Restore: Failed to allocate memory"); res = -1; - return NULL; + return 0; } + attr->Desc = (* tab)[ah->getAttributeId()]; assert(attr->Desc != 0); @@ -940,13 +845,94 @@ RestoreLogIterator::getNextLogEntry(int & res) { attr->Data.void_value = ah->getDataPtr(); } - Twiddle(attr); - m_logEntry.m_values.push_back(attr); + Twiddle(attr->Desc, &(attr->Data)); ah = ah->getNext(); } - + m_count ++; res = 0; return &m_logEntry; } + +NdbOut & +operator<<(NdbOut& ndbout, const AttributeS& attr){ + const AttributeData & data = attr.Data; + const AttributeDesc & desc = *(attr.Desc); + + if (data.null) + { + ndbout << "<NULL>"; + return ndbout; + } + + NdbRecAttr tmprec; + tmprec.setup(desc.m_column, (char *)data.void_value); + ndbout << tmprec; + + return ndbout; +} + +// Print tuple data +NdbOut& +operator<<(NdbOut& ndbout, const TupleS& tuple) +{ + ndbout << tuple.getTable()->getTableName() << "; "; + for (int i = 0; i < tuple.getNoOfAttributes(); i++) + { + AttributeData * attr_data = tuple.getData(i); + const AttributeDesc * attr_desc = tuple.getDesc(i); + const AttributeS attr = {attr_desc, *attr_data}; + debug << i << " " << attr_desc->m_column->getName(); + ndbout << attr; + + if (i != (tuple.getNoOfAttributes() - 1)) + ndbout << delimiter << " "; + } // for + return ndbout; +} + +// Print tuple data +NdbOut& +operator<<(NdbOut& ndbout, const LogEntry& logE) +{ + switch(logE.m_type) + { + case LogEntry::LE_INSERT: + ndbout << "INSERT " << logE.m_table->getTableName() << " "; + break; + case LogEntry::LE_DELETE: + ndbout << "DELETE " << logE.m_table->getTableName() << " "; + break; + case LogEntry::LE_UPDATE: + ndbout << "UPDATE " << logE.m_table->getTableName() << " "; + break; + default: + ndbout << "Unknown log entry type (not insert, delete or update)" ; + } + + for (Uint32 i= 0; i < logE.size();i++) + { + const AttributeS * attr = logE[i]; + ndbout << attr->Desc->m_column->getName() << "="; + ndbout << (* attr); + if (i < (logE.size() - 1)) + ndbout << ", "; + } + return ndbout; +} + + +NdbOut & +operator<<(NdbOut& ndbout, const TableS & table){ + ndbout << endl << "Table: " << table.getTableName() << endl; + for (int j = 0; j < table.getNoOfAttributes(); j++) + { + const AttributeDesc * desc = table[j]; + ndbout << desc->m_column->getName() << ": " << desc->m_column->getType(); + ndbout << " key: " << desc->m_column->getPrimaryKey(); + ndbout << " array: " << desc->arraySize; + ndbout << " size: " << desc->size << endl; + } // for + return ndbout; +} diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/src/kernel/blocks/backup/restore/Restore.hpp index c01fbf67593..e9149e38e44 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp +++ b/ndb/src/kernel/blocks/backup/restore/Restore.hpp @@ -18,14 +18,15 @@ #define RESTORE_H #include <ndb_global.h> +#include <NdbOut.hpp> #include <BackupFormat.hpp> #include <NdbApi.hpp> -#include <NdbSchemaCon.hpp> -#include "myVector.hpp" #include <ndb_version.h> #include <version.h> +static const char * delimiter = ";"; // Delimiter in file dump + const int FileNameLenC = 256; const int TableNameLenC = 256; const int AttrNameLenC = 256; @@ -62,29 +63,22 @@ struct AttributeData { struct AttributeDesc { //private: - // TODO (sometimes): use a temporary variable in DTIMAP so we can - // hide AttributeDesc private variables friend class TupleS; friend class TableS; friend class RestoreDataIterator; friend class RestoreMetaData; friend struct AttributeS; - char name[AttrNameLenC]; - Uint32 attrId; - AttrType type; - bool nullable; - KeyType key; Uint32 size; // bits Uint32 arraySize; + Uint32 attrId; + NdbDictionary::Column *m_column; Uint32 m_nullBitIndex; public: - AttributeDesc() { - name[0] = 0; - } + AttributeDesc(NdbDictionary::Column *column); + AttributeDesc(); - const TableS * m_table; Uint32 getSizeInWords() const { return (size * arraySize + 31)/ 32;} }; // AttributeDesc @@ -97,19 +91,26 @@ class TupleS { private: friend class RestoreDataIterator; - const TableS * m_currentTable; - myVector<AttributeS*> allAttributes; - Uint32 * dataRecord; + const TableS *m_currentTable; + AttributeData *allAttrData; bool prepareRecord(const TableS &); public: - TupleS() {dataRecord = NULL;}; - ~TupleS() {if(dataRecord != NULL) delete [] dataRecord;}; - int getNoOfAttributes() const { return allAttributes.size(); }; - const TableS * getTable() const { return m_currentTable;}; - const AttributeS * operator[](int i) const { return allAttributes[i];}; - Uint32 * getDataRecord() { return dataRecord;}; - void createDataRecord(Uint32 bytes) { dataRecord = new Uint32[bytes];}; + TupleS() { + m_currentTable= 0; + allAttrData= 0; + }; + ~TupleS() + { + if (allAttrData) + delete [] allAttrData; + }; + TupleS(const TupleS& tuple); // disable copy constructor + TupleS & operator=(const TupleS& tuple); + int getNoOfAttributes() const; + const TableS * getTable() const; + const AttributeDesc * getDesc(int i) const; + AttributeData * getData(int i) const; }; // class TupleS class TableS { @@ -118,46 +119,28 @@ class TableS { friend class RestoreMetaData; friend class RestoreDataIterator; - Uint32 tableId; - char tableName[TableNameLenC]; Uint32 schemaVersion; Uint32 backupVersion; - myVector<AttributeDesc *> allAttributesDesc; - myVector<AttributeDesc *> m_fixedKeys; - //myVector<AttributeDesc *> m_variableKey; - myVector<AttributeDesc *> m_fixedAttribs; - myVector<AttributeDesc *> m_variableAttribs; + Vector<AttributeDesc *> allAttributesDesc; + Vector<AttributeDesc *> m_fixedKeys; + //Vector<AttributeDesc *> m_variableKey; + Vector<AttributeDesc *> m_fixedAttribs; + Vector<AttributeDesc *> m_variableAttribs; Uint32 m_noOfNullable; Uint32 m_nullBitmaskSize; int pos; - char create_string[2048]; - /* - char mysqlTableName[1024]; - char mysqlDatabaseName[1024]; - */ - void createAttr(const char* name, - const AttrType type, - const unsigned int size, // in bits - const unsigned int arraySize, - const bool nullable, - const KeyType key); + void createAttr(NdbDictionary::Column *column); public: class NdbDictionary::Table* m_dictTable; - TableS (const char * name){ - snprintf(tableName, sizeof(tableName), name); - m_noOfNullable = m_nullBitmaskSize = 0; - } + TableS (class NdbTableImpl* dictTable); + ~TableS(); - void setTableId (Uint32 id) { - tableId = id; - } - Uint32 getTableId() const { - return tableId; + return m_dictTable->getTableId(); } /* void setMysqlTableName(char * tableName) { @@ -174,7 +157,6 @@ public: void setBackupVersion(Uint32 version) { backupVersion = version; } - Uint32 getBackupVersion() const { return backupVersion; @@ -208,18 +190,26 @@ protected: BackupFormat::FileHeader m_expectedFileHeader; Uint32 m_nodeId; - Uint32 * m_buffer; - Uint32 m_bufferSize; - Uint32 * createBuffer(Uint32 bytes); + void * m_buffer; + void * m_buffer_ptr; + Uint32 m_buffer_sz; + Uint32 m_buffer_data_left; + void (* free_data_callback)(); + bool openFile(); void setCtlFile(Uint32 nodeId, Uint32 backupId, const char * path); void setDataFile(const BackupFile & bf, Uint32 no); void setLogFile(const BackupFile & bf, Uint32 no); + Uint32 buffer_get_ptr(void **p_buf_ptr, Uint32 size, Uint32 nmemb); + Uint32 buffer_read(void *ptr, Uint32 size, Uint32 nmemb); + Uint32 buffer_get_ptr_ahead(void **p_buf_ptr, Uint32 size, Uint32 nmemb); + Uint32 buffer_read_ahead(void *ptr, Uint32 size, Uint32 nmemb); + void setName(const char * path, const char * name); - BackupFile(); + BackupFile(void (* free_data_callback)() = 0); ~BackupFile(); public: bool readHeader(); @@ -229,12 +219,12 @@ public: const char * getFilename() const { return m_fileName;} Uint32 getNodeId() const { return m_nodeId;} const BackupFormat::FileHeader & getFileHeader() const { return m_fileHeader;} - bool Twiddle(AttributeS * attr, Uint32 arraySize = 0); + bool Twiddle(const AttributeDesc * attr_desc, AttributeData * attr_data, Uint32 arraySize = 0); }; class RestoreMetaData : public BackupFile { - myVector<TableS *> allTables; + Vector<TableS *> allTables; bool readMetaFileHeader(); bool readMetaTableDesc(); @@ -247,14 +237,11 @@ class RestoreMetaData : public BackupFile { bool parseTableDescriptor(const Uint32 * data, Uint32 len); public: - RestoreMetaData(const char * path, Uint32 nodeId, Uint32 bNo); - ~RestoreMetaData(); + virtual ~RestoreMetaData(); int loadContent(); - - Uint32 getNoOfTables() const { return allTables.size();} const TableS * operator[](int i) const { return allTables[i];} @@ -266,20 +253,20 @@ public: class RestoreDataIterator : public BackupFile { const RestoreMetaData & m_metaData; - Uint32 m_count; - TupleS m_tuple; const TableS* m_currentTable; + TupleS m_tuple; + public: // Constructor - RestoreDataIterator(const RestoreMetaData &); - ~RestoreDataIterator(); + RestoreDataIterator(const RestoreMetaData &, void (* free_data_callback)()); + ~RestoreDataIterator() {}; // Read data file fragment header bool readFragmentHeader(int & res); bool validateFragmentFooter(); - + const TupleS *getNextTuple(int & res); }; @@ -292,9 +279,35 @@ public: }; EntryType m_type; const TableS * m_table; - myVector<AttributeS*> m_values; - - + Vector<AttributeS*> m_values; + Vector<AttributeS*> m_values_e; + AttributeS *add_attr() { + AttributeS * attr; + if (m_values_e.size() > 0) { + attr = m_values_e[m_values_e.size()-1]; + m_values_e.erase(m_values_e.size()-1); + } + else + { + attr = new AttributeS; + } + m_values.push_back(attr); + return attr; + } + void clear() { + for(Uint32 i= 0; i < m_values.size(); i++) + m_values_e.push_back(m_values[i]); + m_values.clear(); + } + ~LogEntry() + { + for(Uint32 i= 0; i< m_values.size(); i++) + delete m_values[i]; + for(Uint32 i= 0; i< m_values_e.size(); i++) + delete m_values_e[i]; + } + Uint32 size() const { return m_values.size(); } + const AttributeS * operator[](int i) const { return m_values[i];} }; class RestoreLogIterator : public BackupFile { @@ -305,10 +318,16 @@ private: LogEntry m_logEntry; public: RestoreLogIterator(const RestoreMetaData &); - + virtual ~RestoreLogIterator() {}; + const LogEntry * getNextLogEntry(int & res); }; +NdbOut& operator<<(NdbOut& ndbout, const TableS&); +NdbOut& operator<<(NdbOut& ndbout, const TupleS&); +NdbOut& operator<<(NdbOut& ndbout, const LogEntry&); +NdbOut& operator<<(NdbOut& ndbout, const RestoreMetaData&); + #endif diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.cpp b/ndb/src/kernel/blocks/backup/restore/consumer.cpp new file mode 100644 index 00000000000..e94c31b2666 --- /dev/null +++ b/ndb/src/kernel/blocks/backup/restore/consumer.cpp @@ -0,0 +1,107 @@ +/* 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 "consumer.hpp" + +#ifdef USE_MYSQL +int +BackupConsumer::create_table_string(const TableS & table, + char * tableName, + char *buf){ + int pos = 0; + int pos2 = 0; + char buf2[2048]; + + pos += sprintf(buf+pos, "%s%s", "CREATE TABLE ", tableName); + pos += sprintf(buf+pos, "%s", "("); + pos2 += sprintf(buf2+pos2, "%s", " primary key("); + + for (int j = 0; j < table.getNoOfAttributes(); j++) + { + const AttributeDesc * desc = table[j]; + // ndbout << desc->name << ": "; + pos += sprintf(buf+pos, "%s%s", desc->m_column->getName()," "); + switch(desc->m_column->getType()){ + case NdbDictionary::Column::Int: + pos += sprintf(buf+pos, "%s", "int"); + break; + case NdbDictionary::Column::Unsigned: + pos += sprintf(buf+pos, "%s", "int unsigned"); + break; + case NdbDictionary::Column::Float: + pos += sprintf(buf+pos, "%s", "float"); + break; + case NdbDictionary::Column::Decimal: + pos += sprintf(buf+pos, "%s", "decimal"); + break; + case NdbDictionary::Column::Char: + pos += sprintf(buf+pos, "%s", "char"); + break; + case NdbDictionary::Column::Varchar: + pos += sprintf(buf+pos, "%s", "varchar"); + break; + case NdbDictionary::Column::Binary: + pos += sprintf(buf+pos, "%s", "binary"); + break; + case NdbDictionary::Column::Varbinary: + pos += sprintf(buf+pos, "%s", "varchar binary"); + break; + case NdbDictionary::Column::Bigint: + pos += sprintf(buf+pos, "%s", "bigint"); + break; + case NdbDictionary::Column::Bigunsigned: + pos += sprintf(buf+pos, "%s", "bigint unsigned"); + break; + case NdbDictionary::Column::Double: + pos += sprintf(buf+pos, "%s", "double"); + break; + case NdbDictionary::Column::Datetime: + pos += sprintf(buf+pos, "%s", "datetime"); + break; + case NdbDictionary::Column::Timespec: + pos += sprintf(buf+pos, "%s", "time"); + break; + case NdbDictionary::Column::Undefined: + // pos += sprintf(buf+pos, "%s", "varchar binary"); + return -1; + break; + default: + //pos += sprintf(buf+pos, "%s", "varchar binary"); + return -1; + } + if (desc->arraySize > 1) { + int attrSize = desc->arraySize; + pos += sprintf(buf+pos, "%s%u%s", + "(", + attrSize, + ")"); + } + if (desc->m_column->getPrimaryKey()) { + pos += sprintf(buf+pos, "%s", " not null"); + pos2 += sprintf(buf2+pos2, "%s%s", desc->m_column->getName(), ","); + } + pos += sprintf(buf+pos, "%s", ","); + } // for + pos2--; // remove trailing comma + pos2 += sprintf(buf2+pos2, "%s", ")"); + // pos--; // remove trailing comma + + pos += sprintf(buf+pos, "%s", buf2); + pos += sprintf(buf+pos, "%s", ") type=ndbcluster"); + return 0; +} + +#endif // USE_MYSQL diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.hpp b/ndb/src/kernel/blocks/backup/restore/consumer.hpp new file mode 100644 index 00000000000..e3ba2041a22 --- /dev/null +++ b/ndb/src/kernel/blocks/backup/restore/consumer.hpp @@ -0,0 +1,34 @@ +/* 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 */ + +#ifndef CONSUMER_HPP +#define CONSUMER_HPP + +#include "Restore.hpp" + +class BackupConsumer { +public: + virtual ~BackupConsumer() { } + virtual bool init() { return true;} + virtual bool table(const TableS &){return true;} + virtual void tuple(const TupleS &){} + virtual void tuple_free(){} + virtual void endOfTuples(){} + virtual void logEntry(const LogEntry &){} + virtual void endOfLogEntrys(){} +}; + +#endif diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp b/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp new file mode 100644 index 00000000000..0aa5b521d29 --- /dev/null +++ b/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp @@ -0,0 +1,55 @@ +/* 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 "consumer_printer.hpp" + +bool +BackupPrinter::table(const TableS & tab) +{ + if (m_print || m_print_meta) + { + m_ndbout << tab; + ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName()); + } + return true; +} + +void +BackupPrinter::tuple(const TupleS & tup) +{ + m_dataCount++; + if (m_print || m_print_data) + m_ndbout << tup << endl; +} + +void +BackupPrinter::logEntry(const LogEntry & logE) +{ + if (m_print || m_print_log) + m_ndbout << logE << endl; + m_logCount++; +} + +void +BackupPrinter::endOfLogEntrys() +{ + if (m_print || m_print_log) + { + ndbout << "Printed " << m_dataCount << " tuples and " + << m_logCount << " log entries" + << " to stdout." << endl; + } +} diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp b/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp new file mode 100644 index 00000000000..7cbc924e364 --- /dev/null +++ b/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp @@ -0,0 +1,50 @@ +/* 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 */ + +#ifndef CONSUMER_PRINTER_HPP +#define CONSUMER_PRINTER_HPP + +#include "consumer.hpp" + +class BackupPrinter : public BackupConsumer +{ + NdbOut & m_ndbout; +public: + BackupPrinter(NdbOut & out = ndbout) : m_ndbout(out) + { + m_print = false; + m_print_log = false; + m_print_data = false; + m_print_meta = false; + } + + virtual bool table(const TableS &); +#ifdef USE_MYSQL + virtual bool table(const TableS &, MYSQL* mysqlp); +#endif + virtual void tuple(const TupleS &); + virtual void logEntry(const LogEntry &); + virtual void endOfTuples() {}; + virtual void endOfLogEntrys(); + bool m_print; + bool m_print_log; + bool m_print_data; + bool m_print_meta; + Uint32 m_logCount; + Uint32 m_dataCount; +}; + +#endif diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp b/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp new file mode 100644 index 00000000000..5731a9a3883 --- /dev/null +++ b/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp @@ -0,0 +1,516 @@ +/* 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 "consumer_restore.hpp" +#include <NdbSleep.h> + +extern FilteredNdbOut err; +extern FilteredNdbOut info; +extern FilteredNdbOut debug; + +static void callback(int, NdbConnection*, void*); + +bool +BackupRestore::init() +{ + release(); + + if (!m_restore && !m_restore_meta) + return true; + + m_ndb = new Ndb(); + + if (m_ndb == NULL) + return false; + + // Turn off table name completion + m_ndb->useFullyQualifiedNames(false); + + m_ndb->init(1024); + if (m_ndb->waitUntilReady(30) != 0) + { + err << "Failed to connect to ndb!!" << endl; + return false; + } + info << "Connected to ndb!!" << endl; + + m_callback = new restore_callback_t[m_parallelism]; + + if (m_callback == 0) + { + err << "Failed to allocate callback structs" << endl; + return false; + } + + m_tuples = new TupleS[m_parallelism]; + + if (m_tuples == 0) + { + err << "Failed to allocate tuples" << endl; + return false; + } + + m_free_callback= m_callback; + for (Uint32 i= 0; i < m_parallelism; i++) { + m_callback[i].restore= this; + m_callback[i].connection= 0; + m_callback[i].tup= &m_tuples[i]; + if (i > 0) + m_callback[i-1].next= &(m_callback[i]); + } + m_callback[m_parallelism-1].next = 0; + + return true; +} + +void BackupRestore::release() +{ + if (m_ndb) + { + delete m_ndb; + m_ndb= 0; + } + + if (m_callback) + { + delete [] m_callback; + m_callback= 0; + } + + if (m_tuples) + { + delete [] m_tuples; + m_tuples= 0; + } +} + +BackupRestore::~BackupRestore() +{ + release(); +} + +bool +BackupRestore::table(const TableS & table){ + if (!m_restore_meta) + return true; + + NdbDictionary::Dictionary* dict = m_ndb->getDictionary(); + if (dict->createTable(*table.m_dictTable) == -1) + { + err << "Create table " << table.getTableName() << " failed: " + << dict->getNdbError() << endl; + return false; + } + info << "Successfully restored table " << table.getTableName()<< endl ; + return true; +} + +void BackupRestore::tuple(const TupleS & tup) +{ + if (!m_restore) + return; + + restore_callback_t * cb = m_free_callback; + + if (cb == 0) + assert(false); + + m_free_callback = cb->next; + cb->retries = 0; + *(cb->tup) = tup; // must do copy! + tuple_a(cb); + + if (m_free_callback == 0) + { + // send-poll all transactions + // close transaction is done in callback + m_ndb->sendPollNdb(3000, 1); + } +} + +void BackupRestore::tuple_a(restore_callback_t *cb) +{ + while (cb->retries < 10) + { + /** + * start transactions + */ + cb->connection = m_ndb->startTransaction(); + if (cb->connection == NULL) + { + /* + if (errorHandler(cb)) + { + continue; + } + */ + exitHandler(); + } // if + + const TupleS &tup = *(cb->tup); + const TableS * table = tup.getTable(); + NdbOperation * op = cb->connection->getNdbOperation(table->getTableName()); + + if (op == NULL) + { + if (errorHandler(cb)) + continue; + exitHandler(); + } // if + + if (op->writeTuple() == -1) + { + if (errorHandler(cb)) + continue; + exitHandler(); + } // if + + int ret = 0; + for (int j = 0; j < 2; j++) + { + for (int i = 0; i < tup.getNoOfAttributes(); i++) + { + const AttributeDesc * attr_desc = tup.getDesc(i); + const AttributeData * attr_data = tup.getData(i); + int size = attr_desc->size; + int arraySize = attr_desc->arraySize; + char * dataPtr = attr_data->string_value; + Uint32 length = (size * arraySize) / 8; + if (attr_desc->m_column->getPrimaryKey()) + { + if (j == 1) continue; + ret = op->equal(i, dataPtr, length); + } + else + { + if (j == 0) continue; + if (attr_data->null) + ret = op->setValue(i, NULL, 0); + else + ret = op->setValue(i, dataPtr, length); + } + if (ret < 0) { + ndbout_c("Column: %d type %d",i, + attr_desc->m_column->getType()); + break; + } + } + if (ret < 0) + break; + } + if (ret < 0) + { + if (errorHandler(cb)) + continue; + exitHandler(); + } + + // Prepare transaction (the transaction is NOT yet sent to NDB) + cb->connection->executeAsynchPrepare(Commit, &callback, cb); + m_transactions++; + return; + } + err << "Unable to recover from errors. Exiting..." << endl; + exitHandler(); +} + +void BackupRestore::cback(int result, restore_callback_t *cb) +{ + m_transactions--; + + if (result < 0) + { + /** + * Error. temporary or permanent? + */ + if (errorHandler(cb)) + tuple_a(cb); // retry + else + { + err << "Restore: Failed to restore data due to a unrecoverable error. Exiting..." << endl; + exitHandler(); + } + } + else + { + /** + * OK! close transaction + */ + m_ndb->closeTransaction(cb->connection); + cb->connection= 0; + cb->next= m_free_callback; + m_free_callback= cb; + m_dataCount++; + } +} + +/** + * returns true if is recoverable, + * Error handling based on hugo + * false if it is an error that generates an abort. + */ +bool BackupRestore::errorHandler(restore_callback_t *cb) +{ + NdbError error= cb->connection->getNdbError(); + m_ndb->closeTransaction(cb->connection); + cb->connection= 0; + cb->retries++; + switch(error.status) + { + case NdbError::Success: + return false; + // ERROR! + break; + + case NdbError::TemporaryError: + NdbSleep_MilliSleep(10); + return true; + // RETRY + break; + + case NdbError::UnknownResult: + err << error << endl; + return false; + // ERROR! + break; + + default: + case NdbError::PermanentError: + switch (error.code) + { + case 499: + case 250: + NdbSleep_MilliSleep(10); + return true; //temp errors? + default: + break; + } + //ERROR + err << error << endl; + return false; + break; + } + return false; +} + +void BackupRestore::exitHandler() +{ + release(); + exit(-1); +} + + +void +BackupRestore::tuple_free() +{ + if (!m_restore) + return; + + if (m_transactions > 0) { + // Send all transactions to NDB + m_ndb->sendPreparedTransactions(0); + + // Poll all transactions + while (m_transactions > 0) + m_ndb->pollNdb(3000, m_transactions); + } +} + +void +BackupRestore::endOfTuples() +{ + tuple_free(); +} + +void +BackupRestore::logEntry(const LogEntry & tup) +{ + if (!m_restore) + return; + + NdbConnection * trans = m_ndb->startTransaction(); + if (trans == NULL) + { + // Deep shit, TODO: handle the error + err << "Cannot start transaction" << endl; + exit(-1); + } // if + + const TableS * table = tup.m_table; + NdbOperation * op = trans->getNdbOperation(table->getTableName()); + if (op == NULL) + { + err << "Cannot get operation: " << trans->getNdbError() << endl; + exit(-1); + } // if + + int check = 0; + switch(tup.m_type) + { + case LogEntry::LE_INSERT: + check = op->insertTuple(); + break; + case LogEntry::LE_UPDATE: + check = op->updateTuple(); + break; + case LogEntry::LE_DELETE: + check = op->deleteTuple(); + break; + default: + err << "Log entry has wrong operation type." + << " Exiting..."; + exit(-1); + } + + for (Uint32 i= 0; i < tup.size(); i++) + { + const AttributeS * attr = tup[i]; + int size = attr->Desc->size; + int arraySize = attr->Desc->arraySize; + const char * dataPtr = attr->Data.string_value; + + const Uint32 length = (size / 8) * arraySize; + if (attr->Desc->m_column->getPrimaryKey()) + op->equal(attr->Desc->attrId, dataPtr, length); + else + op->setValue(attr->Desc->attrId, dataPtr, length); + } + + const int ret = trans->execute(Commit); + if (ret != 0) + { + // Both insert update and delete can fail during log running + // and it's ok + // TODO: check that the error is either tuple exists or tuple does not exist? + switch(tup.m_type) + { + case LogEntry::LE_INSERT: + break; + case LogEntry::LE_UPDATE: + break; + case LogEntry::LE_DELETE: + break; + } + if (false) + { + err << "execute failed: " << trans->getNdbError() << endl; + exit(-1); + } + } + + m_ndb->closeTransaction(trans); + m_logCount++; +} + +void +BackupRestore::endOfLogEntrys() +{ + if (!m_restore) + return; + + info << "Restored " << m_dataCount << " tuples and " + << m_logCount << " log entries" << endl; +} + +/* + * callback : This is called when the transaction is polled + * + * (This function must have three arguments: + * - The result of the transaction, + * - The NdbConnection object, and + * - A pointer to an arbitrary object.) + */ + +static void +callback(int result, NdbConnection* trans, void* aObject) +{ + restore_callback_t *cb = (restore_callback_t *)aObject; + (cb->restore)->cback(result, cb); +} + +#if 0 // old tuple impl +void +BackupRestore::tuple(const TupleS & tup) +{ + if (!m_restore) + return; + while (1) + { + NdbConnection * trans = m_ndb->startTransaction(); + if (trans == NULL) + { + // Deep shit, TODO: handle the error + ndbout << "Cannot start transaction" << endl; + exit(-1); + } // if + + const TableS * table = tup.getTable(); + NdbOperation * op = trans->getNdbOperation(table->getTableName()); + if (op == NULL) + { + ndbout << "Cannot get operation: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } // if + + // TODO: check return value and handle error + if (op->writeTuple() == -1) + { + ndbout << "writeTuple call failed: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } // if + + for (int i = 0; i < tup.getNoOfAttributes(); i++) + { + const AttributeS * attr = tup[i]; + int size = attr->Desc->size; + int arraySize = attr->Desc->arraySize; + const char * dataPtr = attr->Data.string_value; + + const Uint32 length = (size * arraySize) / 8; + if (attr->Desc->m_column->getPrimaryKey()) + op->equal(i, dataPtr, length); + } + + for (int i = 0; i < tup.getNoOfAttributes(); i++) + { + const AttributeS * attr = tup[i]; + int size = attr->Desc->size; + int arraySize = attr->Desc->arraySize; + const char * dataPtr = attr->Data.string_value; + + const Uint32 length = (size * arraySize) / 8; + if (!attr->Desc->m_column->getPrimaryKey()) + if (attr->Data.null) + op->setValue(i, NULL, 0); + else + op->setValue(i, dataPtr, length); + } + int ret = trans->execute(Commit); + if (ret != 0) + { + ndbout << "execute failed: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } + m_ndb->closeTransaction(trans); + if (ret == 0) + break; + } + m_dataCount++; +} +#endif diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp b/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp new file mode 100644 index 00000000000..2d36501bf40 --- /dev/null +++ b/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp @@ -0,0 +1,75 @@ +/* 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 */ + +#ifndef CONSUMER_RESTORE_HPP +#define CONSUMER_RESTORE_HPP + +#include "consumer.hpp" + +struct restore_callback_t { + class BackupRestore *restore; + class TupleS *tup; + class NdbConnection *connection; + int retries; + restore_callback_t *next; +}; + + +class BackupRestore : public BackupConsumer +{ +public: + BackupRestore(Uint32 parallelism=1) + { + m_ndb = 0; + m_logCount = m_dataCount = 0; + m_restore = false; + m_restore_meta = false; + m_parallelism = parallelism; + m_callback = 0; + m_tuples = 0; + m_free_callback = 0; + m_transactions = 0; + } + + virtual ~BackupRestore(); + virtual bool init(); + virtual void release(); + virtual bool table(const TableS &); + virtual void tuple(const TupleS &); + virtual void tuple_free(); + virtual void tuple_a(restore_callback_t *cb); + virtual void cback(int result, restore_callback_t *cb); + virtual bool errorHandler(restore_callback_t *cb); + virtual void exitHandler(); + virtual void endOfTuples(); + virtual void logEntry(const LogEntry &); + virtual void endOfLogEntrys(); + void connectToMysql(); + Ndb * m_ndb; + bool m_restore; + bool m_restore_meta; + Uint32 m_logCount; + Uint32 m_dataCount; + + Uint32 m_parallelism; + Uint32 m_transactions; + + TupleS *m_tuples; + restore_callback_t *m_callback; + restore_callback_t *m_free_callback; +}; + +#endif diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp b/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp new file mode 100644 index 00000000000..6a9ec07148a --- /dev/null +++ b/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp @@ -0,0 +1,652 @@ +/* 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 "consumer_restore.hpp" +#include <NdbSleep.h> + +extern FilteredNdbOut err; +extern FilteredNdbOut info; +extern FilteredNdbOut debug; + +static bool asynchErrorHandler(NdbConnection * trans, Ndb * ndb); +static void callback(int result, NdbConnection* trans, void* aObject); + +bool +BackupRestore::init() +{ + + if (!m_restore && !m_restore_meta) + return true; + + m_ndb = new Ndb(); + + if (m_ndb == NULL) + return false; + + // Turn off table name completion + m_ndb->useFullyQualifiedNames(false); + + m_ndb->init(1024); + if (m_ndb->waitUntilReady(30) != 0) + { + ndbout << "Failed to connect to ndb!!" << endl; + return false; + } + ndbout << "Connected to ndb!!" << endl; + +#if USE_MYSQL + if(use_mysql) + { + if ( mysql_thread_safe() == 0 ) + { + ndbout << "Not thread safe mysql library..." << endl; + exit(-1); + } + + ndbout << "Connecting to MySQL..." <<endl; + + /** + * nwe param: + * port + * host + * user + */ + bool returnValue = true; + mysql_init(&mysql); + { + int portNo = 3306; + if ( mysql_real_connect(&mysql, + ga_host, + ga_user, + ga_password, + ga_database, + ga_port, +:: ga_socket, + 0) == NULL ) + { + ndbout_c("Connect failed: %s", mysql_error(&mysql)); + returnValue = false; + } + ndbout << "Connected to MySQL!!!" <<endl; + } + + /* if(returnValue){ + mysql_set_server_option(&mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON); + } + */ + return returnValue; + } +#endif + + if (m_callback) { + delete [] m_callback; + m_callback = 0; + } + + m_callback = new restore_callback_t[m_parallelism]; + + if (m_callback == 0) + { + ndbout << "Failed to allocate callback structs" << endl; + return false; + } + + m_free_callback = m_callback; + for (int i= 0; i < m_parallelism; i++) { + m_callback[i].restore = this; + m_callback[i].connection = 0; + m_callback[i].retries = 0; + if (i > 0) + m_callback[i-1].next = &(m_callback[i]); + } + m_callback[m_parallelism-1].next = 0; + + return true; + +} + +BackupRestore::~BackupRestore() +{ + if (m_ndb != 0) + delete m_ndb; + + if (m_callback) + delete [] m_callback; +} + +#ifdef USE_MYSQL +bool +BackupRestore::table(const TableS & table, MYSQL * mysqlp){ + if (!m_restore_meta) + { + return true; + } + + char tmpTabName[MAX_TAB_NAME_SIZE*2]; + sprintf(tmpTabName, "%s", table.getTableName()); + char * database = strtok(tmpTabName, "/"); + char * schema = strtok( NULL , "/"); + char * tableName = strtok( NULL , "/"); + + /** + * this means that the user did not specify schema + * and it is a v2x backup + */ + if(database == NULL) + return false; + if(schema == NULL) + return false; + if(tableName==NULL) + tableName = schema; + + char stmtCreateDB[255]; + sprintf(stmtCreateDB,"CREATE DATABASE %s", database); + + /*ignore return value. mysql_select_db will trap errors anyways*/ + if (mysql_query(mysqlp,stmtCreateDB) == 0) + { + //ndbout_c("%s", stmtCreateDB); + } + + if (mysql_select_db(&mysql, database) != 0) + { + ndbout_c("Error: %s", mysql_error(&mysql)); + return false; + } + + char buf [2048]; + /** + * create table ddl + */ + if (create_table_string(table, tableName, buf)) + { + ndbout_c("Unable to create a table definition since the " + "backup contains undefined types"); + return false; + } + + //ndbout_c("%s", buf); + + if (mysql_query(mysqlp,buf) != 0) + { + ndbout_c("Error: %s", mysql_error(&mysql)); + return false; + } else + { + ndbout_c("Successfully restored table %s into database %s", tableName, database); + } + + return true; +} +#endif + +bool +BackupRestore::table(const TableS & table){ + if (!m_restore_meta) + { + return true; + } + NdbDictionary::Dictionary* dict = m_ndb->getDictionary(); + if (dict->createTable(*table.m_dictTable) == -1) + { + err << "Create table " << table.getTableName() << " failed: " + << dict->getNdbError() << endl; + return false; + } + info << "Successfully restored table " << table.getTableName()<< endl ; + return true; +} + +void BackupRestore::tuple(const TupleS & tup) +{ + if (!m_restore) + { + delete &tup; + return; + } + + restore_callback_t * cb = m_free_callback; + + if (cb) + { + m_free_callback = cb->next; + cb->retries = 0; + cb->tup = &tup; + tuple_a(cb); + } + + if (m_free_callback == 0) + { + // send-poll all transactions + // close transaction is done in callback + m_ndb->sendPollNdb(3000, 1); + } +} + +void BackupRestore::tuple_a(restore_callback_t *cb) +{ + while (cb->retries < 10) + { + /** + * start transactions + */ + cb->connection = m_ndb->startTransaction(); + if (cb->connection == NULL) + { + /* + if (asynchErrorHandler(cb->connection, m_ndb)) + { + cb->retries++; + continue; + } + */ + asynchExitHandler(); + } // if + + const TupleS &tup = *(cb->tup); + const TableS * table = tup.getTable(); + NdbOperation * op = cb->connection->getNdbOperation(table->getTableName()); + + if (op == NULL) + { + if (asynchErrorHandler(cb->connection, m_ndb)) + { + cb->retries++; + continue; + } + asynchExitHandler(); + } // if + + if (op->writeTuple() == -1) + { + if (asynchErrorHandler(cb->connection, m_ndb)) + { + cb->retries++; + continue; + } + asynchExitHandler(); + } // if + + Uint32 ret = 0; + for (int i = 0; i < tup.getNoOfAttributes(); i++) + { + const AttributeS * attr = tup[i]; + int size = attr->Desc->size; + int arraySize = attr->Desc->arraySize; + char * dataPtr = attr->Data.string_value; + Uint32 length = (size * arraySize) / 8; + if (attr->Desc->m_column->getPrimaryKey()) + { + ret = op->equal(i, dataPtr, length); + } + else + { + if (attr->Data.null) + ret = op->setValue(i, NULL, 0); + else + ret = op->setValue(i, dataPtr, length); + } + + if (ret<0) + { + ndbout_c("Column: %d type %d",i, + tup.getTable()->m_dictTable->getColumn(i)->getType()); + if (asynchErrorHandler(cb->connection, m_ndb)) + { + cb->retries++; + break; + } + asynchExitHandler(); + } + } + if (ret < 0) + continue; + + // Prepare transaction (the transaction is NOT yet sent to NDB) + cb->connection->executeAsynchPrepare(Commit, &callback, cb); + m_transactions++; + } + ndbout_c("Unable to recover from errors. Exiting..."); + asynchExitHandler(); +} + +void BackupRestore::cback(int result, restore_callback_t *cb) +{ + if (result<0) + { + /** + * Error. temporary or permanent? + */ + if (asynchErrorHandler(cb->connection, m_ndb)) + { + cb->retries++; + tuple_a(cb); + } + else + { + ndbout_c("Restore: Failed to restore data " + "due to a unrecoverable error. Exiting..."); + delete m_ndb; + delete cb->tup; + exit(-1); + } + } + else + { + /** + * OK! close transaction + */ + m_ndb->closeTransaction(cb->connection); + delete cb->tup; + m_transactions--; + } +} + +void BackupRestore::asynchExitHandler() +{ + if (m_ndb != NULL) + delete m_ndb; + exit(-1); +} + +#if 0 // old tuple impl +void +BackupRestore::tuple(const TupleS & tup) +{ + if (!m_restore) + return; + while (1) + { + NdbConnection * trans = m_ndb->startTransaction(); + if (trans == NULL) + { + // Deep shit, TODO: handle the error + ndbout << "Cannot start transaction" << endl; + exit(-1); + } // if + + const TableS * table = tup.getTable(); + NdbOperation * op = trans->getNdbOperation(table->getTableName()); + if (op == NULL) + { + ndbout << "Cannot get operation: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } // if + + // TODO: check return value and handle error + if (op->writeTuple() == -1) + { + ndbout << "writeTuple call failed: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } // if + + for (int i = 0; i < tup.getNoOfAttributes(); i++) + { + const AttributeS * attr = tup[i]; + int size = attr->Desc->size; + int arraySize = attr->Desc->arraySize; + const char * dataPtr = attr->Data.string_value; + + const Uint32 length = (size * arraySize) / 8; + if (attr->Desc->m_column->getPrimaryKey()) + op->equal(i, dataPtr, length); + } + + for (int i = 0; i < tup.getNoOfAttributes(); i++) + { + const AttributeS * attr = tup[i]; + int size = attr->Desc->size; + int arraySize = attr->Desc->arraySize; + const char * dataPtr = attr->Data.string_value; + + const Uint32 length = (size * arraySize) / 8; + if (!attr->Desc->m_column->getPrimaryKey()) + if (attr->Data.null) + op->setValue(i, NULL, 0); + else + op->setValue(i, dataPtr, length); + } + int ret = trans->execute(Commit); + if (ret != 0) + { + ndbout << "execute failed: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } + m_ndb->closeTransaction(trans); + if (ret == 0) + break; + } + m_dataCount++; +} +#endif + +void +BackupRestore::endOfTuples() +{ + if (!m_restore) + return; + + // Send all transactions to NDB + m_ndb->sendPreparedTransactions(0); + + // Poll all transactions + m_ndb->pollNdb(3000, m_transactions); + + // Close all transactions + // for (int i = 0; i < nPreparedTransactions; i++) + // m_ndb->closeTransaction(asynchTrans[i]); +} + +void +BackupRestore::logEntry(const LogEntry & tup) +{ + if (!m_restore) + return; + + NdbConnection * trans = m_ndb->startTransaction(); + if (trans == NULL) + { + // Deep shit, TODO: handle the error + ndbout << "Cannot start transaction" << endl; + exit(-1); + } // if + + const TableS * table = tup.m_table; + NdbOperation * op = trans->getNdbOperation(table->getTableName()); + if (op == NULL) + { + ndbout << "Cannot get operation: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } // if + + int check = 0; + switch(tup.m_type) + { + case LogEntry::LE_INSERT: + check = op->insertTuple(); + break; + case LogEntry::LE_UPDATE: + check = op->updateTuple(); + break; + case LogEntry::LE_DELETE: + check = op->deleteTuple(); + break; + default: + ndbout << "Log entry has wrong operation type." + << " Exiting..."; + exit(-1); + } + + for (int i = 0; i < tup.m_values.size(); i++) + { + const AttributeS * attr = tup.m_values[i]; + int size = attr->Desc->size; + int arraySize = attr->Desc->arraySize; + const char * dataPtr = attr->Data.string_value; + + const Uint32 length = (size / 8) * arraySize; + if (attr->Desc->m_column->getPrimaryKey()) + op->equal(attr->Desc->attrId, dataPtr, length); + else + op->setValue(attr->Desc->attrId, dataPtr, length); + } + +#if 1 + trans->execute(Commit); +#else + const int ret = trans->execute(Commit); + // Both insert update and delete can fail during log running + // and it's ok + + if (ret != 0) + { + ndbout << "execute failed: "; + ndbout << trans->getNdbError() << endl; + exit(-1); + } +#endif + + m_ndb->closeTransaction(trans); + m_logCount++; +} + +void +BackupRestore::endOfLogEntrys() +{ + if (m_restore) + { + ndbout << "Restored " << m_dataCount << " tuples and " + << m_logCount << " log entries" << endl; + } +} +#if 0 +/***************************************** + * + * Callback function for asynchronous transactions + * + * Idea for error handling: Transaction objects have to be stored globally when + * they are prepared. + * In the callback function if the transaction: + * succeeded: delete the object from global storage + * failed but can be retried: execute the object that is in global storage + * failed but fatal: delete the object from global storage + * + ******************************************/ +static void restoreCallback(int result, // Result for transaction + NdbConnection *object, // Transaction object + void *anything) // Not used +{ + static Uint32 counter = 0; + + + debug << "restoreCallback function called " << counter << " time(s)" << endl; + + ++counter; + + if (result == -1) + { + ndbout << " restoreCallback (" << counter; + if ((counter % 10) == 1) + { + ndbout << "st"; + } // if + else if ((counter % 10) == 2) + { + ndbout << "nd"; + } // else if + else if ((counter % 10 ) ==3) + { + ndbout << "rd"; + } // else if + else + { + ndbout << "th"; + } // else + err << " time: error detected " << object->getNdbError() << endl; + } // if + +} // restoreCallback +#endif + + + +/* + * callback : This is called when the transaction is polled + * + * (This function must have three arguments: + * - The result of the transaction, + * - The NdbConnection object, and + * - A pointer to an arbitrary object.) + */ + +static void +callback(int result, NdbConnection* trans, void* aObject) +{ + restore_callback_t *cb = (restore_callback_t *)aObject; + (cb->restore)->cback(result, cb); +} + +/** + * returns true if is recoverable, + * Error handling based on hugo + * false if it is an error that generates an abort. + */ +static +bool asynchErrorHandler(NdbConnection * trans, Ndb* ndb) +{ + NdbError error = trans->getNdbError(); + ndb->closeTransaction(trans); + switch(error.status) + { + case NdbError::Success: + return false; + // ERROR! + break; + + case NdbError::TemporaryError: + NdbSleep_MilliSleep(10); + return true; + // RETRY + break; + + case NdbError::UnknownResult: + ndbout << error << endl; + return false; + // ERROR! + break; + + default: + case NdbError::PermanentError: + switch (error.code) + { + case 499: + case 250: + NdbSleep_MilliSleep(10); + return true; //temp errors? + default: + break; + } + //ERROR + ndbout << error << endl; + return false; + break; + } + return false; +} diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp index 1df82a7f055..99deeb3115c 100644 --- a/ndb/src/kernel/blocks/backup/restore/main.cpp +++ b/ndb/src/kernel/blocks/backup/restore/main.cpp @@ -14,62 +14,26 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "Restore.hpp" #include <getarg.h> -#include <NdbSleep.h> #include <Vector.hpp> #include <ndb_limits.h> #include <NdbTCP.h> -#ifdef USE_MYSQL -#include <mysql.h> -#endif - #include <NdbOut.hpp> -NdbOut& operator<<(NdbOut& ndbout, const TupleS& tuple); -NdbOut& operator<<(NdbOut& ndbout, const LogEntry& logEntry); -NdbOut& operator<<(NdbOut& ndbout, const RestoreMetaData &); +#include "consumer_restore.hpp" +#include "consumer_printer.hpp" extern FilteredNdbOut err; extern FilteredNdbOut info; extern FilteredNdbOut debug; -static const char * delimiter = ";"; // Delimiter in file dump - static int ga_nodeId = 0; -static int ga_nParallelism = 1; +static int ga_nParallelism = 128; static int ga_backupId = 0; static bool ga_dont_ignore_systab_0 = false; -static myVector<class BackupConsumer *> g_consumers; +static Vector<class BackupConsumer *> g_consumers; -#ifdef USE_MYSQL -/** - * mysql specific stuff: - */ -static const char* ga_user = "root"; -static const char* ga_host = "localhost"; -static const char* ga_socket = "/tmp/mysql.sock"; -static const char* ga_password = ""; -static const char* ga_database = ""; -static int ga_port = 3306; -static bool use_mysql = false; -static MYSQL mysql; -#endif - - -#ifdef NDB_WIN32 -static const char* ga_backupPath = ".\\"; -#else -static const char* ga_backupPath = "./"; -#endif - -typedef struct { - void * ndb; - void * restore; - TupleS * tup; - int transaction; - int retries; -} restore_callback_t; +static const char* ga_backupPath = "." DIR_SEPARATOR; static const char* ga_connect_NDB = NULL; @@ -78,100 +42,9 @@ static const char* ga_connect_NDB = NULL; */ static bool ga_restore = false; static bool ga_print = false; - - - -class BackupConsumer { -public: - virtual bool init() { return true;} - virtual bool table(const TableS &){return true;} -#ifdef USE_MYSQL - virtual bool table(const TableS &, MYSQL* mysqlp) {return true;}; -#endif - virtual void tuple(const TupleS &){} - virtual void tupleAsynch(const TupleS &, restore_callback_t * callback) {}; - // virtual bool asynchErrorHandler(NdbConnection * trans){return true;}; - virtual void asynchExitHandler(){}; - virtual void endOfTuples(){} - virtual void logEntry(const LogEntry &){} - virtual void endOfLogEntrys(){} -protected: - int create_table_string(const TableS & table, char * ,char *); -}; - -class BackupPrinter : public BackupConsumer -{ - NdbOut & m_ndbout; -public: - BackupPrinter(NdbOut & out = ndbout) : m_ndbout(out) - { - m_print = false; - m_print_log = false; - m_print_data = false; - m_print_meta = false; - } - - virtual bool table(const TableS &); -#ifdef USE_MYSQL - virtual bool table(const TableS &, MYSQL* mysqlp); -#endif - virtual void tuple(const TupleS &); - virtual void logEntry(const LogEntry &); - virtual void endOfTuples() {}; - virtual void endOfLogEntrys(); - virtual void tupleAsynch(const TupleS &, restore_callback_t * callback); - bool m_print; - bool m_print_log; - bool m_print_data; - bool m_print_meta; - Uint32 m_logCount; - Uint32 m_dataCount; - -}; - -class BackupRestore : public BackupConsumer -{ -public: - BackupRestore() - { - m_ndb = 0; - m_logCount = m_dataCount = 0; - m_restore = false; - m_restore_meta = false; - } - - virtual ~BackupRestore(); - - virtual bool init(); - virtual bool table(const TableS &); -#ifdef USE_MYSQL - virtual bool table(const TableS &, MYSQL* mysqlp); -#endif - virtual void tuple(const TupleS &); - virtual void tupleAsynch(const TupleS &, restore_callback_t * callback); - virtual void asynchExitHandler(); - virtual void endOfTuples(); - virtual void logEntry(const LogEntry &); - virtual void endOfLogEntrys(); - void connectToMysql(); - Ndb * m_ndb; - bool m_restore; - bool m_restore_meta; - Uint32 m_logCount; - Uint32 m_dataCount; -}; bool readArguments(const int argc, const char** argv) { - BackupPrinter* printer = new BackupPrinter(); - if (printer == NULL) - return false; - BackupRestore* restore = new BackupRestore(); - if (restore == NULL) - { - delete printer; - return false; - } int _print = 0; int _print_meta = 0; @@ -234,10 +107,18 @@ readArguments(const int argc, const char** argv) ga_nParallelism < 1 || ga_nParallelism >1024) { - arg_printusage(args, num_args, argv[0], "<path to backup files>\n"); + return false; + } + + BackupPrinter* printer = new BackupPrinter(); + if (printer == NULL) + return false; + + BackupRestore* restore = new BackupRestore(ga_nParallelism); + if (restore == NULL) + { delete printer; - delete restore; return false; } @@ -280,11 +161,11 @@ readArguments(const int argc, const char** argv) } { - BackupConsumer * c = printer; + BackupConsumer * c = printer; g_consumers.push_back(c); } { - BackupConsumer * c = restore; + BackupConsumer * c = restore; g_consumers.push_back(c); } // Set backup file path @@ -292,20 +173,6 @@ readArguments(const int argc, const char** argv) { ga_backupPath = argv[optind]; } -#ifdef USE_MYSQL - if(use_mysql) { - ga_dont_ignore_systab_0 = false; - ga_database = ""; //not used yet. pethaps later if we want to - // restore meta data in an existing mysql database, - // and not just restore it to the same database - // as when the backup was taken. - // If implementing this, then the - // tupleAsynch must also be changed so that the - // table data is restored to the correct table. - // also, mysql_select_db must be set properly (ie., - // ignored in codw below) - } -#endif return true; } @@ -314,15 +181,12 @@ readArguments(const int argc, const char** argv) void clearConsumers() { - for(int i = 0; i<g_consumers.size(); i++) + for(Uint32 i= 0; i<g_consumers.size(); i++) delete g_consumers[i]; g_consumers.clear(); } -static bool asynchErrorHandler(NdbConnection * trans, Ndb * ndb); -static NdbConnection * asynchTrans[1024]; - -bool +static bool checkSysTable(const char *tableName) { return ga_dont_ignore_systab_0 || @@ -332,6 +196,12 @@ checkSysTable(const char *tableName) strcmp(tableName, "sys/def/NDB$EVENTS_0") != 0); } +static void +free_data_callback() +{ + for(Uint32 i= 0; i < g_consumers.size(); i++) + g_consumers[i]->tuple_free(); +} int main(int argc, const char** argv) @@ -341,6 +211,12 @@ main(int argc, const char** argv) return -1; } + if (ga_connect_NDB != NULL) + { + // Use connection string + Ndb::setConnectString(ga_connect_NDB); + } + /** * we must always load meta data, even if we will only print it to stdout */ @@ -361,7 +237,7 @@ main(int argc, const char** argv) return -1; } - if (res == -3) + if (metaData.getNoOfTables() == 0) { ndbout_c("Restore: The backup contains no tables "); return -1; @@ -375,7 +251,7 @@ main(int argc, const char** argv) } - for(int i = 0; i<g_consumers.size(); i++) + for(Uint32 i= 0; i < g_consumers.size(); i++) { if (!g_consumers[i]->init()) { @@ -389,36 +265,22 @@ main(int argc, const char** argv) { if (checkSysTable(metaData[i]->getTableName())) { - for(int j = 0; j<g_consumers.size(); j++) -#ifdef USE_MYSQL - if(use_mysql) { - if (!g_consumers[j]->table(* metaData[i], &mysql)) - { - ndbout_c("Restore: Failed to restore table: %s. " - "Exiting...", - metaData[i]->getTableName()); - return -11; - } - } else -#endif - if (!g_consumers[j]->table(* metaData[i])) - { - ndbout_c("Restore: Failed to restore table: %s. " - "Exiting...", - metaData[i]->getTableName()); - return -11; - } - + for(Uint32 j= 0; j < g_consumers.size(); j++) + if (!g_consumers[j]->table(* metaData[i])) + { + ndbout_c("Restore: Failed to restore table: %s. " + "Exiting...", + metaData[i]->getTableName()); + return -11; + } } } - - if (ga_restore || ga_print) { if (ga_restore) { - RestoreDataIterator dataIter(metaData); + RestoreDataIterator dataIter(metaData, &free_data_callback); // Read data file header if (!dataIter.readHeader()) @@ -428,19 +290,15 @@ main(int argc, const char** argv) } - while (dataIter.readFragmentHeader(res)) + while (dataIter.readFragmentHeader(res= 0)) { - const TupleS* tuple = 0; - while ((tuple = dataIter.getNextTuple(res)) != NULL) + const TupleS* tuple; + while ((tuple = dataIter.getNextTuple(res= 1)) != 0) { if (checkSysTable(tuple->getTable()->getTableName())) - { - for(int i = 0; i<g_consumers.size(); i++) - { - g_consumers[i]->tupleAsynch(* tuple, 0); - } - } - } while (tuple != NULL); + for(Uint32 i= 0; i < g_consumers.size(); i++) + g_consumers[i]->tuple(* tuple); + } // while (tuple != NULL); if (res < 0) { @@ -457,44 +315,37 @@ main(int argc, const char** argv) if (res < 0) { - ndbout_c("Restore: An error occured while restoring data. " - "Exiting..."); + err << "Restore: An error occured while restoring data. Exiting... res=" << res << endl; return -1; } dataIter.validateFooter(); //not implemented - for (int i = 0; i<g_consumers.size(); i++) + + for (Uint32 i= 0; i < g_consumers.size(); i++) g_consumers[i]->endOfTuples(); RestoreLogIterator logIter(metaData); if (!logIter.readHeader()) { - ndbout << "Failed to read header of data file. Exiting..."; + err << "Failed to read header of data file. Exiting..." << endl; return -1; } - /** - * I have not touched the part below : -johan 040218 - * except fixing return values. - */ const LogEntry * logEntry = 0; - while ((logEntry = logIter.getNextLogEntry(res))) + while ((logEntry = logIter.getNextLogEntry(res= 0)) != 0) { if (checkSysTable(logEntry->m_table->getTableName())) - { - for(int i = 0; i<g_consumers.size(); i++) + for(Uint32 i= 0; i < g_consumers.size(); i++) g_consumers[i]->logEntry(* logEntry); - } } if (res < 0) { - ndbout_c("Restore: An restoring the data log" - "Exiting..."); + err << "Restore: An restoring the data log. Exiting... res=" << res << endl; return -1; } logIter.validateFooter(); //not implemented - for (int i = 0; i<g_consumers.size(); i++) + for (Uint32 i= 0; i < g_consumers.size(); i++) g_consumers[i]->endOfLogEntrys(); } } @@ -502,1033 +353,3 @@ main(int argc, const char** argv) return 1; } // main -NdbOut & -operator<<(NdbOut& ndbout, const AttributeS& attr){ - const AttributeData & data = attr.Data; - const AttributeDesc & desc = * attr.Desc; - - if (data.null) - { - ndbout << "<NULL>"; - return ndbout; - } - - if (desc.arraySize > 1) - ndbout << "[ "; - for (Uint32 j = 0; j < desc.arraySize; j++) - { - // Print strings without spaces, - // (but ndbout char does not work as expected, see below) - switch (desc.type) - { - case Signed: - switch (desc.size) - { - case 8: - ndbout << (short)data.int8_value[j]; - break; - case 16: - ndbout << data.int16_value[j]; - break; - case 32: - ndbout << data.int32_value[j]; - break; - case 64: - ndbout << data.int64_value[j]; - break; - case 128: - ndbout << "Signed sz = 128 - this is something wrong??" << endl; - break; - default: - // Unknown, error - break; - } // switch size - break; - case UnSigned: - switch (desc.size) - { - case 8: - ndbout << (short)data.u_int8_value[j]; - break; - case 16: - ndbout << data.u_int16_value[j]; - break; - case 32: - ndbout << data.u_int32_value[j]; - break; - case 64: - ndbout << data.u_int64_value[j]; - break; - case 128: - ndbout << "UnSigned sz = 128 - this is something wrong??" << endl; - break; - default: - // Unknown, error - break; - } // switch size - break; - case String: - if (desc.size == 8){ - NdbDictionary::Column::Type type = desc.m_table->m_dictTable->getColumn(desc.attrId)->getType(); - if(type == NdbDictionary::Column::Varchar){ - short len = ntohs(data.u_int16_value[0]); - ndbout.print("%.*s", len, (data.string_value+2)); - } else { - ndbout << data.string_value; - } - } // if - else - { - ndbout << "String sz != 8 - this is something wrong??" << endl; - } - j = desc.arraySize; - break; - case Float: - // Not yet supported to print float - ndbout << "float"; - break; - default: - ndbout << "Not defined Attr Type"; - } // switch AttrType - ndbout << " "; - } // for ArraySize - if (desc.arraySize > 1) - { - ndbout << "]"; - } - return ndbout; -} - -// Print tuple data -NdbOut& -operator<<(NdbOut& ndbout, const TupleS& tuple) -{ - ndbout << tuple.getTable()->getTableName() << "; "; - for (int i = 0; i < tuple.getNoOfAttributes(); i++) - { - const AttributeS * attr = tuple[i]; - debug << i << " " << attr->Desc->name; - ndbout << (* attr); - - if (i != (tuple.getNoOfAttributes() - 1)) - ndbout << delimiter << " "; - } // for - return ndbout; -} - -// Print tuple data -NdbOut& -operator<<(NdbOut& ndbout, const LogEntry& logE) -{ - switch(logE.m_type) - { - case LogEntry::LE_INSERT: - ndbout << "INSERT " << logE.m_table->getTableName() << " "; - break; - case LogEntry::LE_DELETE: - ndbout << "DELETE " << logE.m_table->getTableName() << " "; - break; - case LogEntry::LE_UPDATE: - ndbout << "UPDATE " << logE.m_table->getTableName() << " "; - break; - default: - ndbout << "Unknown log entry type (not insert, delete or update)" ; - } - - for (int i = 0; i < logE.m_values.size();i++) - { - const AttributeS * attr = logE.m_values[i]; - ndbout << attr->Desc->name << "="; - ndbout << (* attr); - if (i < (logE.m_values.size() - 1)) - ndbout << ", "; - } - return ndbout; -} - - -NdbOut & -operator<<(NdbOut& ndbout, const TableS & table){ - ndbout << endl << "Table: " << table.getTableName() << endl; - for (int j = 0; j < table.getNoOfAttributes(); j++) - { - const AttributeDesc * desc = table[j]; - ndbout << desc->name << ": "; - NdbDictionary::Column::Type type = table.m_dictTable->getColumn(desc->attrId)->getType(); - switch(type){ - case NdbDictionary::Column::Int: - ndbout << "Int "; - break; - case NdbDictionary::Column::Unsigned: - ndbout << "Unsigned "; - break; - case NdbDictionary::Column::Float: - ndbout << "Float "; - break; - case NdbDictionary::Column::Decimal: - ndbout << "Decimal "; - break; - case NdbDictionary::Column::Char: - ndbout << "Char "; - break; - case NdbDictionary::Column::Varchar: - ndbout << "Varchar "; - break; - case NdbDictionary::Column::Binary: - ndbout << "Binary "; - break; - case NdbDictionary::Column::Varbinary: - ndbout << "Varbinary "; - break; - case NdbDictionary::Column::Bigint: - ndbout << "Bigint "; - break; - case NdbDictionary::Column::Bigunsigned: - ndbout << "Bigunsigned "; - break; - case NdbDictionary::Column::Double: - ndbout << "Double "; - break; - case NdbDictionary::Column::Datetime: - ndbout << "Datetime "; - break; - case NdbDictionary::Column::Timespec: - ndbout << "Timespec "; - break; - case NdbDictionary::Column::Undefined: - ndbout << "Undefined "; - break; - default: - ndbout << "Unknown(" << type << ")"; - } - ndbout << " key: " << desc->key; - ndbout << " array: " << desc->arraySize; - ndbout << " size: " << desc->size << endl; - } // for - return ndbout; -} - - -#if 0 -/***************************************** - * - * Callback function for asynchronous transactions - * - * Idea for error handling: Transaction objects have to be stored globally when - * they are prepared. - * In the callback function if the transaction: - * succeeded: delete the object from global storage - * failed but can be retried: execute the object that is in global storage - * failed but fatal: delete the object from global storage - * - ******************************************/ -static void restoreCallback(int result, // Result for transaction - NdbConnection *object, // Transaction object - void *anything) // Not used -{ - static Uint32 counter = 0; - - - debug << "restoreCallback function called " << counter << " time(s)" << endl; - - ++counter; - - if (result == -1) - { - ndbout << " restoreCallback (" << counter; - if ((counter % 10) == 1) - { - ndbout << "st"; - } // if - else if ((counter % 10) == 2) - { - ndbout << "nd"; - } // else if - else if ((counter % 10 ) ==3) - { - ndbout << "rd"; - } // else if - else - { - ndbout << "th"; - } // else - err << " time: error detected " << object->getNdbError() << endl; - } // if - -} // restoreCallback -#endif - - - -bool -BackupPrinter::table(const TableS & tab) -{ - if (m_print || m_print_meta) - { - m_ndbout << tab; - ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName()); - } - return true; -} - -#ifdef USE_MYSQL -bool -BackupPrinter::table(const TableS & tab, MYSQL * mysql) -{ - if (m_print || m_print_meta) - { - - char tmpTabName[MAX_TAB_NAME_SIZE*2]; - sprintf(tmpTabName, "%s", tab.getTableName()); - char * database = strtok(tmpTabName, "/"); - char * schema = strtok( NULL , "/"); - char * tableName = strtok( NULL , "/"); - - /** - * this means that the user did not specify schema - * and it is a v2x backup - */ - if(database == NULL) - return false; - if(schema == NULL) - return false; - if(tableName==NULL) - tableName = schema; - - char stmtCreateDB[255]; - - sprintf(stmtCreateDB,"CREATE DATABASE %s", database); - ndbout_c("%s", stmtCreateDB); - - - char buf [2048]; - create_table_string(tab, tableName, buf); - ndbout_c("%s", buf); - - ndbout_c("Successfully printed table: %s", tab.m_dictTable->getName()); - } - return true; -} - -#endif - -void -BackupPrinter::tuple(const TupleS & tup) -{ - if (m_print || m_print_data) - m_ndbout << tup << endl; -} - -void -BackupPrinter::logEntry(const LogEntry & logE) -{ - if (m_print || m_print_log) - m_ndbout << logE << endl; - m_logCount++; -} - -bool -BackupRestore::init() -{ - - if (!m_restore && !m_restore_meta) - return true; - - if (ga_connect_NDB != NULL) - { - // Use connection string - Ndb::setConnectString(ga_connect_NDB); - } - - m_ndb = new Ndb(); - - if (m_ndb == NULL) - return false; - - // Turn off table name completion - m_ndb->useFullyQualifiedNames(false); - - m_ndb->init(1024); - if (m_ndb->waitUntilReady(30) != 0) - { - ndbout << "Failed to connect to ndb!!" << endl; - delete m_ndb; - return false; - } - ndbout << "Connected to ndb!!" << endl; - -#if USE_MYSQL - if(use_mysql) - { - if ( mysql_thread_safe() == 0 ) - { - ndbout << "Not thread safe mysql library..." << endl; - exit(-1); - } - - ndbout << "Connecting to MySQL..." <<endl; - - /** - * nwe param: - * port - * host - * user - */ - bool returnValue = true; - mysql_init(&mysql); - { - int portNo = 3306; - if ( mysql_real_connect(&mysql, - ga_host, - ga_user, - ga_password, - ga_database, - ga_port, - ga_socket, - 0) == NULL ) - { - ndbout_c("Connect failed: %s", mysql_error(&mysql)); - returnValue = false; - } - ndbout << "Connected to MySQL!!!" <<endl; - } - - /* if(returnValue){ - mysql_set_server_option(&mysql, MYSQL_OPTION_MULTI_STATEMENTS_ON); - } - */ - return returnValue; - } -#endif - return true; - -} - -BackupRestore::~BackupRestore() -{ - if (m_ndb != 0) - delete m_ndb; -} -#ifdef USE_MYSQL -bool -BackupRestore::table(const TableS & table, MYSQL * mysqlp){ - if (!m_restore_meta) - { - return true; - } - - char tmpTabName[MAX_TAB_NAME_SIZE*2]; - sprintf(tmpTabName, "%s", table.getTableName()); - char * database = strtok(tmpTabName, "/"); - char * schema = strtok( NULL , "/"); - char * tableName = strtok( NULL , "/"); - - /** - * this means that the user did not specify schema - * and it is a v2x backup - */ - if(database == NULL) - return false; - if(schema == NULL) - return false; - if(tableName==NULL) - tableName = schema; - - char stmtCreateDB[255]; - sprintf(stmtCreateDB,"CREATE DATABASE %s", database); - - /*ignore return value. mysql_select_db will trap errors anyways*/ - if (mysql_query(mysqlp,stmtCreateDB) == 0) - { - //ndbout_c("%s", stmtCreateDB); - } - - if (mysql_select_db(&mysql, database) != 0) - { - ndbout_c("Error: %s", mysql_error(&mysql)); - return false; - } - - char buf [2048]; - /** - * create table ddl - */ - if (create_table_string(table, tableName, buf)) - { - ndbout_c("Unable to create a table definition since the " - "backup contains undefined types"); - return false; - } - - //ndbout_c("%s", buf); - - if (mysql_query(mysqlp,buf) != 0) - { - ndbout_c("Error: %s", mysql_error(&mysql)); - return false; - } else - { - ndbout_c("Successfully restored table %s into database %s", tableName, database); - } - - return true; -} -#endif - -int -BackupConsumer::create_table_string(const TableS & table, - char * tableName, - char *buf){ - int pos = 0; - int pos2 = 0; - char buf2[2048]; - - pos += sprintf(buf+pos, "%s%s", "CREATE TABLE ", tableName); - pos += sprintf(buf+pos, "%s", "("); - pos2 += sprintf(buf2+pos2, "%s", " primary key("); - - for (int j = 0; j < table.getNoOfAttributes(); j++) - { - const AttributeDesc * desc = table[j]; - // ndbout << desc->name << ": "; - pos += sprintf(buf+pos, "%s%s", desc->name," "); - NdbDictionary::Column::Type type = table.m_dictTable->getColumn(desc->attrId)->getType(); - switch(type){ - case NdbDictionary::Column::Int: - pos += sprintf(buf+pos, "%s", "int"); - break; - case NdbDictionary::Column::Unsigned: - pos += sprintf(buf+pos, "%s", "int unsigned"); - break; - case NdbDictionary::Column::Float: - pos += sprintf(buf+pos, "%s", "float"); - break; - case NdbDictionary::Column::Decimal: - pos += sprintf(buf+pos, "%s", "decimal"); - break; - case NdbDictionary::Column::Char: - pos += sprintf(buf+pos, "%s", "char"); - break; - case NdbDictionary::Column::Varchar: - pos += sprintf(buf+pos, "%s", "varchar"); - break; - case NdbDictionary::Column::Binary: - pos += sprintf(buf+pos, "%s", "binary"); - break; - case NdbDictionary::Column::Varbinary: - pos += sprintf(buf+pos, "%s", "varchar binary"); - break; - case NdbDictionary::Column::Bigint: - pos += sprintf(buf+pos, "%s", "bigint"); - break; - case NdbDictionary::Column::Bigunsigned: - pos += sprintf(buf+pos, "%s", "bigint unsigned"); - break; - case NdbDictionary::Column::Double: - pos += sprintf(buf+pos, "%s", "double"); - break; - case NdbDictionary::Column::Datetime: - pos += sprintf(buf+pos, "%s", "datetime"); - break; - case NdbDictionary::Column::Timespec: - pos += sprintf(buf+pos, "%s", "time"); - break; - case NdbDictionary::Column::Undefined: - // pos += sprintf(buf+pos, "%s", "varchar binary"); - return -1; - break; - default: - //pos += sprintf(buf+pos, "%s", "varchar binary"); - return -1; - } - if (desc->arraySize > 1) { - int attrSize = desc->arraySize; - pos += sprintf(buf+pos, "%s%u%s", - "(", - attrSize, - ")"); - } - if (table.m_dictTable->getColumn(desc->attrId)->getPrimaryKey()) { - pos += sprintf(buf+pos, "%s", " not null"); - pos2 += sprintf(buf2+pos2, "%s%s", desc->name, ","); - } - pos += sprintf(buf+pos, "%s", ","); - } // for - pos2--; // remove trailing comma - pos2 += sprintf(buf2+pos2, "%s", ")"); - // pos--; // remove trailing comma - - pos += sprintf(buf+pos, "%s", buf2); - pos += sprintf(buf+pos, "%s", ") type=ndbcluster"); - return 0; -} - - - -bool -BackupRestore::table(const TableS & table){ - if (!m_restore_meta) - { - return true; - } - NdbDictionary::Dictionary* dict = m_ndb->getDictionary(); - if (dict->createTable(*table.m_dictTable) == -1) - { - err << "Create table " << table.getTableName() << " failed: " - << dict->getNdbError() << endl; - return false; - } - info << "Successfully restored table " << table.getTableName()<< endl ; - return true; -} - - - -/* - * callback : This is called when the transaction is polled - * - * (This function must have three arguments: - * - The result of the transaction, - * - The NdbConnection object, and - * - A pointer to an arbitrary object.) - */ - -static void -callback(int result, NdbConnection* trans, void* aObject) -{ - restore_callback_t * cbData = (restore_callback_t *)aObject; - if (result<0) - { - /** - * Error. temporary or permanent? - */ - if (asynchErrorHandler(trans, (Ndb*)cbData->ndb)) - { - ((Ndb*)cbData->ndb)->closeTransaction(asynchTrans[cbData->transaction]); - cbData->retries++; - ((BackupRestore*)cbData)->tupleAsynch( * (TupleS*)(cbData->tup), cbData); - } - else - { - ndbout_c("Restore: Failed to restore data " - "due to a unrecoverable error. Exiting..."); - delete (Ndb*)cbData->ndb; - delete cbData->tup; - delete cbData; - exit(-1); - } - } - else - { - /** - * OK! close transaction - */ - ((Ndb*)cbData->ndb)->closeTransaction(asynchTrans[cbData->transaction]); - delete cbData->tup; - delete cbData; - } -} - -static int nPreparedTransactions = 0; -void -BackupPrinter::tupleAsynch(const TupleS & tup, restore_callback_t * callback) -{ - m_dataCount++; - if (m_print || m_print_data) - m_ndbout << tup << endl; -} - -void BackupRestore::tupleAsynch(const TupleS & tup, restore_callback_t * cbData) -{ - - if (!m_restore) - { - delete &tup; - return; - } - Uint32 retries; - if (cbData!=0) - retries = cbData->retries; - else - retries = 0; - - while (retries < 10) - { - /** - * start transactions - */ - asynchTrans[nPreparedTransactions] = m_ndb->startTransaction(); - if (asynchTrans[nPreparedTransactions] == NULL) - { - if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb)) - { - retries++; - continue; - } - asynchExitHandler(); - } // if - - const TableS * table = tup.getTable(); - NdbOperation * op = - asynchTrans[nPreparedTransactions]->getNdbOperation(table->getTableName()); - - if (op == NULL) - { - if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb)) - { - retries++; - continue; - } - asynchExitHandler(); - } // if - - if (op->writeTuple() == -1) - { - if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb)) - { - retries++; - continue; - } - asynchExitHandler(); - } // if - - Uint32 ret = 0; - for (int i = 0; i < tup.getNoOfAttributes(); i++) - { - const AttributeS * attr = tup[i]; - int size = attr->Desc->size; - int arraySize = attr->Desc->arraySize; - const KeyType key = attr->Desc->key; - char * dataPtr = attr->Data.string_value; - Uint32 length = (size * arraySize) / 8; - if (key == TupleKey) - { - ret = op->equal(i, dataPtr, length); - if (ret<0) - { - ndbout_c("Column: %d type %d",i, - tup.getTable()->m_dictTable->getColumn(i)->getType()); - - if (asynchErrorHandler(asynchTrans[nPreparedTransactions],m_ndb)) - { - retries++; - continue; - } - asynchExitHandler(); - } - } - } - - for (int i = 0; i < tup.getNoOfAttributes(); i++) - { - const AttributeS * attr = tup[i]; - int size = attr->Desc->size; - int arraySize = attr->Desc->arraySize; - KeyType key = attr->Desc->key; - char * dataPtr = attr->Data.string_value; - Uint32 length = (size * arraySize) / 8; - - if (key == NoKey && !attr->Data.null) - ret = op->setValue(i, dataPtr, length); - else if (key == NoKey && attr->Data.null) - ret = op->setValue(i, NULL, 0); - - if (ret<0) - { - ndbout_c("Column: %d type %d",i, - tup.getTable()->m_dictTable->getColumn(i)->getType()); - if (asynchErrorHandler(asynchTrans[nPreparedTransactions], m_ndb)) - { - retries++; - continue; - } - asynchExitHandler(); - } - } - restore_callback_t * cb; - if (cbData ==0) - { - cb = new restore_callback_t; - cb->retries = 0; - } - else - cb =cbData; - cb->ndb = m_ndb; - cb->restore = this; - cb->tup = (TupleS*)&tup; - cb->transaction = nPreparedTransactions; - - // Prepare transaction (the transaction is NOT yet sent to NDB) - asynchTrans[nPreparedTransactions]->executeAsynchPrepare(Commit, - &callback, - cb); - if (nPreparedTransactions == ga_nParallelism-1) - { - // send-poll all transactions - // close transaction is done in callback - m_ndb->sendPollNdb(3000, ga_nParallelism); - nPreparedTransactions=0; - } - else - nPreparedTransactions++; - m_dataCount++; - return; - } - ndbout_c("Unable to recover from errors. Exiting..."); - asynchExitHandler(); -} - -void BackupRestore::asynchExitHandler() -{ - if (m_ndb != NULL) - delete m_ndb; - exit(-1); -} -/** - * returns true if is recoverable, - * Error handling based on hugo - * false if it is an error that generates an abort. - */ -static -bool asynchErrorHandler(NdbConnection * trans, Ndb* ndb) -{ - - NdbError error = trans->getNdbError(); - ndb->closeTransaction(trans); - switch(error.status) - { - case NdbError::Success: - return false; - // ERROR! - break; - - case NdbError::TemporaryError: - NdbSleep_MilliSleep(10); - return true; - // RETRY - break; - - case NdbError::UnknownResult: - ndbout << error << endl; - return false; - // ERROR! - break; - - default: - case NdbError::PermanentError: - switch (error.code) - { - case 499: - case 250: - NdbSleep_MilliSleep(10); - return true; //temp errors? - default: - break; - } - //ERROR - ndbout << error << endl; - return false; - break; - } - return false; -} - - - -void -BackupRestore::tuple(const TupleS & tup) -{ - if (!m_restore) - return; - while (1) - { - NdbConnection * trans = m_ndb->startTransaction(); - if (trans == NULL) - { - // Deep shit, TODO: handle the error - ndbout << "Cannot start transaction" << endl; - exit(-1); - } // if - - const TableS * table = tup.getTable(); - NdbOperation * op = trans->getNdbOperation(table->getTableName()); - if (op == NULL) - { - ndbout << "Cannot get operation: "; - ndbout << trans->getNdbError() << endl; - exit(-1); - } // if - - // TODO: check return value and handle error - if (op->writeTuple() == -1) - { - ndbout << "writeTuple call failed: "; - ndbout << trans->getNdbError() << endl; - exit(-1); - } // if - - for (int i = 0; i < tup.getNoOfAttributes(); i++) - { - const AttributeS * attr = tup[i]; - int size = attr->Desc->size; - int arraySize = attr->Desc->arraySize; - KeyType key = attr->Desc->key; - const char * dataPtr = attr->Data.string_value; - - const Uint32 length = (size * arraySize) / 8; - if (key == TupleKey) - { - op->equal(i, dataPtr, length); - } - } - - for (int i = 0; i < tup.getNoOfAttributes(); i++) - { - const AttributeS * attr = tup[i]; - int size = attr->Desc->size; - int arraySize = attr->Desc->arraySize; - KeyType key = attr->Desc->key; - const char * dataPtr = attr->Data.string_value; - - const Uint32 length = (size * arraySize) / 8; - if (key == NoKey && !attr->Data.null) - { - op->setValue(i, dataPtr, length); - } - else if (key == NoKey && attr->Data.null) - { - op->setValue(i, NULL, 0); - } - } - int ret = trans->execute(Commit); - if (ret != 0) - { - ndbout << "execute failed: "; - ndbout << trans->getNdbError() << endl; - exit(-1); - } - m_ndb->closeTransaction(trans); - if (ret == 0) - break; - } - m_dataCount++; -} - -void -BackupRestore::endOfTuples() -{ - if (!m_restore) - return; - // Send all transactions to NDB - m_ndb->sendPreparedTransactions(0); - // Poll all transactions - m_ndb->pollNdb(3000, nPreparedTransactions); - // Close all transactions - // for (int i = 0; i < nPreparedTransactions; i++) - // m_ndb->closeTransaction(asynchTrans[i]); - nPreparedTransactions=0; -} - -void -BackupRestore::logEntry(const LogEntry & tup) -{ - if (!m_restore) - return; - - NdbConnection * trans = m_ndb->startTransaction(); - if (trans == NULL) - { - // Deep shit, TODO: handle the error - ndbout << "Cannot start transaction" << endl; - exit(-1); - } // if - - const TableS * table = tup.m_table; - NdbOperation * op = trans->getNdbOperation(table->getTableName()); - if (op == NULL) - { - ndbout << "Cannot get operation: "; - ndbout << trans->getNdbError() << endl; - exit(-1); - } // if - - int check = 0; - switch(tup.m_type) - { - case LogEntry::LE_INSERT: - check = op->insertTuple(); - break; - case LogEntry::LE_UPDATE: - check = op->updateTuple(); - break; - case LogEntry::LE_DELETE: - check = op->deleteTuple(); - break; - default: - ndbout << "Log entry has wrong operation type." - << " Exiting..."; - exit(-1); - } - - for (int i = 0; i < tup.m_values.size(); i++) - { - const AttributeS * attr = tup.m_values[i]; - int size = attr->Desc->size; - int arraySize = attr->Desc->arraySize; - KeyType key = attr->Desc->key; - const char * dataPtr = attr->Data.string_value; - - const Uint32 length = (size / 8) * arraySize; - if (key == TupleKey) - { - op->equal(attr->Desc->attrId, dataPtr, length); - } - else if (key == NoKey) - { - op->setValue(attr->Desc->attrId, dataPtr, length); - } - } - -#if 1 - trans->execute(Commit); -#else - const int ret = trans->execute(Commit); - // Both insert update and delete can fail during log running - // and it's ok - - if (ret != 0) - { - ndbout << "execute failed: "; - ndbout << trans->getNdbError() << endl; - exit(-1); - } -#endif - - m_ndb->closeTransaction(trans); - m_logCount++; -} - -void -BackupRestore::endOfLogEntrys() -{ - if (ga_restore) - { - ndbout << "Restored " << m_dataCount << " tuples and " - << m_logCount << " log entries" << endl; - } -} - -void -BackupPrinter::endOfLogEntrys() -{ - if (m_print || m_print_log) - { - ndbout << "Printed " << m_dataCount << " tuples and " - << m_logCount << " log entries" - << " to stdout." << endl; - } -} - - - - diff --git a/ndb/src/kernel/blocks/backup/restore/myVector.hpp b/ndb/src/kernel/blocks/backup/restore/myVector.hpp deleted file mode 100644 index c858999d2be..00000000000 --- a/ndb/src/kernel/blocks/backup/restore/myVector.hpp +++ /dev/null @@ -1,128 +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 */ - -#ifndef MY_VECTOR_HPP -#define MY_VECTOR_HPP - -// Template class for std::vector-like class (hopefully works in OSE) -template <class T> -class myVector -{ - - // Note that last element in array is used for end() and is always empty - int sizeIncrement; - int thisSize; - int used; - T *storage; - -public: - - // Assignment of whole vector - myVector<T> & operator=(myVector<T> & org) { - - // Don't copy if they point to the same address - if (!(this == &org)) { - // Check memory space - if (thisSize < org.thisSize) { - // We have to increase memory for destination - T* tmpStorage = new T[org.thisSize]; - delete[] storage; - storage = tmpStorage; - } // if - thisSize = org.thisSize; - sizeIncrement = org.sizeIncrement; - used = org.used; - for (int i = 0; i < thisSize; i++) { - storage[i] = org.storage[i]; - } // for - } // if - return *this; - } // operator= - - // Construct with size s+1 - myVector(int s = 1) : sizeIncrement(5), // sizeIncrement(s), - thisSize(s + 1), - used(0), - storage(new T[s + 1]) { } - - ~myVector() { delete[] storage; } // Destructor: deallocate memory - - T& operator[](int i) { // Return by index - if ((i < 0) || (i >= used)) { - // Index error - ndbout << "vector index out of range" << endl; - abort(); - return storage[used - 1]; - } // if - else { - return storage[i]; - } // else - } // operator[] - - const T& operator[](int i) const { // Return by index - if ((i < 0) || (i >= used)) { - // Index error - ndbout << "vector index out of range" << endl; - abort(); - return storage[used - 1]; - } // if - else { - return storage[i]; - } // else - } // operator[] - - int getSize() const { return used; } - - void push_back (T& item) { - if (used >= thisSize - 1) { - // We have to allocate new storage - int newSize = thisSize + sizeIncrement; - T* tmpStorage = new T[newSize]; - if (tmpStorage == NULL) { - // Memory allocation error! break - ndbout << "PANIC: Memory allocation error in vector" << endl; - return; - } // if - thisSize = newSize; - for (int i = 0; i < used; i++) { - tmpStorage[i] = storage[i]; - } // for - delete[] storage; - storage = tmpStorage; - } // if - - // Now push - storage[used] = item; - used++; - }; // myVector<> push_back() - - // Remove item at back - void pop_back() { - if (used > 0) { - used--; - } // if - } // pop_back() - - int size() const { return used; }; - - bool empty() const { return(used == 0); } - - void clear() { - used = 0; - } -}; - -#endif diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 02474f6bee0..933ee2cf8e1 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -2432,6 +2432,7 @@ void Dbacc::execACC_LOCKREQ(Signal* signal) } fragrecptr.i = req->fragPtrI; ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec); + ndbrequire(req->fragId == fragrecptr.p->myfid); // caller must be explicit here ndbrequire(req->accOpPtr == RNIL); // seize operation to hold the lock diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 613f9ccea11..1abf4b3a7e9 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -1225,6 +1225,18 @@ Dblqh::sendAddFragReq(Signal* signal) tuxreq->fragOff = addfragptr.p->lh3DistrBits; tuxreq->tableType = addfragptr.p->tableType; tuxreq->primaryTableId = addfragptr.p->primaryTableId; + // pointer to index fragment in TUP + tuxreq->tupIndexFragPtrI = + addfragptr.p->addfragStatus == AddFragRecord::WAIT_TWO_TUX ? + fragptr.p->tupFragptr[0] : fragptr.p->tupFragptr[1]; + // pointers to table fragments in TUP and ACC + FragrecordPtr tFragPtr; + tFragPtr.i = fragptr.p->tableFragptr; + ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); + tuxreq->tupTableFragPtrI[0] = tFragPtr.p->tupFragptr[0]; + tuxreq->tupTableFragPtrI[1] = tFragPtr.p->tupFragptr[1]; + tuxreq->accTableFragPtrI[0] = tFragPtr.p->accFragptr[0]; + tuxreq->accTableFragPtrI[1] = tFragPtr.p->accFragptr[1]; sendSignal(fragptr.p->tuxBlockref, GSN_TUXFRAGREQ, signal, TuxFragReq::SignalLength, JBB); return; diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 1c916c2754c..5afd79687a1 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -2736,8 +2736,8 @@ void Dbtc::execTCKEYREQ(Signal* signal) case ZUPDATE: jam(); if (Tattrlength == 0) { - TCKEY_abort(signal, 5); - return; + //TCKEY_abort(signal, 5); + //return; }//if /*---------------------------------------------------------------------*/ // The missing break is intentional since we also want to set the opLock @@ -5950,62 +5950,70 @@ void Dbtc::checkStartFragTimeout(Signal* signal) /* BEEN DELAYED FOR SO LONG THAT WE ARE FORCED TO PERFORM */ /* SOME ACTION, EITHER ABORT OR RESEND OR REMOVE A NODE FROM */ /* THE WAITING PART OF A PROTOCOL. */ +/* +The algorithm used here is to check 1024 transactions at a time before +doing a real-time break. +To avoid aborting both transactions in a deadlock detected by time-out +we insert a random extra time-out of upto 630 ms by using the lowest +six bits of the api connect reference. +We spread it out from 0 to 630 ms if base time-out is larger than 3 sec, +we spread it out from 0 to 70 ms if base time-out is smaller than 300 msec, +and otherwise we spread it out 310 ms. +*/ /*------------------------------------------------------------------*/ -void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 TapiConPtr) +void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) { - UintR texpiredTime[8]; - UintR TloopCount = 0; + Uint32 end_ptr, time_passed, time_out_value, mask_value; + const Uint32 api_con_sz= capiConnectFilesize; + const Uint32 tc_timer= ctcTimer; + const Uint32 time_out_param= ctimeOutValue; - ctimeOutCheckHeartbeat = ctcTimer; + ctimeOutCheckHeartbeat = tc_timer; - const Uint32 TapiConSz = capiConnectFilesize; - const Uint32 TtcTimer = ctcTimer; - const Uint32 TtimeOutValue = ctimeOutValue; - - while ((TapiConPtr + 8) < TapiConSz) { - jam(); - texpiredTime[0] = TtcTimer - getApiConTimer(TapiConPtr + 0); - texpiredTime[1] = TtcTimer - getApiConTimer(TapiConPtr + 1); - texpiredTime[2] = TtcTimer - getApiConTimer(TapiConPtr + 2); - texpiredTime[3] = TtcTimer - getApiConTimer(TapiConPtr + 3); - texpiredTime[4] = TtcTimer - getApiConTimer(TapiConPtr + 4); - texpiredTime[5] = TtcTimer - getApiConTimer(TapiConPtr + 5); - texpiredTime[6] = TtcTimer - getApiConTimer(TapiConPtr + 6); - texpiredTime[7] = TtcTimer - getApiConTimer(TapiConPtr + 7); - for (Uint32 Ti = 0; Ti < 8; Ti++) { - if (getApiConTimer(TapiConPtr + Ti) != 0) { - if (texpiredTime[Ti] > TtimeOutValue) { - jam(); - timeOutFoundLab(signal, TapiConPtr + Ti); - return; - }//if - }//if - }//for - TapiConPtr += 8; - if (TloopCount++ > 128) { - jam(); - sendContinueTimeOutControl(signal, TapiConPtr); - return; - }//if - }//while - for ( ; TapiConPtr < TapiConSz; TapiConPtr++) { + if (api_con_ptr + 1024 < api_con_sz) { jam(); - if (getApiConTimer(TapiConPtr) != 0) { - texpiredTime[0] = TtcTimer - getApiConTimer(TapiConPtr); - if (texpiredTime[0] > TtimeOutValue) { + end_ptr= api_con_ptr + 1024; + } else { + jam(); + end_ptr= api_con_sz; + } + if (time_out_param > 300) { + jam(); + mask_value= 63; + } else if (time_out_param < 30) { + jam(); + mask_value= 7; + } else { + jam(); + mask_value= 31; + } + for ( ; api_con_ptr < end_ptr; api_con_ptr++) { + Uint32 api_timer= getApiConTimer(api_con_ptr); + jam(); + if (api_timer != 0) { + time_out_value= time_out_param + (api_con_ptr & mask_value); + time_passed= tc_timer - api_timer; + if (time_passed > time_out_value) { jam(); - timeOutFoundLab(signal, TapiConPtr); + timeOutFoundLab(signal, api_con_ptr); return; - }//if - }//if - }//for - /*------------------------------------------------------------------*/ - /* */ - /* WE HAVE NOW CHECKED ALL TRANSACTIONS FOR TIME-OUT AND ALSO */ - /* STARTED TIME-OUT HANDLING OF THOSE WE FOUND. WE ARE NOW */ - /* READY AND CAN WAIT FOR THE NEXT TIME-OUT CHECK. */ - /*------------------------------------------------------------------*/ - ctimeOutCheckActive = TOCS_FALSE; + } + } + } + if (api_con_ptr == api_con_sz) { + jam(); + /*------------------------------------------------------------------*/ + /* */ + /* WE HAVE NOW CHECKED ALL TRANSACTIONS FOR TIME-OUT AND ALSO */ + /* STARTED TIME-OUT HANDLING OF THOSE WE FOUND. WE ARE NOW */ + /* READY AND CAN WAIT FOR THE NEXT TIME-OUT CHECK. */ + /*------------------------------------------------------------------*/ + ctimeOutCheckActive = TOCS_FALSE; + } else { + jam(); + sendContinueTimeOutControl(signal, api_con_ptr); + } + return; }//Dbtc::timeOutLoopStartLab() void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index c09c8984ce2..4781230a311 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -996,6 +996,31 @@ public: Dbtup(const class Configuration &); virtual ~Dbtup(); + /* + * TUX uses logical tuple address when talking to ACC and LQH. + */ + void tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32& tupAddr); + + /* + * TUX index in TUP has single Uint32 array attribute which stores an + * index node. TUX reads and writes the node directly via pointer. + */ + int tuxAllocNode(Signal* signal, Uint32 fragPtrI, Uint32& pageId, Uint32& pageOffset, Uint32*& node); + void tuxFreeNode(Signal* signal, Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* node); + void tuxGetNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32*& node); + + /* + * TUX reads primary table attributes for index keys. Input is + * attribute ids in AttributeHeader format. Output is pointers to + * attribute data within tuple or 0 for NULL value. + */ + void tuxReadAttrs(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupVersion, Uint32 numAttrs, const Uint32* attrIds, const Uint32** attrData); + + /* + * TUX reads primary key for md5 summing and when returning keyinfo. + */ + void tuxReadKeys(); // under construction + private: BLOCK_DEFINES(Dbtup); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp index 3a074f7fe5b..f11de5238e2 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp @@ -31,6 +31,154 @@ // methods used by ordered index void +Dbtup::tuxGetTupAddr(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32& tupAddr) +{ + ljamEntry(); + FragrecordPtr fragPtr; + fragPtr.i = fragPtrI; + ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); + TablerecPtr tablePtr; + tablePtr.i = fragPtr.p->fragTableId; + ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec); + PagePtr pagePtr; + pagePtr.i = pageId; + ptrCheckGuard(pagePtr, cnoOfPage, page); + Uint32 fragPageId = pagePtr.p->pageWord[ZPAGE_FRAG_PAGE_ID_POS]; + Uint32 tupheadsize = tablePtr.p->tupheadsize; + ndbrequire(pageOffset >= ZPAGE_HEADER_SIZE); + Uint32 offset = pageOffset - ZPAGE_HEADER_SIZE; + ndbrequire(offset % tupheadsize == 0); + Uint32 pageIndex = (offset / tupheadsize) << 1; + tupAddr = (fragPageId << MAX_TUPLES_BITS) | pageIndex; +} + +int +Dbtup::tuxAllocNode(Signal* signal, Uint32 fragPtrI, Uint32& pageId, Uint32& pageOffset, Uint32*& node) +{ + ljamEntry(); + FragrecordPtr fragPtr; + fragPtr.i = fragPtrI; + ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); + TablerecPtr tablePtr; + tablePtr.i = fragPtr.p->fragTableId; + ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec); + PagePtr pagePtr; + terrorCode = 0; + if (! allocTh(fragPtr.p, tablePtr.p, NORMAL_PAGE, signal, pageOffset, pagePtr)) { + ljam(); + ndbrequire(terrorCode != 0); + return terrorCode; + } + pageId = pagePtr.i; + Uint32 attrDescIndex = tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE); + Uint32 attrDataOffset = AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr); + node = &pagePtr.p->pageWord[pageOffset] + attrDataOffset; + return 0; +} + +void +Dbtup::tuxFreeNode(Signal* signal, Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* node) +{ + ljamEntry(); + FragrecordPtr fragPtr; + fragPtr.i = fragPtrI; + ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); + TablerecPtr tablePtr; + tablePtr.i = fragPtr.p->fragTableId; + ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec); + PagePtr pagePtr; + pagePtr.i = pageId; + ptrCheckGuard(pagePtr, cnoOfPage, page); + Uint32 attrDescIndex = tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE); + Uint32 attrDataOffset = AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr); + ndbrequire(node == &pagePtr.p->pageWord[pageOffset] + attrDataOffset); + freeTh(fragPtr.p, tablePtr.p, signal, pagePtr.p, pageOffset); +} + +void +Dbtup::tuxGetNode(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32*& node) +{ + ljamEntry(); + FragrecordPtr fragPtr; + fragPtr.i = fragPtrI; + ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); + TablerecPtr tablePtr; + tablePtr.i = fragPtr.p->fragTableId; + ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec); + PagePtr pagePtr; + pagePtr.i = pageId; + ptrCheckGuard(pagePtr, cnoOfPage, page); + Uint32 attrDescIndex = tablePtr.p->tabDescriptor + (0 << ZAD_LOG_SIZE); + Uint32 attrDataOffset = AttributeOffset::getOffset(tableDescriptor[attrDescIndex + 1].tabDescr); + node = &pagePtr.p->pageWord[pageOffset] + attrDataOffset; +} + +void +Dbtup::tuxReadAttrs(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32 tupVersion, Uint32 numAttrs, const Uint32* attrIds, const Uint32** attrData) +{ + ljamEntry(); + FragrecordPtr fragPtr; + fragPtr.i = fragPtrI; + ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); + TablerecPtr tablePtr; + tablePtr.i = fragPtr.p->fragTableId; + ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec); + PagePtr pagePtr; + pagePtr.i = pageId; + ptrCheckGuard(pagePtr, cnoOfPage, page); + // search for tuple version if not original + if (pagePtr.p->pageWord[pageOffset + 1] != tupVersion) { + ljam(); + OperationrecPtr opPtr; + opPtr.i = pagePtr.p->pageWord[pageOffset]; + Uint32 loopGuard = 0; + while (true) { + ptrCheckGuard(opPtr, cnoOfOprec, operationrec); + if (opPtr.p->realPageIdC != RNIL) { + pagePtr.i = opPtr.p->realPageIdC; + pageOffset = opPtr.p->pageOffsetC; + ptrCheckGuard(pagePtr, cnoOfPage, page); + if (pagePtr.p->pageWord[pageOffset + 1] == tupVersion) { + ljam(); + break; + } + } + ljam(); + opPtr.i = opPtr.p->nextActiveOp; + ndbrequire(++loopGuard < (1 << ZTUP_VERSION_BITS)); + } + } + const Uint32 tabDescriptor = tablePtr.p->tabDescriptor; + const Uint32* tupleHeader = &pagePtr.p->pageWord[pageOffset]; + for (Uint32 i = 0; i < numAttrs; i++) { + AttributeHeader ah(attrIds[i]); + Uint32 attrId = ah.getAttributeId(); + Uint32 index = tabDescriptor + (attrId << ZAD_LOG_SIZE); + Uint32 desc1 = tableDescriptor[index].tabDescr; + Uint32 desc2 = tableDescriptor[index + 1].tabDescr; + if (AttributeDescriptor::getNullable(desc1)) { + Uint32 offset = AttributeOffset::getNullFlagOffset(desc2); + ndbrequire(offset < tablePtr.p->tupNullWords); + offset += tablePtr.p->tupNullIndex; + ndbrequire(offset < tablePtr.p->tupheadsize); + if (AttributeOffset::isNULL(tupleHeader[offset], desc2)) { + ljam(); + attrData[i] = 0; + continue; + } + } + attrData[i] = tupleHeader + AttributeOffset::getOffset(desc2); + } +} + +void // under construction +Dbtup::tuxReadKeys() +{ +} + +// deprecated signal interfaces + +void Dbtup::execTUP_READ_ATTRS(Signal* signal) { ljamEntry(); @@ -168,10 +316,10 @@ Dbtup::execTUP_QUERY_TH(Signal* signal) for this transaction and savepoint id. If its tuple version equals the requested then we have a visible tuple otherwise not. */ - jam(); + ljam(); Uint32 read_tupVersion = pagePtr.p->pageWord[tempOp.pageOffset + 1]; if (read_tupVersion == req_tupVersion) { - jam(); + ljam(); ret_result = 1; } } @@ -425,7 +573,8 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) buildPtr.p->m_tupleNo = 0; break; } - pagePtr.i = getRealpid(fragPtr.p, buildPtr.p->m_pageId); + Uint32 realPageId = getRealpid(fragPtr.p, buildPtr.p->m_pageId); + pagePtr.i = realPageId; ptrCheckGuard(pagePtr, cnoOfPage, page); const Uint32 pageState = pagePtr.p->pageWord[ZPAGE_STATE_POS]; if (pageState != ZTH_MM_FREE && @@ -439,8 +588,7 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) } // get tuple const Uint32 tupheadsize = tablePtr.p->tupheadsize; - const Uint32 pageOffset = ZPAGE_HEADER_SIZE + - buildPtr.p->m_tupleNo * tupheadsize; + Uint32 pageOffset = ZPAGE_HEADER_SIZE + buildPtr.p->m_tupleNo * tupheadsize; if (pageOffset + tupheadsize > ZWORDS_ON_PAGE) { ljam(); buildPtr.p->m_pageId++; @@ -472,15 +620,14 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) buildPtr.p->m_tupleNo++; break; } + Uint32 tupVersion = pagePtr.p->pageWord[pageOffset + 1]; OperationrecPtr pageOperPtr; pageOperPtr.i = pagePtr.p->pageWord[pageOffset]; - Uint32 pageId = buildPtr.p->m_pageId; - Uint32 pageIndex = buildPtr.p->m_tupleNo << 1; if (pageOperPtr.i != RNIL) { /* If there is an ongoing operation on the tuple then it is either a copy tuple or an original tuple with an ongoing transaction. In - both cases fragPageId and pageIndex refers to the original tuple. + both cases realPageId and pageOffset refer to the original tuple. The tuple address stored in TUX will always be the original tuple but with the tuple version of the tuple we found. @@ -490,12 +637,11 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) tuple as a copy tuple. The original tuple is stable and is thus preferrable to store in TUX. */ - jam(); + ljam(); ptrCheckGuard(pageOperPtr, cnoOfOprec, operationrec); - pageId = pageOperPtr.p->fragPageId; - pageIndex = pageOperPtr.p->pageIndex; + realPageId = pageOperPtr.p->realPageId; + pageOffset = pageOperPtr.p->pageOffset; }//if - Uint32 tup_version = pagePtr.p->pageWord[pageOffset + 1]; #ifdef TIME_MEASUREMENT NdbTick_getMicroTimer(&start); #endif @@ -505,8 +651,9 @@ Dbtup::buildIndex(Signal* signal, Uint32 buildPtrI) req->tableId = tablePtr.i; req->indexId = triggerPtr.p->indexId; req->fragId = tablePtr.p->fragid[buildPtr.p->m_fragNo]; - req->tupAddr = (pageId << MAX_TUPLES_BITS) | pageIndex; - req->tupVersion = tup_version; + req->pageId = realPageId; + req->pageOffset = pageOffset; + req->tupVersion = tupVersion; req->opInfo = TuxMaintReq::OpAdd; EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ, signal, TuxMaintReq::SignalLength); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp index 6fceea31150..a93ff4566e7 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp @@ -962,7 +962,8 @@ Dbtup::executeTuxInsertTriggers(Signal* signal, // fill in constant part req->tableId = regOperPtr->tableRef; req->fragId = regOperPtr->fragId; - req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex; + req->pageId = regOperPtr->realPageId; + req->pageOffset = regOperPtr->pageOffset; req->tupVersion = tupVersion; req->opInfo = TuxMaintReq::OpAdd; // loop over index list @@ -1000,7 +1001,8 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal, // fill in constant part req->tableId = regOperPtr->tableRef; req->fragId = regOperPtr->fragId; - req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex; + req->pageId = regOperPtr->realPageId; + req->pageOffset = regOperPtr->pageOffset; req->tupVersion = tupVersion; req->opInfo = TuxMaintReq::OpAdd; // loop over index list @@ -1009,7 +1011,6 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal, triggerList.first(triggerPtr); while (triggerPtr.i != RNIL) { ljam(); - req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex; req->indexId = triggerPtr.p->indexId; req->errorCode = RNIL; EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ, @@ -1074,7 +1075,8 @@ Dbtup::executeTuxCommitTriggers(Signal* signal, // fill in constant part req->tableId = regOperPtr->tableRef; req->fragId = regOperPtr->fragId; - req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex; + req->pageId = regOperPtr->realPageId; + req->pageOffset = regOperPtr->pageOffset; req->tupVersion = tupVersion; req->opInfo = TuxMaintReq::OpRemove; // loop over index list @@ -1117,7 +1119,8 @@ Dbtup::executeTuxAbortTriggers(Signal* signal, // fill in constant part req->tableId = regOperPtr->tableRef; req->fragId = regOperPtr->fragId; - req->tupAddr = (regOperPtr->fragPageId << MAX_TUPLES_BITS) | regOperPtr->pageIndex; + req->pageId = regOperPtr->realPageId; + req->pageOffset = regOperPtr->pageOffset; req->tupVersion = tupVersion; req->opInfo = TuxMaintReq::OpRemove; // loop over index list diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index e871fc86dea..25e85ba9f5f 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -20,11 +20,15 @@ #include <new> #include <ndb_limits.h> #include <SimulatedBlock.hpp> +#include <AttributeDescriptor.hpp> #include <AttributeHeader.hpp> #include <ArrayPool.hpp> #include <DataBuffer.hpp> #include <md5_hash.hpp> +// big brother +#include <Dbtup.hpp> + // signal classes #include <signaldata/DictTabInfo.hpp> #include <signaldata/TuxContinueB.hpp> @@ -81,6 +85,10 @@ #define jam() jamLine(90000 + __LINE__) #define jamEntry() jamEntryLine(90000 + __LINE__) #endif +#ifndef jam +#define jam() jamLine(__LINE__) +#define jamEntry() jamEntryLine(__LINE__) +#endif #undef max #undef min @@ -92,15 +100,13 @@ public: Dbtux(const Configuration& conf); virtual ~Dbtux(); + // pointer to TUP instance in this thread + Dbtup* c_tup; + private: // sizes are in words (Uint32) static const unsigned MaxIndexFragments = 2 * NO_OF_FRAG_PER_NODE; static const unsigned MaxIndexAttributes = MAX_ATTRIBUTES_IN_INDEX; -#ifdef VM_TRACE - static const unsigned MaxNodeHandles = 10000; // More space for printTree -#else - static const unsigned MaxNodeHandles = 128; // enough for 1 operation -#endif static const unsigned MaxAttrDataSize = 2048; public: static const unsigned DescPageSize = 256; @@ -114,7 +120,7 @@ private: struct DescEnt; /* - * Pointer to Uint32 data. Interpretation is context dependent. + * Pointer to array of Uint32. */ struct Data { private: @@ -130,7 +136,7 @@ private: friend class Data; /* - * Pointer to constant Uint32 data. + * Pointer to array of constant Uint32. */ struct ConstData; friend struct ConstData; @@ -153,8 +159,12 @@ private: static const unsigned AttributeHeaderSize = 1; /* - * Logical tuple address, "local key". Identifies both table tuples - * and index tuples. The code assumes it is one word. + * Array of pointers to TUP table attributes. Always read-on|y. + */ + typedef const Uint32** TableData; + + /* + * Logical tuple address, "local key". Identifies table tuples. */ typedef Uint32 TupAddr; static const unsigned NullTupAddr = (Uint32)-1; @@ -168,22 +178,32 @@ private: Uint32 m_pageId; // page i-value Uint16 m_pageOffset; // page offset in words TupLoc(); + TupLoc(Uint32 pageId, Uint16 pageOffset); + bool operator==(const TupLoc& loc) const; + bool operator!=(const TupLoc& loc) const; }; + /* + * There is no const member NullTupLoc since the compiler may not be + * able to optimize it to TupLoc() constants. Instead null values are + * constructed on the stack with TupLoc(). + */ +#define NullTupLoc TupLoc() + // tree definitions /* - * Tree entry. Points to a tuple in primary table via logical address - * of "original" tuple and tuple version. Uses 2 words to get correct - * aligment (one byte is wasted currently). + * Tree entry. Points to a tuple in primary table via physical + * address of "original" tuple and tuple version. + * + * ZTUP_VERSION_BITS must be 15 (or less). */ struct TreeEnt; friend struct TreeEnt; struct TreeEnt { - TupAddr m_tupAddr; // address of original tuple - Uint16 m_tupVersion; // version - Uint8 m_fragBit; // which duplicated table fragment - Uint8 unused1; + TupLoc m_tupLoc; // address of original tuple + unsigned m_tupVersion : 15; // version + unsigned m_fragBit : 1; // which duplicated table fragment TreeEnt(); // methods int cmp(const TreeEnt ent) const; @@ -196,7 +216,7 @@ private: * prefix 3) max and min entries 4) rest of entries 5) one extra entry * used as work space. * - * struct TreeNode part 1 + * struct TreeNode part 1, size 6 words * min prefix part 2, size TreeHead::m_prefSize * max prefix part 2, size TreeHead::m_prefSize * max entry part 3 @@ -204,6 +224,10 @@ private: * rest of entries part 4 * work entry part 5 * + * There are 3 links to other nodes: left child, right child, parent. + * These are in TupLoc format but the pageIds and pageOffsets are + * stored in separate arrays (saves 1 word). + * * Occupancy (number of entries) is at least 1 except temporarily when * a node is about to be removed. If occupancy is 1, only max entry * is present but both min and max prefixes are set. @@ -211,11 +235,12 @@ private: struct TreeNode; friend struct TreeNode; struct TreeNode { - TupAddr m_link[3]; // link to 0-left child 1-right child 2-parent - Uint8 m_side; // we are 0-left child 1-right child 2-root + Uint32 m_linkPI[3]; // link to 0-left child 1-right child 2-parent + Uint16 m_linkPO[3]; // page offsets for above real page ids + unsigned m_side : 2; // we are 0-left child 1-right child 2-root + int m_balance : 2; // balance -1, 0, +1 + unsigned pad1 : 4; Uint8 m_occup; // current number of entries - Int8 m_balance; // balance -1, 0, +1 - Uint8 unused1; Uint32 m_nodeScan; // list of scans at this node TreeNode(); }; @@ -243,7 +268,7 @@ private: Uint8 m_prefSize; // words in min/max prefix each Uint8 m_minOccup; // min entries in internal node Uint8 m_maxOccup; // max entries in node - TupAddr m_root; // root node + TupLoc m_root; // root node TreeHead(); // methods unsigned getSize(AccSize acc) const; @@ -261,8 +286,7 @@ private: struct TreePos; friend struct TreePos; struct TreePos { - TupAddr m_addr; // logical node address - TupLoc m_loc; // physical address + TupLoc m_loc; // physical node address Uint16 m_pos; // position 0 to m_occup Uint8 m_match; // at an existing entry Uint8 m_dir; // from link (0-2) or within node (3) @@ -304,10 +328,9 @@ private: * Attribute metadata. Size must be multiple of word size. */ struct DescAttr { - unsigned m_primaryAttrId : 16; - unsigned m_typeId : 8; - unsigned m_nullable : 1; - unsigned pad1 : 7; + Uint32 m_attrDesc; // standard AttributeDescriptor + Uint16 m_primaryAttrId; + Uint16 m_typeId; }; static const unsigned DescAttrSize = sizeof(DescAttr) >> 2; @@ -443,9 +466,11 @@ private: Uint16 m_descOff; Uint16 m_numAttrs; TreeHead m_tree; - Uint32 m_nodeList; // node cache of current operation - Uint32 m_nodeFree; // one node pre-allocated for insert + TupLoc m_freeLoc; // one node pre-allocated for insert DLList<ScanOp> m_scanList; // current scans on this fragment + Uint32 m_tupIndexFragPtrI; + Uint32 m_tupTableFragPtrI[2]; + Uint32 m_accTableFragPtrI[2]; union { Uint32 nextPool; }; @@ -476,62 +501,39 @@ private: // node handles /* - * A tree operation builds a cache of accessed nodes. This allows - * different implementations of index memory access. The cache is - * committed and released at the end of the operation. + * A node handle is a reference to a tree node in TUP. It is used to + * operate on the node. Node handles are allocated on the stack. */ struct NodeHandle; friend struct NodeHandle; struct NodeHandle { - enum Flags { - // bits 0,1 mark need for left,right prefix - DoInsert = (1 << 2), - DoDelete = (1 << 3), - DoUpdate = (1 << 4) - }; - Dbtux& m_tux; // this block Frag& m_frag; // fragment using the node - TupAddr m_addr; // logical node address TupLoc m_loc; // physical node address - AccSize m_acc; // accessed size - unsigned m_flags; // flags - union { - Uint32 m_next; // next active node under fragment - Uint32 nextPool; - }; TreeNode* m_node; // pointer to node storage - Uint32 m_cache[MaxTreeNodeSize]; - NodeHandle(Dbtux& tux, Frag& frag); + AccSize m_acc; // accessed size + NodeHandle(Frag& frag); + NodeHandle(const NodeHandle& node); + NodeHandle& operator=(const NodeHandle& node); // getters - TupAddr getLink(unsigned i); + TupLoc getLink(unsigned i); unsigned getChilds(); // cannot spell unsigned getSide(); unsigned getOccup(); int getBalance(); Uint32 getNodeScan(); - Data getPref(unsigned i); - TreeEnt getEnt(unsigned pos); - TreeEnt getMinMax(unsigned i); // setters - void setLink(unsigned i, TupAddr addr); + void setLink(unsigned i, TupLoc loc); void setSide(unsigned i); void setOccup(unsigned n); void setBalance(int b); void setNodeScan(Uint32 scanPtrI); - // operations XXX maybe these should move to Dbtux level - void pushUp(Signal* signal, unsigned pos, const TreeEnt& ent); - void popDown(Signal* signal, unsigned pos, TreeEnt& ent); - void pushDown(Signal* signal, unsigned pos, TreeEnt& ent); - void popUp(Signal* signal, unsigned pos, TreeEnt& ent); - void slide(Signal* signal, Ptr<NodeHandle> nodePtr, unsigned i); - void linkScan(Dbtux::ScanOpPtr scanPtr); - void unlinkScan(Dbtux::ScanOpPtr scanPtr); - bool islinkScan(Dbtux::ScanOpPtr scanPtr); - // for ndbrequire - void progError(int line, int cause, const char* extra); + // access other parts of the node + Data getPref(unsigned i); + TreeEnt getEnt(unsigned pos); + TreeEnt getMinMax(unsigned i); + // for ndbrequire and ndbassert + void progError(int line, int cause, const char* file); }; - typedef Ptr<NodeHandle> NodeHandlePtr; - ArrayPool<NodeHandle> c_nodeHandlePool; // parameters for methods @@ -563,42 +565,6 @@ private: }; /* - * Node storage operation. - */ - struct StorePar { - TupStoreTh::OpCode m_opCode;// operation code - unsigned m_offset; // data offset in words - unsigned m_size; // number of words - Uint32 m_errorCode; // terrorCode from TUP - StorePar(); - }; - - /* - * Tree search for entry. - */ - struct SearchPar; - friend struct SearchPar; - struct SearchPar { - ConstData m_data; // input index key values - TreeEnt m_ent; // input tuple and version - SearchPar(); - }; - - /* - * Attribute data comparison. - */ - struct CmpPar; - friend struct CmpPar; - struct CmpPar { - ConstData m_data1; // full search key - ConstData m_data2; // full or prefix data - unsigned m_len2; // words in data2 buffer - unsigned m_first; // first attribute - unsigned m_numEq; // number of initial equal attributes - CmpPar(); - }; - - /* * Scan bound comparison. */ struct BoundPar; @@ -621,7 +587,10 @@ private: void execSTTOR(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); // utils + void setKeyAttrs(const Frag& frag); + void readKeyAttrs(const Frag& frag, TreeEnt ent, unsigned start, TableData keyData); void copyAttrs(Data dst, ConstData src, CopyPar& copyPar); + void copyAttrs(const Frag& frag, TableData data1, Data data2, unsigned maxlen2 = MaxAttrDataSize); /* * DbtuxMeta.cpp @@ -633,8 +602,6 @@ private: bool allocDescEnt(IndexPtr indexPtr); void freeDescEnt(IndexPtr indexPtr); void dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 senderData); - // helpers - DescEnt& getDescEnt(Uint32 descPage, Uint32 descOff); /* * DbtuxMaint.cpp @@ -642,29 +609,35 @@ private: void execTUX_MAINT_REQ(Signal* signal); void tupReadAttrs(Signal* signal, const Frag& frag, ReadPar& readPar); void tupReadKeys(Signal* signal, const Frag& frag, ReadPar& readPar); - void tupStoreTh(Signal* signal, const Frag& frag, NodeHandlePtr nodePtr, StorePar storePar); /* * DbtuxNode.cpp */ - void seizeNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr); - void preallocNode(Signal* signal, Frag& frag, Uint32& errorCode); - void findNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr); - void selectNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr, AccSize acc); - void insertNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc); - void deleteNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr); - void accessNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc); - void setNodePref(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i); - void commitNodes(Signal* signal, Frag& frag, bool updateOk); + int allocNode(Signal* signal, NodeHandle& node); + void accessNode(Signal* signal, NodeHandle& node, AccSize acc); + void selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc); + void insertNode(Signal* signal, NodeHandle& node, AccSize acc); + void deleteNode(Signal* signal, NodeHandle& node); + void setNodePref(Signal* signal, NodeHandle& node, unsigned i); + // node operations + void nodePushUp(Signal* signal, NodeHandle& node, unsigned pos, const TreeEnt& ent); + void nodePopDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent); + void nodePushDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent); + void nodePopUp(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent); + void nodeSlide(Signal* signal, NodeHandle& dstNode, NodeHandle& srcNode, unsigned i); + // scans linked to node + void linkScan(NodeHandle& node, ScanOpPtr scanPtr); + void unlinkScan(NodeHandle& node, ScanOpPtr scanPtr); + bool islinkScan(NodeHandle& node, ScanOpPtr scanPtr); /* * DbtuxTree.cpp */ - void treeSearch(Signal* signal, Frag& frag, SearchPar searchPar, TreePos& treePos); + void treeSearch(Signal* signal, Frag& frag, TableData searchKey, TreeEnt searchEnt, TreePos& treePos); void treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent); void treeRemove(Signal* signal, Frag& frag, TreePos treePos); - void treeRotateSingle(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i); - void treeRotateDouble(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i); + void treeRotateSingle(Signal* signal, Frag& frag, NodeHandle& node, unsigned i); + void treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i); /* * DbtuxScan.cpp @@ -687,7 +660,8 @@ private: /* * DbtuxCmp.cpp */ - int cmpTreeAttrs(const Frag& frag, CmpPar& cmpPar); + int cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, ConstData data2, unsigned maxlen2 = MaxAttrDataSize); + int cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, TableData data2); int cmpScanBound(const Frag& frag, const BoundPar boundPar); /* @@ -698,23 +672,24 @@ private: struct PrintPar { char m_path[100]; // LR prefix unsigned m_side; // expected side - TupAddr m_parent; // expected parent address + TupLoc m_parent; // expected parent address int m_depth; // returned depth unsigned m_occup; // returned occupancy bool m_ok; // returned status PrintPar(); }; void printTree(Signal* signal, Frag& frag, NdbOut& out); - void printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar& par); + void printNode(Signal* signal, Frag& frag, NdbOut& out, TupLoc loc, PrintPar& par); + friend class NdbOut& operator<<(NdbOut&, const TupLoc&); friend class NdbOut& operator<<(NdbOut&, const TreeEnt&); friend class NdbOut& operator<<(NdbOut&, const TreeNode&); friend class NdbOut& operator<<(NdbOut&, const TreeHead&); friend class NdbOut& operator<<(NdbOut&, const TreePos&); friend class NdbOut& operator<<(NdbOut&, const DescAttr&); + friend class NdbOut& operator<<(NdbOut&, const ScanOp&); friend class NdbOut& operator<<(NdbOut&, const Index&); friend class NdbOut& operator<<(NdbOut&, const Frag&); friend class NdbOut& operator<<(NdbOut&, const NodeHandle&); - friend class NdbOut& operator<<(NdbOut&, const ScanOp&); FILE* debugFile; NdbOut debugOut; unsigned debugFlags; @@ -730,10 +705,25 @@ private: Uint32 c_internalStartPhase; Uint32 c_typeOfStart; - // buffers - Data c_keyBuffer; // search key or scan bound + /* + * Array of index key attribute ids in AttributeHeader format. + * Includes fixed attribute sizes. This is global data set at + * operation start and is not passed as a parameter. + */ + Data c_keyAttrs; + + // buffer for search key data as pointers to TUP storage + TableData c_searchKey; + + // buffer for current entry key data as pointers to TUP storage + TableData c_entryKey; + + // buffer for scan bounds and keyinfo (primary key) + Data c_dataBuffer; - // small stuff + // inlined utils + DescEnt& getDescEnt(Uint32 descPage, Uint32 descOff); + Uint32 getTupAddr(const Frag& frag, TreeEnt ent); static unsigned min(unsigned x, unsigned y); static unsigned max(unsigned x, unsigned y); }; @@ -831,19 +821,58 @@ Dbtux::ConstData::operator=(Data data) return *this; } +// Dbtux::TupLoc + +inline +Dbtux::TupLoc::TupLoc() : + m_pageId(RNIL), + m_pageOffset(0) +{ +} + +inline +Dbtux::TupLoc::TupLoc(Uint32 pageId, Uint16 pageOffset) : + m_pageId(pageId), + m_pageOffset(pageOffset) +{ +} + +inline bool +Dbtux::TupLoc::operator==(const TupLoc& loc) const +{ + return m_pageId == loc.m_pageId && m_pageOffset == loc.m_pageOffset; +} + +inline bool +Dbtux::TupLoc::operator!=(const TupLoc& loc) const +{ + return ! (*this == loc); +} + // Dbtux::TreeEnt +inline +Dbtux::TreeEnt::TreeEnt() : + m_tupLoc(), + m_tupVersion(0), + m_fragBit(0) +{ +} + inline int Dbtux::TreeEnt::cmp(const TreeEnt ent) const { - // compare frags first (not optimal but makes easier to read logs) if (m_fragBit < ent.m_fragBit) return -1; if (m_fragBit > ent.m_fragBit) return +1; - if (m_tupAddr < ent.m_tupAddr) + if (m_tupLoc.m_pageId < ent.m_tupLoc.m_pageId) return -1; - if (m_tupAddr > ent.m_tupAddr) + if (m_tupLoc.m_pageId > ent.m_tupLoc.m_pageId) + return +1; + if (m_tupLoc.m_pageOffset < ent.m_tupLoc.m_pageOffset) + return -1; + if (m_tupLoc.m_pageOffset > ent.m_tupLoc.m_pageOffset) return +1; if (m_tupVersion < ent.m_tupVersion) return -1; @@ -852,8 +881,36 @@ Dbtux::TreeEnt::cmp(const TreeEnt ent) const return 0; } +// Dbtux::TreeNode + +inline +Dbtux::TreeNode::TreeNode() : + m_side(2), + m_balance(0), + pad1(0), + m_occup(0), + m_nodeScan(RNIL) +{ + m_linkPI[0] = NullTupLoc.m_pageId; + m_linkPO[0] = NullTupLoc.m_pageOffset; + m_linkPI[1] = NullTupLoc.m_pageId; + m_linkPO[1] = NullTupLoc.m_pageOffset; + m_linkPI[2] = NullTupLoc.m_pageId; + m_linkPO[2] = NullTupLoc.m_pageOffset; +} + // Dbtux::TreeHead +inline +Dbtux::TreeHead::TreeHead() : + m_nodeSize(0), + m_prefSize(0), + m_minOccup(0), + m_maxOccup(0), + m_root() +{ +} + inline unsigned Dbtux::TreeHead::getSize(AccSize acc) const { @@ -885,52 +942,10 @@ Dbtux::TreeHead::getEntList(TreeNode* node) const return (TreeEnt*)ptr; } -// Dbtux - -// constructors - -inline -Dbtux::TupLoc::TupLoc() : - m_pageId(RNIL), - m_pageOffset(0) -{ -} - -inline -Dbtux::TreeEnt::TreeEnt() : - m_tupAddr(NullTupAddr), - m_tupVersion(0), - m_fragBit(255), - unused1(0) -{ -} - -inline -Dbtux::TreeNode::TreeNode() : - m_side(255), - m_occup(0), - m_balance(0), - unused1(0xa1), - m_nodeScan(RNIL) -{ - m_link[0] = NullTupAddr; - m_link[1] = NullTupAddr; - m_link[2] = NullTupAddr; -} - -inline -Dbtux::TreeHead::TreeHead() : - m_nodeSize(0), - m_prefSize(0), - m_minOccup(0), - m_maxOccup(0), - m_root(0) -{ -} +// Dbtux::TreePos inline Dbtux::TreePos::TreePos() : - m_addr(NullTupAddr), m_loc(), m_pos(ZNIL), m_match(false), @@ -939,6 +954,8 @@ Dbtux::TreePos::TreePos() : { } +// Dbtux::DescPage + inline Dbtux::DescPage::DescPage() : m_nextPage(RNIL), @@ -953,6 +970,41 @@ Dbtux::DescPage::DescPage() : } } +// Dbtux::ScanOp + +inline +Dbtux::ScanOp::ScanOp(ScanBoundPool& scanBoundPool) : + m_state(Undef), + m_lockwait(false), + m_userPtr(RNIL), + m_userRef(RNIL), + m_tableId(RNIL), + m_indexId(RNIL), + m_fragPtrI(RNIL), + m_transId1(0), + m_transId2(0), + m_savePointId(0), + m_accLockOp(RNIL), + m_readCommitted(0), + m_lockMode(0), + m_keyInfo(0), + m_boundMin(scanBoundPool), + m_boundMax(scanBoundPool), + m_scanPos(), + m_lastEnt(), + m_nodeScan(RNIL) +{ + m_bound[0] = &m_boundMin; + m_bound[1] = &m_boundMax; + m_boundCnt[0] = 0; + m_boundCnt[1] = 0; + for (unsigned i = 0; i < MaxAccLockOps; i++) { + m_accLockOps[i] = RNIL; + } +} + +// Dbtux::Index + inline Dbtux::Index::Index() : m_state(NotDefined), @@ -969,6 +1021,8 @@ Dbtux::Index::Index() : }; }; +// Dbtux::Frag + inline Dbtux::Frag::Frag(ArrayPool<ScanOp>& scanOpPool) : m_tableId(RNIL), @@ -979,12 +1033,18 @@ Dbtux::Frag::Frag(ArrayPool<ScanOp>& scanOpPool) : m_descOff(0), m_numAttrs(ZNIL), m_tree(), - m_nodeList(RNIL), - m_nodeFree(RNIL), - m_scanList(scanOpPool) + m_freeLoc(), + m_scanList(scanOpPool), + m_tupIndexFragPtrI(RNIL) { + m_tupTableFragPtrI[0] = RNIL; + m_tupTableFragPtrI[1] = RNIL; + m_accTableFragPtrI[0] = RNIL; + m_accTableFragPtrI[1] = RNIL; } +// Dbtux::FragOp + inline Dbtux::FragOp::FragOp() : m_userPtr(RNIL), @@ -997,160 +1057,107 @@ Dbtux::FragOp::FragOp() : { }; +// Dbtux::NodeHandle + inline -Dbtux::NodeHandle::NodeHandle(Dbtux& tux, Frag& frag) : - m_tux(tux), +Dbtux::NodeHandle::NodeHandle(Frag& frag) : m_frag(frag), - m_addr(NullTupAddr), m_loc(), - m_acc(AccNone), - m_flags(0), - m_next(RNIL), - m_node(0) + m_node(0), + m_acc(AccNone) { } inline -Dbtux::ScanOp::ScanOp(ScanBoundPool& scanBoundPool) : - m_state(Undef), - m_lockwait(false), - m_userPtr(RNIL), - m_userRef(RNIL), - m_tableId(RNIL), - m_indexId(RNIL), - m_fragPtrI(RNIL), - m_transId1(0), - m_transId2(0), - m_savePointId(0), - m_accLockOp(RNIL), - m_readCommitted(0), - m_lockMode(0), - m_keyInfo(0), - m_boundMin(scanBoundPool), - m_boundMax(scanBoundPool), - m_scanPos(), - m_lastEnt(), - m_nodeScan(RNIL) +Dbtux::NodeHandle::NodeHandle(const NodeHandle& node) : + m_frag(node.m_frag), + m_loc(node.m_loc), + m_node(node.m_node), + m_acc(node.m_acc) { - m_bound[0] = &m_boundMin; - m_bound[1] = &m_boundMax; - m_boundCnt[0] = 0; - m_boundCnt[1] = 0; - for (unsigned i = 0; i < MaxAccLockOps; i++) { - m_accLockOps[i] = RNIL; - } } -inline -Dbtux::CopyPar::CopyPar() : - m_items(0), - m_headers(true), - m_maxwords(~0), // max unsigned - // output - m_numitems(0), - m_numwords(0) +inline Dbtux::NodeHandle& +Dbtux::NodeHandle::operator=(const NodeHandle& node) { + ndbassert(&m_frag == &node.m_frag); + m_loc = node.m_loc; + m_node = node.m_node; + m_acc = node.m_acc; + return *this; } -inline -Dbtux::ReadPar::ReadPar() : - m_first(0), - m_count(0), - m_data(0), - m_size(0) +inline Dbtux::TupLoc +Dbtux::NodeHandle::getLink(unsigned i) { + ndbrequire(i <= 2); + return TupLoc(m_node->m_linkPI[i], m_node->m_linkPO[i]); } -inline -Dbtux::StorePar::StorePar() : - m_opCode(TupStoreTh::OpUndefined), - m_offset(0), - m_size(0), - m_errorCode(0) +inline unsigned +Dbtux::NodeHandle::getChilds() { + return (getLink(0) != NullTupLoc) + (getLink(1) != NullTupLoc); } -inline -Dbtux::SearchPar::SearchPar() : - m_data(0), - m_ent() +inline unsigned +Dbtux::NodeHandle::getSide() { + return m_node->m_side; } -inline -Dbtux::CmpPar::CmpPar() : - m_data1(0), - m_data2(0), - m_len2(0), - m_first(0), - m_numEq(0) +inline unsigned +Dbtux::NodeHandle::getOccup() { + return m_node->m_occup; } -inline -Dbtux::BoundPar::BoundPar() : - m_data1(0), - m_data2(0), - m_count1(0), - m_len2(0), - m_dir(255) +inline int +Dbtux::NodeHandle::getBalance() { + return m_node->m_balance; } -#ifdef VM_TRACE -inline -Dbtux::PrintPar::PrintPar() : - // caller fills in - m_path(), - m_side(255), - m_parent(NullTupAddr), - // default return values - m_depth(0), - m_occup(0), - m_ok(true) +inline Uint32 +Dbtux::NodeHandle::getNodeScan() { + return m_node->m_nodeScan; } -#endif - -// node handles -inline Dbtux::TupAddr -Dbtux::NodeHandle::getLink(unsigned i) +inline void +Dbtux::NodeHandle::setLink(unsigned i, TupLoc loc) { ndbrequire(i <= 2); - return m_node->m_link[i]; + m_node->m_linkPI[i] = loc.m_pageId; + m_node->m_linkPO[i] = loc.m_pageOffset; } -inline unsigned -Dbtux::NodeHandle::getChilds() -{ - return - (m_node->m_link[0] != NullTupAddr) + - (m_node->m_link[1] != NullTupAddr); -} - -inline Dbtux::TupAddr -Dbtux::NodeHandle::getSide() +inline void +Dbtux::NodeHandle::setSide(unsigned i) { - return m_node->m_side; + ndbrequire(i <= 2); + m_node->m_side = i; } -inline unsigned -Dbtux::NodeHandle::getOccup() +inline void +Dbtux::NodeHandle::setOccup(unsigned n) { - return m_node->m_occup; + TreeHead& tree = m_frag.m_tree; + ndbrequire(n <= tree.m_maxOccup); + m_node->m_occup = n; } -inline int -Dbtux::NodeHandle::getBalance() +inline void +Dbtux::NodeHandle::setBalance(int b) { - return m_node->m_balance; + ndbrequire(abs(b) <= 1); + m_node->m_balance = b; } -inline Uint32 -Dbtux::NodeHandle::getNodeScan() +inline void +Dbtux::NodeHandle::setNodeScan(Uint32 scanPtrI) { - return m_node->m_nodeScan; + m_node->m_nodeScan = scanPtrI; } inline Dbtux::Data @@ -1184,47 +1191,54 @@ Dbtux::NodeHandle::getMinMax(unsigned i) return getEnt(i == 0 ? 0 : occup - 1); } -inline void -Dbtux::NodeHandle::setLink(unsigned i, TupAddr addr) -{ - ndbrequire(i <= 2); - m_node->m_link[i] = addr; - m_flags |= DoUpdate; -} +// parameters for methods -inline void -Dbtux::NodeHandle::setSide(unsigned i) +inline +Dbtux::CopyPar::CopyPar() : + m_items(0), + m_headers(true), + m_maxwords(~0), // max unsigned + // output + m_numitems(0), + m_numwords(0) { - // ndbrequire(i <= 1); - m_node->m_side = i; - m_flags |= DoUpdate; } -inline void -Dbtux::NodeHandle::setOccup(unsigned n) +inline +Dbtux::ReadPar::ReadPar() : + m_first(0), + m_count(0), + m_data(0), + m_size(0) { - TreeHead& tree = m_frag.m_tree; - ndbrequire(n <= tree.m_maxOccup); - m_node->m_occup = n; - m_flags |= DoUpdate; } -inline void -Dbtux::NodeHandle::setBalance(int b) +inline +Dbtux::BoundPar::BoundPar() : + m_data1(0), + m_data2(0), + m_count1(0), + m_len2(0), + m_dir(255) { - ndbrequire(abs(b) <= 1); - m_node->m_balance = b; - m_flags |= DoUpdate; } -inline void -Dbtux::NodeHandle::setNodeScan(Uint32 scanPtrI) +#ifdef VM_TRACE +inline +Dbtux::PrintPar::PrintPar() : + // caller fills in + m_path(), + m_side(255), + m_parent(), + // default return values + m_depth(0), + m_occup(0), + m_ok(true) { - m_node->m_nodeScan = scanPtrI; - m_flags |= DoUpdate; } +#endif -// other methods +// utils inline Dbtux::DescEnt& Dbtux::getDescEnt(Uint32 descPage, Uint32 descOff) @@ -1237,6 +1251,17 @@ Dbtux::getDescEnt(Uint32 descPage, Uint32 descOff) return *descEnt; } +inline Uint32 +Dbtux::getTupAddr(const Frag& frag, TreeEnt ent) +{ + const Uint32 tableFragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit]; + const TupLoc tupLoc = ent.m_tupLoc; + Uint32 tupAddr = NullTupAddr; + c_tup->tuxGetTupAddr(tableFragPtrI, tupLoc.m_pageId, tupLoc.m_pageOffset, tupAddr); + jamEntry(); + return tupAddr; +} + inline unsigned Dbtux::min(unsigned x, unsigned y) { diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp index 6404cc66213..7601a14a242 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp @@ -18,50 +18,42 @@ #include "Dbtux.hpp" /* - * Search key vs tree entry. + * Search key vs node prefix. * - * Compare search key and index attribute data. The attribute data may - * be partial in which case CmpUnknown may be returned. Also counts how - * many (additional) initial attributes were equal. + * The comparison starts at given attribute position (in fact 0). The + * position is updated by number of equal initial attributes found. The + * prefix may be partial in which case CmpUnknown may be returned. */ int -Dbtux::cmpTreeAttrs(const Frag& frag, CmpPar& cmpPar) +Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, ConstData data2, unsigned maxlen2) { + const unsigned numAttrs = frag.m_numAttrs; const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff); - ConstData data1 = cmpPar.m_data1; - ConstData data2 = cmpPar.m_data2; // number of words of attribute data left - unsigned len2 = cmpPar.m_len2; - const unsigned numAttrs = frag.m_numAttrs; - unsigned index = cmpPar.m_first; - ndbrequire(index < numAttrs); - // skip to right position in search key XXX do it before the call - for (unsigned i = 0; i < index; i++) { - jam(); - data1 += AttributeHeaderSize + data1.ah().getDataSize(); - } - unsigned numEq = 0; + unsigned len2 = maxlen2; + // skip to right position in search key + data1 += start; int ret = 0; - while (index < numAttrs) { + while (start < numAttrs) { if (len2 < AttributeHeaderSize) { jam(); ret = NdbSqlUtil::CmpUnknown; break; } len2 -= AttributeHeaderSize; - if (! data1.ah().isNULL()) { + if (*data1 != 0) { if (! data2.ah().isNULL()) { jam(); // current attribute - const DescAttr& descAttr = descEnt.m_descAttr[index]; + const DescAttr& descAttr = descEnt.m_descAttr[start]; const unsigned typeId = descAttr.m_typeId; // full data size - const unsigned size1 = data1.ah().getDataSize(); + const unsigned size1 = AttributeDescriptor::getSizeInWords(descAttr.m_attrDesc); ndbrequire(size1 != 0 && size1 == data2.ah().getDataSize()); const unsigned size2 = min(size1, len2); len2 -= size2; // compare - const Uint32* const p1 = &data1[AttributeHeaderSize]; + const Uint32* const p1 = *data1; const Uint32* const p2 = &data2[AttributeHeaderSize]; ret = NdbSqlUtil::cmp(typeId, p1, p2, size1, size2); if (ret != 0) { @@ -82,18 +74,71 @@ Dbtux::cmpTreeAttrs(const Frag& frag, CmpPar& cmpPar) break; } } - data1 += AttributeHeaderSize + data1.ah().getDataSize(); + data1 += 1; data2 += AttributeHeaderSize + data2.ah().getDataSize(); - numEq++; - index++; + start++; } // XXX until data format errors are handled ndbrequire(ret != NdbSqlUtil::CmpError); - cmpPar.m_numEq += numEq; // add to previous count return ret; } /* + * Search key vs tree entry. + * + * Start position is updated as in previous routine. + */ +int +Dbtux::cmpSearchKey(const Frag& frag, unsigned& start, TableData data1, TableData data2) +{ + const unsigned numAttrs = frag.m_numAttrs; + const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff); + // skip to right position + data1 += start; + data2 += start; + int ret = 0; + while (start < numAttrs) { + if (*data1 != 0) { + if (*data2 != 0) { + jam(); + // current attribute + const DescAttr& descAttr = descEnt.m_descAttr[start]; + const unsigned typeId = descAttr.m_typeId; + // full data size + const unsigned size1 = AttributeDescriptor::getSizeInWords(descAttr.m_attrDesc); + // compare + const Uint32* const p1 = *data1; + const Uint32* const p2 = *data2; + ret = NdbSqlUtil::cmp(typeId, p1, p2, size1, size1); + if (ret != 0) { + jam(); + break; + } + } else { + jam(); + // not NULL < NULL + ret = -1; + break; + } + } else { + if (*data2 != 0) { + jam(); + // NULL > not NULL + ret = +1; + break; + } + } + data1 += 1; + data2 += 1; + start++; + } + // XXX until data format errors are handled + ndbrequire(ret != NdbSqlUtil::CmpError); + return ret; +} + + +/* * Scan bound vs tree entry. * * Compare lower or upper bound and index attribute data. The attribute diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp index c5d24205d1a..c4931685305 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp @@ -97,7 +97,7 @@ Dbtux::printTree(Signal* signal, Frag& frag, NdbOut& out) PrintPar par; strcpy(par.m_path, "."); par.m_side = 2; - par.m_parent = NullTupAddr; + par.m_parent = NullTupLoc; printNode(signal, frag, out, tree.m_root, par); out.m_out->flush(); if (! par.m_ok) { @@ -106,26 +106,24 @@ Dbtux::printTree(Signal* signal, Frag& frag, NdbOut& out) signal->theData[1] = 1; execDUMP_STATE_ORD(signal); if (debugFile != 0) { - commitNodes(signal, frag, false); printTree(signal, frag, debugOut); } } ndbrequire(false); } - commitNodes(signal, frag, false); } void -Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar& par) +Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupLoc loc, PrintPar& par) { - if (addr == NullTupAddr) { + if (loc == NullTupLoc) { par.m_depth = 0; return; } TreeHead& tree = frag.m_tree; - NodeHandlePtr nodePtr; - selectNode(signal, frag, nodePtr, addr, AccFull); - out << par.m_path << " " << *nodePtr.p << endl; + NodeHandle node(frag); + selectNode(signal, node, loc, AccFull); + out << par.m_path << " " << node << endl; // check children PrintPar cpar[2]; ndbrequire(strlen(par.m_path) + 1 < sizeof(par.m_path)); @@ -133,57 +131,57 @@ Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar sprintf(cpar[i].m_path, "%s%c", par.m_path, "LR"[i]); cpar[i].m_side = i; cpar[i].m_depth = 0; - cpar[i].m_parent = addr; - printNode(signal, frag, out, nodePtr.p->getLink(i), cpar[i]); + cpar[i].m_parent = loc; + printNode(signal, frag, out, node.getLink(i), cpar[i]); if (! cpar[i].m_ok) { par.m_ok = false; } } // check child-parent links - if (nodePtr.p->getLink(2) != par.m_parent) { + if (node.getLink(2) != par.m_parent) { par.m_ok = false; out << par.m_path << " *** "; - out << "parent addr " << hex << nodePtr.p->getLink(2); + out << "parent loc " << hex << node.getLink(2); out << " should be " << hex << par.m_parent << endl; } - if (nodePtr.p->getSide() != par.m_side) { + if (node.getSide() != par.m_side) { par.m_ok = false; out << par.m_path << " *** "; - out << "side " << dec << nodePtr.p->getSide(); + out << "side " << dec << node.getSide(); out << " should be " << dec << par.m_side << endl; } // check balance const int balance = -cpar[0].m_depth + cpar[1].m_depth; - if (nodePtr.p->getBalance() != balance) { + if (node.getBalance() != balance) { par.m_ok = false; out << par.m_path << " *** "; - out << "balance " << nodePtr.p->getBalance(); + out << "balance " << node.getBalance(); out << " should be " << balance << endl; } - if (abs(nodePtr.p->getBalance()) > 1) { + if (abs(node.getBalance()) > 1) { par.m_ok = false; out << par.m_path << " *** "; - out << "balance " << nodePtr.p->getBalance() << " is invalid" << endl; + out << "balance " << node.getBalance() << " is invalid" << endl; } // check occupancy - if (nodePtr.p->getOccup() > tree.m_maxOccup) { + if (node.getOccup() > tree.m_maxOccup) { par.m_ok = false; out << par.m_path << " *** "; - out << "occupancy " << nodePtr.p->getOccup(); + out << "occupancy " << node.getOccup(); out << " greater than max " << tree.m_maxOccup << endl; } // check for occupancy of interior node - if (nodePtr.p->getChilds() == 2 && nodePtr.p->getOccup() < tree.m_minOccup) { + if (node.getChilds() == 2 && node.getOccup() < tree.m_minOccup) { par.m_ok = false; out << par.m_path << " *** "; - out << "occupancy " << nodePtr.p->getOccup() << " of interior node"; + out << "occupancy " << node.getOccup() << " of interior node"; out << " less than min " << tree.m_minOccup << endl; } // check missed half-leaf/leaf merge for (unsigned i = 0; i <= 1; i++) { - if (nodePtr.p->getLink(i) != NullTupAddr && - nodePtr.p->getLink(1 - i) == NullTupAddr && - nodePtr.p->getOccup() + cpar[i].m_occup <= tree.m_maxOccup) { + if (node.getLink(i) != NullTupLoc && + node.getLink(1 - i) == NullTupLoc && + node.getOccup() + cpar[i].m_occup <= tree.m_maxOccup) { par.m_ok = false; out << par.m_path << " *** "; out << "missed merge with child " << i << endl; @@ -191,14 +189,26 @@ Dbtux::printNode(Signal* signal, Frag& frag, NdbOut& out, TupAddr addr, PrintPar } // return values par.m_depth = 1 + max(cpar[0].m_depth, cpar[1].m_depth); - par.m_occup = nodePtr.p->getOccup(); + par.m_occup = node.getOccup(); +} + +NdbOut& +operator<<(NdbOut& out, const Dbtux::TupLoc& loc) +{ + if (loc == Dbtux::NullTupLoc) { + out << "null"; + } else { + out << dec << loc.m_pageId; + out << "." << dec << loc.m_pageOffset; + } + return out; } NdbOut& operator<<(NdbOut& out, const Dbtux::TreeEnt& ent) { out << dec << ent.m_fragBit; - out << "-" << hex << ent.m_tupAddr; + out << "-" << ent.m_tupLoc; out << "-" << dec << ent.m_tupVersion; return out; } @@ -206,10 +216,13 @@ operator<<(NdbOut& out, const Dbtux::TreeEnt& ent) NdbOut& operator<<(NdbOut& out, const Dbtux::TreeNode& node) { + Dbtux::TupLoc link0(node.m_linkPI[0], node.m_linkPO[0]); + Dbtux::TupLoc link1(node.m_linkPI[1], node.m_linkPO[1]); + Dbtux::TupLoc link2(node.m_linkPI[2], node.m_linkPO[2]); out << "[TreeNode " << hex << &node; - out << " [left " << hex << node.m_link[0] << "]"; - out << " [right " << hex << node.m_link[1] << "]"; - out << " [up " << hex << node.m_link[2] << "]"; + out << " [left " << link0 << "]"; + out << " [right " << link1 << "]"; + out << " [up " << link2 << "]"; out << " [side " << dec << node.m_side << "]"; out << " [occup " << dec << node.m_occup << "]"; out << " [balance " << dec << (int)node.m_balance << "]"; @@ -238,7 +251,7 @@ NdbOut& operator<<(NdbOut& out, const Dbtux::TreePos& pos) { out << "[TreePos " << hex << &pos; - out << " [addr " << hex << pos.m_addr << "]"; + out << " [loc " << pos.m_loc << "]"; out << " [pos " << dec << pos.m_pos << "]"; out << " [match " << dec << pos.m_match << "]"; out << " [dir " << dec << pos.m_dir << "]"; @@ -251,9 +264,9 @@ NdbOut& operator<<(NdbOut& out, const Dbtux::DescAttr& descAttr) { out << "[DescAttr " << hex << &descAttr; + out << " [attrDesc " << hex << descAttr.m_attrDesc; out << " [primaryAttrId " << dec << descAttr.m_primaryAttrId << "]"; out << " [typeId " << dec << descAttr.m_typeId << "]"; - out << " [nullable " << dec << descAttr.m_nullable << "]"; out << "]"; return out; } @@ -338,9 +351,8 @@ operator<<(NdbOut& out, const Dbtux::NodeHandle& node) const Dbtux::Frag& frag = node.m_frag; const Dbtux::TreeHead& tree = frag.m_tree; out << "[NodeHandle " << hex << &node; - out << " [addr " << hex << node.m_addr << "]"; + out << " [loc " << node.m_loc << "]"; out << " [acc " << dec << node.m_acc << "]"; - out << " [flags " << hex << node.m_flags << "]"; out << " [node " << *node.m_node << "]"; if (node.m_acc >= Dbtux::AccPref) { for (unsigned i = 0; i <= 1; i++) { diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp index 082b243bcb1..93a5c78338c 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp @@ -21,6 +21,7 @@ Dbtux::Dbtux(const Configuration& conf) : SimulatedBlock(DBTUX, conf), + c_tup(0), c_descPageList(RNIL), #ifdef VM_TRACE debugFile(0), @@ -29,15 +30,15 @@ Dbtux::Dbtux(const Configuration& conf) : #endif c_internalStartPhase(0), c_typeOfStart(NodeState::ST_ILLEGAL_TYPE), - c_keyBuffer(0) + c_dataBuffer(0) { BLOCK_CONSTRUCTOR(Dbtux); // verify size assumptions (also when release-compiled) ndbrequire( - (sizeof(DescHead) & 0x3) == 0 && - (sizeof(DescAttr) & 0x3) == 0 && (sizeof(TreeEnt) & 0x3) == 0 && - (sizeof(TreeNode) & 0x3) == 0 + (sizeof(TreeNode) & 0x3) == 0 && + (sizeof(DescHead) & 0x3) == 0 && + (sizeof(DescAttr) & 0x3) == 0 ); /* * DbtuxGen.cpp @@ -123,6 +124,8 @@ Dbtux::execSTTOR(Signal* signal) case 1: jam(); CLEAR_ERROR_INSERT_VALUE; + c_tup = (Dbtup*)globalData.getBlock(DBTUP); + ndbrequire(c_tup != 0); break; case 3: jam(); @@ -175,12 +178,11 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) c_fragPool.setSize(nFragment); c_descPagePool.setSize(nDescPage); c_fragOpPool.setSize(MaxIndexFragments); - c_nodeHandlePool.setSize(MaxNodeHandles); c_scanOpPool.setSize(nScanOp); c_scanBoundPool.setSize(nScanBoundWords); /* * Index id is physical array index. We seize and initialize all - * index records now. This assumes ArrayPool is an array. + * index records now. */ IndexPtr indexPtr; while (1) { @@ -193,7 +195,10 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) new (indexPtr.p) Index(); } // allocate buffers - c_keyBuffer = (Uint32*)allocRecord("c_keyBuffer", sizeof(Uint64), (MaxAttrDataSize + 1) >> 1); + c_keyAttrs = (Uint32*)allocRecord("c_keyAttrs", sizeof(Uint32), MaxIndexAttributes); + c_searchKey = (TableData)allocRecord("c_searchKey", sizeof(Uint32*), MaxIndexAttributes); + c_entryKey = (TableData)allocRecord("c_entryKey", sizeof(Uint32*), MaxIndexAttributes); + c_dataBuffer = (Uint32*)allocRecord("c_dataBuffer", sizeof(Uint64), (MaxAttrDataSize + 1) >> 1); // ack ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend(); conf->senderRef = reference(); @@ -205,6 +210,37 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) // utils void +Dbtux::setKeyAttrs(const Frag& frag) +{ + Data keyAttrs = c_keyAttrs; // global + const unsigned numAttrs = frag.m_numAttrs; + const DescEnt& descEnt = getDescEnt(frag.m_descPage, frag.m_descOff); + for (unsigned i = 0; i < numAttrs; i++) { + const DescAttr& descAttr = descEnt.m_descAttr[i]; + Uint32 size = AttributeDescriptor::getSizeInWords(descAttr.m_attrDesc); + // set attr id and fixed size + keyAttrs.ah() = AttributeHeader(descAttr.m_primaryAttrId, size); + keyAttrs += 1; + } +} + +void +Dbtux::readKeyAttrs(const Frag& frag, TreeEnt ent, unsigned start, TableData keyData) +{ + ConstData keyAttrs = c_keyAttrs; // global + const Uint32 tableFragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit]; + const TupLoc tupLoc = ent.m_tupLoc; + const Uint32 tupVersion = ent.m_tupVersion; + ndbrequire(start < frag.m_numAttrs); + const unsigned numAttrs = frag.m_numAttrs - start; + // start applies to both keys and output data + keyAttrs += start; + keyData += start; + c_tup->tuxReadAttrs(tableFragPtrI, tupLoc.m_pageId, tupLoc.m_pageOffset, tupVersion, numAttrs, keyAttrs, keyData); + jamEntry(); +} + +void Dbtux::copyAttrs(Data dst, ConstData src, CopyPar& copyPar) { CopyPar c = copyPar; @@ -238,4 +274,46 @@ Dbtux::copyAttrs(Data dst, ConstData src, CopyPar& copyPar) copyPar = c; } +/* + * Input is pointers to table attributes. Output is array of attribute + * data with headers. Copies whatever fits. + */ +void +Dbtux::copyAttrs(const Frag& frag, TableData data1, Data data2, unsigned maxlen2) +{ + ConstData keyAttrs = c_keyAttrs; // global + const unsigned numAttrs = frag.m_numAttrs; + unsigned len2 = maxlen2; + for (unsigned n = 0; n < numAttrs; n++) { + jam(); + const unsigned attrId = keyAttrs.ah().getAttributeId(); + const unsigned dataSize = keyAttrs.ah().getDataSize(); + const Uint32* const p1 = *data1; + if (p1 != 0) { + if (len2 == 0) + return; + data2.ah() = AttributeHeader(attrId, dataSize); + data2 += 1; + len2 -= 1; + unsigned n = dataSize; + for (unsigned i = 0; i < dataSize; i++) { + if (len2 == 0) + return; + *data2 = p1[i]; + data2 += 1; + len2 -= 1; + } + } else { + if (len2 == 0) + return; + data2.ah() = AttributeHeader(attrId, 0); + data2.ah().setNULL(); + data2 += 1; + len2 -= 1; + } + keyAttrs += 1; + data1 += 1; + } +} + BLOCK_FUNCTIONS(Dbtux); diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp index a6b2485067c..fc72611a273 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp @@ -33,11 +33,12 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) jam(); #ifdef VM_TRACE if (debugFlags & DebugMaint) { + TupLoc tupLoc(sig->pageId, sig->pageOffset); debugOut << "opInfo=" << hex << sig->opInfo; debugOut << " tableId=" << dec << sig->tableId; debugOut << " indexId=" << dec << sig->indexId; debugOut << " fragId=" << dec << sig->fragId; - debugOut << " tupAddr=" << hex << sig->tupAddr; + debugOut << " tupLoc=" << tupLoc; debugOut << " tupVersion=" << dec << sig->tupVersion; debugOut << " -- ignored at ISP=" << dec << c_internalStartPhase; debugOut << " TOS=" << dec << c_typeOfStart; @@ -72,31 +73,25 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) } ndbrequire(fragPtr.i != RNIL); Frag& frag = *fragPtr.p; - ndbrequire(frag.m_nodeList == RNIL); - // set up index entry + // set up index keys for this operation + setKeyAttrs(frag); + // set up search entry TreeEnt ent; - ent.m_tupAddr = req->tupAddr; + ent.m_tupLoc = TupLoc(req->pageId, req->pageOffset); ent.m_tupVersion = req->tupVersion; ent.m_fragBit = fragBit; // read search key - ReadPar readPar; - readPar.m_ent = ent; - readPar.m_first = 0; - readPar.m_count = frag.m_numAttrs; - // output goes here - readPar.m_data = c_keyBuffer; - tupReadAttrs(signal, frag, readPar); + readKeyAttrs(frag, ent, 0, c_searchKey); // check if all keys are null { + const unsigned numAttrs = frag.m_numAttrs; bool allNull = true; - ConstData data = readPar.m_data; - for (unsigned i = 0; i < frag.m_numAttrs; i++) { - if (! data.ah().isNULL()) { + for (unsigned i = 0; i < numAttrs; i++) { + if (c_searchKey[i] != 0) { jam(); allNull = false; break; } - data += AttributeHeaderSize + data.ah().getDataSize(); } if (allNull) { jam(); @@ -105,11 +100,6 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) return; } } - // find position in tree - SearchPar searchPar; - searchPar.m_data = c_keyBuffer; - searchPar.m_ent = ent; - TreePos treePos; #ifdef VM_TRACE if (debugFlags & DebugMaint) { debugOut << "opCode=" << dec << opCode; @@ -121,7 +111,9 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) debugOut << endl; } #endif - treeSearch(signal, frag, searchPar, treePos); + // find position in tree + TreePos treePos; + treeSearch(signal, frag, c_searchKey, ent, treePos); #ifdef VM_TRACE if (debugFlags & DebugMaint) { debugOut << treePos << endl; @@ -143,17 +135,18 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) } /* * At most one new node is inserted in the operation. We keep one - * free node pre-allocated so the operation cannot fail. This also - * gives a real TupAddr for links to the new node. + * free node pre-allocated so the operation cannot fail. */ - if (frag.m_nodeFree == RNIL) { + if (frag.m_freeLoc == NullTupLoc) { jam(); - preallocNode(signal, frag, req->errorCode); + NodeHandle node(frag); + req->errorCode = allocNode(signal, node); if (req->errorCode != 0) { jam(); break; } - ndbrequire(frag.m_nodeFree != RNIL); + frag.m_freeLoc = node.m_loc; + ndbrequire(frag.m_freeLoc != NullTupLoc); } treeAdd(signal, frag, treePos, ent); break; @@ -175,7 +168,6 @@ Dbtux::execTUX_MAINT_REQ(Signal* signal) break; } // commit and release nodes - commitNodes(signal, frag, req->errorCode == 0); #ifdef VM_TRACE if (debugFlags & DebugTree) { printTree(signal, frag, debugOut); @@ -199,11 +191,11 @@ Dbtux::tupReadAttrs(Signal* signal, const Frag& frag, ReadPar& readPar) req->requestInfo = 0; req->tableId = frag.m_tableId; req->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff); - req->fragPtrI = RNIL; - req->tupAddr = ent.m_tupAddr; + req->fragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit]; + req->tupAddr = (Uint32)-1; req->tupVersion = ent.m_tupVersion; - req->pageId = RNIL; - req->pageOffset = 0; + req->pageId = ent.m_tupLoc.m_pageId; + req->pageOffset = ent.m_tupLoc.m_pageOffset; req->bufferId = 0; // add count and list of attribute ids Data data = (Uint32*)req + TupReadAttrs::SignalLength; @@ -246,11 +238,11 @@ Dbtux::tupReadKeys(Signal* signal, const Frag& frag, ReadPar& readPar) req->requestInfo = TupReadAttrs::ReadKeys; req->tableId = frag.m_tableId; req->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff); - req->fragPtrI = RNIL; - req->tupAddr = ent.m_tupAddr; + req->fragPtrI = frag.m_tupTableFragPtrI[ent.m_fragBit]; + req->tupAddr = (Uint32)-1; req->tupVersion = RNIL; // not used - req->pageId = RNIL; - req->pageOffset = 0; + req->pageId = ent.m_tupLoc.m_pageId; + req->pageOffset = ent.m_tupLoc.m_pageOffset; req->bufferId = 0; // execute EXECUTE_DIRECT(DBTUP, GSN_TUP_READ_ATTRS, signal, TupReadAttrs::SignalLength); @@ -270,100 +262,3 @@ Dbtux::tupReadKeys(Signal* signal, const Frag& frag, ReadPar& readPar) readPar.m_count = numKeys; readPar.m_size = copyPar.m_numwords; } - -/* - * Operate on index node tuple in TUP. The data is copied between node - * cache and index storage via signal data. - */ -void -Dbtux::tupStoreTh(Signal* signal, const Frag& frag, NodeHandlePtr nodePtr, StorePar storePar) -{ - const TreeHead& tree = frag.m_tree; - // define the direct signal - TupStoreTh* req = (TupStoreTh*)signal->getDataPtrSend(); - req->errorCode = RNIL; - req->tableId = frag.m_indexId; - req->fragId = frag.m_fragId; - req->fragPtrI = RNIL; - req->tupAddr = nodePtr.p->m_addr; - req->tupVersion = 0; - req->pageId = nodePtr.p->m_loc.m_pageId; - req->pageOffset = nodePtr.p->m_loc.m_pageOffset; - req->bufferId = 0; - req->opCode = storePar.m_opCode; - ndbrequire(storePar.m_offset + storePar.m_size <= tree.m_nodeSize); - req->dataOffset = storePar.m_offset; - req->dataSize = storePar.m_size; - // the node cache - ndbrequire(nodePtr.p->m_node != 0); - // the buffer in signal data - Uint32* const buffer = (Uint32*)req + TupStoreTh::SignalLength; - // copy in data - switch (storePar.m_opCode) { - case TupStoreTh::OpRead: - jam(); - #ifdef VM_TRACE - { - Uint32* dst = buffer + storePar.m_offset; - memset(dst, 0xa9, storePar.m_size << 2); - } - #endif - break; - case TupStoreTh::OpInsert: - jam(); - // fallthru - case TupStoreTh::OpUpdate: - jam(); - // copy from cache to signal data - { - Uint32* dst = buffer + storePar.m_offset; - const Uint32* src = (const Uint32*)nodePtr.p->m_node + storePar.m_offset; - memcpy(dst, src, storePar.m_size << 2); - } - break; - case TupStoreTh::OpDelete: - jam(); - break; - default: - ndbrequire(false); - break; - } - // execute - EXECUTE_DIRECT(DBTUP, GSN_TUP_STORE_TH, signal, TupStoreTh::SignalLength); - jamEntry(); - if (req->errorCode != 0) { - jam(); - storePar.m_errorCode = req->errorCode; - return; - } - ndbrequire(req->errorCode == 0); - // copy out data - switch (storePar.m_opCode) { - case TupStoreTh::OpRead: - jam(); - { - Uint32* dst = (Uint32*)nodePtr.p->m_node + storePar.m_offset; - const Uint32* src = (const Uint32*)buffer + storePar.m_offset; - memcpy(dst, src, storePar.m_size << 2); - } - // fallthru - case TupStoreTh::OpInsert: - jam(); - // fallthru - case TupStoreTh::OpUpdate: - jam(); - nodePtr.p->m_addr = req->tupAddr; - nodePtr.p->m_loc.m_pageId = req->pageId; - nodePtr.p->m_loc.m_pageOffset = req->pageOffset; - break; - case TupStoreTh::OpDelete: - jam(); - nodePtr.p->m_addr = NullTupAddr; - nodePtr.p->m_loc.m_pageId = RNIL; - nodePtr.p->m_loc.m_pageOffset = 0; - break; - default: - ndbrequire(false); - break; - } -} diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp index 2ffd599429c..0612f191830 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp @@ -85,6 +85,11 @@ Dbtux::execTUXFRAGREQ(Signal* signal) fragPtr.p->m_fragOff = req->fragOff; fragPtr.p->m_fragId = req->fragId; fragPtr.p->m_numAttrs = req->noOfAttr; + fragPtr.p->m_tupIndexFragPtrI = req->tupIndexFragPtrI; + fragPtr.p->m_tupTableFragPtrI[0] = req->tupTableFragPtrI[0]; + fragPtr.p->m_tupTableFragPtrI[1] = req->tupTableFragPtrI[1]; + fragPtr.p->m_accTableFragPtrI[0] = req->accTableFragPtrI[0]; + fragPtr.p->m_accTableFragPtrI[1] = req->accTableFragPtrI[1]; // add the fragment to the index indexPtr.p->m_fragId[indexPtr.p->m_numFrags] = req->fragId; indexPtr.p->m_fragPtrI[indexPtr.p->m_numFrags] = fragPtr.i; @@ -176,10 +181,9 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) // define the attribute DescEnt& descEnt = getDescEnt(indexPtr.p->m_descPage, indexPtr.p->m_descOff); DescAttr& descAttr = descEnt.m_descAttr[attrId]; + descAttr.m_attrDesc = req->attrDescriptor; descAttr.m_primaryAttrId = req->primaryAttrId; descAttr.m_typeId = req->extTypeInfo & 0xFF; - descAttr.m_nullable = AttributeDescriptor::getNullable(req->attrDescriptor); - descAttr.pad1 = 0; #ifdef VM_TRACE if (debugFlags & DebugMeta) { debugOut << "Add frag " << fragPtr.i << " attr " << attrId << " " << descAttr << endl; @@ -197,6 +201,7 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) jam(); // initialize tree header TreeHead& tree = fragPtr.p->m_tree; + new (&tree) TreeHead(); // make these configurable later tree.m_nodeSize = MAX_TTREE_NODE_SIZE; tree.m_prefSize = MAX_TTREE_PREF_SIZE; @@ -222,8 +227,8 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) break; } tree.m_minOccup = tree.m_maxOccup - maxSlack; - // root node does not exist - tree.m_root = NullTupAddr; + // root node does not exist (also set by ctor) + tree.m_root = NullTupLoc; // fragment is defined c_fragOpPool.release(fragOpPtr); } @@ -310,12 +315,6 @@ Dbtux::dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 sen unsigned i = --indexPtr.p->m_numFrags; FragPtr fragPtr; c_fragPool.getPtr(fragPtr, indexPtr.p->m_fragPtrI[i]); - Frag& frag = *fragPtr.p; - ndbrequire(frag.m_nodeList == RNIL); - if (frag.m_nodeFree != RNIL) { - c_nodeHandlePool.release(frag.m_nodeFree); - frag.m_nodeFree = RNIL; - } c_fragPool.release(fragPtr); // the real time break is not used for anything currently signal->theData[0] = TuxContinueB::DropIndex; diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp index 6733a87da97..c969e35dc82 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp @@ -18,241 +18,113 @@ #include "Dbtux.hpp" /* - * Node handles. - * - * We use the "cache" implementation. Node operations are done on - * cached copies. Index memory is updated at the end of the operation. - * At most one node is inserted and it is always pre-allocated. - * - * An alternative "pointer" implementation which writes directly into - * index memory is planned for later. + * Allocate index node in TUP. */ - -// Dbtux - -void -Dbtux::seizeNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr) -{ - if (! c_nodeHandlePool.seize(nodePtr)) { - jam(); - return; - } - new (nodePtr.p) NodeHandle(*this, frag); - nodePtr.p->m_next = frag.m_nodeList; - frag.m_nodeList = nodePtr.i; - // node cache used always - nodePtr.p->m_node = (TreeNode*)nodePtr.p->m_cache; - new (nodePtr.p->m_node) TreeNode(); -#ifdef VM_TRACE - TreeHead& tree = frag.m_tree; - TreeNode* node = nodePtr.p->m_node; - memset(tree.getPref(node, 0), 0xa2, tree.m_prefSize << 2); - memset(tree.getPref(node, 1), 0xa2, tree.m_prefSize << 2); - TreeEnt* entList = tree.getEntList(node); - memset(entList, 0xa4, (tree.m_maxOccup + 1) * (TreeEntSize << 2)); -#endif -} - -void -Dbtux::preallocNode(Signal* signal, Frag& frag, Uint32& errorCode) -{ - ndbrequire(frag.m_nodeFree == RNIL); - NodeHandlePtr nodePtr; - seizeNode(signal, frag, nodePtr); - ndbrequire(nodePtr.i != RNIL); - // remove from cache XXX ugly - frag.m_nodeFree = frag.m_nodeList; - frag.m_nodeList = nodePtr.p->m_next; - StorePar storePar; - storePar.m_opCode = TupStoreTh::OpInsert; - storePar.m_offset = 0; - storePar.m_size = 0; - tupStoreTh(signal, frag, nodePtr, storePar); - if (storePar.m_errorCode != 0) { - jam(); - errorCode = storePar.m_errorCode; - c_nodeHandlePool.release(nodePtr); - frag.m_nodeFree = RNIL; - } -} - -/* - * Find node in the cache. XXX too slow, use direct links instead - */ -void -Dbtux::findNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr) -{ - NodeHandlePtr tmpPtr; - tmpPtr.i = frag.m_nodeList; - while (tmpPtr.i != RNIL) { - jam(); - c_nodeHandlePool.getPtr(tmpPtr); - if (tmpPtr.p->m_addr == addr) { - jam(); - nodePtr = tmpPtr; - return; - } - tmpPtr.i = tmpPtr.p->m_next; - } - nodePtr.i = RNIL; - nodePtr.p = 0; -} - -/* - * Get handle for existing node. - */ -void -Dbtux::selectNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, TupAddr addr, AccSize acc) +int +Dbtux::allocNode(Signal* signal, NodeHandle& node) { - ndbrequire(addr != NullTupAddr && acc > AccNone); - NodeHandlePtr tmpPtr; - // search in cache - findNode(signal, frag, tmpPtr, addr); - if (tmpPtr.i == RNIL) { + Frag& frag = node.m_frag; + Uint32 pageId = NullTupLoc.m_pageId; + Uint32 pageOffset = NullTupLoc.m_pageOffset; + Uint32* node32 = 0; + int errorCode = c_tup->tuxAllocNode(signal, frag.m_tupIndexFragPtrI, pageId, pageOffset, node32); + jamEntry(); + if (errorCode == 0) { jam(); - // add new node - seizeNode(signal, frag, tmpPtr); - ndbrequire(tmpPtr.i != RNIL); - tmpPtr.p->m_addr = addr; + node.m_loc = TupLoc(pageId, pageOffset); + node.m_node = reinterpret_cast<TreeNode*>(node32); + node.m_acc = AccNone; + ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0); } - if (tmpPtr.p->m_acc < acc) { - jam(); - accessNode(signal, frag, tmpPtr, acc); - } - nodePtr = tmpPtr; + return errorCode; } /* - * Create new node in the cache and mark it for insert. + * Access more of the node. */ void -Dbtux::insertNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc) +Dbtux::accessNode(Signal* signal, NodeHandle& node, AccSize acc) { - ndbrequire(acc > AccNone); - NodeHandlePtr tmpPtr; - // use the pre-allocated node - tmpPtr.i = frag.m_nodeFree; - frag.m_nodeFree = RNIL; - c_nodeHandlePool.getPtr(tmpPtr); - // move it to the cache - tmpPtr.p->m_next = frag.m_nodeList; - frag.m_nodeList = tmpPtr.i; - tmpPtr.p->m_acc = acc; - tmpPtr.p->m_flags |= NodeHandle::DoInsert; - nodePtr = tmpPtr; + ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0); + if (node.m_acc >= acc) + return; + // XXX could do prefetch + node.m_acc = acc; } /* - * Mark existing node for deletion. + * Set handle to point to existing node. */ void -Dbtux::deleteNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr) +Dbtux::selectNode(Signal* signal, NodeHandle& node, TupLoc loc, AccSize acc) { - NodeHandlePtr tmpPtr = nodePtr; - ndbrequire(tmpPtr.p->getOccup() == 0); - tmpPtr.p->m_flags |= NodeHandle::DoDelete; - // scans have already been moved by popDown or popUp + Frag& frag = node.m_frag; + ndbrequire(loc != NullTupLoc); + Uint32 pageId = loc.m_pageId; + Uint32 pageOffset = loc.m_pageOffset; + Uint32* node32 = 0; + c_tup->tuxGetNode(frag.m_tupIndexFragPtrI, pageId, pageOffset, node32); + jamEntry(); + node.m_loc = loc; + node.m_node = reinterpret_cast<TreeNode*>(node32); + node.m_acc = AccNone; + ndbrequire(node.m_loc != NullTupLoc && node.m_node != 0); + accessNode(signal, node, acc); } /* - * Access more of the node. + * Set handle to point to new node. Uses the pre-allocated node. */ void -Dbtux::accessNode(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, AccSize acc) +Dbtux::insertNode(Signal* signal, NodeHandle& node, AccSize acc) { + Frag& frag = node.m_frag; + TupLoc loc = frag.m_freeLoc; + frag.m_freeLoc = NullTupLoc; + selectNode(signal, node, loc, acc); + new (node.m_node) TreeNode(); +#ifdef VM_TRACE TreeHead& tree = frag.m_tree; - NodeHandlePtr tmpPtr = nodePtr; - if (tmpPtr.p->m_acc >= acc) - return; - if (! (tmpPtr.p->m_flags & NodeHandle::DoInsert)) { - jam(); - StorePar storePar; - storePar.m_opCode = TupStoreTh::OpRead; - storePar.m_offset = tree.getSize(tmpPtr.p->m_acc); - storePar.m_size = tree.getSize(acc) - tree.getSize(tmpPtr.p->m_acc); - tmpPtr.p->m_tux.tupStoreTh(signal, frag, tmpPtr, storePar); - ndbrequire(storePar.m_errorCode == 0); - } - tmpPtr.p->m_acc = acc; + memset(node.getPref(0), 0xa2, tree.m_prefSize << 2); + memset(node.getPref(1), 0xa2, tree.m_prefSize << 2); + TreeEnt* entList = tree.getEntList(node.m_node); + memset(entList, 0xa4, (tree.m_maxOccup + 1) * (TreeEntSize << 2)); +#endif } /* - * Set prefix. + * Delete existing node. */ void -Dbtux::setNodePref(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i) +Dbtux::deleteNode(Signal* signal, NodeHandle& node) { - TreeHead& tree = frag.m_tree; - NodeHandlePtr tmpPtr = nodePtr; - ReadPar readPar; - ndbrequire(i <= 1); - readPar.m_ent = tmpPtr.p->getMinMax(i); - readPar.m_first = 0; - readPar.m_count = frag.m_numAttrs; - // leave in signal data - readPar.m_data = 0; - // XXX implement max words to read - tupReadAttrs(signal, frag, readPar); - // copy whatever fits - CopyPar copyPar; - copyPar.m_items = readPar.m_count; - copyPar.m_headers = true; - copyPar.m_maxwords = tree.m_prefSize; - Data pref = tmpPtr.p->getPref(i); - copyAttrs(pref, readPar.m_data, copyPar); - nodePtr.p->m_flags |= NodeHandle::DoUpdate; + Frag& frag = node.m_frag; + ndbrequire(node.getOccup() == 0); + TupLoc loc = node.m_loc; + Uint32 pageId = loc.m_pageId; + Uint32 pageOffset = loc.m_pageOffset; + Uint32* node32 = reinterpret_cast<Uint32*>(node.m_node); + c_tup->tuxFreeNode(signal, frag.m_tupIndexFragPtrI, pageId, pageOffset, node32); + jamEntry(); + // invalidate handle and storage + node.m_loc = NullTupLoc; + node.m_node = 0; } /* - * Commit and release nodes at the end of an operation. Used also on - * error since no changes have been made (updateOk false). + * Set prefix. Copies the number of words that fits. Includes + * attribute headers for now. XXX use null mask instead */ void -Dbtux::commitNodes(Signal* signal, Frag& frag, bool updateOk) +Dbtux::setNodePref(Signal* signal, NodeHandle& node, unsigned i) { - TreeHead& tree = frag.m_tree; - NodeHandlePtr nodePtr; - nodePtr.i = frag.m_nodeList; - frag.m_nodeList = RNIL; - while (nodePtr.i != RNIL) { - c_nodeHandlePool.getPtr(nodePtr); - const unsigned flags = nodePtr.p->m_flags; - if (flags & NodeHandle::DoDelete) { - jam(); - ndbrequire(updateOk); - // delete - StorePar storePar; - storePar.m_opCode = TupStoreTh::OpDelete; - nodePtr.p->m_tux.tupStoreTh(signal, frag, nodePtr, storePar); - ndbrequire(storePar.m_errorCode == 0); - } else if (flags & NodeHandle::DoUpdate) { - jam(); - ndbrequire(updateOk); - // set prefixes - if (flags & (1 << 0)) { - jam(); - setNodePref(signal, frag, nodePtr, 0); - } - if (flags & (1 << 1)) { - jam(); - setNodePref(signal, frag, nodePtr, 1); - } - // update - StorePar storePar; - storePar.m_opCode = TupStoreTh::OpUpdate; - storePar.m_offset = 0; - storePar.m_size = tree.getSize(nodePtr.p->m_acc); - nodePtr.p->m_tux.tupStoreTh(signal, frag, nodePtr, storePar); - ndbrequire(storePar.m_errorCode == 0); - } - // release - NodeHandlePtr tmpPtr = nodePtr; - nodePtr.i = nodePtr.p->m_next; - c_nodeHandlePool.release(tmpPtr); - } + const Frag& frag = node.m_frag; + const TreeHead& tree = frag.m_tree; + readKeyAttrs(frag, node.getMinMax(i), 0, c_entryKey); + copyAttrs(frag, c_entryKey, node.getPref(i), tree.m_prefSize); } -// Dbtux::NodeHandle +// node operations /* * Add entry at position. Move entries greater than or equal to the old @@ -264,25 +136,26 @@ Dbtux::commitNodes(Signal* signal, Frag& frag, bool updateOk) * 0 1 2 3 4 5 6 0 1 2 3 4 5 6 */ void -Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent) +Dbtux::nodePushUp(Signal* signal, NodeHandle& node, unsigned pos, const TreeEnt& ent) { - TreeHead& tree = m_frag.m_tree; - const unsigned occup = getOccup(); + Frag& frag = node.m_frag; + TreeHead& tree = frag.m_tree; + const unsigned occup = node.getOccup(); ndbrequire(occup < tree.m_maxOccup && pos <= occup); // fix scans ScanOpPtr scanPtr; - scanPtr.i = getNodeScan(); + scanPtr.i = node.getNodeScan(); while (scanPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(scanPtr); + c_scanOpPool.getPtr(scanPtr); TreePos& scanPos = scanPtr.p->m_scanPos; - ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup); + ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup); if (scanPos.m_pos >= pos) { jam(); #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "At pushUp pos=" << pos << " " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "At pushUp pos=" << pos << " " << node << endl; } #endif scanPos.m_pos++; @@ -290,7 +163,7 @@ Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent) scanPtr.i = scanPtr.p->m_nodeScan; } // fix node - TreeEnt* const entList = tree.getEntList(m_node); + TreeEnt* const entList = tree.getEntList(node.m_node); entList[occup] = entList[0]; TreeEnt* const tmpList = entList + 1; for (unsigned i = occup; i > pos; i--) { @@ -298,18 +171,18 @@ Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent) tmpList[i] = tmpList[i - 1]; } tmpList[pos] = ent; + entList[0] = entList[occup + 1]; + node.setOccup(occup + 1); + // fix prefixes if (occup == 0 || pos == 0) - m_flags |= (1 << 0); + setNodePref(signal, node, 0); if (occup == 0 || pos == occup) - m_flags |= (1 << 1); - entList[0] = entList[occup + 1]; - setOccup(occup + 1); - m_flags |= DoUpdate; + setNodePref(signal, node, 1); } /* * Remove and return entry at position. Move entries greater than the - * removed one to the left. This is the opposite of pushUp. + * removed one to the left. This is the opposite of nodePushUp. * * D * ^ ^ @@ -317,46 +190,47 @@ Dbtux::NodeHandle::pushUp(Signal* signal, unsigned pos, const TreeEnt& ent) * 0 1 2 3 4 5 6 0 1 2 3 4 5 6 */ void -Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent) +Dbtux::nodePopDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent) { - TreeHead& tree = m_frag.m_tree; - const unsigned occup = getOccup(); + Frag& frag = node.m_frag; + TreeHead& tree = frag.m_tree; + const unsigned occup = node.getOccup(); ndbrequire(occup <= tree.m_maxOccup && pos < occup); ScanOpPtr scanPtr; // move scans whose entry disappears - scanPtr.i = getNodeScan(); + scanPtr.i = node.getNodeScan(); while (scanPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(scanPtr); + c_scanOpPool.getPtr(scanPtr); TreePos& scanPos = scanPtr.p->m_scanPos; - ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup); + ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup); const Uint32 nextPtrI = scanPtr.p->m_nodeScan; if (scanPos.m_pos == pos) { jam(); #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "At popDown pos=" << pos << " " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "At popDown pos=" << pos << " " << node << endl; } #endif - m_tux.scanNext(signal, scanPtr); + scanNext(signal, scanPtr); } scanPtr.i = nextPtrI; } // fix other scans - scanPtr.i = getNodeScan(); + scanPtr.i = node.getNodeScan(); while (scanPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(scanPtr); + c_scanOpPool.getPtr(scanPtr); TreePos& scanPos = scanPtr.p->m_scanPos; - ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup); + ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup); ndbrequire(scanPos.m_pos != pos); if (scanPos.m_pos > pos) { jam(); #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "At popDown pos=" << pos << " " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "At popDown pos=" << pos << " " << node << endl; } #endif scanPos.m_pos--; @@ -364,7 +238,7 @@ Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent) scanPtr.i = scanPtr.p->m_nodeScan; } // fix node - TreeEnt* const entList = tree.getEntList(m_node); + TreeEnt* const entList = tree.getEntList(node.m_node); entList[occup] = entList[0]; TreeEnt* const tmpList = entList + 1; ent = tmpList[pos]; @@ -372,13 +246,13 @@ Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent) jam(); tmpList[i] = tmpList[i + 1]; } + entList[0] = entList[occup - 1]; + node.setOccup(occup - 1); + // fix prefixes if (occup != 1 && pos == 0) - m_flags |= (1 << 0); + setNodePref(signal, node, 0); if (occup != 1 && pos == occup - 1) - m_flags |= (1 << 1); - entList[0] = entList[occup - 1]; - setOccup(occup - 1); - m_flags |= DoUpdate; + setNodePref(signal, node, 1); } /* @@ -391,47 +265,48 @@ Dbtux::NodeHandle::popDown(Signal* signal, unsigned pos, TreeEnt& ent) * 0 1 2 3 4 5 6 0 1 2 3 4 5 6 */ void -Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent) +Dbtux::nodePushDown(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent) { - TreeHead& tree = m_frag.m_tree; - const unsigned occup = getOccup(); + Frag& frag = node.m_frag; + TreeHead& tree = frag.m_tree; + const unsigned occup = node.getOccup(); ndbrequire(occup <= tree.m_maxOccup && pos < occup); ScanOpPtr scanPtr; // move scans whose entry disappears - scanPtr.i = getNodeScan(); + scanPtr.i = node.getNodeScan(); while (scanPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(scanPtr); + c_scanOpPool.getPtr(scanPtr); TreePos& scanPos = scanPtr.p->m_scanPos; - ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup); + ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup); const Uint32 nextPtrI = scanPtr.p->m_nodeScan; if (scanPos.m_pos == 0) { jam(); #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "At pushDown pos=" << pos << " " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "At pushDown pos=" << pos << " " << node << endl; } #endif // here we may miss a valid entry "X" XXX known bug - m_tux.scanNext(signal, scanPtr); + scanNext(signal, scanPtr); } scanPtr.i = nextPtrI; } // fix other scans - scanPtr.i = getNodeScan(); + scanPtr.i = node.getNodeScan(); while (scanPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(scanPtr); + c_scanOpPool.getPtr(scanPtr); TreePos& scanPos = scanPtr.p->m_scanPos; - ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup); + ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup); ndbrequire(scanPos.m_pos != 0); if (scanPos.m_pos <= pos) { jam(); #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "At pushDown pos=" << pos << " " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "At pushDown pos=" << pos << " " << node << endl; } #endif scanPos.m_pos--; @@ -439,7 +314,7 @@ Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent) scanPtr.i = scanPtr.p->m_nodeScan; } // fix node - TreeEnt* const entList = tree.getEntList(m_node); + TreeEnt* const entList = tree.getEntList(node.m_node); entList[occup] = entList[0]; TreeEnt* const tmpList = entList + 1; TreeEnt oldMin = tmpList[0]; @@ -449,18 +324,18 @@ Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent) } tmpList[pos] = ent; ent = oldMin; + entList[0] = entList[occup]; + // fix prefixes if (true) - m_flags |= (1 << 0); + setNodePref(signal, node, 0); if (occup == 1 || pos == occup - 1) - m_flags |= (1 << 1); - entList[0] = entList[occup]; - m_flags |= DoUpdate; + setNodePref(signal, node, 1); } /* * Remove and return entry at position. Move entries less than the * removed one to the right. Replace min entry by the input entry. - * This is the opposite of pushDown. + * This is the opposite of nodePushDown. * * X D * v ^ ^ @@ -468,47 +343,48 @@ Dbtux::NodeHandle::pushDown(Signal* signal, unsigned pos, TreeEnt& ent) * 0 1 2 3 4 5 6 0 1 2 3 4 5 6 */ void -Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent) +Dbtux::nodePopUp(Signal* signal, NodeHandle& node, unsigned pos, TreeEnt& ent) { - TreeHead& tree = m_frag.m_tree; - const unsigned occup = getOccup(); + Frag& frag = node.m_frag; + TreeHead& tree = frag.m_tree; + const unsigned occup = node.getOccup(); ndbrequire(occup <= tree.m_maxOccup && pos < occup); ScanOpPtr scanPtr; // move scans whose entry disappears - scanPtr.i = getNodeScan(); + scanPtr.i = node.getNodeScan(); while (scanPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(scanPtr); + c_scanOpPool.getPtr(scanPtr); TreePos& scanPos = scanPtr.p->m_scanPos; - ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup); + ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup); const Uint32 nextPtrI = scanPtr.p->m_nodeScan; if (scanPos.m_pos == pos) { jam(); #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "At popUp pos=" << pos << " " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Move scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "At popUp pos=" << pos << " " << node << endl; } #endif // here we may miss a valid entry "X" XXX known bug - m_tux.scanNext(signal, scanPtr); + scanNext(signal, scanPtr); } scanPtr.i = nextPtrI; } // fix other scans - scanPtr.i = getNodeScan(); + scanPtr.i = node.getNodeScan(); while (scanPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(scanPtr); + c_scanOpPool.getPtr(scanPtr); TreePos& scanPos = scanPtr.p->m_scanPos; - ndbrequire(scanPos.m_addr == m_addr && scanPos.m_pos < occup); + ndbrequire(scanPos.m_loc == node.m_loc && scanPos.m_pos < occup); ndbrequire(scanPos.m_pos != pos); if (scanPos.m_pos < pos) { jam(); #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "At popUp pos=" << pos << " " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Fix scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "At popUp pos=" << pos << " " << node << endl; } #endif scanPos.m_pos++; @@ -516,7 +392,7 @@ Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent) scanPtr.i = scanPtr.p->m_nodeScan; } // fix node - TreeEnt* const entList = tree.getEntList(m_node); + TreeEnt* const entList = tree.getEntList(node.m_node); entList[occup] = entList[0]; TreeEnt* const tmpList = entList + 1; TreeEnt newMin = ent; @@ -526,12 +402,12 @@ Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent) tmpList[i] = tmpList[i - 1]; } tmpList[0] = newMin; + entList[0] = entList[occup]; + // fix prefixes if (true) - m_flags |= (1 << 0); + setNodePref(signal, node, 0); if (occup == 1 || pos == occup - 1) - m_flags |= (1 << 1); - entList[0] = entList[occup]; - m_flags |= DoUpdate; + setNodePref(signal, node, 1); } /* @@ -539,14 +415,15 @@ Dbtux::NodeHandle::popUp(Signal* signal, unsigned pos, TreeEnt& ent) * after the max (i=1). XXX can be optimized */ void -Dbtux::NodeHandle::slide(Signal* signal, NodeHandlePtr nodePtr, unsigned i) +Dbtux::nodeSlide(Signal* signal, NodeHandle& dstNode, NodeHandle& srcNode, unsigned i) { + Frag& frag = dstNode.m_frag; + TreeHead& tree = frag.m_tree; ndbrequire(i <= 1); - TreeHead& tree = m_frag.m_tree; - while (getOccup() < tree.m_maxOccup && nodePtr.p->getOccup() != 0) { + while (dstNode.getOccup() < tree.m_maxOccup && srcNode.getOccup() != 0) { TreeEnt ent; - nodePtr.p->popDown(signal, i == 0 ? nodePtr.p->getOccup() - 1 : 0, ent); - pushUp(signal, i == 0 ? 0 : getOccup(), ent); + nodePopDown(signal, srcNode, i == 0 ? srcNode.getOccup() - 1 : 0, ent); + nodePushUp(signal, dstNode, i == 0 ? 0 : dstNode.getOccup(), ent); } } @@ -555,50 +432,50 @@ Dbtux::NodeHandle::slide(Signal* signal, NodeHandlePtr nodePtr, unsigned i) * ordering does not matter. */ void -Dbtux::NodeHandle::linkScan(Dbtux::ScanOpPtr scanPtr) +Dbtux::linkScan(NodeHandle& node, ScanOpPtr scanPtr) { #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Link scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "To node " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Link scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "To node " << node << endl; } #endif - ndbrequire(! islinkScan(scanPtr) && scanPtr.p->m_nodeScan == RNIL); - scanPtr.p->m_nodeScan = getNodeScan(); - setNodeScan(scanPtr.i); + ndbrequire(! islinkScan(node, scanPtr) && scanPtr.p->m_nodeScan == RNIL); + scanPtr.p->m_nodeScan = node.getNodeScan(); + node.setNodeScan(scanPtr.i); } /* * Unlink a scan from the list under the node. */ void -Dbtux::NodeHandle::unlinkScan(Dbtux::ScanOpPtr scanPtr) +Dbtux::unlinkScan(NodeHandle& node, ScanOpPtr scanPtr) { #ifdef VM_TRACE - if (m_tux.debugFlags & m_tux.DebugScan) { - m_tux.debugOut << "Unlink scan " << scanPtr.i << " " << *scanPtr.p << endl; - m_tux.debugOut << "From node " << *this << endl; + if (debugFlags & DebugScan) { + debugOut << "Unlink scan " << scanPtr.i << " " << *scanPtr.p << endl; + debugOut << "From node " << node << endl; } #endif - Dbtux::ScanOpPtr currPtr; - currPtr.i = getNodeScan(); - Dbtux::ScanOpPtr prevPtr; + ScanOpPtr currPtr; + currPtr.i = node.getNodeScan(); + ScanOpPtr prevPtr; prevPtr.i = RNIL; while (true) { jam(); - m_tux.c_scanOpPool.getPtr(currPtr); + c_scanOpPool.getPtr(currPtr); Uint32 nextPtrI = currPtr.p->m_nodeScan; if (currPtr.i == scanPtr.i) { jam(); if (prevPtr.i == RNIL) { - setNodeScan(nextPtrI); + node.setNodeScan(nextPtrI); } else { jam(); prevPtr.p->m_nodeScan = nextPtrI; } scanPtr.p->m_nodeScan = RNIL; // check for duplicates - ndbrequire(! islinkScan(scanPtr)); + ndbrequire(! islinkScan(node, scanPtr)); return; } prevPtr = currPtr; @@ -610,13 +487,13 @@ Dbtux::NodeHandle::unlinkScan(Dbtux::ScanOpPtr scanPtr) * Check if a scan is linked to this node. Only for ndbrequire. */ bool -Dbtux::NodeHandle::islinkScan(Dbtux::ScanOpPtr scanPtr) +Dbtux::islinkScan(NodeHandle& node, ScanOpPtr scanPtr) { - Dbtux::ScanOpPtr currPtr; - currPtr.i = getNodeScan(); + ScanOpPtr currPtr; + currPtr.i = node.getNodeScan(); while (currPtr.i != RNIL) { jam(); - m_tux.c_scanOpPool.getPtr(currPtr); + c_scanOpPool.getPtr(currPtr); if (currPtr.i == scanPtr.i) { jam(); return true; @@ -627,7 +504,7 @@ Dbtux::NodeHandle::islinkScan(Dbtux::ScanOpPtr scanPtr) } void -Dbtux::NodeHandle::progError(int line, int cause, const char* extra) +Dbtux::NodeHandle::progError(int line, int cause, const char* file) { - m_tux.progError(line, cause, extra); + ErrorReporter::handleAssert("Dbtux::NodeHandle: assert failed", file, line); } diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp index eaa539d9cfc..703b0abb683 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp @@ -42,12 +42,11 @@ Dbtux::execACC_SCANREQ(Signal* signal) } ndbrequire(fragPtr.i != RNIL); Frag& frag = *fragPtr.p; - ndbrequire(frag.m_nodeList == RNIL); // must be normal DIH/TC fragment ndbrequire(frag.m_fragId < (1 << frag.m_fragOff)); TreeHead& tree = frag.m_tree; // check for empty fragment - if (tree.m_root == NullTupAddr) { + if (tree.m_root == NullTupLoc) { jam(); AccScanConf* const conf = (AccScanConf*)signal->getDataPtrSend(); conf->scanPtr = req->senderData; @@ -241,7 +240,6 @@ Dbtux::execNEXT_SCANREQ(Signal* signal) debugOut << "NEXT_SCANREQ scan " << scanPtr.i << " " << scan << endl; } #endif - ndbrequire(frag.m_nodeList == RNIL); // handle unlock previous and close scan switch (req->scanFlag) { case NextScanReq::ZSCAN_NEXT: @@ -275,13 +273,13 @@ Dbtux::execNEXT_SCANREQ(Signal* signal) case NextScanReq::ZSCAN_CLOSE: jam(); // unlink from tree node first to avoid state changes - if (scan.m_scanPos.m_addr != NullTupAddr) { + if (scan.m_scanPos.m_loc != NullTupLoc) { jam(); - const TupAddr addr = scan.m_scanPos.m_addr; - NodeHandlePtr nodePtr; - selectNode(signal, frag, nodePtr, addr, AccHead); - nodePtr.p->unlinkScan(scanPtr); - scan.m_scanPos.m_addr = NullTupAddr; + const TupLoc loc = scan.m_scanPos.m_loc; + NodeHandle node(frag); + selectNode(signal, node, loc, AccHead); + unlinkScan(node, scanPtr); + scan.m_scanPos.m_loc = NullTupLoc; } if (scan.m_lockwait) { jam(); @@ -295,7 +293,6 @@ Dbtux::execNEXT_SCANREQ(Signal* signal) jamEntry(); ndbrequire(lockReq->returnCode == AccLockReq::Success); scan.m_state = ScanOp::Aborting; - commitNodes(signal, frag, true); return; } if (scan.m_state == ScanOp::Locked) { @@ -350,7 +347,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) signal->theData[1] = true; EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2); jamEntry(); - commitNodes(signal, frag, true); return; // stop } if (scan.m_lockwait) { @@ -365,7 +361,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) // if TC has ordered scan close, it will be detected here sendSignal(scan.m_userRef, GSN_NEXT_SCANCONF, signal, signalLength, JBB); - commitNodes(signal, frag, true); return; // stop } if (scan.m_state == ScanOp::First) { @@ -395,7 +390,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) const TreeEnt ent = scan.m_scanPos.m_ent; // read tuple key keyPar.m_ent = ent; - keyPar.m_data = c_keyBuffer; + keyPar.m_data = c_dataBuffer; tupReadKeys(signal, frag, keyPar); // get read lock or exclusive lock AccLockReq* const lockReq = (AccLockReq*)signal->getDataPtrSend(); @@ -407,12 +402,11 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) lockReq->userRef = reference(); lockReq->tableId = scan.m_tableId; lockReq->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff); - // should cache this at fragment create - lockReq->fragPtrI = RNIL; + lockReq->fragPtrI = frag.m_accTableFragPtrI[ent.m_fragBit]; const Uint32* const buf32 = static_cast<Uint32*>(keyPar.m_data); const Uint64* const buf64 = reinterpret_cast<const Uint64*>(buf32); lockReq->hashValue = md5_hash(buf64, keyPar.m_size); - lockReq->tupAddr = ent.m_tupAddr; + lockReq->tupAddr = getTupAddr(frag, ent); lockReq->transId1 = scan.m_transId1; lockReq->transId2 = scan.m_transId2; // execute @@ -445,7 +439,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) signal->theData[1] = true; EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2); jamEntry(); - commitNodes(signal, frag, true); return; // stop break; case AccLockReq::Refused: @@ -458,7 +451,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) signal->theData[1] = true; EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2); jamEntry(); - commitNodes(signal, frag, true); return; // stop break; case AccLockReq::NoFreeOp: @@ -471,7 +463,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) signal->theData[1] = true; EXECUTE_DIRECT(DBLQH, GSN_CHECK_LCP_STOP, signal, 2); jamEntry(); - commitNodes(signal, frag, true); return; // stop break; default: @@ -492,7 +483,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) if (keyPar.m_data == 0) { jam(); keyPar.m_ent = ent; - keyPar.m_data = c_keyBuffer; + keyPar.m_data = c_dataBuffer; tupReadKeys(signal, frag, keyPar); } } @@ -512,7 +503,7 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) } conf->accOperationPtr = accLockOp; conf->fragId = frag.m_fragId | (ent.m_fragBit << frag.m_fragOff); - conf->localKey[0] = ent.m_tupAddr; + conf->localKey[0] = getTupAddr(frag, ent); conf->localKey[1] = 0; conf->localKeyLength = 1; unsigned signalLength = 6; @@ -555,7 +546,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) scan.m_lastEnt = ent; // next time look for next entry scan.m_state = ScanOp::Next; - commitNodes(signal, frag, true); return; } // XXX in ACC this is checked before req->checkLcpStop @@ -569,7 +559,6 @@ Dbtux::execACC_CHECK_SCAN(Signal* signal) unsigned signalLength = 3; sendSignal(scanPtr.p->m_userRef, GSN_NEXT_SCANCONF, signal, signalLength, JBB); - commitNodes(signal, frag, true); return; } ndbrequire(false); @@ -700,45 +689,45 @@ Dbtux::scanFirst(Signal* signal, ScanOpPtr scanPtr) ScanOp& scan = *scanPtr.p; Frag& frag = *c_fragPool.getPtr(scan.m_fragPtrI); TreeHead& tree = frag.m_tree; - if (tree.m_root == NullTupAddr) { + if (tree.m_root == NullTupLoc) { // tree may have become empty jam(); scan.m_state = ScanOp::Last; return; } TreePos pos; - pos.m_addr = tree.m_root; - NodeHandlePtr nodePtr; + pos.m_loc = tree.m_root; + NodeHandle node(frag); // unpack lower bound const ScanBound& bound = *scan.m_bound[0]; ScanBoundIterator iter; bound.first(iter); for (unsigned j = 0; j < bound.getSize(); j++) { jam(); - c_keyBuffer[j] = *iter.data; + c_dataBuffer[j] = *iter.data; bound.next(iter); } // comparison parameters BoundPar boundPar; - boundPar.m_data1 = c_keyBuffer; + boundPar.m_data1 = c_dataBuffer; boundPar.m_count1 = scan.m_boundCnt[0]; boundPar.m_dir = 0; loop: { jam(); - selectNode(signal, frag, nodePtr, pos.m_addr, AccPref); - const unsigned occup = nodePtr.p->getOccup(); + selectNode(signal, node, pos.m_loc, AccPref); + const unsigned occup = node.getOccup(); ndbrequire(occup != 0); for (unsigned i = 0; i <= 1; i++) { jam(); // compare prefix - boundPar.m_data2 = nodePtr.p->getPref(i); + boundPar.m_data2 = node.getPref(i); boundPar.m_len2 = tree.m_prefSize; int ret = cmpScanBound(frag, boundPar); if (ret == NdbSqlUtil::CmpUnknown) { jam(); // read full value ReadPar readPar; - readPar.m_ent = nodePtr.p->getMinMax(i); + readPar.m_ent = node.getMinMax(i); readPar.m_first = 0; readPar.m_count = frag.m_numAttrs; readPar.m_data = 0; // leave in signal data @@ -751,11 +740,11 @@ loop: { } if (i == 0 && ret < 0) { jam(); - const TupAddr tupAddr = nodePtr.p->getLink(i); - if (tupAddr != NullTupAddr) { + const TupLoc loc = node.getLink(i); + if (loc != NullTupLoc) { jam(); // continue to left subtree - pos.m_addr = tupAddr; + pos.m_loc = loc; goto loop; } // start scanning this node @@ -764,34 +753,34 @@ loop: { pos.m_dir = 3; scan.m_scanPos = pos; scan.m_state = ScanOp::Next; - nodePtr.p->linkScan(scanPtr); + linkScan(node, scanPtr); return; } if (i == 1 && ret > 0) { jam(); - const TupAddr tupAddr = nodePtr.p->getLink(i); - if (tupAddr != NullTupAddr) { + const TupLoc loc = node.getLink(i); + if (loc != NullTupLoc) { jam(); // continue to right subtree - pos.m_addr = tupAddr; + pos.m_loc = loc; goto loop; } // start scanning upwards pos.m_dir = 1; scan.m_scanPos = pos; scan.m_state = ScanOp::Next; - nodePtr.p->linkScan(scanPtr); + linkScan(node, scanPtr); return; } } // read rest of current node - accessNode(signal, frag, nodePtr, AccFull); + accessNode(signal, node, AccFull); // look for first entry ndbrequire(occup >= 2); for (unsigned j = 1; j < occup; j++) { jam(); ReadPar readPar; - readPar.m_ent = nodePtr.p->getEnt(j); + readPar.m_ent = node.getEnt(j); readPar.m_first = 0; readPar.m_count = frag.m_numAttrs; readPar.m_data = 0; // leave in signal data @@ -809,7 +798,7 @@ loop: { pos.m_dir = 3; scan.m_scanPos = pos; scan.m_state = ScanOp::Next; - nodePtr.p->linkScan(scanPtr); + linkScan(node, scanPtr); return; } } @@ -858,42 +847,42 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) bound.first(iter); for (unsigned j = 0; j < bound.getSize(); j++) { jam(); - c_keyBuffer[j] = *iter.data; + c_dataBuffer[j] = *iter.data; bound.next(iter); } // comparison parameters BoundPar boundPar; - boundPar.m_data1 = c_keyBuffer; + boundPar.m_data1 = c_dataBuffer; boundPar.m_count1 = scan.m_boundCnt[1]; boundPar.m_dir = 1; // use copy of position TreePos pos = scan.m_scanPos; // get and remember original node - NodeHandlePtr origNodePtr; - selectNode(signal, frag, origNodePtr, pos.m_addr, AccHead); - ndbrequire(origNodePtr.p->islinkScan(scanPtr)); + NodeHandle origNode(frag); + selectNode(signal, origNode, pos.m_loc, AccHead); + ndbrequire(islinkScan(origNode, scanPtr)); // current node in loop - NodeHandlePtr nodePtr = origNodePtr; + NodeHandle node = origNode; while (true) { jam(); if (pos.m_dir == 2) { // coming up from root ends the scan jam(); - pos.m_addr = NullTupAddr; + pos.m_loc = NullTupLoc; scan.m_state = ScanOp::Last; break; } - if (nodePtr.p->m_addr != pos.m_addr) { + if (node.m_loc != pos.m_loc) { jam(); - selectNode(signal, frag, nodePtr, pos.m_addr, AccHead); + selectNode(signal, node, pos.m_loc, AccHead); } if (pos.m_dir == 4) { // coming down from parent proceed to left child jam(); - TupAddr addr = nodePtr.p->getLink(0); - if (addr != NullTupAddr) { + TupLoc loc = node.getLink(0); + if (loc != NullTupLoc) { jam(); - pos.m_addr = addr; + pos.m_loc = loc; pos.m_dir = 4; // unchanged continue; } @@ -910,10 +899,10 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) if (pos.m_dir == 3) { // within node jam(); - unsigned occup = nodePtr.p->getOccup(); + unsigned occup = node.getOccup(); ndbrequire(occup >= 1); // access full node - accessNode(signal, frag, nodePtr, AccFull); + accessNode(signal, node, AccFull); // advance position if (! pos.m_match) pos.m_match = true; @@ -921,7 +910,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) pos.m_pos++; if (pos.m_pos < occup) { jam(); - pos.m_ent = nodePtr.p->getEnt(pos.m_pos); + pos.m_ent = node.getEnt(pos.m_pos); pos.m_dir = 3; // unchanged // XXX implement prefix optimization ReadPar readPar; @@ -938,7 +927,7 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) if (ret < 0) { jam(); // hit upper bound of single range scan - pos.m_addr = NullTupAddr; + pos.m_loc = NullTupLoc; scan.m_state = ScanOp::Last; break; } @@ -952,10 +941,10 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) break; } // after node proceed to right child - TupAddr addr = nodePtr.p->getLink(1); - if (addr != NullTupAddr) { + TupLoc loc = node.getLink(1); + if (loc != NullTupLoc) { jam(); - pos.m_addr = addr; + pos.m_loc = loc; pos.m_dir = 4; continue; } @@ -965,8 +954,8 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) if (pos.m_dir == 1) { // coming from right child proceed to parent jam(); - pos.m_addr = nodePtr.p->getLink(2); - pos.m_dir = nodePtr.p->getSide(); + pos.m_loc = node.getLink(2); + pos.m_dir = node.getSide(); continue; } ndbrequire(false); @@ -975,16 +964,16 @@ Dbtux::scanNext(Signal* signal, ScanOpPtr scanPtr) scan.m_scanPos = pos; // relink if (scan.m_state == ScanOp::Current) { - ndbrequire(pos.m_addr == nodePtr.p->m_addr); - if (origNodePtr.i != nodePtr.i) { + ndbrequire(pos.m_loc == node.m_loc); + if (origNode.m_loc != node.m_loc) { jam(); - origNodePtr.p->unlinkScan(scanPtr); - nodePtr.p->linkScan(scanPtr); + unlinkScan(origNode, scanPtr); + linkScan(node, scanPtr); } } else if (scan.m_state == ScanOp::Last) { jam(); - ndbrequire(pos.m_addr == NullTupAddr); - origNodePtr.p->unlinkScan(scanPtr); + ndbrequire(pos.m_loc == NullTupLoc); + unlinkScan(origNode, scanPtr); } else { ndbrequire(false); } @@ -1012,10 +1001,10 @@ Dbtux::scanVisible(Signal* signal, ScanOpPtr scanPtr, TreeEnt ent) Uint32 tableId = frag.m_tableId; Uint32 fragBit = ent.m_fragBit; Uint32 fragId = frag.m_fragId | (fragBit << frag.m_fragOff); - Uint32 tupAddr = ent.m_tupAddr; + Uint32 tupAddr = getTupAddr(frag, ent); Uint32 tupVersion = ent.m_tupVersion; /* Check for same tuple twice in row */ - if (scan.m_lastEnt.m_tupAddr == tupAddr && + if (scan.m_lastEnt.m_tupLoc == ent.m_tupLoc && scan.m_lastEnt.m_fragBit == fragBit) { jam(); return false; @@ -1044,7 +1033,6 @@ void Dbtux::scanClose(Signal* signal, ScanOpPtr scanPtr) { ScanOp& scan = *scanPtr.p; - Frag& frag = *c_fragPool.getPtr(scanPtr.p->m_fragPtrI); ndbrequire(! scan.m_lockwait && scan.m_accLockOp == RNIL); // unlock all not unlocked by LQH for (unsigned i = 0; i < MaxAccLockOps; i++) { @@ -1069,7 +1057,6 @@ Dbtux::scanClose(Signal* signal, ScanOpPtr scanPtr) sendSignal(scanPtr.p->m_userRef, GSN_NEXT_SCANCONF, signal, signalLength, JBB); releaseScanOp(scanPtr); - commitNodes(signal, frag, true); } void diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp index 860aa65414f..7c3f5fa36b8 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp @@ -26,71 +26,55 @@ * same in min/max need not be checked. */ void -Dbtux::treeSearch(Signal* signal, Frag& frag, SearchPar searchPar, TreePos& treePos) +Dbtux::treeSearch(Signal* signal, Frag& frag, TableData searchKey, TreeEnt searchEnt, TreePos& treePos) { const TreeHead& tree = frag.m_tree; const unsigned numAttrs = frag.m_numAttrs; - treePos.m_addr = tree.m_root; - NodeHandlePtr nodePtr; - if (treePos.m_addr == NullTupAddr) { + treePos.m_loc = tree.m_root; + if (treePos.m_loc == NullTupLoc) { // empty tree jam(); treePos.m_pos = 0; treePos.m_match = false; return; } + NodeHandle node(frag); loop: { jam(); - selectNode(signal, frag, nodePtr, treePos.m_addr, AccPref); - const unsigned occup = nodePtr.p->getOccup(); + selectNode(signal, node, treePos.m_loc, AccPref); + const unsigned occup = node.getOccup(); ndbrequire(occup != 0); // number of equal initial attributes in bounding node - unsigned numEq = ZNIL; + unsigned start = ZNIL; for (unsigned i = 0; i <= 1; i++) { jam(); + unsigned start1 = 0; // compare prefix - CmpPar cmpPar; - cmpPar.m_data1 = searchPar.m_data; - cmpPar.m_data2 = nodePtr.p->getPref(i); - cmpPar.m_len2 = tree.m_prefSize; - cmpPar.m_first = 0; - cmpPar.m_numEq = 0; - int ret = cmpTreeAttrs(frag, cmpPar); + int ret = cmpSearchKey(frag, start1, searchKey, node.getPref(i), tree.m_prefSize); if (ret == NdbSqlUtil::CmpUnknown) { jam(); - // read full value - ReadPar readPar; - readPar.m_ent = nodePtr.p->getMinMax(i); - ndbrequire(cmpPar.m_numEq < numAttrs); - readPar.m_first = cmpPar.m_numEq; - readPar.m_count = numAttrs - cmpPar.m_numEq; - readPar.m_data = 0; // leave in signal data - tupReadAttrs(signal, frag, readPar); - // compare full value - cmpPar.m_data2 = readPar.m_data; - cmpPar.m_len2 = ZNIL; // big - cmpPar.m_first = readPar.m_first; - ret = cmpTreeAttrs(frag, cmpPar); + // read and compare remaining attributes + readKeyAttrs(frag, node.getMinMax(i), start1, c_entryKey); + ret = cmpSearchKey(frag, start1, searchKey, c_entryKey); ndbrequire(ret != NdbSqlUtil::CmpUnknown); } - if (numEq > cmpPar.m_numEq) - numEq = cmpPar.m_numEq; + if (start > start1) + start = start1; if (ret == 0) { jam(); // keys are equal, compare entry values - ret = searchPar.m_ent.cmp(nodePtr.p->getMinMax(i)); + ret = searchEnt.cmp(node.getMinMax(i)); } if (i == 0 ? (ret < 0) : (ret > 0)) { jam(); - const TupAddr tupAddr = nodePtr.p->getLink(i); - if (tupAddr != NullTupAddr) { + const TupLoc loc = node.getLink(i); + if (loc != NullTupLoc) { jam(); // continue to left/right subtree - treePos.m_addr = tupAddr; + treePos.m_loc = loc; goto loop; } // position is immediately before/after this node - // XXX disallow second case treePos.m_pos = (i == 0 ? 0 : occup); treePos.m_match = false; return; @@ -103,36 +87,26 @@ loop: { return; } } - // read rest of the bounding node - accessNode(signal, frag, nodePtr, AccFull); + // access rest of the bounding node + accessNode(signal, node, AccFull); // position is strictly within the node ndbrequire(occup >= 2); const unsigned numWithin = occup - 2; for (unsigned j = 1; j <= numWithin; j++) { jam(); int ret = 0; - // compare remaining attributes - if (numEq < numAttrs) { + if (start < numAttrs) { jam(); - ReadPar readPar; - readPar.m_ent = nodePtr.p->getEnt(j); - readPar.m_first = numEq; - readPar.m_count = numAttrs - numEq; - readPar.m_data = 0; // leave in signal data - tupReadAttrs(signal, frag, readPar); - // compare - CmpPar cmpPar; - cmpPar.m_data1 = searchPar.m_data; - cmpPar.m_data2 = readPar.m_data; - cmpPar.m_len2 = ZNIL; // big - cmpPar.m_first = readPar.m_first; - ret = cmpTreeAttrs(frag, cmpPar); + // read and compare remaining attributes + unsigned start1 = start; + readKeyAttrs(frag, node.getEnt(j), start1, c_entryKey); + ret = cmpSearchKey(frag, start1, searchKey, c_entryKey); ndbrequire(ret != NdbSqlUtil::CmpUnknown); } if (ret == 0) { jam(); // keys are equal, compare entry values - ret = searchPar.m_ent.cmp(nodePtr.p->getEnt(j)); + ret = searchEnt.cmp(node.getEnt(j)); } if (ret <= 0) { jam(); @@ -157,94 +131,94 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent) { TreeHead& tree = frag.m_tree; unsigned pos = treePos.m_pos; - NodeHandlePtr nodePtr; + NodeHandle node(frag); // check for empty tree - if (treePos.m_addr == NullTupAddr) { + if (treePos.m_loc == NullTupLoc) { jam(); - insertNode(signal, frag, nodePtr, AccPref); - nodePtr.p->pushUp(signal, 0, ent); - nodePtr.p->setSide(2); - tree.m_root = nodePtr.p->m_addr; + insertNode(signal, node, AccPref); + nodePushUp(signal, node, 0, ent); + node.setSide(2); + tree.m_root = node.m_loc; return; } // access full node - selectNode(signal, frag, nodePtr, treePos.m_addr, AccFull); + selectNode(signal, node, treePos.m_loc, AccFull); // check if it is bounding node - if (pos != 0 && pos != nodePtr.p->getOccup()) { + if (pos != 0 && pos != node.getOccup()) { jam(); // check if room for one more - if (nodePtr.p->getOccup() < tree.m_maxOccup) { + if (node.getOccup() < tree.m_maxOccup) { jam(); - nodePtr.p->pushUp(signal, pos, ent); + nodePushUp(signal, node, pos, ent); return; } // returns min entry - nodePtr.p->pushDown(signal, pos - 1, ent); + nodePushDown(signal, node, pos - 1, ent); // find position to add the removed min entry - TupAddr childAddr = nodePtr.p->getLink(0); - if (childAddr == NullTupAddr) { + TupLoc childLoc = node.getLink(0); + if (childLoc == NullTupLoc) { jam(); // left child will be added pos = 0; } else { jam(); // find glb node - while (childAddr != NullTupAddr) { + while (childLoc != NullTupLoc) { jam(); - selectNode(signal, frag, nodePtr, childAddr, AccHead); - childAddr = nodePtr.p->getLink(1); + selectNode(signal, node, childLoc, AccHead); + childLoc = node.getLink(1); } // access full node again - accessNode(signal, frag, nodePtr, AccFull); - pos = nodePtr.p->getOccup(); + accessNode(signal, node, AccFull); + pos = node.getOccup(); } // fall thru to next case } // adding new min or max unsigned i = (pos == 0 ? 0 : 1); - ndbrequire(nodePtr.p->getLink(i) == NullTupAddr); + ndbrequire(node.getLink(i) == NullTupLoc); // check if the half-leaf/leaf has room for one more - if (nodePtr.p->getOccup() < tree.m_maxOccup) { + if (node.getOccup() < tree.m_maxOccup) { jam(); - nodePtr.p->pushUp(signal, pos, ent); + nodePushUp(signal, node, pos, ent); return; } // add a new node - NodeHandlePtr childPtr; - insertNode(signal, frag, childPtr, AccPref); - childPtr.p->pushUp(signal, 0, ent); + NodeHandle childNode(frag); + insertNode(signal, childNode, AccPref); + nodePushUp(signal, childNode, 0, ent); // connect parent and child - nodePtr.p->setLink(i, childPtr.p->m_addr); - childPtr.p->setLink(2, nodePtr.p->m_addr); - childPtr.p->setSide(i); + node.setLink(i, childNode.m_loc); + childNode.setLink(2, node.m_loc); + childNode.setSide(i); // re-balance tree at each node while (true) { // height of subtree i has increased by 1 int j = (i == 0 ? -1 : +1); - int b = nodePtr.p->getBalance(); + int b = node.getBalance(); if (b == 0) { // perfectly balanced jam(); - nodePtr.p->setBalance(j); + node.setBalance(j); // height change propagates up } else if (b == -j) { // height of shorter subtree increased jam(); - nodePtr.p->setBalance(0); + node.setBalance(0); // height of tree did not change - done break; } else if (b == j) { // height of longer subtree increased jam(); - NodeHandlePtr childPtr; - selectNode(signal, frag, childPtr, nodePtr.p->getLink(i), AccHead); - int b2 = childPtr.p->getBalance(); + NodeHandle childNode(frag); + selectNode(signal, childNode, node.getLink(i), AccHead); + int b2 = childNode.getBalance(); if (b2 == b) { jam(); - treeRotateSingle(signal, frag, nodePtr, i); + treeRotateSingle(signal, frag, node, i); } else if (b2 == -b) { jam(); - treeRotateDouble(signal, frag, nodePtr, i); + treeRotateDouble(signal, frag, node, i); } else { // height of subtree increased so it cannot be perfectly balanced ndbrequire(false); @@ -254,14 +228,14 @@ Dbtux::treeAdd(Signal* signal, Frag& frag, TreePos treePos, TreeEnt ent) } else { ndbrequire(false); } - TupAddr parentAddr = nodePtr.p->getLink(2); - if (parentAddr == NullTupAddr) { + TupLoc parentLoc = node.getLink(2); + if (parentLoc == NullTupLoc) { jam(); // root node - done break; } - i = nodePtr.p->getSide(); - selectNode(signal, frag, nodePtr, parentAddr, AccHead); + i = node.getSide(); + selectNode(signal, node, parentLoc, AccHead); } } @@ -273,101 +247,101 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) { TreeHead& tree = frag.m_tree; unsigned pos = treePos.m_pos; - NodeHandlePtr nodePtr; + NodeHandle node(frag); // access full node - selectNode(signal, frag, nodePtr, treePos.m_addr, AccFull); + selectNode(signal, node, treePos.m_loc, AccFull); TreeEnt ent; // check interior node first - if (nodePtr.p->getChilds() == 2) { + if (node.getChilds() == 2) { jam(); - ndbrequire(nodePtr.p->getOccup() >= tree.m_minOccup); + ndbrequire(node.getOccup() >= tree.m_minOccup); // check if no underflow - if (nodePtr.p->getOccup() > tree.m_minOccup) { + if (node.getOccup() > tree.m_minOccup) { jam(); - nodePtr.p->popDown(signal, pos, ent); + nodePopDown(signal, node, pos, ent); return; } // save current handle - NodeHandlePtr parentPtr = nodePtr; + NodeHandle parentNode = node; // find glb node - TupAddr childAddr = nodePtr.p->getLink(0); - while (childAddr != NullTupAddr) { + TupLoc childLoc = node.getLink(0); + while (childLoc != NullTupLoc) { jam(); - selectNode(signal, frag, nodePtr, childAddr, AccHead); - childAddr = nodePtr.p->getLink(1); + selectNode(signal, node, childLoc, AccHead); + childLoc = node.getLink(1); } // access full node again - accessNode(signal, frag, nodePtr, AccFull); + accessNode(signal, node, AccFull); // use glb max as new parent min - ent = nodePtr.p->getEnt(nodePtr.p->getOccup() - 1); - parentPtr.p->popUp(signal, pos, ent); + ent = node.getEnt(node.getOccup() - 1); + nodePopUp(signal, parentNode, pos, ent); // set up to remove glb max - pos = nodePtr.p->getOccup() - 1; + pos = node.getOccup() - 1; // fall thru to next case } // remove the element - nodePtr.p->popDown(signal, pos, ent); - ndbrequire(nodePtr.p->getChilds() <= 1); + nodePopDown(signal, node, pos, ent); + ndbrequire(node.getChilds() <= 1); // handle half-leaf for (unsigned i = 0; i <= 1; i++) { jam(); - TupAddr childAddr = nodePtr.p->getLink(i); - if (childAddr != NullTupAddr) { + TupLoc childLoc = node.getLink(i); + if (childLoc != NullTupLoc) { // move to child - selectNode(signal, frag, nodePtr, childAddr, AccFull); + selectNode(signal, node, childLoc, AccFull); // balance of half-leaf parent requires child to be leaf break; } } - ndbrequire(nodePtr.p->getChilds() == 0); + ndbrequire(node.getChilds() == 0); // get parent if any - TupAddr parentAddr = nodePtr.p->getLink(2); - NodeHandlePtr parentPtr; - unsigned i = nodePtr.p->getSide(); + TupLoc parentLoc = node.getLink(2); + NodeHandle parentNode(frag); + unsigned i = node.getSide(); // move all that fits into parent - if (parentAddr != NullTupAddr) { + if (parentLoc != NullTupLoc) { jam(); - selectNode(signal, frag, parentPtr, nodePtr.p->getLink(2), AccFull); - parentPtr.p->slide(signal, nodePtr, i); + selectNode(signal, parentNode, node.getLink(2), AccFull); + nodeSlide(signal, parentNode, node, i); // fall thru to next case } // non-empty leaf - if (nodePtr.p->getOccup() >= 1) { + if (node.getOccup() >= 1) { jam(); return; } // remove empty leaf - deleteNode(signal, frag, nodePtr); - if (parentAddr == NullTupAddr) { + deleteNode(signal, node); + if (parentLoc == NullTupLoc) { jam(); // tree is now empty - tree.m_root = NullTupAddr; + tree.m_root = NullTupLoc; return; } - nodePtr = parentPtr; - nodePtr.p->setLink(i, NullTupAddr); + node = parentNode; + node.setLink(i, NullTupLoc); #ifdef dbtux_min_occup_less_max_occup // check if we created a half-leaf - if (nodePtr.p->getBalance() == 0) { + if (node.getBalance() == 0) { jam(); // move entries from the other child - TupAddr childAddr = nodePtr.p->getLink(1 - i); - NodeHandlePtr childPtr; - selectNode(signal, frag, childPtr, childAddr, AccFull); - nodePtr.p->slide(signal, childPtr, 1 - i); - if (childPtr.p->getOccup() == 0) { + TupLoc childLoc = node.getLink(1 - i); + NodeHandle childNode(frag); + selectNode(signal, childNode, childLoc, AccFull); + nodeSlide(signal, node, childNode, 1 - i); + if (childNode.getOccup() == 0) { jam(); - deleteNode(signal, frag, childPtr); - nodePtr.p->setLink(1 - i, NullTupAddr); + deleteNode(signal, childNode); + node.setLink(1 - i, NullTupLoc); // we are balanced again but our parent balance changes by -1 - parentAddr = nodePtr.p->getLink(2); - if (parentAddr == NullTupAddr) { + parentLoc = node.getLink(2); + if (parentLoc == NullTupLoc) { jam(); return; } // fix side and become parent - i = nodePtr.p->getSide(); - selectNode(signal, frag, nodePtr, parentAddr, AccHead); + i = node.getSide(); + selectNode(signal, node, parentLoc, AccHead); } } #endif @@ -375,50 +349,50 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) while (true) { // height of subtree i has decreased by 1 int j = (i == 0 ? -1 : +1); - int b = nodePtr.p->getBalance(); + int b = node.getBalance(); if (b == 0) { // perfectly balanced jam(); - nodePtr.p->setBalance(-j); + node.setBalance(-j); // height of tree did not change - done return; } else if (b == j) { // height of longer subtree has decreased jam(); - nodePtr.p->setBalance(0); + node.setBalance(0); // height change propagates up } else if (b == -j) { // height of shorter subtree has decreased jam(); - NodeHandlePtr childPtr; // child on the other side - selectNode(signal, frag, childPtr, nodePtr.p->getLink(1 - i), AccHead); - int b2 = childPtr.p->getBalance(); + NodeHandle childNode(frag); + selectNode(signal, childNode, node.getLink(1 - i), AccHead); + int b2 = childNode.getBalance(); if (b2 == b) { jam(); - treeRotateSingle(signal, frag, nodePtr, 1 - i); + treeRotateSingle(signal, frag, node, 1 - i); // height of tree decreased and propagates up } else if (b2 == -b) { jam(); - treeRotateDouble(signal, frag, nodePtr, 1 - i); + treeRotateDouble(signal, frag, node, 1 - i); // height of tree decreased and propagates up } else { jam(); - treeRotateSingle(signal, frag, nodePtr, 1 - i); + treeRotateSingle(signal, frag, node, 1 - i); // height of tree did not change - done return; } } else { ndbrequire(false); } - TupAddr parentAddr = nodePtr.p->getLink(2); - if (parentAddr == NullTupAddr) { + TupLoc parentLoc = node.getLink(2); + if (parentLoc == NullTupLoc) { jam(); // root node - done return; } - i = nodePtr.p->getSide(); - selectNode(signal, frag, nodePtr, parentAddr, AccHead); + i = node.getSide(); + selectNode(signal, node, parentLoc, AccHead); } } @@ -441,55 +415,55 @@ Dbtux::treeRemove(Signal* signal, Frag& frag, TreePos treePos) void Dbtux::treeRotateSingle(Signal* signal, Frag& frag, - NodeHandlePtr& nodePtr, + NodeHandle& node, unsigned i) { ndbrequire(i <= 1); /* 5 is the old top node that have been unbalanced due to an insert or delete. The balance is still the old balance before the update. - Verify that n5Bal is 1 if RR rotate and -1 if LL rotate. + Verify that bal5 is 1 if RR rotate and -1 if LL rotate. */ - NodeHandlePtr n5Ptr = nodePtr; - const TupAddr n5Addr = n5Ptr.p->m_addr; - const int n5Bal = n5Ptr.p->getBalance(); - const int n5side = n5Ptr.p->getSide(); - ndbrequire(n5Bal + (1 - i) == i); + NodeHandle node5 = node; + const TupLoc loc5 = node5.m_loc; + const int bal5 = node5.getBalance(); + const int side5 = node5.getSide(); + ndbrequire(bal5 + (1 - i) == i); /* 3 is the new root of this part of the tree which is to swap place with node 5. For an insert to cause this it must have the same balance as 5. For deletes it can have the balance 0. */ - TupAddr n3Addr = n5Ptr.p->getLink(i); - NodeHandlePtr n3Ptr; - selectNode(signal, frag, n3Ptr, n3Addr, AccHead); - const int n3Bal = n3Ptr.p->getBalance(); + TupLoc loc3 = node5.getLink(i); + NodeHandle node3(frag); + selectNode(signal, node3, loc3, AccHead); + const int bal3 = node3.getBalance(); /* 2 must always be there but is not changed. Thus we mereley check that it exists. */ - ndbrequire(n3Ptr.p->getLink(i) != NullTupAddr); + ndbrequire(node3.getLink(i) != NullTupLoc); /* 4 is not necessarily there but if it is there it will move from one side of 3 to the other side of 5. For LL it moves from the right side to the left side and for RR it moves from the left side to the right side. This means that it also changes parent from 3 to 5. */ - TupAddr n4Addr = n3Ptr.p->getLink(1 - i); - NodeHandlePtr n4Ptr; - if (n4Addr != NullTupAddr) { + TupLoc loc4 = node3.getLink(1 - i); + NodeHandle node4(frag); + if (loc4 != NullTupLoc) { jam(); - selectNode(signal, frag, n4Ptr, n4Addr, AccHead); - ndbrequire(n4Ptr.p->getSide() == (1 - i) && - n4Ptr.p->getLink(2) == n3Addr); - n4Ptr.p->setSide(i); - n4Ptr.p->setLink(2, n5Addr); + selectNode(signal, node4, loc4, AccHead); + ndbrequire(node4.getSide() == (1 - i) && + node4.getLink(2) == loc3); + node4.setSide(i); + node4.setLink(2, loc5); }//if /* Retrieve the address of 5's parent before it is destroyed */ - TupAddr n0Addr = n5Ptr.p->getLink(2); + TupLoc loc0 = node5.getLink(2); /* The next step is to perform the rotation. 3 will inherit 5's parent @@ -503,22 +477,22 @@ Dbtux::treeRotateSingle(Signal* signal, 1. 3 must have had 5 as parent before the change. 2. 3's side is left for LL and right for RR before change. */ - ndbrequire(n3Ptr.p->getLink(2) == n5Addr); - ndbrequire(n3Ptr.p->getSide() == i); - n3Ptr.p->setLink(1 - i, n5Addr); - n3Ptr.p->setLink(2, n0Addr); - n3Ptr.p->setSide(n5side); - n5Ptr.p->setLink(i, n4Addr); - n5Ptr.p->setLink(2, n3Addr); - n5Ptr.p->setSide(1 - i); - if (n0Addr != NullTupAddr) { + ndbrequire(node3.getLink(2) == loc5); + ndbrequire(node3.getSide() == i); + node3.setLink(1 - i, loc5); + node3.setLink(2, loc0); + node3.setSide(side5); + node5.setLink(i, loc4); + node5.setLink(2, loc3); + node5.setSide(1 - i); + if (loc0 != NullTupLoc) { jam(); - NodeHandlePtr n0Ptr; - selectNode(signal, frag, n0Ptr, n0Addr, AccHead); - n0Ptr.p->setLink(n5side, n3Addr); + NodeHandle node0(frag); + selectNode(signal, node0, loc0, AccHead); + node0.setLink(side5, loc3); } else { jam(); - frag.m_tree.m_root = n3Addr; + frag.m_tree.m_root = loc3; }//if /* The final step of the change is to update the balance of 3 and 5 that changed places. There are two cases here. The first case is @@ -531,22 +505,22 @@ Dbtux::treeRotateSingle(Signal* signal, In this case 5 will change balance but still be unbalanced and 3 will be unbalanced in the opposite direction of 5. */ - if (n3Bal == n5Bal) { + if (bal3 == bal5) { jam(); - n3Ptr.p->setBalance(0); - n5Ptr.p->setBalance(0); - } else if (n3Bal == 0) { + node3.setBalance(0); + node5.setBalance(0); + } else if (bal3 == 0) { jam(); - n3Ptr.p->setBalance(-n5Bal); - n5Ptr.p->setBalance(n5Bal); + node3.setBalance(-bal5); + node5.setBalance(bal5); } else { ndbrequire(false); }//if /* - Set nodePtr to 3 as return parameter for enabling caller to continue + Set node to 3 as return parameter for enabling caller to continue traversing the tree. */ - nodePtr = n3Ptr; + node = node3; } /* @@ -651,105 +625,105 @@ Dbtux::treeRotateSingle(Signal* signal, * */ void -Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandlePtr& nodePtr, unsigned i) +Dbtux::treeRotateDouble(Signal* signal, Frag& frag, NodeHandle& node, unsigned i) { // old top node - NodeHandlePtr n6Ptr = nodePtr; - const TupAddr n6Addr = n6Ptr.p->m_addr; + NodeHandle node6 = node; + const TupLoc loc6 = node6.m_loc; // the un-updated balance - const int n6Bal = n6Ptr.p->getBalance(); - const unsigned n6Side = n6Ptr.p->getSide(); + const int bal6 = node6.getBalance(); + const unsigned side6 = node6.getSide(); // level 1 - TupAddr n2Addr = n6Ptr.p->getLink(i); - NodeHandlePtr n2Ptr; - selectNode(signal, frag, n2Ptr, n2Addr, AccHead); - const int n2Bal = n2Ptr.p->getBalance(); + TupLoc loc2 = node6.getLink(i); + NodeHandle node2(frag); + selectNode(signal, node2, loc2, AccHead); + const int bal2 = node2.getBalance(); // level 2 - TupAddr n4Addr = n2Ptr.p->getLink(1 - i); - NodeHandlePtr n4Ptr; - selectNode(signal, frag, n4Ptr, n4Addr, AccHead); - const int n4Bal = n4Ptr.p->getBalance(); + TupLoc loc4 = node2.getLink(1 - i); + NodeHandle node4(frag); + selectNode(signal, node4, loc4, AccHead); + const int bal4 = node4.getBalance(); ndbrequire(i <= 1); - ndbrequire(n6Bal + (1 - i) == i); - ndbrequire(n2Bal == -n6Bal); - ndbrequire(n2Ptr.p->getLink(2) == n6Addr); - ndbrequire(n2Ptr.p->getSide() == i); - ndbrequire(n4Ptr.p->getLink(2) == n2Addr); + ndbrequire(bal6 + (1 - i) == i); + ndbrequire(bal2 == -bal6); + ndbrequire(node2.getLink(2) == loc6); + ndbrequire(node2.getSide() == i); + ndbrequire(node4.getLink(2) == loc2); // level 3 - TupAddr n3Addr = n4Ptr.p->getLink(i); - TupAddr n5Addr = n4Ptr.p->getLink(1 - i); + TupLoc loc3 = node4.getLink(i); + TupLoc loc5 = node4.getLink(1 - i); // fill up leaf before it becomes internal - if (n3Addr == NullTupAddr && n5Addr == NullTupAddr) { + if (loc3 == NullTupLoc && loc5 == NullTupLoc) { jam(); TreeHead& tree = frag.m_tree; - accessNode(signal, frag, n2Ptr, AccFull); - accessNode(signal, frag, n4Ptr, AccFull); - n4Ptr.p->slide(signal, n2Ptr, i); + accessNode(signal, node2, AccFull); + accessNode(signal, node4, AccFull); + nodeSlide(signal, node4, node2, i); // implied by rule of merging half-leaves with leaves - ndbrequire(n4Ptr.p->getOccup() >= tree.m_minOccup); - ndbrequire(n2Ptr.p->getOccup() != 0); + ndbrequire(node4.getOccup() >= tree.m_minOccup); + ndbrequire(node2.getOccup() != 0); } else { - if (n3Addr != NullTupAddr) { + if (loc3 != NullTupLoc) { jam(); - NodeHandlePtr n3Ptr; - selectNode(signal, frag, n3Ptr, n3Addr, AccHead); - n3Ptr.p->setLink(2, n2Addr); - n3Ptr.p->setSide(1 - i); + NodeHandle node3(frag); + selectNode(signal, node3, loc3, AccHead); + node3.setLink(2, loc2); + node3.setSide(1 - i); } - if (n5Addr != NullTupAddr) { + if (loc5 != NullTupLoc) { jam(); - NodeHandlePtr n5Ptr; - selectNode(signal, frag, n5Ptr, n5Addr, AccHead); - n5Ptr.p->setLink(2, n6Ptr.p->m_addr); - n5Ptr.p->setSide(i); + NodeHandle node5(frag); + selectNode(signal, node5, loc5, AccHead); + node5.setLink(2, node6.m_loc); + node5.setSide(i); } } // parent - TupAddr n0Addr = n6Ptr.p->getLink(2); - NodeHandlePtr n0Ptr; + TupLoc loc0 = node6.getLink(2); + NodeHandle node0(frag); // perform the rotation - n6Ptr.p->setLink(i, n5Addr); - n6Ptr.p->setLink(2, n4Addr); - n6Ptr.p->setSide(1 - i); + node6.setLink(i, loc5); + node6.setLink(2, loc4); + node6.setSide(1 - i); - n2Ptr.p->setLink(1 - i, n3Addr); - n2Ptr.p->setLink(2, n4Addr); + node2.setLink(1 - i, loc3); + node2.setLink(2, loc4); - n4Ptr.p->setLink(i, n2Addr); - n4Ptr.p->setLink(1 - i, n6Addr); - n4Ptr.p->setLink(2, n0Addr); - n4Ptr.p->setSide(n6Side); + node4.setLink(i, loc2); + node4.setLink(1 - i, loc6); + node4.setLink(2, loc0); + node4.setSide(side6); - if (n0Addr != NullTupAddr) { + if (loc0 != NullTupLoc) { jam(); - selectNode(signal, frag, n0Ptr, n0Addr, AccHead); - n0Ptr.p->setLink(n6Side, n4Addr); + selectNode(signal, node0, loc0, AccHead); + node0.setLink(side6, loc4); } else { jam(); - frag.m_tree.m_root = n4Addr; + frag.m_tree.m_root = loc4; } // set balance of changed nodes - n4Ptr.p->setBalance(0); - if (n4Bal == 0) { + node4.setBalance(0); + if (bal4 == 0) { jam(); - n2Ptr.p->setBalance(0); - n6Ptr.p->setBalance(0); - } else if (n4Bal == -n2Bal) { + node2.setBalance(0); + node6.setBalance(0); + } else if (bal4 == -bal2) { jam(); - n2Ptr.p->setBalance(0); - n6Ptr.p->setBalance(n2Bal); - } else if (n4Bal == n2Bal) { + node2.setBalance(0); + node6.setBalance(bal2); + } else if (bal4 == bal2) { jam(); - n2Ptr.p->setBalance(-n2Bal); - n6Ptr.p->setBalance(0); + node2.setBalance(-bal2); + node6.setBalance(0); } else { ndbrequire(false); } // new top node - nodePtr = n4Ptr; + node = node4; } diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am index 5ba59e8b3b7..0b48ad5724f 100644 --- a/ndb/src/kernel/blocks/dbtux/Makefile.am +++ b/ndb/src/kernel/blocks/dbtux/Makefile.am @@ -10,6 +10,8 @@ libdbtux_a_SOURCES = \ DbtuxCmp.cpp \ DbtuxDebug.cpp +INCLUDES_LOC = -I$(top_srcdir)/ndb/src/kernel/blocks/dbtup + include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_kernel.mk.am diff --git a/ndb/src/kernel/blocks/dbtux/Times.txt b/ndb/src/kernel/blocks/dbtux/Times.txt new file mode 100644 index 00000000000..16c4102249b --- /dev/null +++ b/ndb/src/kernel/blocks/dbtux/Times.txt @@ -0,0 +1,52 @@ +index maintenance overhead +========================== + +"mc02" 2x1700 MHz linux-2.4.9 gcc-2.96 -O3 one db-node + +case a: index on Unsigned +testOIBasic -case u -table 1 -index 1 -fragtype small -threads 10 -rows 100000 -subloop 1 -nologging + +case b: index on Varchar(5) + Varchar(5) + Varchar(20) + Unsigned +testOIBasic -case u -table 2 -index 4 -fragtype small -threads 10 -rows 100000 -subloop 1 -nologging + +1 million rows, pk update without index, pk update with index +shows ms / 1000 rows for each and pct overhead +the figures are based on single run on idle machine + +040616 mc02/a 40 ms 87 ms 114 pct + mc02/b 51 ms 128 ms 148 pct + +optim 1 mc02/a 38 ms 85 ms 124 pct + mc02/b 51 ms 123 ms 140 pct + +optim 2 mc02/a 41 ms 80 ms 96 pct + mc02/b 51 ms 117 ms 128 pct + +optim 3 mc02/a 43 ms 80 ms 85 pct + mc02/b 54 ms 118 ms 117 pct + +optim 4 mc02/a 42 ms 80 ms 87 pct + mc02/b 51 ms 119 ms 129 pct + +optim 5 mc02/a 43 ms 77 ms 77 pct + mc02/b 54 ms 118 ms 117 pct + +optim 6 mc02/a 42 ms 70 ms 66 pct + mc02/b 53 ms 109 ms 105 pct + +optim 7 mc02/a 42 ms 69 ms 61 pct + mc02/b 52 ms 106 ms 101 pct + +optim 8 mc02/a 42 ms 69 ms 62 pct + mc02/b 54 ms 104 ms 92 pct + +optim 9 mc02/a 43 ms 67 ms 54 pct + mc02/b 53 ms 102 ms 91 pct + +optim 10 mc02/a 44 ms 65 ms 46 pct + mc02/b 53 ms 88 ms 66 pct + +optim 11 mc02/a 43 ms 63 ms 46 pct + mc02/b 52 ms 86 ms 63 pct + +vim: set et: diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index ac29614bc70..f2d2edb615d 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -525,7 +525,7 @@ void Qmgr::execCM_REGREQ(Signal* signal) cmRegConf->dynamicId = TdynId; c_clusterNodes.copyto(NdbNodeBitmask::Size, cmRegConf->allNdbNodes); sendSignal(Tblockref, GSN_CM_REGCONF, signal, - CmRegConf::SignalLength, JBB); + CmRegConf::SignalLength, JBA); DEBUG_START(GSN_CM_REGCONF, refToNode(Tblockref), ""); /** @@ -847,7 +847,7 @@ void Qmgr::execCM_NODEINFOCONF(Signal* signal) nodePtr.i = getOwnNodeId(); ptrAss(nodePtr, nodeRec); ndbrequire(nodePtr.p->phase == ZSTARTING); - ndbrequire(c_start.m_gsn = GSN_CM_NODEINFOREQ); + ndbrequire(c_start.m_gsn == GSN_CM_NODEINFOREQ); c_start.m_nodes.clearWaitingFor(nodeId); /** @@ -1019,7 +1019,7 @@ void Qmgr::execCM_ADD(Signal* signal) ndbrequire(addNodePtr.i == nodePtr.i); switch(type){ case CmAdd::Prepare: - ndbrequire(c_start.m_gsn = GSN_CM_NODEINFOREQ); + ndbrequire(c_start.m_gsn == GSN_CM_NODEINFOREQ); /** * Wait for CM_NODEINFO_CONF */ diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 72ba282ad13..bb4b6be8221 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -430,7 +430,7 @@ const int no_of_type_values = (sizeof(type_values) / sizeof(ndb_mgm_type_atoi)); extern "C" -enum ndb_mgm_node_type +ndb_mgm_node_type ndb_mgm_match_node_type(const char * type) { if(type == 0) @@ -474,7 +474,7 @@ const int no_of_status_values = (sizeof(status_values) / sizeof(ndb_mgm_status_atoi)); extern "C" -enum ndb_mgm_node_status +ndb_mgm_node_status ndb_mgm_match_node_status(const char * status) { if(status == 0) diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index 9482d70eb0a..f3eaaaa68bd 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -11,11 +11,11 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon -LDADD_LOC = $(top_srcdir)/ndb/src/libndbclient.la \ - $(top_srcdir)/ndb/src/common/editline/libeditline.a \ +LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ + $(top_builddir)/ndb/src/common/editline/libeditline.a \ @TERMCAP_LIB@ -AM_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 143e0996103..fc493fe10c7 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -17,14 +17,14 @@ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/ndbapi \ -I$(top_srcdir)/ndb/src/mgmapi \ -I$(top_srcdir)/ndb/src/common/mgmcommon -LDADD_LOC = $(top_srcdir)/ndb/src/libndbclient.la \ - $(top_srcdir)/ndb/src/common/editline/libeditline.a \ +LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ + $(top_builddir)/ndb/src/common/editline/libeditline.a \ @TERMCAP_LIB@ include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am -AM_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index 79f5ce5fdf0..2ec58ab6e85 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -31,13 +31,12 @@ libndbapi_la_SOURCES = \ NdbEventOperationImpl.cpp \ NdbApiSignal.cpp \ NdbRecAttr.cpp \ - NdbSchemaCon.cpp \ - NdbSchemaOp.cpp \ NdbUtil.cpp \ NdbReceiver.cpp \ NdbDictionary.cpp \ NdbDictionaryImpl.cpp \ - DictCache.cpp + DictCache.cpp \ + NdbBlob.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi diff --git a/ndb/src/ndbapi/Makefile_old b/ndb/src/ndbapi/Makefile_old index f2dd21fdaa3..c2bb0189a7f 100644 --- a/ndb/src/ndbapi/Makefile_old +++ b/ndb/src/ndbapi/Makefile_old @@ -58,7 +58,8 @@ SOURCES = \ NdbSchemaOp.cpp \ NdbUtil.cpp \ NdbReceiver.cpp \ - NdbDictionary.cpp NdbDictionaryImpl.cpp DictCache.cpp + NdbDictionary.cpp NdbDictionaryImpl.cpp DictCache.cpp \ + NdbBlob.cpp include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index f55c37709b6..3be78bbf2f8 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -38,6 +38,10 @@ Name: Ndb.cpp #include <NdbEnv.h> #include <BaseString.hpp> +#ifndef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif + /**************************************************************************** void connect(); diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp new file mode 100644 index 00000000000..8e067f770e8 --- /dev/null +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -0,0 +1,1349 @@ +/* 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.hpp" +#include "NdbDictionaryImpl.hpp" +#include "NdbConnection.hpp" +#include "NdbOperation.hpp" +#include "NdbIndexOperation.hpp" +#include "NdbRecAttr.hpp" +#include "NdbBlob.hpp" + +#ifdef NDB_BLOB_DEBUG +#define DBG(x) \ + do { \ + static const char* p = getenv("NDB_BLOB_DEBUG"); \ + if (p == 0 || *p == 0 || *p == '0') break; \ + const char* cname = theColumn == NULL ? "BLOB" : theColumn->m_name.c_str(); \ + ndbout << cname << " " << __LINE__ << " " << x << " " << *this << endl; \ + } while (0) +#define EXE() assert(theNdbCon->executeNoBlobs(NoCommit) == 0) +#else +#define DBG(x) +#endif + +static char* +ndb_blob_debug(const Uint32* data, unsigned size) +{ + static char buf[128 + 1]; // MT irrelevant + buf[0] = 0; + for (unsigned i = 0; i < size && i < 128 / 4; i++) { + sprintf(buf + strlen(buf), "%*s%08x", i != 0, "", data[i]); + } + return buf; +} + +/* + * Reading index table directly (as a table) is faster but there are + * bugs or limitations. Keep the code but make possible to choose. + */ +static const bool g_ndb_blob_ok_to_read_index_table = false; + +// state (inline) + +inline void +NdbBlob::setState(State newState) +{ + DBG("setState " << newState); + theState = newState; +} + +// define blob table + +int +NdbBlob::getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName) +{ + NdbTableImpl* t = anNdb->theDictionary->m_impl.getTable(tableName); + if (t == NULL) + return -1; + NdbColumnImpl* c = t->getColumn(columnName); + if (c == NULL) + return -1; + getBlobTableName(btname, t, c); + return 0; +} + +void +NdbBlob::getBlobTableName(char* btname, const NdbTableImpl* t, const NdbColumnImpl* c) +{ + assert(t != 0 && c != 0 && c->getBlobType()); + memset(btname, 0, BlobTableNameSize); + sprintf(btname, "NDB$BLOB_%d_%d_%d", (int)t->m_tableId, (int)t->m_version, (int)c->m_attrId); +} + +void +NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c) +{ + char btname[BlobTableNameSize]; + getBlobTableName(btname, t, c); + bt.setName(btname); + bt.setLogging(t->getLogging()); + bt.setFragmentType(t->getFragmentType()); + { NdbDictionary::Column bc("DIST"); + bc.setType(NdbDictionary::Column::Unsigned); + bc.setPrimaryKey(true); + bc.setDistributionKey(true); + bt.addColumn(bc); + } + { NdbDictionary::Column bc("PART"); + bc.setType(NdbDictionary::Column::Unsigned); + bc.setPrimaryKey(true); + bt.addColumn(bc); + } + { NdbDictionary::Column bc("PK"); + bc.setType(NdbDictionary::Column::Unsigned); + assert(t->m_sizeOfKeysInWords != 0); + bc.setLength(t->m_sizeOfKeysInWords); + bc.setPrimaryKey(true); + bt.addColumn(bc); + } + { NdbDictionary::Column bc("DATA"); + switch (c->m_type) { + case NdbDictionary::Column::Blob: + bc.setType(NdbDictionary::Column::Binary); + break; + case NdbDictionary::Column::Clob: + bc.setType(NdbDictionary::Column::Char); + break; + default: + assert(false); + break; + } + bc.setLength(c->getPartSize()); + bt.addColumn(bc); + } +} + +// initialization + +NdbBlob::NdbBlob() +{ + init(); +} + +void +NdbBlob::init() +{ + theState = Idle; + theBlobTableName[0] = 0; + theNdb = NULL; + theNdbCon = NULL; + theNdbOp = NULL; + theTable = NULL; + theAccessTable = NULL; + theColumn = NULL; + theFillChar = 0; + theInlineSize = 0; + thePartSize = 0; + theStripeSize = 0; + theGetFlag = false; + theGetBuf = NULL; + theSetFlag = false; + theSetBuf = NULL; + theGetSetBytes = 0; + theHead = NULL; + theInlineData = NULL; + theHeadInlineRecAttr = NULL; + theHeadInlineUpdateFlag = false; + theNewPartFlag = false; + theNullFlag = -1; + theLength = 0; + thePos = 0; + theNext = NULL; +} + +void +NdbBlob::release() +{ + setState(Idle); +} + +// buffers + +NdbBlob::Buf::Buf() : + data(NULL), + size(0), + maxsize(0) +{ +} + +NdbBlob::Buf::~Buf() +{ + delete [] data; +} + +void +NdbBlob::Buf::alloc(unsigned n) +{ + size = n; + if (maxsize < n) { + delete [] data; + // align to Uint64 + if (n % 8 != 0) + n += 8 - n % 8; + data = new char [n]; + maxsize = n; + } +#ifdef VM_TRACE + memset(data, 'X', maxsize); +#endif +} + +// classify operations (inline) + +inline bool +NdbBlob::isTableOp() +{ + return theTable == theAccessTable; +} + +inline bool +NdbBlob::isIndexOp() +{ + return theTable != theAccessTable; +} + +inline bool +NdbBlob::isKeyOp() +{ + return + theNdbOp->theOperationType == NdbOperation::InsertRequest || + theNdbOp->theOperationType == NdbOperation::UpdateRequest || + theNdbOp->theOperationType == NdbOperation::ReadRequest || + theNdbOp->theOperationType == NdbOperation::ReadExclusive || + theNdbOp->theOperationType == NdbOperation::DeleteRequest; +} + +inline bool +NdbBlob::isReadOp() +{ + return + theNdbOp->theOperationType == NdbOperation::ReadRequest || + theNdbOp->theOperationType == NdbOperation::ReadExclusive; +} + +inline bool +NdbBlob::isInsertOp() +{ + return + theNdbOp->theOperationType == NdbOperation::InsertRequest; +} + +inline bool +NdbBlob::isUpdateOp() +{ + return + theNdbOp->theOperationType == NdbOperation::UpdateRequest; +} + +inline bool +NdbBlob::isDeleteOp() +{ + return + theNdbOp->theOperationType == NdbOperation::DeleteRequest; +} + +inline bool +NdbBlob::isScanOp() +{ + return + theNdbOp->theOperationType == NdbOperation::OpenScanRequest || + theNdbOp->theOperationType == NdbOperation::OpenRangeScanRequest; +} + +// computations (inline) + +inline Uint32 +NdbBlob::getPartNumber(Uint64 pos) +{ + assert(pos >= theInlineSize); + return (pos - theInlineSize) / thePartSize; +} + +inline Uint32 +NdbBlob::getPartCount() +{ + if (theLength <= theInlineSize) + return 0; + return 1 + getPartNumber(theLength - 1); +} + +inline Uint32 +NdbBlob::getDistKey(Uint32 part) +{ + assert(theStripeSize != 0); + return (part / theStripeSize) % theStripeSize; +} + +// getters and setters + +int +NdbBlob::getTableKeyValue(NdbOperation* anOp) +{ + Uint32* data = (Uint32*)theKeyBuf.data; + unsigned pos = 0; + DBG("getTableKeyValue"); + for (unsigned i = 0; i < theTable->m_columns.size(); i++) { + NdbColumnImpl* c = theTable->m_columns[i]; + assert(c != NULL); + if (c->m_pk) { + unsigned len = c->m_attrSize * c->m_arraySize; + if (anOp->getValue(c, (char*)&data[pos]) == NULL) { + setErrorCode(anOp); + return -1; + } + // odd bytes receive no data and must be zeroed + while (len % 4 != 0) { + char* p = (char*)&data[pos] + len++; + *p = 0; + } + pos += len / 4; + } + } + assert(pos == theKeyBuf.size / 4); + return 0; +} + +int +NdbBlob::setTableKeyValue(NdbOperation* anOp) +{ + const Uint32* data = (const Uint32*)theKeyBuf.data; + unsigned pos = 0; + const unsigned size = theTable->m_columns.size(); + DBG("setTableKeyValue key=" << ndb_blob_debug(data, size)); + for (unsigned i = 0; i < size; i++) { + NdbColumnImpl* c = theTable->m_columns[i]; + assert(c != NULL); + if (c->m_pk) { + unsigned len = c->m_attrSize * c->m_arraySize; + if (anOp->equal_impl(c, (const char*)&data[pos], len) == -1) { + setErrorCode(anOp); + return -1; + } + pos += (len + 3) / 4; + } + } + assert(pos == theKeyBuf.size / 4); + return 0; +} + +int +NdbBlob::setAccessKeyValue(NdbOperation* anOp) +{ + const Uint32* data = (const Uint32*)theAccessKeyBuf.data; + unsigned pos = 0; + const unsigned size = theAccessTable->m_columns.size(); + DBG("setAccessKeyValue key=" << ndb_blob_debug(data, size)); + for (unsigned i = 0; i < size; i++) { + NdbColumnImpl* c = theAccessTable->m_columns[i]; + assert(c != NULL); + if (c->m_pk) { + unsigned len = c->m_attrSize * c->m_arraySize; + if (anOp->equal_impl(c, (const char*)&data[pos], len) == -1) { + setErrorCode(anOp); + return -1; + } + pos += (len + 3) / 4; + } + } + assert(pos == theAccessKeyBuf.size / 4); + return 0; +} + +int +NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) +{ + Uint32* data = (Uint32*)theKeyBuf.data; + unsigned size = theTable->m_sizeOfKeysInWords; + DBG("setPartKeyValue dist=" << getDistKey(part) << " part=" << part << " key=" << ndb_blob_debug(data, size)); + if (anOp->equal((Uint32)0, getDistKey(part)) == -1 || + anOp->equal((Uint32)1, part) == -1 || + anOp->equal((Uint32)2, theKeyBuf.data) == -1) { + setErrorCode(anOp); + return -1; + } + return 0; +} + +int +NdbBlob::getHeadInlineValue(NdbOperation* anOp) +{ + DBG("getHeadInlineValue"); + theHeadInlineRecAttr = anOp->getValue(theColumn, theHeadInlineBuf.data); + if (theHeadInlineRecAttr == NULL) { + setErrorCode(anOp); + return -1; + } + return 0; +} + +void +NdbBlob::getHeadFromRecAttr() +{ + assert(theHeadInlineRecAttr != NULL); + theNullFlag = theHeadInlineRecAttr->isNULL(); + assert(theNullFlag != -1); + theLength = ! theNullFlag ? theHead->length : 0; + DBG("getHeadFromRecAttr out"); +} + +int +NdbBlob::setHeadInlineValue(NdbOperation* anOp) +{ + DBG("setHeadInlineValue"); + theHead->length = theLength; + if (theLength < theInlineSize) + memset(theInlineData + theLength, 0, theInlineSize - theLength); + assert(theNullFlag != -1); + const char* aValue = theNullFlag ? 0 : theHeadInlineBuf.data; + if (anOp->setValue(theColumn, aValue, theHeadInlineBuf.size) == -1) { + setErrorCode(anOp); + return -1; + } + theHeadInlineUpdateFlag = false; + return 0; +} + +// getValue/setValue + +int +NdbBlob::getValue(void* data, Uint32 bytes) +{ + DBG("getValue data=" << hex << data << " bytes=" << dec << bytes); + if (theGetFlag || theState != Prepared) { + setErrorCode(ErrState); + return -1; + } + if (! isReadOp() && ! isScanOp()) { + setErrorCode(ErrUsage); + return -1; + } + if (data == NULL && bytes != 0) { + setErrorCode(ErrUsage); + return -1; + } + theGetFlag = true; + theGetBuf = static_cast<char*>(data); + theGetSetBytes = bytes; + return 0; +} + +int +NdbBlob::setValue(const void* data, Uint32 bytes) +{ + DBG("setValue data=" << hex << data << " bytes=" << dec << bytes); + if (theSetFlag || theState != Prepared) { + setErrorCode(ErrState); + return -1; + } + if (! isInsertOp() && ! isUpdateOp()) { + setErrorCode(ErrUsage); + return -1; + } + if (data == NULL && bytes != 0) { + setErrorCode(ErrUsage); + return -1; + } + theSetFlag = true; + theSetBuf = static_cast<const char*>(data); + theGetSetBytes = bytes; + if (isInsertOp()) { + // write inline part now + if (theSetBuf != 0) { + unsigned n = theGetSetBytes; + if (n > theInlineSize) + n = theInlineSize; + if (writeDataPrivate(0, theSetBuf, n) == -1) + return -1; + } else { + theNullFlag = true; + theLength = 0; + } + if (setHeadInlineValue(theNdbOp) == -1) + return -1; + } + return 0; +} + +// misc operations + +int +NdbBlob::getNull(bool& isNull) +{ + if (theState == Prepared && theSetFlag) { + isNull = (theSetBuf == NULL); + return 0; + } + if (theNullFlag == -1) { + setErrorCode(ErrState); + return -1; + } + isNull = theNullFlag; + return 0; +} + +int +NdbBlob::setNull() +{ + DBG("setNull"); + if (theNullFlag == -1) { + if (theState == Prepared) { + return setValue(0, 0); + } + setErrorCode(ErrState); + return -1; + } + if (theNullFlag) + return 0; + if (deleteParts(0, getPartCount()) == -1) + return -1; + theNullFlag = true; + theLength = 0; + theHeadInlineUpdateFlag = true; + return 0; +} + +int +NdbBlob::getLength(Uint64& len) +{ + if (theState == Prepared && theSetFlag) { + len = theGetSetBytes; + return 0; + } + if (theNullFlag == -1) { + setErrorCode(ErrState); + return -1; + } + len = theLength; + return 0; +} + +int +NdbBlob::truncate(Uint64 length) +{ + DBG("truncate kength=" << length); + if (theNullFlag == -1) { + setErrorCode(ErrState); + return -1; + } + if (theLength > length) { + if (length >= theInlineSize) { + Uint32 part1 = getPartNumber(length); + Uint32 part2 = getPartNumber(theLength - 1); + assert(part2 >= part1); + if (deleteParts(part1, part2 - part1) == -1) + return -1; + } else { + if (deleteParts(0, getPartCount()) == -1) + return -1; + } + theLength = length; + theHeadInlineUpdateFlag = true; + } + return 0; +} + +int +NdbBlob::getPos(Uint64& pos) +{ + if (theNullFlag == -1) { + setErrorCode(ErrState); + return -1; + } + pos = thePos; + return 0; +} + +int +NdbBlob::setPos(Uint64 pos) +{ + if (theNullFlag == -1) { + setErrorCode(ErrState); + return -1; + } + if (pos > theLength) { + setErrorCode(ErrSeek); + return -1; + } + thePos = pos; + return 0; +} + +// read/write + +int +NdbBlob::readData(void* data, Uint32& bytes) +{ + if (readData(thePos, data, bytes) == -1) + return -1; + thePos += bytes; + assert(thePos <= theLength); + return 0; +} + +int +NdbBlob::readData(Uint64 pos, void* data, Uint32& bytes) +{ + if (theState != Active) { + setErrorCode(ErrState); + return -1; + } + char* buf = static_cast<char*>(data); + return readDataPrivate(pos, buf, bytes); +} + +int +NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) +{ + DBG("readData pos=" << pos << " bytes=" << bytes); + if (pos > theLength) { + setErrorCode(ErrSeek); + return -1; + } + if (bytes > theLength - pos) + bytes = theLength - pos; + Uint32 len = bytes; + if (len > 0) { + // inline part + if (pos < theInlineSize) { + Uint32 n = theInlineSize - pos; + if (n > len) + n = len; + memcpy(buf, theInlineData + pos, n); + pos += n; + buf += n; + len -= n; + } + } + if (len > 0) { + assert(pos >= theInlineSize); + Uint32 off = (pos - theInlineSize) % thePartSize; + // partial first block + if (off != 0) { + DBG("partial first block pos=" << pos << " len=" << len); + Uint32 part = (pos - theInlineSize) / thePartSize; + if (readParts(thePartBuf.data, part, 1) == -1) + return -1; + DBG("force execute"); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) { + setErrorCode(theNdbOp); + return -1; + } + Uint32 n = thePartSize - off; + if (n > len) + n = len; + memcpy(buf, thePartBuf.data + off, n); + pos += n; + buf += n; + len -= n; + } + } + if (len > 0) { + assert((pos - theInlineSize) % thePartSize == 0); + // complete blocks in the middle + if (len >= thePartSize) { + Uint32 part = (pos - theInlineSize) / thePartSize; + Uint32 count = len / thePartSize; + if (readParts(buf, part, count) == -1) + return -1; + Uint32 n = thePartSize * count; + pos += n; + buf += n; + len -= n; + } + } + if (len > 0) { + // partial last block + DBG("partial last block pos=" << pos << " len=" << len); + assert((pos - theInlineSize) % thePartSize == 0 && len < thePartSize); + Uint32 part = (pos - theInlineSize) / thePartSize; + if (readParts(thePartBuf.data, part, 1) == -1) + return -1; + DBG("force execute"); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) { + setErrorCode(theNdbOp); + return -1; + } + memcpy(buf, thePartBuf.data, len); + Uint32 n = len; + pos += n; + buf += n; + len -= n; + } + assert(len == 0); + return 0; +} + +int +NdbBlob::writeData(const void* data, Uint32 bytes) +{ + if (writeData(thePos, data, bytes) == -1) + return -1; + thePos += bytes; + assert(thePos <= theLength); + return 0; +} + +int +NdbBlob::writeData(Uint64 pos, const void* data, Uint32 bytes) +{ + if (theState != Active) { + setErrorCode(ErrState); + return -1; + } + const char* buf = static_cast<const char*>(data); + return writeDataPrivate(pos, buf, bytes); +} + +int +NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) +{ + DBG("writeData pos=" << pos << " bytes=" << bytes); + if (pos > theLength) { + setErrorCode(ErrSeek); + return -1; + } + Uint32 len = bytes; + // any write makes blob not NULL + if (theNullFlag) { + theNullFlag = false; + theHeadInlineUpdateFlag = true; + } + if (len > 0) { + // inline part + if (pos < theInlineSize) { + Uint32 n = theInlineSize - pos; + if (n > len) + n = len; + memcpy(theInlineData + pos, buf, n); + theHeadInlineUpdateFlag = true; + pos += n; + buf += n; + len -= n; + } + } + if (len > 0) { + assert(pos >= theInlineSize); + Uint32 off = (pos - theInlineSize) % thePartSize; + // partial first block + if (off != 0) { + DBG("partial first block pos=" << pos << " len=" << len); + if (theNewPartFlag) { + // must flush insert to guarantee read + DBG("force execute"); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) { + setErrorCode(theNdbOp); + return -1; + } + theNewPartFlag = false; + } + Uint32 part = (pos - theInlineSize) / thePartSize; + if (readParts(thePartBuf.data, part, 1) == -1) + return -1; + DBG("force execute"); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) { + setErrorCode(theNdbOp); + return -1; + } + Uint32 n = thePartSize - off; + if (n > len) { + memset(thePartBuf.data + off + len, theFillChar, n - len); + n = len; + } + memcpy(thePartBuf.data + off, buf, n); + if (updateParts(thePartBuf.data, part, 1) == -1) + return -1; + pos += n; + buf += n; + len -= n; + } + } + if (len > 0) { + assert((pos - theInlineSize) % thePartSize == 0); + // complete blocks in the middle + if (len >= thePartSize) { + Uint32 part = (pos - theInlineSize) / thePartSize; + Uint32 count = len / thePartSize; + for (unsigned i = 0; i < count; i++) { + if (part + i < getPartCount()) { + if (updateParts(buf, part + i, 1) == -1) + return -1; + } else { + if (insertParts(buf, part + i, 1) == -1) + return -1; + } + Uint32 n = thePartSize; + pos += n; + buf += n; + len -= n; + } + } + } + if (len > 0) { + // partial last block + DBG("partial last block pos=" << pos << " len=" << len); + assert((pos - theInlineSize) % thePartSize == 0 && len < thePartSize); + Uint32 part = (pos - theInlineSize) / thePartSize; + if (theLength > pos + len) { + if (theNewPartFlag) { + // must flush insert to guarantee read + DBG("force execute"); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) { + setErrorCode(theNdbOp); + return -1; + } + theNewPartFlag = false; + } + if (readParts(thePartBuf.data, part, 1) == -1) + return -1; + DBG("force execute"); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) { + setErrorCode(theNdbOp); + return -1; + } + memcpy(thePartBuf.data, buf, len); + if (updateParts(thePartBuf.data, part, 1) == -1) + return -1; + } else { + memcpy(thePartBuf.data, buf, len); + memset(thePartBuf.data + len, theFillChar, thePartSize - len); + if (part < getPartCount()) { + if (updateParts(thePartBuf.data, part, 1) == -1) + return -1; + } else { + if (insertParts(thePartBuf.data, part, 1) == -1) + return -1; + } + } + Uint32 n = len; + pos += n; + buf += n; + len -= n; + } + assert(len == 0); + if (theLength < pos) { + theLength = pos; + theHeadInlineUpdateFlag = true; + } + DBG("writeData out"); + return 0; +} + +int +NdbBlob::readParts(char* buf, Uint32 part, Uint32 count) +{ + DBG("readParts part=" << part << " count=" << count); + Uint32 n = 0; + while (n < count) { + NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName); + if (tOp == NULL || + tOp->readTuple() == -1 || + setPartKeyValue(tOp, part + n) == -1 || + tOp->getValue((Uint32)3, buf) == NULL) { + setErrorCode(tOp); + return -1; + } + buf += thePartSize; + n++; + } + return 0; +} + +int +NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count) +{ + DBG("insertParts part=" << part << " count=" << count); + Uint32 n = 0; + while (n < count) { + NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName); + if (tOp == NULL || + tOp->insertTuple() == -1 || + setPartKeyValue(tOp, part + n) == -1 || + tOp->setValue((Uint32)3, buf) == -1) { + setErrorCode(tOp); + return -1; + } + buf += thePartSize; + n++; + theNewPartFlag = true; + } + return 0; +} + +int +NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count) +{ + DBG("updateParts part=" << part << " count=" << count); + Uint32 n = 0; + while (n < count) { + NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName); + if (tOp == NULL || + tOp->updateTuple() == -1 || + setPartKeyValue(tOp, part + n) == -1 || + tOp->setValue((Uint32)3, buf) == -1) { + setErrorCode(tOp); + return -1; + } + buf += thePartSize; + n++; + theNewPartFlag = true; + } + return 0; +} + +int +NdbBlob::deleteParts(Uint32 part, Uint32 count) +{ + DBG("deleteParts part=" << part << " count=" << count); + Uint32 n = 0; + while (n < count) { + NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTableName); + if (tOp == NULL || + tOp->deleteTuple() == -1 || + setPartKeyValue(tOp, part + n) == -1) { + setErrorCode(tOp); + return -1; + } + n++; + } + return 0; +} + +// blob handle maintenance + +/* + * Prepare blob handle linked to an operation. Checks blob table. + * Allocates buffers. For key operation fetches key data from signal + * data. For read operation adds read of head+inline. + */ +int +NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* aColumn) +{ + assert(theState == Idle); + // ndb api stuff + theNdb = anOp->theNdb; + theNdbCon = aCon; // for scan, this is the real transaction (m_transConnection) + theNdbOp = anOp; + theTable = anOp->m_currentTable; + theAccessTable = anOp->m_accessTable; + theColumn = aColumn; + DBG("atPrepare"); + NdbDictionary::Column::Type partType = NdbDictionary::Column::Undefined; + switch (theColumn->getType()) { + case NdbDictionary::Column::Blob: + partType = NdbDictionary::Column::Binary; + theFillChar = 0x0; + break; + case NdbDictionary::Column::Clob: + partType = NdbDictionary::Column::Char; + theFillChar = 0x20; + break; + default: + setErrorCode(ErrUsage); + return -1; + } + // sizes + theInlineSize = theColumn->getInlineSize(); + thePartSize = theColumn->getPartSize(); + theStripeSize = theColumn->getStripeSize(); + // blob table sanity check + assert((NDB_BLOB_HEAD_SIZE << 2) == sizeof(Head)); + assert(theColumn->m_attrSize * theColumn->m_arraySize == sizeof(Head) + theInlineSize); + getBlobTableName(theBlobTableName, theTable, theColumn); + const NdbDictionary::Table* bt; + const NdbDictionary::Column* bc; + if (theInlineSize >= (1 << 16) || + thePartSize == 0 || + thePartSize >= (1 << 16) || + theStripeSize == 0 || + (bt = theNdb->theDictionary->getTable(theBlobTableName)) == NULL || + (bc = bt->getColumn("DATA")) == NULL || + bc->getType() != partType || + bc->getLength() != (int)thePartSize) { + setErrorCode(ErrTable); + return -1; + } + // buffers + theKeyBuf.alloc(theTable->m_sizeOfKeysInWords << 2); + theAccessKeyBuf.alloc(theAccessTable->m_sizeOfKeysInWords << 2); + theHeadInlineBuf.alloc(sizeof(Head) + theInlineSize); + thePartBuf.alloc(thePartSize); + theHead = (Head*)theHeadInlineBuf.data; + theInlineData = theHeadInlineBuf.data + sizeof(Head); + // handle different operation types + bool supportedOp = false; + if (isKeyOp()) { + if (isTableOp()) { + // get table key + Uint32* data = (Uint32*)theKeyBuf.data; + unsigned size = theTable->m_sizeOfKeysInWords; + if (theNdbOp->getKeyFromTCREQ(data, size) == -1) { + setErrorCode(ErrUsage); + return -1; + } + } + if (isIndexOp()) { + // get index key + Uint32* data = (Uint32*)theAccessKeyBuf.data; + unsigned size = theAccessTable->m_sizeOfKeysInWords; + if (theNdbOp->getKeyFromTCREQ(data, size) == -1) { + setErrorCode(ErrUsage); + return -1; + } + } + if (isReadOp()) { + // add read of head+inline in this op + if (getHeadInlineValue(theNdbOp) == -1) + return -1; + } + if (isInsertOp()) { + // becomes NULL unless set before execute + theNullFlag = true; + theLength = 0; + } + supportedOp = true; + } + if (isScanOp()) { + // add read of head+inline in this op + if (getHeadInlineValue(theNdbOp) == -1) + return -1; + supportedOp = true; + } + if (! supportedOp) { + setErrorCode(ErrUsage); + return -1; + } + setState(Prepared); + DBG("atPrepare out"); + return 0; +} + +/* + * Before execute of prepared operation. May add new operations before + * this one. May ask that this operation and all before it (a "batch") + * is executed immediately in no-commit mode. + */ +int +NdbBlob::preExecute(ExecType anExecType, bool& batch) +{ + DBG("preExecute"); + if (theState == Invalid) + return -1; + assert(theState == Prepared); + // handle different operation types + assert(isKeyOp()); + if (isReadOp()) { + if (theGetFlag && theGetSetBytes > theInlineSize) { + // need blob head before proceeding + batch = true; + } + } + if (isInsertOp()) { + if (theSetFlag && theGetSetBytes > theInlineSize) { + // add ops to write rest of a setValue + assert(theSetBuf != 0); + Uint64 pos = theInlineSize; + const char* buf = theSetBuf + theInlineSize; + Uint32 bytes = theGetSetBytes - theInlineSize; + if (writeDataPrivate(pos, buf, bytes) == -1) + return -1; + if (anExecType == Commit && theHeadInlineUpdateFlag) { + // add an operation to update head+inline + NdbOperation* tOp = theNdbCon->getNdbOperation(theTable); + if (tOp == NULL || + tOp->updateTuple() == -1 || + setTableKeyValue(tOp) == -1 || + setHeadInlineValue(tOp) == -1) { + setErrorCode(ErrAbort); + return -1; + } + } + } + } + if (isTableOp()) { + if (isUpdateOp() || isDeleteOp()) { + // add operation before this one to read head+inline + NdbOperation* tOp = theNdbCon->getNdbOperation(theTable, theNdbOp); + if (tOp == NULL || + tOp->readTuple() == -1 || + setTableKeyValue(tOp) == -1 || + getHeadInlineValue(tOp) == -1) { + setErrorCode(tOp); + return -1; + } + // execute immediately + batch = true; + } + } + if (isIndexOp()) { + // add op before this one to read table key + NdbBlob* tFirstBlob = theNdbOp->theBlobList; + if (this == tFirstBlob) { + // first blob does it for all + if (g_ndb_blob_ok_to_read_index_table) { + Uint32 pkAttrId = theAccessTable->getNoOfColumns() - 1; + NdbOperation* tOp = theNdbCon->getNdbOperation(theAccessTable, theNdbOp); + if (tOp == NULL || + tOp->readTuple() == -1 || + setAccessKeyValue(tOp) == -1 || + tOp->getValue(pkAttrId, theKeyBuf.data) == NULL) { + setErrorCode(tOp); + return -1; + } + } else { + NdbOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); + if (tOp == NULL || + tOp->readTuple() == -1 || + setAccessKeyValue(tOp) == -1 || + getTableKeyValue(tOp) == -1) { + setErrorCode(tOp); + return -1; + } + } + } + if (isUpdateOp() || isDeleteOp()) { + // add op before this one to read head+inline via index + NdbIndexOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); + if (tOp == NULL || + tOp->readTuple() == -1 || + setAccessKeyValue(tOp) == -1 || + getHeadInlineValue(tOp) == -1) { + setErrorCode(tOp); + return -1; + } + // execute immediately + batch = true; + } + } + DBG("preExecute out batch=" << batch); + return 0; +} + +/* + * After execute, for any operation. If already Active, this routine + * has been done previously. Operations which requested a no-commit + * batch can add new operations after this one. They are added before + * any remaining prepared operations. + */ +int +NdbBlob::postExecute(ExecType anExecType) +{ + DBG("postExecute type=" << anExecType); + if (theState == Invalid) + return -1; + if (theState == Active) + return 0; + assert(theState == Prepared); + assert(isKeyOp()); + if (isIndexOp()) { + NdbBlob* tFirstBlob = theNdbOp->theBlobList; + if (this != tFirstBlob) { + // copy key from first blob + assert(theKeyBuf.size == tFirstBlob->theKeyBuf.size); + memcpy(theKeyBuf.data, tFirstBlob->theKeyBuf.data, tFirstBlob->theKeyBuf.size); + } + } + if (isReadOp()) { + getHeadFromRecAttr(); + if (theGetFlag && theGetSetBytes > 0) { + // copy inline bytes to user buffer + assert(theGetBuf != NULL); + unsigned n = theGetSetBytes; + if (n > theInlineSize) + n = theInlineSize; + memcpy(theGetBuf, theInlineData, n); + } + if (theGetFlag && theGetSetBytes > theInlineSize) { + // add ops to read rest of a getValue + assert(anExecType == NoCommit); + assert(theGetBuf != 0); + Uint64 pos = theInlineSize; + char* buf = theGetBuf + theInlineSize; + Uint32 bytes = theGetSetBytes - theInlineSize; + if (readDataPrivate(pos, buf, bytes) == -1) + return -1; + } + } + if (isUpdateOp()) { + assert(anExecType == NoCommit); + getHeadFromRecAttr(); + if (theSetFlag) { + // setValue overwrites everything + if (theSetBuf != 0) { + if (truncate(0) == -1) + return -1; + if (writeDataPrivate(0, theSetBuf, theGetSetBytes) == -1) + return -1; + } else { + if (setNull() == -1) + return -1; + } + } + } + if (isDeleteOp()) { + assert(anExecType == NoCommit); + getHeadFromRecAttr(); + if (deleteParts(0, getPartCount()) == -1) + return -1; + } + theNewPartFlag = false; + setState(anExecType == NoCommit ? Active : Closed); + DBG("postExecute out"); + return 0; +} + +/* + * Before commit of completed operation. For write add operation to + * update head+inline. + */ +int +NdbBlob::preCommit() +{ + DBG("preCommit"); + if (theState == Invalid) + return -1; + assert(theState == Active); + assert(isKeyOp()); + if (isInsertOp() || isUpdateOp()) { + if (theHeadInlineUpdateFlag) { + // add an operation to update head+inline + NdbOperation* tOp = theNdbCon->getNdbOperation(theTable); + if (tOp == NULL || + tOp->updateTuple() == -1 || + setTableKeyValue(tOp) == -1 || + setHeadInlineValue(tOp) == -1) { + setErrorCode(ErrAbort); + return -1; + } + } + } + DBG("preCommit out"); + return 0; +} + +/* + * After next scan result. Handle like read op above. + */ +int +NdbBlob::atNextResult() +{ + DBG("atNextResult"); + if (theState == Invalid) + return -1; + assert(isScanOp()); + getHeadFromRecAttr(); + // reset position + thePos = 0; + // get primary key + { Uint32* data = (Uint32*)theKeyBuf.data; + unsigned size = theTable->m_sizeOfKeysInWords; + if (theNdbOp->getKeyFromKEYINFO20(data, size) == -1) { + setErrorCode(ErrUsage); + return -1; + } + } + if (! theNullFlag) { + if (theGetFlag && theGetSetBytes > 0) { + // copy inline bytes to user buffer + assert(theGetBuf != NULL); + unsigned n = theGetSetBytes; + if (n > theLength) + n = theLength; + if (n > theInlineSize) + n = theInlineSize; + memcpy(theGetBuf, theInlineData, n); + } + if (theGetFlag && theGetSetBytes > theInlineSize && theLength > theInlineSize) { + // add ops to read rest of a getValue + assert(theGetBuf != 0); + Uint64 pos = theInlineSize; + char* buf = theGetBuf + theInlineSize; + Uint32 bytes = theGetSetBytes - theInlineSize; + if (readDataPrivate(pos, buf, bytes) == -1) + return -1; + // must also execute them + DBG("force execute"); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) { + setErrorCode((NdbOperation*)0); + return -1; + } + } + } + setState(Active); + DBG("atNextResult out"); + return 0; +} + + +// misc + +const NdbDictionary::Column* +NdbBlob::getColumn() +{ + return theColumn; +} + +// errors + +void +NdbBlob::setErrorCode(int anErrorCode, bool invalidFlag) +{ + DBG("setErrorCode code=" << anErrorCode); + theError.code = anErrorCode; + if (invalidFlag) + setState(Invalid); +} + +void +NdbBlob::setErrorCode(NdbOperation* anOp, bool invalidFlag) +{ + int code = 0; + if (anOp != NULL && (code = anOp->theError.code) != 0) + ; + else if ((code = theNdbCon->theError.code) != 0) + ; + else if ((code = theNdb->theError.code) != 0) + ; + else + code = ErrUnknown; + setErrorCode(code, invalidFlag); +} + +void +NdbBlob::setErrorCode(NdbConnection* aCon, bool invalidFlag) +{ + int code = 0; + if (theNdbCon != NULL && (code = theNdbCon->theError.code) != 0) + ; + else if ((code = theNdb->theError.code) != 0) + ; + else + code = ErrUnknown; + setErrorCode(code, invalidFlag); +} + +#ifdef VM_TRACE +NdbOut& +operator<<(NdbOut& out, const NdbBlob& blob) +{ + ndbout << dec << "s=" << blob.theState; + ndbout << dec << " n=" << blob.theNullFlag;; + ndbout << dec << " l=" << blob.theLength; + ndbout << dec << " p=" << blob.thePos; + ndbout << dec << " u=" << blob.theHeadInlineUpdateFlag; + return out; +} +#endif diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index fbfd0e99238..ad415b8acbf 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -35,6 +35,7 @@ Adjust: 971022 UABMNST First version. #include "NdbApiSignal.hpp" #include "TransporterFacade.hpp" #include "API.hpp" +#include "NdbBlob.hpp" #include <ndb_limits.h> #include <signaldata/TcKeyConf.hpp> @@ -89,7 +90,8 @@ NdbConnection::NdbConnection( Ndb* aNdb ) : theCurrentScanRec(NULL), thePreviousScanRec(NULL), theScanningOp(NULL), - theBuddyConPtr(0xFFFFFFFF) + theBuddyConPtr(0xFFFFFFFF), + theBlobFlag(false) { theListState = NotInList; theError.code = 0; @@ -152,6 +154,8 @@ NdbConnection::init() m_theLastCursorOperation = NULL; m_firstExecutedCursorOp = 0; theBuddyConPtr = 0xFFFFFFFF; + // + theBlobFlag = false; }//NdbConnection::init() /***************************************************************************** @@ -251,6 +255,86 @@ NdbConnection::execute(ExecType aTypeOfExec, AbortOption abortOption, int forceSend) { + if (! theBlobFlag) + return executeNoBlobs(aTypeOfExec, abortOption, forceSend); + + // execute prepared ops in batches, as requested by blobs + + ExecType tExecType; + NdbOperation* tPrepOp; + + do { + tExecType = aTypeOfExec; + tPrepOp = theFirstOpInList; + while (tPrepOp != NULL) { + bool batch = false; + NdbBlob* tBlob = tPrepOp->theBlobList; + while (tBlob != NULL) { + if (tBlob->preExecute(tExecType, batch) == -1) + return -1; + tBlob = tBlob->theNext; + } + if (batch) { + // blob asked to execute all up to here now + tExecType = NoCommit; + break; + } + tPrepOp = tPrepOp->next(); + } + // save rest of prepared ops if batch + NdbOperation* tRestOp; + NdbOperation* tLastOp; + if (tPrepOp != NULL) { + tRestOp = tPrepOp->next(); + tPrepOp->next(NULL); + tLastOp = theLastOpInList; + theLastOpInList = tPrepOp; + } + if (tExecType == Commit) { + NdbOperation* tOp = theCompletedFirstOp; + while (tOp != NULL) { + NdbBlob* tBlob = tOp->theBlobList; + while (tBlob != NULL) { + if (tBlob->preCommit() == -1) + return -1; + tBlob = tBlob->theNext; + } + tOp = tOp->next(); + } + } + if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) + return -1; + { + NdbOperation* tOp = theCompletedFirstOp; + while (tOp != NULL) { + NdbBlob* tBlob = tOp->theBlobList; + while (tBlob != NULL) { + // may add new operations if batch + if (tBlob->postExecute(tExecType) == -1) + return -1; + tBlob = tBlob->theNext; + } + tOp = tOp->next(); + } + } + // add saved prepared ops if batch + if (tPrepOp != NULL && tRestOp != NULL) { + if (theFirstOpInList == NULL) + theFirstOpInList = tRestOp; + else + theLastOpInList->next(tRestOp); + theLastOpInList = tLastOp; + } + } while (theFirstOpInList != NULL || tExecType != aTypeOfExec); + + return 0; +} + +int +NdbConnection::executeNoBlobs(ExecType aTypeOfExec, + AbortOption abortOption, + int forceSend) +{ //------------------------------------------------------------------------ // We will start by preparing all operations in the transaction defined // since last execute or since beginning. If this works ok we will continue @@ -330,7 +414,6 @@ NdbConnection::executeAsynchPrepare( ExecType aTypeOfExec, * Reset error.code on execute */ theError.code = 0; - NdbCursorOperation* tcOp = m_theFirstCursorOperation; if (tcOp != 0){ // Execute any cursor operations @@ -885,7 +968,7 @@ Remark: Get an operation from NdbOperation object idlelist and object, synchronous. *****************************************************************************/ NdbOperation* -NdbConnection::getNdbOperation(NdbTableImpl * tab) +NdbConnection::getNdbOperation(NdbTableImpl * tab, NdbOperation* aNextOp) { NdbOperation* tOp; @@ -897,14 +980,28 @@ NdbConnection::getNdbOperation(NdbTableImpl * tab) tOp = theNdb->getOperation(); if (tOp == NULL) goto getNdbOp_error1; - if (theLastOpInList != NULL) { - theLastOpInList->next(tOp); - theLastOpInList = tOp; + if (aNextOp == NULL) { + if (theLastOpInList != NULL) { + theLastOpInList->next(tOp); + theLastOpInList = tOp; + } else { + theLastOpInList = tOp; + theFirstOpInList = tOp; + }//if + tOp->next(NULL); } else { - theLastOpInList = tOp; - theFirstOpInList = tOp; - }//if - tOp->next(NULL); + // add before the given op + if (theFirstOpInList == aNextOp) { + theFirstOpInList = tOp; + } else { + NdbOperation* aLoopOp = theFirstOpInList; + while (aLoopOp != NULL && aLoopOp->next() != aNextOp) + aLoopOp = aLoopOp->next(); + assert(aLoopOp != NULL); + aLoopOp->next(tOp); + } + tOp->next(aNextOp); + } if (tOp->init(tab, this) != -1) { return tOp; } else { @@ -1068,21 +1165,36 @@ Remark: Get an operation from NdbIndexOperation object idlelist and get *****************************************************************************/ NdbIndexOperation* NdbConnection::getNdbIndexOperation(NdbIndexImpl * anIndex, - NdbTableImpl * aTable) + NdbTableImpl * aTable, + NdbOperation* aNextOp) { NdbIndexOperation* tOp; tOp = theNdb->getIndexOperation(); if (tOp == NULL) goto getNdbOp_error1; - if (theLastOpInList != NULL) { - theLastOpInList->next(tOp); - theLastOpInList = tOp; + if (aNextOp == NULL) { + if (theLastOpInList != NULL) { + theLastOpInList->next(tOp); + theLastOpInList = tOp; + } else { + theLastOpInList = tOp; + theFirstOpInList = tOp; + }//if + tOp->next(NULL); } else { - theLastOpInList = tOp; - theFirstOpInList = tOp; - }//if - tOp->next(NULL); + // add before the given op + if (theFirstOpInList == aNextOp) { + theFirstOpInList = tOp; + } else { + NdbOperation* aLoopOp = theFirstOpInList; + while (aLoopOp != NULL && aLoopOp->next() != aNextOp) + aLoopOp = aLoopOp->next(); + assert(aLoopOp != NULL); + aLoopOp->next(tOp); + } + tOp->next(aNextOp); + } if (tOp->indxInit(anIndex, aTable, this)!= -1) { return tOp; } else { diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 89ed801bec5..413ad0745db 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -103,6 +103,11 @@ NdbDictionary::Column::getLength() const{ return m_impl.m_length; } +int +NdbDictionary::Column::getSize() const{ + return m_impl.m_attrSize; +} + void NdbDictionary::Column::setNullable(bool val){ m_impl.m_nullable = val; @@ -268,6 +273,9 @@ NdbDictionary::Table::addColumn(const Column & c){ if(c.getPrimaryKey()){ m_impl.m_noOfKeys++; } + if (col->getBlobType()) { + m_impl.m_noOfBlobs++; + } m_impl.buildColumnHash(); } @@ -797,3 +805,74 @@ const struct NdbError & NdbDictionary::Dictionary::getNdbError() const { return m_impl.getNdbError(); } + +NdbOut& operator <<(NdbOut& ndbout, const NdbDictionary::Column::Type type) +{ + switch(type){ + case NdbDictionary::Column::Bigunsigned: + ndbout << "Bigunsigned"; + break; + case NdbDictionary::Column::Unsigned: + ndbout << "Unsigned"; + break; + case NdbDictionary::Column::Smallunsigned: + ndbout << "Smallunsigned"; + break; + case NdbDictionary::Column::Tinyunsigned: + ndbout << "Tinyunsigned"; + break; + case NdbDictionary::Column::Bigint: + ndbout << "Bigint"; + break; + case NdbDictionary::Column::Int: + ndbout << "Int"; + break; + case NdbDictionary::Column::Smallint: + ndbout << "Smallint"; + break; + case NdbDictionary::Column::Tinyint: + ndbout << "Tinyint"; + break; + case NdbDictionary::Column::Char: + ndbout << "Char"; + break; + case NdbDictionary::Column::Varchar: + ndbout << "Varchar"; + break; + case NdbDictionary::Column::Float: + ndbout << "Float"; + break; + case NdbDictionary::Column::Double: + ndbout << "Double"; + break; + case NdbDictionary::Column::Mediumint: + ndbout << "Mediumint"; + break; + case NdbDictionary::Column::Mediumunsigned: + ndbout << "Mediumunsigend"; + break; + case NdbDictionary::Column::Binary: + ndbout << "Binary"; + break; + case NdbDictionary::Column::Varbinary: + ndbout << "Varbinary"; + break; + case NdbDictionary::Column::Decimal: + ndbout << "Decimal"; + break; + case NdbDictionary::Column::Timespec: + ndbout << "Timespec"; + break; + case NdbDictionary::Column::Blob: + ndbout << "Blob"; + break; + case NdbDictionary::Column::Undefined: + ndbout << "Undefined"; + break; + default: + ndbout << "Unknown type=" << (Uint32)type; + break; + } + + return ndbout; +} diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 25726dbf2ac..9589639a332 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -34,6 +34,7 @@ #include <AttributeList.hpp> #include <NdbEventOperation.hpp> #include "NdbEventOperationImpl.hpp" +#include "NdbBlob.hpp" #define DEBUG_PRINT 0 #define INCOMPATIBLE_VERSION -2 @@ -178,7 +179,14 @@ NdbColumnImpl::equal(const NdbColumnImpl& col) const case NdbDictionary::Column::Double: case NdbDictionary::Column::Datetime: case NdbDictionary::Column::Timespec: + break; case NdbDictionary::Column::Blob: + case NdbDictionary::Column::Clob: + if (m_precision != col.m_precision || + m_scale != col.m_scale || + m_length != col.m_length) { + return false; + } break; } if (m_autoIncrement != col.m_autoIncrement){ @@ -223,6 +231,8 @@ NdbTableImpl::NdbTableImpl() : NdbDictionary::Table(* this), m_facade(this) { m_noOfKeys = 0; + m_sizeOfKeysInWords = 0; + m_noOfBlobs = 0; m_index = 0; init(); } @@ -257,6 +267,8 @@ NdbTableImpl::init(){ m_indexType = NdbDictionary::Index::Undefined; m_noOfKeys = 0; + m_sizeOfKeysInWords = 0; + m_noOfBlobs = 0; } bool @@ -336,6 +348,8 @@ NdbTableImpl::assign(const NdbTableImpl& org) m_index = org.m_index; m_noOfKeys = org.m_noOfKeys; + m_sizeOfKeysInWords = org.m_sizeOfKeysInWords; + m_noOfBlobs = org.m_noOfBlobs; m_version = org.m_version; m_status = org.m_status; @@ -1076,6 +1090,8 @@ columnTypeMapping[] = { { DictTabInfo::ExtVarbinary, NdbDictionary::Column::Varbinary }, { DictTabInfo::ExtDatetime, NdbDictionary::Column::Datetime }, { DictTabInfo::ExtTimespec, NdbDictionary::Column::Timespec }, + { DictTabInfo::ExtBlob, NdbDictionary::Column::Blob }, + { DictTabInfo::ExtClob, NdbDictionary::Column::Clob }, { -1, -1 } }; @@ -1131,6 +1147,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, Uint32 keyInfoPos = 0; Uint32 keyCount = 0; + Uint32 blobCount; for(Uint32 i = 0; i < tableDesc.NoOfAttributes; i++) { DictTabInfo::Attribute attrDesc; attrDesc.init(); @@ -1187,6 +1204,8 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, } else { col->m_keyInfoPos = 0; } + if (col->getBlobType()) + blobCount++; NdbColumnImpl * null = 0; impl->m_columns.fill(attrDesc.AttributeId, null); @@ -1199,6 +1218,8 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, it.next(); } impl->m_noOfKeys = keyCount; + impl->m_sizeOfKeysInWords = keyInfoPos; + impl->m_noOfBlobs = blobCount; * ret = impl; return 0; } @@ -1206,6 +1227,43 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret, /***************************************************************** * Create table and alter table */ +int +NdbDictionaryImpl::createTable(NdbTableImpl &t) +{ + if (m_receiver.createTable(m_ndb, t) != 0) + return -1; + if (t.m_noOfBlobs == 0) + return 0; + // update table def from DICT + NdbTableImpl * tp = getTable(t.m_externalName.c_str()); + if (tp == NULL) { + m_error.code = 709; + return -1; + } + if (createBlobTables(* tp) != 0) { + int save_code = m_error.code; + (void)dropTable(t); + m_error.code = save_code; + return -1; + } + return 0; +} + +int +NdbDictionaryImpl::createBlobTables(NdbTableImpl &t) +{ + for (unsigned i = 0; i < t.m_columns.size(); i++) { + NdbColumnImpl & c = *t.m_columns[i]; + if (! c.getBlobType()) + continue; + NdbTableImpl bt; + NdbBlob::getBlobTable(bt, &t, &c); + if (createTable(bt) != 0) + return -1; + } + return 0; +} + int NdbDictInterface::createTable(Ndb & ndb, NdbTableImpl & impl) @@ -1540,6 +1598,12 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl) if (dropIndex(element.name, name) == -1) return -1; } + + if (impl.m_noOfBlobs != 0) { + if (dropBlobTables(impl) != 0) + return -1; + } + int ret = m_receiver.dropTable(impl); if(ret == 0){ const char * internalTableName = impl.m_internalName.c_str(); @@ -1555,6 +1619,23 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl) } int +NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t) +{ + for (unsigned i = 0; i < t.m_columns.size(); i++) { + NdbColumnImpl & c = *t.m_columns[i]; + if (! c.getBlobType()) + continue; + char btname[NdbBlob::BlobTableNameSize]; + NdbBlob::getBlobTableName(btname, &t, &c); + if (dropTable(btname) != 0) { + if (m_error.code != 709) + return -1; + } + } + return 0; +} + +int NdbDictInterface::dropTable(const NdbTableImpl & impl) { NdbApiSignal tSignal(m_reference); diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index b10ec099593..bf59838c198 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -81,6 +81,7 @@ public: Uint32 m_keyInfoPos; Uint32 m_extType; // used by restore (kernel type in versin v2x) bool getInterpretableType() const ; + bool getBlobType() const; /** * Equality/assign @@ -141,6 +142,8 @@ public: * Aggregates */ Uint32 m_noOfKeys; + unsigned short m_sizeOfKeysInWords; + unsigned short m_noOfBlobs; /** * Equality/assign @@ -353,13 +356,12 @@ public: bool setTransporter(class Ndb * ndb, class TransporterFacade * tf); bool setTransporter(class TransporterFacade * tf); - int createTable(NdbTableImpl &t) - { - return m_receiver.createTable(m_ndb, t); - } + int createTable(NdbTableImpl &t); + int createBlobTables(NdbTableImpl &); int alterTable(NdbTableImpl &t); int dropTable(const char * name); int dropTable(NdbTableImpl &); + int dropBlobTables(NdbTableImpl &); int invalidateObject(NdbTableImpl &); int removeCachedObject(NdbTableImpl &); @@ -433,6 +435,13 @@ NdbColumnImpl::getInterpretableType() const { } inline +bool +NdbColumnImpl::getBlobType() const { + return (m_type == NdbDictionary::Column::Blob || + m_type == NdbDictionary::Column::Clob); +} + +inline NdbTableImpl & NdbTableImpl::getImpl(NdbDictionary::Table & t){ return t.m_impl; diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/ndb/src/ndbapi/NdbEventOperationImpl.cpp index 7b4afc72ef7..b73a58d97c4 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -499,8 +499,7 @@ NdbEventOperationImpl::print() NdbRecAttr *p = theFirstRecAttrs[i]; ndbout << " %u " << i; while (p) { - ndbout << " : " << p->attrId() << " = "; - printRecAttr(p); + ndbout << " : " << p->attrId() << " = " << *p; p = p->next(); } ndbout << "\n"; @@ -1248,60 +1247,3 @@ NdbGlobalEventBuffer::real_wait(NdbGlobalEventBufferHandle *h, n += hasData(h->m_bufferIds[i]); return n; } - -/** - * TODO Change this function to use the real datatypes - * from NdbDictionary alternatively make a - * "printer" in NdbRecAttr that can be used from all programs - */ - -// and remove this include -#include "NdbSchemaOp.hpp" -void -NdbEventOperationImpl::printRecAttr(NdbRecAttr *p) -{ - int size = p->attrSize(); - int aSize = p->arraySize(); - - - switch(convertColumnTypeToAttrType(p->getType())){ - case UnSigned: - switch(size) { - case 8: ndbout << p->u_64_value(); break; - case 4: ndbout << p->u_32_value(); break; - case 2: ndbout << p->u_short_value(); break; - case 1: ndbout << (unsigned) p->u_char_value(); break; - default: ndbout << "Unknown size" << endl; - } - break; - - case Signed: - switch(size) { - case 8: ndbout << p->int64_value(); break; - case 4: ndbout << p->int32_value(); break; - case 2: ndbout << p->short_value(); break; - case 1: ndbout << (int) p->char_value(); break; - default: ndbout << "Unknown size" << endl; - } - break; - - case String: - { - char* buf = new char[aSize+1]; - memcpy(buf, p->aRef(), aSize); - buf[aSize] = 0; - ndbout << buf; - delete [] buf; - } - break; - - case Float: - ndbout << p->float_value(); - break; - - default: - ndbout << "Unknown"; - break; - } - -} diff --git a/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/ndb/src/ndbapi/NdbEventOperationImpl.hpp index b7dee084a9f..f67c998e639 100644 --- a/ndb/src/ndbapi/NdbEventOperationImpl.hpp +++ b/ndb/src/ndbapi/NdbEventOperationImpl.hpp @@ -60,7 +60,6 @@ public: void print(); void printAll(); - void printRecAttr(NdbRecAttr *); Ndb *m_ndb; NdbEventImpl *m_eventImpl; diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 02d94f39f2d..631c09e2e6d 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -372,6 +372,17 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, } else if ((tOpType == ReadRequest) || (tOpType == DeleteRequest) || (tOpType == ReadExclusive)) { theStatus = GetValue; + // create blob handles automatically + if (tOpType == DeleteRequest && m_currentTable->m_noOfBlobs != 0) { + for (unsigned i = 0; i < m_currentTable->m_columns.size(); i++) { + NdbColumnImpl* c = m_currentTable->m_columns[i]; + assert(c != 0); + if (c->getBlobType()) { + if (getBlobHandle(theNdbCon, c) == NULL) + return -1; + } + } + } return 0; } else if ((tOpType == InsertRequest) || (tOpType == WriteRequest)) { theStatus = SetValue; diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index 8bc9111d060..e6031a58c5f 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -31,6 +31,7 @@ #include "NdbApiSignal.hpp" #include "NdbRecAttr.hpp" #include "NdbUtil.hpp" +#include "NdbBlob.hpp" #include "ndbapi_limits.h" #include <signaldata/TcKeyReq.hpp> #include "NdbDictionaryImpl.hpp" @@ -103,7 +104,8 @@ NdbOperation::NdbOperation(Ndb* aNdb) : theFirstSCAN_TABINFO_Recv(NULL), theLastSCAN_TABINFO_Recv(NULL), theSCAN_TABCONF_Recv(NULL), - theBoundATTRINFO(NULL) + theBoundATTRINFO(NULL), + theBlobList(NULL) { theReceiver.init(NdbReceiver::NDB_OPERATION, this); theError.code = 0; @@ -197,6 +199,7 @@ NdbOperation::init(NdbTableImpl* tab, NdbConnection* myConnection){ theTotalNrOfKeyWordInSignal = 8; theMagicNumber = 0xABCDEF01; theBoundATTRINFO = NULL; + theBlobList = NULL; tSignal = theNdb->getSignal(); if (tSignal == NULL) @@ -236,6 +239,8 @@ NdbOperation::release() NdbCall* tSaveCall; NdbSubroutine* tSubroutine; NdbSubroutine* tSaveSubroutine; + NdbBlob* tBlob; + NdbBlob* tSaveBlob; if (theTCREQ != NULL) { @@ -308,6 +313,14 @@ NdbOperation::release() } theBoundATTRINFO = NULL; } + tBlob = theBlobList; + while (tBlob != NULL) + { + tSaveBlob = tBlob; + tBlob = tBlob->theNext; + theNdb->releaseNdbBlob(tSaveBlob); + } + theBlobList = NULL; releaseScan(); } @@ -356,6 +369,18 @@ NdbOperation::setValue( Uint32 anAttrId, return setValue(m_currentTable->getColumn(anAttrId), aValuePassed, len); } +NdbBlob* +NdbOperation::getBlobHandle(const char* anAttrName) +{ + return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrName)); +} + +NdbBlob* +NdbOperation::getBlobHandle(Uint32 anAttrId) +{ + return getBlobHandle(theNdbCon, m_currentTable->getColumn(anAttrId)); +} + int NdbOperation::incValue(const char* anAttrName, Uint32 aValue) { @@ -428,4 +453,8 @@ NdbOperation::setBound(Uint32 anAttrId, int type, const void* aValue, Uint32 len return setBound(m_accessTable->getColumn(anAttrId), type, aValue, len); } - +const char* +NdbOperation::getTableName() const +{ + return m_currentTable->m_externalName.c_str(); +} diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp index a513f8a6c3a..69a6602fe65 100644 --- a/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -34,6 +34,7 @@ #include "NdbUtil.hpp" #include "NdbOut.hpp" #include "NdbImpl.hpp" +#include "NdbBlob.hpp" #include <Interpreter.hpp> @@ -604,6 +605,33 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, return 0; }//NdbOperation::setValue() +NdbBlob* +NdbOperation::getBlobHandle(NdbConnection* aCon, const NdbColumnImpl* tAttrInfo) +{ + NdbBlob* tBlob = theBlobList; + NdbBlob* tLastBlob = NULL; + while (tBlob != NULL) { + if (tBlob->theColumn == tAttrInfo) + return tBlob; + tLastBlob = tBlob; + tBlob = tBlob->theNext; + } + tBlob = theNdb->getNdbBlob(); + if (tBlob == NULL) + return NULL; + if (tBlob->atPrepare(aCon, this, tAttrInfo) == -1) { + theNdb->releaseNdbBlob(tBlob); + return NULL; + } + if (tLastBlob == NULL) + theBlobList = tBlob; + else + tLastBlob->theNext = tBlob; + tBlob->theNext = NULL; + theNdbCon->theBlobFlag = true; + return tBlob; +} + /* * Define bound on index column in range scan. */ diff --git a/ndb/src/ndbapi/NdbOperationScan.cpp b/ndb/src/ndbapi/NdbOperationScan.cpp index 0c377d3fd98..299e6f2adea 100644 --- a/ndb/src/ndbapi/NdbOperationScan.cpp +++ b/ndb/src/ndbapi/NdbOperationScan.cpp @@ -569,8 +569,35 @@ NdbOperation::takeOverScanOp(OperationType opType, NdbConnection* updateTrans) } } + // create blob handles automatically + if (opType == DeleteRequest && m_currentTable->m_noOfBlobs != 0) { + for (unsigned i = 0; i < m_currentTable->m_columns.size(); i++) { + NdbColumnImpl* c = m_currentTable->m_columns[i]; + assert(c != 0); + if (c->getBlobType()) { + if (newOp->getBlobHandle(updateTrans, c) == NULL) + return NULL; + } + } + } + return newOp; } - - +int +NdbOperation::getKeyFromKEYINFO20(Uint32* data, unsigned size) +{ + const NdbScanReceiver* tScanRec = theNdbCon->thePreviousScanRec; + NdbApiSignal* tSignal = tScanRec->theFirstKEYINFO20_Recv; + unsigned pos = 0; + unsigned n = 0; + while (pos < size) { + if (n == 20) { + tSignal = tSignal->next(); + n = 0; + } + const unsigned h = KeyInfo20::HeaderLength; + data[pos++] = tSignal->getDataPtrSend()[h + n++]; + } + return 0; +} diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp index 8b9b89dcf07..19cb133dbf7 100644 --- a/ndb/src/ndbapi/NdbOperationSearch.cpp +++ b/ndb/src/ndbapi/NdbOperationSearch.cpp @@ -251,6 +251,17 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, } else if ((tOpType == ReadRequest) || (tOpType == DeleteRequest) || (tOpType == ReadExclusive)) { theStatus = GetValue; + // create blob handles automatically + if (tOpType == DeleteRequest && m_currentTable->m_noOfBlobs != 0) { + for (unsigned i = 0; i < m_currentTable->m_columns.size(); i++) { + NdbColumnImpl* c = m_currentTable->m_columns[i]; + assert(c != 0); + if (c->getBlobType()) { + if (getBlobHandle(theNdbCon, c) == NULL) + return -1; + } + } + } return 0; } else if ((tOpType == InsertRequest) || (tOpType == WriteRequest)) { theStatus = SetValue; @@ -497,3 +508,24 @@ LastWordLabel: return 0; } + +int +NdbOperation::getKeyFromTCREQ(Uint32* data, unsigned size) +{ + assert(m_accessTable != 0 && m_accessTable->m_sizeOfKeysInWords != 0); + assert(m_accessTable->m_sizeOfKeysInWords == size); + unsigned pos = 0; + while (pos < 8 && pos < size) { + data[pos++] = theKEYINFOptr[pos]; + } + NdbApiSignal* tSignal = theFirstKEYINFO; + unsigned n = 0; + while (pos < size) { + if (n == 20) { + tSignal = tSignal->next(); + n = 0; + } + data[pos++] = tSignal->getDataPtrSend()[3 + n++]; + } + return 0; +} diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 0f7baeac4f5..0ed2ff4e796 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -27,17 +27,14 @@ Documentation: Adjust: 971206 UABRONM First version ************************************************************************************************/ #include <ndb_global.h> -#include "NdbRecAttr.hpp" +#include <NdbOut.hpp> +#include <NdbRecAttr.hpp> #include "NdbDictionaryImpl.hpp" +#include <NdbTCP.h> -NdbRecAttr::NdbRecAttr() : - theStorageX(NULL), - theValue(NULL), - theRef(NULL), - theNext(NULL), - theAttrId(0xFFFF), - theNULLind(-1) -{ +NdbRecAttr::NdbRecAttr() +{ + init(); } NdbRecAttr::~NdbRecAttr() @@ -46,6 +43,11 @@ NdbRecAttr::~NdbRecAttr() } int +NdbRecAttr::setup(const class NdbDictionary::Column* col, char* aValue) +{ + return setup(&(col->m_impl), aValue); +} +int NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) { Uint32 tAttrSize = anAttrInfo->m_attrSize; @@ -53,6 +55,7 @@ NdbRecAttr::setup(const NdbColumnImpl* anAttrInfo, char* aValue) Uint32 tAttrByteSize = tAttrSize * tArraySize; m_column = anAttrInfo; + theAttrId = anAttrInfo->m_attrId; theAttrSize = tAttrSize; theArraySize = tArraySize; @@ -124,3 +127,79 @@ NdbRecAttr::clone() const { memcpy(ret->theRef, theRef, n); return ret; } + +NdbOut& operator<<(NdbOut& ndbout, const NdbRecAttr &r) +{ + if (r.isNULL()) + { + ndbout << "[NULL]"; + return ndbout; + } + + if (r.arraySize() > 1) + ndbout << "["; + + for (Uint32 j = 0; j < r.arraySize(); j++) + { + if (j > 0) + ndbout << " "; + + switch(r.getType()) + { + case NdbDictionary::Column::Bigunsigned: + ndbout << r.u_64_value(); + break; + case NdbDictionary::Column::Unsigned: + ndbout << r.u_32_value(); + break; + case NdbDictionary::Column::Smallunsigned: + ndbout << r.u_short_value(); + break; + case NdbDictionary::Column::Tinyunsigned: + ndbout << (unsigned) r.u_char_value(); + break; + case NdbDictionary::Column::Bigint: + ndbout << r.int64_value(); + break; + case NdbDictionary::Column::Int: + ndbout << r.int32_value(); + break; + case NdbDictionary::Column::Smallint: + ndbout << r.short_value(); + break; + case NdbDictionary::Column::Tinyint: + ndbout << (int) r.char_value(); + break; + case NdbDictionary::Column::Char: + ndbout.print("%.*s", r.arraySize(), r.aRef()); + j = r.arraySize(); + break; + case NdbDictionary::Column::Varchar: + { + short len = ntohs(r.u_short_value()); + ndbout.print("%.*s", len, r.aRef()+2); + } + j = r.arraySize(); + break; + case NdbDictionary::Column::Float: + ndbout << r.float_value(); + break; + case NdbDictionary::Column::Double: + ndbout << r.double_value(); + break; + default: /* no print functions for the rest, just print type */ + ndbout << r.getType(); + j = r.arraySize(); + if (j > 1) + ndbout << " %u times" << j; + break; + } + } + + if (r.arraySize() > 1) + { + ndbout << "]"; + } + + return ndbout; +} diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 8064eef838e..cc090ac0364 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -34,6 +34,7 @@ #include "NdbApiSignal.hpp" #include <NdbOut.hpp> #include "NdbDictionaryImpl.hpp" +#include "NdbBlob.hpp" NdbScanOperation::NdbScanOperation(Ndb* aNdb) : NdbCursorOperation(aNdb), @@ -294,6 +295,18 @@ int NdbScanOperation::setValue(Uint32 anAttrId, double aValue) return 0; } +NdbBlob* +NdbScanOperation::getBlobHandle(const char* anAttrName) +{ + return NdbOperation::getBlobHandle(m_transConnection, m_currentTable->getColumn(anAttrName)); +} + +NdbBlob* +NdbScanOperation::getBlobHandle(Uint32 anAttrId) +{ + return NdbOperation::getBlobHandle(m_transConnection, m_currentTable->getColumn(anAttrId)); +} + // Private methods int NdbScanOperation::executeCursor(int ProcessorId) @@ -344,6 +357,15 @@ int NdbScanOperation::nextResult(bool fetchAllowed) const NdbError err = theNdbCon->getNdbError(); m_transConnection->setOperationErrorCode(err.code); } + if (result == 0) { + // handle blobs + NdbBlob* tBlob = theBlobList; + while (tBlob != NULL) { + if (tBlob->atNextResult() == -1) + return -1; + tBlob = tBlob->theNext; + } + } return result; } diff --git a/ndb/src/ndbapi/Ndberr.cpp b/ndb/src/ndbapi/Ndberr.cpp index faa2f00cfce..a8b968da03f 100644 --- a/ndb/src/ndbapi/Ndberr.cpp +++ b/ndb/src/ndbapi/Ndberr.cpp @@ -18,9 +18,9 @@ #include <NdbError.hpp> #include "NdbImpl.hpp" #include "NdbDictionaryImpl.hpp" -#include <NdbSchemaCon.hpp> #include <NdbOperation.hpp> #include <NdbConnection.hpp> +#include <NdbBlob.hpp> static void @@ -67,9 +67,9 @@ NdbOperation::getNdbError() const { return theError; } -const -NdbError & -NdbSchemaCon::getNdbError() const { +const +NdbError & +NdbBlob::getNdbError() const { update(theError); return theError; } diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index e42bc31e94c..03baff4aefd 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -85,6 +85,7 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) : theSubroutineList(NULL), theCallList(NULL), theScanList(NULL), + theNdbBlobIdleList(NULL), theNoOfDBnodes(0), theDBnodes(NULL), the_release_ind(NULL), @@ -235,6 +236,8 @@ Ndb::~Ndb() freeNdbCall(); while (theScanList != NULL) freeNdbScanRec(); + while (theNdbBlobIdleList != NULL) + freeNdbBlob(); releaseTransactionArrays(); startTransactionNodeSelectionData.release(); diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index 0d9c0f60985..e557fdc0a5f 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -27,6 +27,7 @@ #include "NdbScanReceiver.hpp" #include "NdbUtil.hpp" #include "API.hpp" +#include "NdbBlob.hpp" void Ndb::checkFailedNode() @@ -435,6 +436,19 @@ Ndb::getSignal() return tSignal; } +NdbBlob* +Ndb::getNdbBlob() +{ + NdbBlob* tBlob = theNdbBlobIdleList; + if (tBlob != NULL) { + theNdbBlobIdleList = tBlob->theNext; + tBlob->init(); + } else { + tBlob = new NdbBlob; + } + return tBlob; +} + /*************************************************************************** void releaseNdbBranch(NdbBranch* aNdbBranch); @@ -601,6 +615,14 @@ Ndb::releaseSignalsInList(NdbApiSignal** pList){ } } +void +Ndb::releaseNdbBlob(NdbBlob* aBlob) +{ + aBlob->release(); + aBlob->theNext = theNdbBlobIdleList; + theNdbBlobIdleList = aBlob; +} + /*************************************************************************** void freeOperation(); @@ -745,6 +767,14 @@ Ndb::freeSignal() cfreeSignals++; } +void +Ndb::freeNdbBlob() +{ + NdbBlob* tBlob = theNdbBlobIdleList; + theNdbBlobIdleList = tBlob->theNext; + delete tBlob; +} + /**************************************************************************** int releaseConnectToNdb(NdbConnection* aConnectConnection); diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index ea7cf4de426..760322d669d 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -418,8 +418,14 @@ ErrorBundle ErrorCodes[] = { { 4259, AE, "Invalid set of range scan bounds" }, { 4260, UD, "NdbScanFilter: Operator is not defined in NdbScanFilter::Group"}, { 4261, UD, "NdbScanFilter: Column is NULL"}, - { 4262, UD, "NdbScanFilter: Condition is out of bounds"} - + { 4262, UD, "NdbScanFilter: Condition is out of bounds"}, + { 4263, IE, "Invalid blob attributes or invalid blob parts table" }, + { 4264, AE, "Invalid usage of blob attribute" }, + { 4265, AE, "Method is not valid in current blob state" }, + { 4266, AE, "Invalid blob seek position" }, + { 4267, IE, "Corrupted blob value" }, + { 4268, IE, "Error in blob head update forced rollback of transaction" }, + { 4268, IE, "Unknown blob error" } }; static diff --git a/ndb/src/old_files/Makefile b/ndb/src/old_files/Makefile deleted file mode 100644 index cd33563ddc1..00000000000 --- a/ndb/src/old_files/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -include .defs.mk - -DIRS := \ - client \ - common \ - kernel \ - ndbapi \ - mgmsrv \ - mgmapi \ - newtonapi \ - rep \ - mgmclient \ - cw \ - ndbbaseclient -ifneq ($(NDB_ODBC),N) - DIRS += ndbclient -endif -ifeq ($(findstring OSE, $(NDB_OS)),) - DIRS += scripts -endif -include $(NDB_TOP)/Epilogue.mk - -_bins_mgmsrv: _libs_ndbapi -_bins_mgmsrv: _libs_mgmapi -_bins_mgmclient: _libs_mgmapi -_bins_mgmclient: _libs_common -_bins_client: _bins_ndbapi -_bins_common: _bins_mgmapi -_bins_kernel: _bins_ndbapi -_bins_newtonapi: _bins_ndbapi -_bins_mgmapi : _libs_common -_bins_rep: _libs_common -_bins_rep: _libs_ndbapi diff --git a/ndb/src/client/Makefile b/ndb/src/old_files/client/Makefile index 1751a98bdfe..1751a98bdfe 100644 --- a/ndb/src/client/Makefile +++ b/ndb/src/old_files/client/Makefile diff --git a/ndb/src/client/odbc/Extra.mk b/ndb/src/old_files/client/odbc/Extra.mk index 762fb0bedd0..762fb0bedd0 100644 --- a/ndb/src/client/odbc/Extra.mk +++ b/ndb/src/old_files/client/odbc/Extra.mk diff --git a/ndb/src/client/odbc/Makefile b/ndb/src/old_files/client/odbc/Makefile index 2da683e7d86..2da683e7d86 100644 --- a/ndb/src/client/odbc/Makefile +++ b/ndb/src/old_files/client/odbc/Makefile diff --git a/ndb/src/client/odbc/NdbOdbc.cpp b/ndb/src/old_files/client/odbc/NdbOdbc.cpp index 67c6b5e0004..67c6b5e0004 100755 --- a/ndb/src/client/odbc/NdbOdbc.cpp +++ b/ndb/src/old_files/client/odbc/NdbOdbc.cpp diff --git a/ndb/src/client/odbc/NdbOdbc.def b/ndb/src/old_files/client/odbc/NdbOdbc.def index 85619b91915..85619b91915 100755 --- a/ndb/src/client/odbc/NdbOdbc.def +++ b/ndb/src/old_files/client/odbc/NdbOdbc.def diff --git a/ndb/src/client/odbc/codegen/CodeGen.cpp b/ndb/src/old_files/client/odbc/codegen/CodeGen.cpp index 6be78b62bd9..6be78b62bd9 100644 --- a/ndb/src/client/odbc/codegen/CodeGen.cpp +++ b/ndb/src/old_files/client/odbc/codegen/CodeGen.cpp diff --git a/ndb/src/client/odbc/codegen/CodeGen.hpp b/ndb/src/old_files/client/odbc/codegen/CodeGen.hpp index ae61dab0c2a..ae61dab0c2a 100644 --- a/ndb/src/client/odbc/codegen/CodeGen.hpp +++ b/ndb/src/old_files/client/odbc/codegen/CodeGen.hpp diff --git a/ndb/src/client/odbc/codegen/Code_base.cpp b/ndb/src/old_files/client/odbc/codegen/Code_base.cpp index dc02e071156..dc02e071156 100644 --- a/ndb/src/client/odbc/codegen/Code_base.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_base.cpp diff --git a/ndb/src/client/odbc/codegen/Code_base.hpp b/ndb/src/old_files/client/odbc/codegen/Code_base.hpp index c67c0ca7adb..c67c0ca7adb 100644 --- a/ndb/src/client/odbc/codegen/Code_base.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_base.hpp diff --git a/ndb/src/client/odbc/codegen/Code_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_column.cpp index c4c0480a5e7..c4c0480a5e7 100644 --- a/ndb/src/client/odbc/codegen/Code_column.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_column.cpp diff --git a/ndb/src/client/odbc/codegen/Code_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_column.hpp index af0dcea690d..af0dcea690d 100644 --- a/ndb/src/client/odbc/codegen/Code_column.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_column.hpp diff --git a/ndb/src/client/odbc/codegen/Code_comp_op.cpp b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.cpp index 7782ed1ea2a..7782ed1ea2a 100644 --- a/ndb/src/client/odbc/codegen/Code_comp_op.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.cpp diff --git a/ndb/src/client/odbc/codegen/Code_comp_op.hpp b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.hpp index 0585ab1dabf..0585ab1dabf 100644 --- a/ndb/src/client/odbc/codegen/Code_comp_op.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_comp_op.hpp diff --git a/ndb/src/client/odbc/codegen/Code_create_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_create_index.cpp index 84f319338a4..84f319338a4 100644 --- a/ndb/src/client/odbc/codegen/Code_create_index.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_create_index.cpp diff --git a/ndb/src/client/odbc/codegen/Code_create_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_create_index.hpp index ebd757e1118..ebd757e1118 100644 --- a/ndb/src/client/odbc/codegen/Code_create_index.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_create_index.hpp diff --git a/ndb/src/client/odbc/codegen/Code_create_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_create_row.cpp index 5b90b658ed7..5b90b658ed7 100644 --- a/ndb/src/client/odbc/codegen/Code_create_row.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_create_row.cpp diff --git a/ndb/src/client/odbc/codegen/Code_create_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_create_row.hpp index f03455ff28e..f03455ff28e 100644 --- a/ndb/src/client/odbc/codegen/Code_create_row.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_create_row.hpp diff --git a/ndb/src/client/odbc/codegen/Code_create_table.cpp b/ndb/src/old_files/client/odbc/codegen/Code_create_table.cpp index 14e4abbd7fe..14e4abbd7fe 100644 --- a/ndb/src/client/odbc/codegen/Code_create_table.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_create_table.cpp diff --git a/ndb/src/client/odbc/codegen/Code_create_table.hpp b/ndb/src/old_files/client/odbc/codegen/Code_create_table.hpp index cbb2189d8ce..cbb2189d8ce 100644 --- a/ndb/src/client/odbc/codegen/Code_create_table.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_create_table.hpp diff --git a/ndb/src/client/odbc/codegen/Code_data_type.cpp b/ndb/src/old_files/client/odbc/codegen/Code_data_type.cpp index 1ff0fcebcbe..1ff0fcebcbe 100644 --- a/ndb/src/client/odbc/codegen/Code_data_type.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_data_type.cpp diff --git a/ndb/src/client/odbc/codegen/Code_data_type.hpp b/ndb/src/old_files/client/odbc/codegen/Code_data_type.hpp index 735dc05014f..735dc05014f 100644 --- a/ndb/src/client/odbc/codegen/Code_data_type.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_data_type.hpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl.cpp index 2ba4291a0e8..2ba4291a0e8 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl.cpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl.hpp index 1ceca62d55d..1ceca62d55d 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl.hpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.cpp index ee037e54c1f..ee037e54c1f 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl_column.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.cpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.hpp index 7d089d37440..7d089d37440 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl_column.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_column.hpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl_constr.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.cpp index 78c23e38d97..78c23e38d97 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl_constr.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.cpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl_constr.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.hpp index ea7808b37cb..ea7808b37cb 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl_constr.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_constr.hpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.cpp index 87589ebbaa0..87589ebbaa0 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl_row.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.cpp diff --git a/ndb/src/client/odbc/codegen/Code_ddl_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.hpp index ac3eded1b2e..ac3eded1b2e 100644 --- a/ndb/src/client/odbc/codegen/Code_ddl_row.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_ddl_row.hpp diff --git a/ndb/src/client/odbc/codegen/Code_delete.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete.cpp index 35b3daa1aca..35b3daa1aca 100644 --- a/ndb/src/client/odbc/codegen/Code_delete.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete.cpp diff --git a/ndb/src/client/odbc/codegen/Code_delete.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete.hpp index c7fa245497b..c7fa245497b 100644 --- a/ndb/src/client/odbc/codegen/Code_delete.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete.hpp diff --git a/ndb/src/client/odbc/codegen/Code_delete_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.cpp index 8f2c3be2848..8f2c3be2848 100644 --- a/ndb/src/client/odbc/codegen/Code_delete_index.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.cpp diff --git a/ndb/src/client/odbc/codegen/Code_delete_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.hpp index 1aaaa18abcb..1aaaa18abcb 100644 --- a/ndb/src/client/odbc/codegen/Code_delete_index.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_index.hpp diff --git a/ndb/src/client/odbc/codegen/Code_delete_lookup.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.cpp index 4a6dec64654..4a6dec64654 100644 --- a/ndb/src/client/odbc/codegen/Code_delete_lookup.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.cpp diff --git a/ndb/src/client/odbc/codegen/Code_delete_lookup.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.hpp index 4138baefa4c..4138baefa4c 100644 --- a/ndb/src/client/odbc/codegen/Code_delete_lookup.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_lookup.hpp diff --git a/ndb/src/client/odbc/codegen/Code_delete_scan.cpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.cpp index fed7244a026..fed7244a026 100644 --- a/ndb/src/client/odbc/codegen/Code_delete_scan.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.cpp diff --git a/ndb/src/client/odbc/codegen/Code_delete_scan.hpp b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.hpp index eb013a8257e..eb013a8257e 100644 --- a/ndb/src/client/odbc/codegen/Code_delete_scan.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_delete_scan.hpp diff --git a/ndb/src/client/odbc/codegen/Code_dml.cpp b/ndb/src/old_files/client/odbc/codegen/Code_dml.cpp index 44fd4478646..44fd4478646 100644 --- a/ndb/src/client/odbc/codegen/Code_dml.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_dml.cpp diff --git a/ndb/src/client/odbc/codegen/Code_dml.hpp b/ndb/src/old_files/client/odbc/codegen/Code_dml.hpp index 0618f583984..0618f583984 100644 --- a/ndb/src/client/odbc/codegen/Code_dml.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_dml.hpp diff --git a/ndb/src/client/odbc/codegen/Code_dml_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.cpp index 808e2ac8c4b..808e2ac8c4b 100644 --- a/ndb/src/client/odbc/codegen/Code_dml_column.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.cpp diff --git a/ndb/src/client/odbc/codegen/Code_dml_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.hpp index 0fb33944a3a..0fb33944a3a 100644 --- a/ndb/src/client/odbc/codegen/Code_dml_column.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_column.hpp diff --git a/ndb/src/client/odbc/codegen/Code_dml_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.cpp index ceb63a9f7b9..ceb63a9f7b9 100644 --- a/ndb/src/client/odbc/codegen/Code_dml_row.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.cpp diff --git a/ndb/src/client/odbc/codegen/Code_dml_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.hpp index 6c7e46ba9af..6c7e46ba9af 100644 --- a/ndb/src/client/odbc/codegen/Code_dml_row.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_dml_row.hpp diff --git a/ndb/src/client/odbc/codegen/Code_drop_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.cpp index b6bae88e270..b6bae88e270 100644 --- a/ndb/src/client/odbc/codegen/Code_drop_index.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.cpp diff --git a/ndb/src/client/odbc/codegen/Code_drop_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.hpp index 99891c9a52f..99891c9a52f 100644 --- a/ndb/src/client/odbc/codegen/Code_drop_index.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_index.hpp diff --git a/ndb/src/client/odbc/codegen/Code_drop_table.cpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.cpp index f20bf9fdae0..f20bf9fdae0 100644 --- a/ndb/src/client/odbc/codegen/Code_drop_table.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.cpp diff --git a/ndb/src/client/odbc/codegen/Code_drop_table.hpp b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.hpp index 849a472ed94..849a472ed94 100644 --- a/ndb/src/client/odbc/codegen/Code_drop_table.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_drop_table.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr.cpp index 4afa75986a0..4afa75986a0 100644 --- a/ndb/src/client/odbc/codegen/Code_expr.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr.hpp index b6f07471b4d..b6f07471b4d 100644 --- a/ndb/src/client/odbc/codegen/Code_expr.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.cpp index 17a9a502d4c..17a9a502d4c 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_column.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.hpp index 2ce7c441e45..2ce7c441e45 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_column.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_column.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_const.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.cpp index 564d307a4f8..564d307a4f8 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_const.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_const.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.hpp index 2e26c637a23..2e26c637a23 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_const.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_const.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_conv.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.cpp index bc89482fedc..bc89482fedc 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_conv.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_conv.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.hpp index 3294960c7b3..3294960c7b3 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_conv.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_conv.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_func.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.cpp index 96b461a72d9..96b461a72d9 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_func.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_func.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.hpp index 856d7529875..856d7529875 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_func.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_func.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_op.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.cpp index 7e8314c1741..7e8314c1741 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_op.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_op.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.hpp index f9686cad151..f9686cad151 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_op.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_op.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_param.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.cpp index 93892cae5e6..93892cae5e6 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_param.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_param.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.hpp index 783e5c087b4..783e5c087b4 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_param.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_param.hpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.cpp index da1751d41d1..da1751d41d1 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_row.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.cpp diff --git a/ndb/src/client/odbc/codegen/Code_expr_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.hpp index 94527931dba..94527931dba 100644 --- a/ndb/src/client/odbc/codegen/Code_expr_row.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_expr_row.hpp diff --git a/ndb/src/client/odbc/codegen/Code_idx_column.cpp b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.cpp index 584ffef3e01..584ffef3e01 100644 --- a/ndb/src/client/odbc/codegen/Code_idx_column.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.cpp diff --git a/ndb/src/client/odbc/codegen/Code_idx_column.hpp b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.hpp index 209ed705b48..209ed705b48 100644 --- a/ndb/src/client/odbc/codegen/Code_idx_column.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_idx_column.hpp diff --git a/ndb/src/client/odbc/codegen/Code_insert.cpp b/ndb/src/old_files/client/odbc/codegen/Code_insert.cpp index c442186c181..c442186c181 100644 --- a/ndb/src/client/odbc/codegen/Code_insert.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_insert.cpp diff --git a/ndb/src/client/odbc/codegen/Code_insert.hpp b/ndb/src/old_files/client/odbc/codegen/Code_insert.hpp index 748b092e33a..748b092e33a 100644 --- a/ndb/src/client/odbc/codegen/Code_insert.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_insert.hpp diff --git a/ndb/src/client/odbc/codegen/Code_pred.cpp b/ndb/src/old_files/client/odbc/codegen/Code_pred.cpp index fe7cac7606e..fe7cac7606e 100644 --- a/ndb/src/client/odbc/codegen/Code_pred.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_pred.cpp diff --git a/ndb/src/client/odbc/codegen/Code_pred.hpp b/ndb/src/old_files/client/odbc/codegen/Code_pred.hpp index a77c1161fa1..a77c1161fa1 100644 --- a/ndb/src/client/odbc/codegen/Code_pred.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_pred.hpp diff --git a/ndb/src/client/odbc/codegen/Code_pred_op.cpp b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.cpp index 29736e45818..29736e45818 100644 --- a/ndb/src/client/odbc/codegen/Code_pred_op.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.cpp diff --git a/ndb/src/client/odbc/codegen/Code_pred_op.hpp b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.hpp index 9130bc3cb81..9130bc3cb81 100644 --- a/ndb/src/client/odbc/codegen/Code_pred_op.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_pred_op.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query.cpp index 9e983942601..9e983942601 100644 --- a/ndb/src/client/odbc/codegen/Code_query.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query.hpp index 97f98f859ff..97f98f859ff 100644 --- a/ndb/src/client/odbc/codegen/Code_query.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_count.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_count.cpp index f52c41df802..f52c41df802 100644 --- a/ndb/src/client/odbc/codegen/Code_query_count.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_count.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_count.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_count.hpp index a094eba4519..a094eba4519 100644 --- a/ndb/src/client/odbc/codegen/Code_query_count.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_count.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_distinct.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.cpp index 4cbfbfe812d..4cbfbfe812d 100644 --- a/ndb/src/client/odbc/codegen/Code_query_distinct.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_distinct.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.hpp index 62c46bda901..62c46bda901 100644 --- a/ndb/src/client/odbc/codegen/Code_query_distinct.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_distinct.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_filter.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.cpp index 934a24d182d..934a24d182d 100644 --- a/ndb/src/client/odbc/codegen/Code_query_filter.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_filter.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.hpp index 60cbf0f86a7..60cbf0f86a7 100644 --- a/ndb/src/client/odbc/codegen/Code_query_filter.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_filter.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_group.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_group.cpp index c3019efaa85..c3019efaa85 100644 --- a/ndb/src/client/odbc/codegen/Code_query_group.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_group.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_group.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_group.hpp index e79022c5284..e79022c5284 100644 --- a/ndb/src/client/odbc/codegen/Code_query_group.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_group.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_index.cpp index ee19d6123cc..ee19d6123cc 100644 --- a/ndb/src/client/odbc/codegen/Code_query_index.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_index.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_index.hpp index 87affd50580..87affd50580 100644 --- a/ndb/src/client/odbc/codegen/Code_query_index.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_index.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_join.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_join.cpp index 89aafe13610..89aafe13610 100644 --- a/ndb/src/client/odbc/codegen/Code_query_join.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_join.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_join.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_join.hpp index f6ac9205329..f6ac9205329 100644 --- a/ndb/src/client/odbc/codegen/Code_query_join.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_join.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_lookup.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.cpp index bad4199190b..bad4199190b 100644 --- a/ndb/src/client/odbc/codegen/Code_query_lookup.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_lookup.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.hpp index e66623d4030..e66623d4030 100644 --- a/ndb/src/client/odbc/codegen/Code_query_lookup.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_lookup.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_project.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_project.cpp index 54043ce3d5d..54043ce3d5d 100644 --- a/ndb/src/client/odbc/codegen/Code_query_project.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_project.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_project.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_project.hpp index 545685ab9df..545685ab9df 100644 --- a/ndb/src/client/odbc/codegen/Code_query_project.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_project.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_range.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_range.cpp index 5d29c5af315..5d29c5af315 100644 --- a/ndb/src/client/odbc/codegen/Code_query_range.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_range.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_range.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_range.hpp index 4438189522c..4438189522c 100644 --- a/ndb/src/client/odbc/codegen/Code_query_range.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_range.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_repeat.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.cpp index 8b295a97916..8b295a97916 100644 --- a/ndb/src/client/odbc/codegen/Code_query_repeat.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_repeat.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.hpp index 90d6ef55104..90d6ef55104 100644 --- a/ndb/src/client/odbc/codegen/Code_query_repeat.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_repeat.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_scan.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.cpp index 1c0f58980e5..1c0f58980e5 100644 --- a/ndb/src/client/odbc/codegen/Code_query_scan.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_scan.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.hpp index d6d1630ddf8..d6d1630ddf8 100644 --- a/ndb/src/client/odbc/codegen/Code_query_scan.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_scan.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_sort.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.cpp index 4ea6db8c4e2..4ea6db8c4e2 100644 --- a/ndb/src/client/odbc/codegen/Code_query_sort.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_sort.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.hpp index d1aa03d9aef..d1aa03d9aef 100644 --- a/ndb/src/client/odbc/codegen/Code_query_sort.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sort.hpp diff --git a/ndb/src/client/odbc/codegen/Code_query_sys.cpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.cpp index affe3dc1264..affe3dc1264 100644 --- a/ndb/src/client/odbc/codegen/Code_query_sys.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.cpp diff --git a/ndb/src/client/odbc/codegen/Code_query_sys.hpp b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.hpp index 8eb069d0413..8eb069d0413 100644 --- a/ndb/src/client/odbc/codegen/Code_query_sys.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_query_sys.hpp diff --git a/ndb/src/client/odbc/codegen/Code_root.cpp b/ndb/src/old_files/client/odbc/codegen/Code_root.cpp index 4f45bdffdaf..4f45bdffdaf 100644 --- a/ndb/src/client/odbc/codegen/Code_root.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_root.cpp diff --git a/ndb/src/client/odbc/codegen/Code_root.hpp b/ndb/src/old_files/client/odbc/codegen/Code_root.hpp index 4f0f96725e3..4f0f96725e3 100644 --- a/ndb/src/client/odbc/codegen/Code_root.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_root.hpp diff --git a/ndb/src/client/odbc/codegen/Code_select.cpp b/ndb/src/old_files/client/odbc/codegen/Code_select.cpp index 611b491968d..611b491968d 100644 --- a/ndb/src/client/odbc/codegen/Code_select.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_select.cpp diff --git a/ndb/src/client/odbc/codegen/Code_select.hpp b/ndb/src/old_files/client/odbc/codegen/Code_select.hpp index eaa9b801f29..eaa9b801f29 100644 --- a/ndb/src/client/odbc/codegen/Code_select.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_select.hpp diff --git a/ndb/src/client/odbc/codegen/Code_set_row.cpp b/ndb/src/old_files/client/odbc/codegen/Code_set_row.cpp index dd13ba0c3f7..dd13ba0c3f7 100644 --- a/ndb/src/client/odbc/codegen/Code_set_row.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_set_row.cpp diff --git a/ndb/src/client/odbc/codegen/Code_set_row.hpp b/ndb/src/old_files/client/odbc/codegen/Code_set_row.hpp index 10d62826ac7..10d62826ac7 100644 --- a/ndb/src/client/odbc/codegen/Code_set_row.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_set_row.hpp diff --git a/ndb/src/client/odbc/codegen/Code_stmt.cpp b/ndb/src/old_files/client/odbc/codegen/Code_stmt.cpp index d790f667b84..d790f667b84 100644 --- a/ndb/src/client/odbc/codegen/Code_stmt.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_stmt.cpp diff --git a/ndb/src/client/odbc/codegen/Code_stmt.hpp b/ndb/src/old_files/client/odbc/codegen/Code_stmt.hpp index 20b7fb965fb..20b7fb965fb 100644 --- a/ndb/src/client/odbc/codegen/Code_stmt.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_stmt.hpp diff --git a/ndb/src/client/odbc/codegen/Code_table.cpp b/ndb/src/old_files/client/odbc/codegen/Code_table.cpp index ee3c2a2ed07..ee3c2a2ed07 100644 --- a/ndb/src/client/odbc/codegen/Code_table.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_table.cpp diff --git a/ndb/src/client/odbc/codegen/Code_table.hpp b/ndb/src/old_files/client/odbc/codegen/Code_table.hpp index 8a95b8fa26c..8a95b8fa26c 100644 --- a/ndb/src/client/odbc/codegen/Code_table.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_table.hpp diff --git a/ndb/src/client/odbc/codegen/Code_table_list.cpp b/ndb/src/old_files/client/odbc/codegen/Code_table_list.cpp index ea9f4fdc26e..ea9f4fdc26e 100644 --- a/ndb/src/client/odbc/codegen/Code_table_list.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_table_list.cpp diff --git a/ndb/src/client/odbc/codegen/Code_table_list.hpp b/ndb/src/old_files/client/odbc/codegen/Code_table_list.hpp index 47989166cac..47989166cac 100644 --- a/ndb/src/client/odbc/codegen/Code_table_list.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_table_list.hpp diff --git a/ndb/src/client/odbc/codegen/Code_update.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update.cpp index 0b33cd628b4..0b33cd628b4 100644 --- a/ndb/src/client/odbc/codegen/Code_update.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update.cpp diff --git a/ndb/src/client/odbc/codegen/Code_update.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update.hpp index 380b651518b..380b651518b 100644 --- a/ndb/src/client/odbc/codegen/Code_update.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update.hpp diff --git a/ndb/src/client/odbc/codegen/Code_update_index.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update_index.cpp index 6f74db0d913..6f74db0d913 100644 --- a/ndb/src/client/odbc/codegen/Code_update_index.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update_index.cpp diff --git a/ndb/src/client/odbc/codegen/Code_update_index.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update_index.hpp index bbad822650a..bbad822650a 100644 --- a/ndb/src/client/odbc/codegen/Code_update_index.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update_index.hpp diff --git a/ndb/src/client/odbc/codegen/Code_update_lookup.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.cpp index 7525fb72692..7525fb72692 100644 --- a/ndb/src/client/odbc/codegen/Code_update_lookup.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.cpp diff --git a/ndb/src/client/odbc/codegen/Code_update_lookup.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.hpp index fc4341880dd..fc4341880dd 100644 --- a/ndb/src/client/odbc/codegen/Code_update_lookup.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update_lookup.hpp diff --git a/ndb/src/client/odbc/codegen/Code_update_scan.cpp b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.cpp index 9fac1728469..9fac1728469 100644 --- a/ndb/src/client/odbc/codegen/Code_update_scan.cpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.cpp diff --git a/ndb/src/client/odbc/codegen/Code_update_scan.hpp b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.hpp index d742883e561..d742883e561 100644 --- a/ndb/src/client/odbc/codegen/Code_update_scan.hpp +++ b/ndb/src/old_files/client/odbc/codegen/Code_update_scan.hpp diff --git a/ndb/src/client/odbc/codegen/Makefile b/ndb/src/old_files/client/odbc/codegen/Makefile index 49e5439556d..49e5439556d 100644 --- a/ndb/src/client/odbc/codegen/Makefile +++ b/ndb/src/old_files/client/odbc/codegen/Makefile diff --git a/ndb/src/client/odbc/codegen/SimpleGram.ypp b/ndb/src/old_files/client/odbc/codegen/SimpleGram.ypp index d49344849d2..07d8017e5ed 100644 --- a/ndb/src/client/odbc/codegen/SimpleGram.ypp +++ b/ndb/src/old_files/client/odbc/codegen/SimpleGram.ypp @@ -88,6 +88,7 @@ struct PhysAttr { int storage; int logging; }; struct PhysAttr* m_phys_attr; NdbDictionary::Object::FragmentType m_storage_attr; bool m_logging_attr; + SqlType::Type m_sql_type; } /* keywords */ @@ -100,6 +101,7 @@ struct PhysAttr { int storage; int logging; }; T_BLOB T_BY T_CHAR + T_CLOB T_CONSTRAINT T_CREATE T_DATETIME @@ -128,6 +130,7 @@ struct PhysAttr { int storage; int logging; }; T_LIMIT T_LOGGING T_LONGBLOB + T_LONGCLOB T_MEDIUM T_NOLOGGING T_NOT @@ -248,6 +251,7 @@ struct PhysAttr { int storage; int logging; }; %type <m_phys_attr> phys_attr2 %type <m_storage_attr> storage_attr %type <m_logging_attr> logging_attr +%type <m_sql_type> blob_type %% @@ -606,10 +610,10 @@ data_type: $$ = dataType; } | - blob_keyword + blob_type { Plan_root* root = simpleParser.root(); - SqlType sqlType(SqlType::Blob, true); + SqlType sqlType($1, true); Plan_data_type* dataType = new Plan_data_type(root, sqlType); root->saveNode(dataType); $$ = dataType; @@ -620,10 +624,26 @@ dummy_binary: | T_BINARY ; -blob_keyword: +blob_type: T_BLOB + { + $$ = SqlType::Blob; + } | T_LONGBLOB + { + $$ = SqlType::Blob; + } + | + T_CLOB + { + $$ = SqlType::Clob; + } + | + T_LONGCLOB + { + $$ = SqlType::Clob; + } ; create_column_rest: /* empty */ diff --git a/ndb/src/client/odbc/codegen/SimpleParser.cpp b/ndb/src/old_files/client/odbc/codegen/SimpleParser.cpp index a2418f49e37..a2418f49e37 100644 --- a/ndb/src/client/odbc/codegen/SimpleParser.cpp +++ b/ndb/src/old_files/client/odbc/codegen/SimpleParser.cpp diff --git a/ndb/src/client/odbc/codegen/SimpleParser.hpp b/ndb/src/old_files/client/odbc/codegen/SimpleParser.hpp index abadae8f905..abadae8f905 100644 --- a/ndb/src/client/odbc/codegen/SimpleParser.hpp +++ b/ndb/src/old_files/client/odbc/codegen/SimpleParser.hpp diff --git a/ndb/src/client/odbc/codegen/SimpleScan.lpp b/ndb/src/old_files/client/odbc/codegen/SimpleScan.lpp index bd930c08cfa..29aa876f669 100644 --- a/ndb/src/client/odbc/codegen/SimpleScan.lpp +++ b/ndb/src/old_files/client/odbc/codegen/SimpleScan.lpp @@ -149,6 +149,7 @@ static const SqlKeyword sqlKeyword[] = { { "BLOB", T_BLOB, StateType }, { "BY", T_BY, -1 }, { "CHAR", T_CHAR, StateType }, + { "CLOB", T_CLOB, StateType }, { "CONSTRAINT", T_CONSTRAINT, -1 }, { "CREATE", T_CREATE, -1 }, { "DATETIME", T_DATETIME, StateType }, @@ -177,6 +178,7 @@ static const SqlKeyword sqlKeyword[] = { { "LIMIT", T_LIMIT, -1 }, { "LOGGING", T_LOGGING, StatePhys }, { "LONGBLOB", T_LONGBLOB, StateType }, + { "LONGCLOB", T_LONGCLOB, StateType }, { "MEDIUM", T_MEDIUM, StatePhys }, { "NOLOGGING", T_NOLOGGING, StatePhys }, { "NOT", T_NOT, -1 }, diff --git a/ndb/src/client/odbc/common/AttrArea.cpp b/ndb/src/old_files/client/odbc/common/AttrArea.cpp index ff9e085a7f6..ff9e085a7f6 100644 --- a/ndb/src/client/odbc/common/AttrArea.cpp +++ b/ndb/src/old_files/client/odbc/common/AttrArea.cpp diff --git a/ndb/src/client/odbc/common/AttrArea.hpp b/ndb/src/old_files/client/odbc/common/AttrArea.hpp index 050cce719bf..050cce719bf 100644 --- a/ndb/src/client/odbc/common/AttrArea.hpp +++ b/ndb/src/old_files/client/odbc/common/AttrArea.hpp diff --git a/ndb/src/client/odbc/common/CodeTree.cpp b/ndb/src/old_files/client/odbc/common/CodeTree.cpp index ebe4840c5f6..ebe4840c5f6 100644 --- a/ndb/src/client/odbc/common/CodeTree.cpp +++ b/ndb/src/old_files/client/odbc/common/CodeTree.cpp diff --git a/ndb/src/client/odbc/common/CodeTree.hpp b/ndb/src/old_files/client/odbc/common/CodeTree.hpp index 1b0ae3199af..1b0ae3199af 100644 --- a/ndb/src/client/odbc/common/CodeTree.hpp +++ b/ndb/src/old_files/client/odbc/common/CodeTree.hpp diff --git a/ndb/src/client/odbc/common/ConnArea.cpp b/ndb/src/old_files/client/odbc/common/ConnArea.cpp index d4d3be52a3c..d4d3be52a3c 100644 --- a/ndb/src/client/odbc/common/ConnArea.cpp +++ b/ndb/src/old_files/client/odbc/common/ConnArea.cpp diff --git a/ndb/src/client/odbc/common/ConnArea.hpp b/ndb/src/old_files/client/odbc/common/ConnArea.hpp index 36367a39bae..36367a39bae 100644 --- a/ndb/src/client/odbc/common/ConnArea.hpp +++ b/ndb/src/old_files/client/odbc/common/ConnArea.hpp diff --git a/ndb/src/client/odbc/common/Ctx.cpp b/ndb/src/old_files/client/odbc/common/Ctx.cpp index d6faa5cba77..d6faa5cba77 100644 --- a/ndb/src/client/odbc/common/Ctx.cpp +++ b/ndb/src/old_files/client/odbc/common/Ctx.cpp diff --git a/ndb/src/client/odbc/common/Ctx.hpp b/ndb/src/old_files/client/odbc/common/Ctx.hpp index d25d45ff0c7..d25d45ff0c7 100644 --- a/ndb/src/client/odbc/common/Ctx.hpp +++ b/ndb/src/old_files/client/odbc/common/Ctx.hpp diff --git a/ndb/src/client/odbc/common/DataField.cpp b/ndb/src/old_files/client/odbc/common/DataField.cpp index 11aae7d893b..11aae7d893b 100644 --- a/ndb/src/client/odbc/common/DataField.cpp +++ b/ndb/src/old_files/client/odbc/common/DataField.cpp diff --git a/ndb/src/client/odbc/common/DataField.hpp b/ndb/src/old_files/client/odbc/common/DataField.hpp index 65138df25f1..65138df25f1 100644 --- a/ndb/src/client/odbc/common/DataField.hpp +++ b/ndb/src/old_files/client/odbc/common/DataField.hpp diff --git a/ndb/src/client/odbc/common/DataRow.cpp b/ndb/src/old_files/client/odbc/common/DataRow.cpp index 509f2673e0d..509f2673e0d 100644 --- a/ndb/src/client/odbc/common/DataRow.cpp +++ b/ndb/src/old_files/client/odbc/common/DataRow.cpp diff --git a/ndb/src/client/odbc/common/DataRow.hpp b/ndb/src/old_files/client/odbc/common/DataRow.hpp index 4a5a1e905b9..4a5a1e905b9 100644 --- a/ndb/src/client/odbc/common/DataRow.hpp +++ b/ndb/src/old_files/client/odbc/common/DataRow.hpp diff --git a/ndb/src/client/odbc/common/DataType.cpp b/ndb/src/old_files/client/odbc/common/DataType.cpp index 9c9629f1d24..96f6a6e0877 100644 --- a/ndb/src/client/odbc/common/DataType.cpp +++ b/ndb/src/old_files/client/odbc/common/DataType.cpp @@ -78,6 +78,9 @@ SqlType::setType(Ctx& ctx, Type type, bool nullable) case Blob: setType(ctx, Varbinary, FAKE_BLOB_SIZE, nullable); // XXX BLOB hack return; + case Clob: + setType(ctx, Varchar, FAKE_BLOB_SIZE, nullable); // XXX BLOB hack + return; case Null: case Unbound: break; @@ -193,6 +196,9 @@ SqlType::setType(Ctx& ctx, const NdbDictionary::Column* ndbColumn) case NdbDictionary::Column::Blob: setType(ctx, Blob, nullable); return; + case NdbDictionary::Column::Clob: + setType(ctx, Clob, nullable); + return; default: break; } diff --git a/ndb/src/client/odbc/common/DataType.hpp b/ndb/src/old_files/client/odbc/common/DataType.hpp index ac2ca337e22..e03e445cf05 100644 --- a/ndb/src/client/odbc/common/DataType.hpp +++ b/ndb/src/old_files/client/odbc/common/DataType.hpp @@ -74,6 +74,7 @@ public: Date = SQL_DATE, Datetime = SQL_TYPE_TIMESTAMP, Blob = SQL_BLOB, + Clob = SQL_CLOB, Null = NullDataType, // not an ODBC SQL type Unbound = UnboundDataType // special for placeholders }; diff --git a/ndb/src/client/odbc/common/DescArea.cpp b/ndb/src/old_files/client/odbc/common/DescArea.cpp index bad9f23d3ef..bad9f23d3ef 100644 --- a/ndb/src/client/odbc/common/DescArea.cpp +++ b/ndb/src/old_files/client/odbc/common/DescArea.cpp diff --git a/ndb/src/client/odbc/common/DescArea.hpp b/ndb/src/old_files/client/odbc/common/DescArea.hpp index e9f552d758d..e9f552d758d 100644 --- a/ndb/src/client/odbc/common/DescArea.hpp +++ b/ndb/src/old_files/client/odbc/common/DescArea.hpp diff --git a/ndb/src/client/odbc/common/DiagArea.cpp b/ndb/src/old_files/client/odbc/common/DiagArea.cpp index 06e8da89495..06e8da89495 100644 --- a/ndb/src/client/odbc/common/DiagArea.cpp +++ b/ndb/src/old_files/client/odbc/common/DiagArea.cpp diff --git a/ndb/src/client/odbc/common/DiagArea.hpp b/ndb/src/old_files/client/odbc/common/DiagArea.hpp index 79c03de6623..79c03de6623 100644 --- a/ndb/src/client/odbc/common/DiagArea.hpp +++ b/ndb/src/old_files/client/odbc/common/DiagArea.hpp diff --git a/ndb/src/client/odbc/common/Makefile b/ndb/src/old_files/client/odbc/common/Makefile index 7ee29738d86..7ee29738d86 100644 --- a/ndb/src/client/odbc/common/Makefile +++ b/ndb/src/old_files/client/odbc/common/Makefile diff --git a/ndb/src/client/odbc/common/OdbcData.cpp b/ndb/src/old_files/client/odbc/common/OdbcData.cpp index 32400e07c7a..32400e07c7a 100644 --- a/ndb/src/client/odbc/common/OdbcData.cpp +++ b/ndb/src/old_files/client/odbc/common/OdbcData.cpp diff --git a/ndb/src/client/odbc/common/OdbcData.hpp b/ndb/src/old_files/client/odbc/common/OdbcData.hpp index c1884507cfe..c1884507cfe 100644 --- a/ndb/src/client/odbc/common/OdbcData.hpp +++ b/ndb/src/old_files/client/odbc/common/OdbcData.hpp diff --git a/ndb/src/client/odbc/common/ResultArea.cpp b/ndb/src/old_files/client/odbc/common/ResultArea.cpp index 79d7fb0ccc4..79d7fb0ccc4 100644 --- a/ndb/src/client/odbc/common/ResultArea.cpp +++ b/ndb/src/old_files/client/odbc/common/ResultArea.cpp diff --git a/ndb/src/client/odbc/common/ResultArea.hpp b/ndb/src/old_files/client/odbc/common/ResultArea.hpp index d4890c44d99..d4890c44d99 100644 --- a/ndb/src/client/odbc/common/ResultArea.hpp +++ b/ndb/src/old_files/client/odbc/common/ResultArea.hpp diff --git a/ndb/src/client/odbc/common/Sqlstate.cpp b/ndb/src/old_files/client/odbc/common/Sqlstate.cpp index 2d625a7c159..2d625a7c159 100644 --- a/ndb/src/client/odbc/common/Sqlstate.cpp +++ b/ndb/src/old_files/client/odbc/common/Sqlstate.cpp diff --git a/ndb/src/client/odbc/common/Sqlstate.hpp b/ndb/src/old_files/client/odbc/common/Sqlstate.hpp index 3b4665dc6ca..3b4665dc6ca 100644 --- a/ndb/src/client/odbc/common/Sqlstate.hpp +++ b/ndb/src/old_files/client/odbc/common/Sqlstate.hpp diff --git a/ndb/src/client/odbc/common/StmtArea.cpp b/ndb/src/old_files/client/odbc/common/StmtArea.cpp index 5ce2d47d31a..5ce2d47d31a 100644 --- a/ndb/src/client/odbc/common/StmtArea.cpp +++ b/ndb/src/old_files/client/odbc/common/StmtArea.cpp diff --git a/ndb/src/client/odbc/common/StmtArea.hpp b/ndb/src/old_files/client/odbc/common/StmtArea.hpp index a88c6d36e6d..a88c6d36e6d 100644 --- a/ndb/src/client/odbc/common/StmtArea.hpp +++ b/ndb/src/old_files/client/odbc/common/StmtArea.hpp diff --git a/ndb/src/client/odbc/common/StmtInfo.cpp b/ndb/src/old_files/client/odbc/common/StmtInfo.cpp index 3467fb5023e..3467fb5023e 100644 --- a/ndb/src/client/odbc/common/StmtInfo.cpp +++ b/ndb/src/old_files/client/odbc/common/StmtInfo.cpp diff --git a/ndb/src/client/odbc/common/StmtInfo.hpp b/ndb/src/old_files/client/odbc/common/StmtInfo.hpp index 9cd489be6da..9cd489be6da 100644 --- a/ndb/src/client/odbc/common/StmtInfo.hpp +++ b/ndb/src/old_files/client/odbc/common/StmtInfo.hpp diff --git a/ndb/src/client/odbc/common/common.cpp b/ndb/src/old_files/client/odbc/common/common.cpp index 73d14c82efe..73d14c82efe 100644 --- a/ndb/src/client/odbc/common/common.cpp +++ b/ndb/src/old_files/client/odbc/common/common.cpp diff --git a/ndb/src/client/odbc/common/common.hpp b/ndb/src/old_files/client/odbc/common/common.hpp index d2f243b6437..d2f243b6437 100644 --- a/ndb/src/client/odbc/common/common.hpp +++ b/ndb/src/old_files/client/odbc/common/common.hpp diff --git a/ndb/src/client/odbc/dictionary/DictCatalog.cpp b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.cpp index 433347c9a70..433347c9a70 100644 --- a/ndb/src/client/odbc/dictionary/DictCatalog.cpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.cpp diff --git a/ndb/src/client/odbc/dictionary/DictCatalog.hpp b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.hpp index 5452990a51b..5452990a51b 100644 --- a/ndb/src/client/odbc/dictionary/DictCatalog.hpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictCatalog.hpp diff --git a/ndb/src/client/odbc/dictionary/DictColumn.cpp b/ndb/src/old_files/client/odbc/dictionary/DictColumn.cpp index fa0128f1ddb..fa0128f1ddb 100644 --- a/ndb/src/client/odbc/dictionary/DictColumn.cpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictColumn.cpp diff --git a/ndb/src/client/odbc/dictionary/DictColumn.hpp b/ndb/src/old_files/client/odbc/dictionary/DictColumn.hpp index 945fb86367b..945fb86367b 100644 --- a/ndb/src/client/odbc/dictionary/DictColumn.hpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictColumn.hpp diff --git a/ndb/src/client/odbc/dictionary/DictIndex.cpp b/ndb/src/old_files/client/odbc/dictionary/DictIndex.cpp index 95d93318902..95d93318902 100644 --- a/ndb/src/client/odbc/dictionary/DictIndex.cpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictIndex.cpp diff --git a/ndb/src/client/odbc/dictionary/DictIndex.hpp b/ndb/src/old_files/client/odbc/dictionary/DictIndex.hpp index 7ba46daaae3..7ba46daaae3 100644 --- a/ndb/src/client/odbc/dictionary/DictIndex.hpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictIndex.hpp diff --git a/ndb/src/client/odbc/dictionary/DictSchema.cpp b/ndb/src/old_files/client/odbc/dictionary/DictSchema.cpp index 91939cb2f26..91939cb2f26 100644 --- a/ndb/src/client/odbc/dictionary/DictSchema.cpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictSchema.cpp diff --git a/ndb/src/client/odbc/dictionary/DictSchema.hpp b/ndb/src/old_files/client/odbc/dictionary/DictSchema.hpp index 099352edbb9..099352edbb9 100644 --- a/ndb/src/client/odbc/dictionary/DictSchema.hpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictSchema.hpp diff --git a/ndb/src/client/odbc/dictionary/DictSys.cpp b/ndb/src/old_files/client/odbc/dictionary/DictSys.cpp index 1ceef66ee57..1ceef66ee57 100644 --- a/ndb/src/client/odbc/dictionary/DictSys.cpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictSys.cpp diff --git a/ndb/src/client/odbc/dictionary/DictSys.hpp b/ndb/src/old_files/client/odbc/dictionary/DictSys.hpp index e6fa661fd59..e6fa661fd59 100644 --- a/ndb/src/client/odbc/dictionary/DictSys.hpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictSys.hpp diff --git a/ndb/src/client/odbc/dictionary/DictTable.cpp b/ndb/src/old_files/client/odbc/dictionary/DictTable.cpp index 4db7d3b3aec..4db7d3b3aec 100644 --- a/ndb/src/client/odbc/dictionary/DictTable.cpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictTable.cpp diff --git a/ndb/src/client/odbc/dictionary/DictTable.hpp b/ndb/src/old_files/client/odbc/dictionary/DictTable.hpp index 5cecfff9562..5cecfff9562 100644 --- a/ndb/src/client/odbc/dictionary/DictTable.hpp +++ b/ndb/src/old_files/client/odbc/dictionary/DictTable.hpp diff --git a/ndb/src/client/odbc/dictionary/Makefile b/ndb/src/old_files/client/odbc/dictionary/Makefile index cdfd3b6ea0c..cdfd3b6ea0c 100644 --- a/ndb/src/client/odbc/dictionary/Makefile +++ b/ndb/src/old_files/client/odbc/dictionary/Makefile diff --git a/ndb/src/client/odbc/docs/class.fig b/ndb/src/old_files/client/odbc/docs/class.fig index 38c24c1fba4..38c24c1fba4 100644 --- a/ndb/src/client/odbc/docs/class.fig +++ b/ndb/src/old_files/client/odbc/docs/class.fig diff --git a/ndb/src/client/odbc/docs/descfield.pl b/ndb/src/old_files/client/odbc/docs/descfield.pl index 80fef22f303..80fef22f303 100644 --- a/ndb/src/client/odbc/docs/descfield.pl +++ b/ndb/src/old_files/client/odbc/docs/descfield.pl diff --git a/ndb/src/client/odbc/docs/diag.txt b/ndb/src/old_files/client/odbc/docs/diag.txt index a9a0e0f42d0..a9a0e0f42d0 100644 --- a/ndb/src/client/odbc/docs/diag.txt +++ b/ndb/src/old_files/client/odbc/docs/diag.txt diff --git a/ndb/src/client/odbc/docs/getinfo.pl b/ndb/src/old_files/client/odbc/docs/getinfo.pl index 34e26b47bab..34e26b47bab 100644 --- a/ndb/src/client/odbc/docs/getinfo.pl +++ b/ndb/src/old_files/client/odbc/docs/getinfo.pl diff --git a/ndb/src/client/odbc/docs/gettypeinfo.pl b/ndb/src/old_files/client/odbc/docs/gettypeinfo.pl index 0a999fd7249..0a999fd7249 100644 --- a/ndb/src/client/odbc/docs/gettypeinfo.pl +++ b/ndb/src/old_files/client/odbc/docs/gettypeinfo.pl diff --git a/ndb/src/client/odbc/docs/handleattr.pl b/ndb/src/old_files/client/odbc/docs/handleattr.pl index 892d34b105b..892d34b105b 100644 --- a/ndb/src/client/odbc/docs/handleattr.pl +++ b/ndb/src/old_files/client/odbc/docs/handleattr.pl diff --git a/ndb/src/client/odbc/docs/main.hpp b/ndb/src/old_files/client/odbc/docs/main.hpp index ebb5b1f235a..ebb5b1f235a 100644 --- a/ndb/src/client/odbc/docs/main.hpp +++ b/ndb/src/old_files/client/odbc/docs/main.hpp diff --git a/ndb/src/client/odbc/docs/ndbodbc.html b/ndb/src/old_files/client/odbc/docs/ndbodbc.html index 6be624dfa1b..6be624dfa1b 100644 --- a/ndb/src/client/odbc/docs/ndbodbc.html +++ b/ndb/src/old_files/client/odbc/docs/ndbodbc.html diff --git a/ndb/src/client/odbc/docs/select.fig b/ndb/src/old_files/client/odbc/docs/select.fig index 4f51a2085b4..4f51a2085b4 100644 --- a/ndb/src/client/odbc/docs/select.fig +++ b/ndb/src/old_files/client/odbc/docs/select.fig diff --git a/ndb/src/client/odbc/docs/systables.pl b/ndb/src/old_files/client/odbc/docs/systables.pl index 728d966a7a4..728d966a7a4 100644 --- a/ndb/src/client/odbc/docs/systables.pl +++ b/ndb/src/old_files/client/odbc/docs/systables.pl diff --git a/ndb/src/client/odbc/docs/type.txt b/ndb/src/old_files/client/odbc/docs/type.txt index d7b391afc55..d7b391afc55 100644 --- a/ndb/src/client/odbc/docs/type.txt +++ b/ndb/src/old_files/client/odbc/docs/type.txt diff --git a/ndb/src/client/odbc/driver/Func.data b/ndb/src/old_files/client/odbc/driver/Func.data index c32671e1135..c32671e1135 100644 --- a/ndb/src/client/odbc/driver/Func.data +++ b/ndb/src/old_files/client/odbc/driver/Func.data diff --git a/ndb/src/client/odbc/driver/Func.pl b/ndb/src/old_files/client/odbc/driver/Func.pl index 1064a6a6c6e..1064a6a6c6e 100644 --- a/ndb/src/client/odbc/driver/Func.pl +++ b/ndb/src/old_files/client/odbc/driver/Func.pl diff --git a/ndb/src/client/odbc/driver/Makefile b/ndb/src/old_files/client/odbc/driver/Makefile index 62f82371da4..62f82371da4 100644 --- a/ndb/src/client/odbc/driver/Makefile +++ b/ndb/src/old_files/client/odbc/driver/Makefile diff --git a/ndb/src/client/odbc/driver/SQLAllocConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp index a7ffd8c89d1..a7ffd8c89d1 100644 --- a/ndb/src/client/odbc/driver/SQLAllocConnect.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLAllocConnect.cpp diff --git a/ndb/src/client/odbc/driver/SQLAllocEnv.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp index a62dae61008..a62dae61008 100644 --- a/ndb/src/client/odbc/driver/SQLAllocEnv.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLAllocEnv.cpp diff --git a/ndb/src/client/odbc/driver/SQLAllocHandle.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp index 9daf6ead946..9daf6ead946 100644 --- a/ndb/src/client/odbc/driver/SQLAllocHandle.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLAllocHandle.cpp diff --git a/ndb/src/client/odbc/driver/SQLAllocHandleStd.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp index 61290e37b7b..61290e37b7b 100644 --- a/ndb/src/client/odbc/driver/SQLAllocHandleStd.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLAllocHandleStd.cpp diff --git a/ndb/src/client/odbc/driver/SQLAllocStmt.cpp b/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp index bf3f149f5de..bf3f149f5de 100644 --- a/ndb/src/client/odbc/driver/SQLAllocStmt.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLAllocStmt.cpp diff --git a/ndb/src/client/odbc/driver/SQLBindCol.cpp b/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp index 5562334e8cc..5562334e8cc 100644 --- a/ndb/src/client/odbc/driver/SQLBindCol.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLBindCol.cpp diff --git a/ndb/src/client/odbc/driver/SQLBindParam.cpp b/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp index 2fcc17b872f..2fcc17b872f 100644 --- a/ndb/src/client/odbc/driver/SQLBindParam.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLBindParam.cpp diff --git a/ndb/src/client/odbc/driver/SQLBindParameter.cpp b/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp index e4ca5bbc731..e4ca5bbc731 100644 --- a/ndb/src/client/odbc/driver/SQLBindParameter.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLBindParameter.cpp diff --git a/ndb/src/client/odbc/driver/SQLBrowseConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp index 7e629e199e5..7e629e199e5 100644 --- a/ndb/src/client/odbc/driver/SQLBrowseConnect.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLBrowseConnect.cpp diff --git a/ndb/src/client/odbc/driver/SQLBulkOperations.cpp b/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp index 7d256d66e3f..7d256d66e3f 100644 --- a/ndb/src/client/odbc/driver/SQLBulkOperations.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLBulkOperations.cpp diff --git a/ndb/src/client/odbc/driver/SQLCancel.cpp b/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp index ac4e43c6e89..ac4e43c6e89 100644 --- a/ndb/src/client/odbc/driver/SQLCancel.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLCancel.cpp diff --git a/ndb/src/client/odbc/driver/SQLCloseCursor.cpp b/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp index 26d88c91e3b..26d88c91e3b 100644 --- a/ndb/src/client/odbc/driver/SQLCloseCursor.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLCloseCursor.cpp diff --git a/ndb/src/client/odbc/driver/SQLColAttribute.cpp b/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp index 0e7e5446932..0e7e5446932 100644 --- a/ndb/src/client/odbc/driver/SQLColAttribute.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLColAttribute.cpp diff --git a/ndb/src/client/odbc/driver/SQLColAttributes.cpp b/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp index 05a4c1d4d37..05a4c1d4d37 100644 --- a/ndb/src/client/odbc/driver/SQLColAttributes.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLColAttributes.cpp diff --git a/ndb/src/client/odbc/driver/SQLColumnPrivileges.cpp b/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp index cfbc9c2bc57..cfbc9c2bc57 100644 --- a/ndb/src/client/odbc/driver/SQLColumnPrivileges.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLColumnPrivileges.cpp diff --git a/ndb/src/client/odbc/driver/SQLColumns.cpp b/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp index 4e0b646ee7d..4e0b646ee7d 100644 --- a/ndb/src/client/odbc/driver/SQLColumns.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLColumns.cpp diff --git a/ndb/src/client/odbc/driver/SQLConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp index d8f30ed47e7..d8f30ed47e7 100644 --- a/ndb/src/client/odbc/driver/SQLConnect.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLConnect.cpp diff --git a/ndb/src/client/odbc/driver/SQLCopyDesc.cpp b/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp index b4d4b2e4122..b4d4b2e4122 100644 --- a/ndb/src/client/odbc/driver/SQLCopyDesc.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLCopyDesc.cpp diff --git a/ndb/src/client/odbc/driver/SQLDataSources.cpp b/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp index 6115e7175f9..6115e7175f9 100644 --- a/ndb/src/client/odbc/driver/SQLDataSources.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLDataSources.cpp diff --git a/ndb/src/client/odbc/driver/SQLDescribeCol.cpp b/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp index f15ce8962f1..f15ce8962f1 100644 --- a/ndb/src/client/odbc/driver/SQLDescribeCol.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLDescribeCol.cpp diff --git a/ndb/src/client/odbc/driver/SQLDescribeParam.cpp b/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp index beff41396fe..beff41396fe 100644 --- a/ndb/src/client/odbc/driver/SQLDescribeParam.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLDescribeParam.cpp diff --git a/ndb/src/client/odbc/driver/SQLDisconnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp index 75db5604da8..75db5604da8 100644 --- a/ndb/src/client/odbc/driver/SQLDisconnect.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLDisconnect.cpp diff --git a/ndb/src/client/odbc/driver/SQLDriverConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp index 340babd8523..340babd8523 100644 --- a/ndb/src/client/odbc/driver/SQLDriverConnect.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLDriverConnect.cpp diff --git a/ndb/src/client/odbc/driver/SQLDrivers.cpp b/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp index 9c52f900992..9c52f900992 100644 --- a/ndb/src/client/odbc/driver/SQLDrivers.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLDrivers.cpp diff --git a/ndb/src/client/odbc/driver/SQLEndTran.cpp b/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp index 20b0b2203f5..20b0b2203f5 100644 --- a/ndb/src/client/odbc/driver/SQLEndTran.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLEndTran.cpp diff --git a/ndb/src/client/odbc/driver/SQLError.cpp b/ndb/src/old_files/client/odbc/driver/SQLError.cpp index af78c931d37..af78c931d37 100644 --- a/ndb/src/client/odbc/driver/SQLError.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLError.cpp diff --git a/ndb/src/client/odbc/driver/SQLExecDirect.cpp b/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp index 0ad99d29cd9..0ad99d29cd9 100644 --- a/ndb/src/client/odbc/driver/SQLExecDirect.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLExecDirect.cpp diff --git a/ndb/src/client/odbc/driver/SQLExecute.cpp b/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp index 9c30d418f09..9c30d418f09 100644 --- a/ndb/src/client/odbc/driver/SQLExecute.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLExecute.cpp diff --git a/ndb/src/client/odbc/driver/SQLExtendedFetch.cpp b/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp index e0dd078b5d0..e0dd078b5d0 100644 --- a/ndb/src/client/odbc/driver/SQLExtendedFetch.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLExtendedFetch.cpp diff --git a/ndb/src/client/odbc/driver/SQLFetch.cpp b/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp index addba7b998c..addba7b998c 100644 --- a/ndb/src/client/odbc/driver/SQLFetch.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLFetch.cpp diff --git a/ndb/src/client/odbc/driver/SQLFetchScroll.cpp b/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp index cfbfc813fca..cfbfc813fca 100644 --- a/ndb/src/client/odbc/driver/SQLFetchScroll.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLFetchScroll.cpp diff --git a/ndb/src/client/odbc/driver/SQLForeignKeys.cpp b/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp index 886ac6bdaa5..886ac6bdaa5 100644 --- a/ndb/src/client/odbc/driver/SQLForeignKeys.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLForeignKeys.cpp diff --git a/ndb/src/client/odbc/driver/SQLFreeConnect.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp index 9ac84710cce..9ac84710cce 100644 --- a/ndb/src/client/odbc/driver/SQLFreeConnect.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLFreeConnect.cpp diff --git a/ndb/src/client/odbc/driver/SQLFreeEnv.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp index 7e35056feb5..7e35056feb5 100644 --- a/ndb/src/client/odbc/driver/SQLFreeEnv.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLFreeEnv.cpp diff --git a/ndb/src/client/odbc/driver/SQLFreeHandle.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp index 284463cbb07..284463cbb07 100644 --- a/ndb/src/client/odbc/driver/SQLFreeHandle.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLFreeHandle.cpp diff --git a/ndb/src/client/odbc/driver/SQLFreeStmt.cpp b/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp index 7af6623a37a..7af6623a37a 100644 --- a/ndb/src/client/odbc/driver/SQLFreeStmt.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLFreeStmt.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetConnectAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp index 66c1f3827e1..66c1f3827e1 100644 --- a/ndb/src/client/odbc/driver/SQLGetConnectAttr.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetConnectAttr.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetConnectOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp index 514bedb12b9..514bedb12b9 100644 --- a/ndb/src/client/odbc/driver/SQLGetConnectOption.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetConnectOption.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetCursorName.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp index d54bdf42005..d54bdf42005 100644 --- a/ndb/src/client/odbc/driver/SQLGetCursorName.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetCursorName.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetData.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp index 3b6987c515d..3b6987c515d 100644 --- a/ndb/src/client/odbc/driver/SQLGetData.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetData.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetDescField.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp index 6cc390a58ed..6cc390a58ed 100644 --- a/ndb/src/client/odbc/driver/SQLGetDescField.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetDescField.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetDescRec.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp index c7e9631b075..c7e9631b075 100644 --- a/ndb/src/client/odbc/driver/SQLGetDescRec.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetDescRec.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetDiagField.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp index 3eb34f7ebf6..3eb34f7ebf6 100644 --- a/ndb/src/client/odbc/driver/SQLGetDiagField.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetDiagField.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetDiagRec.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp index 448c5206d76..448c5206d76 100644 --- a/ndb/src/client/odbc/driver/SQLGetDiagRec.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetDiagRec.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetEnvAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp index c93870326e4..c93870326e4 100644 --- a/ndb/src/client/odbc/driver/SQLGetEnvAttr.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetEnvAttr.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetFunctions.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp index 68416fab1a6..68416fab1a6 100644 --- a/ndb/src/client/odbc/driver/SQLGetFunctions.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetFunctions.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetInfo.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp index 8f0a0d67cfa..8f0a0d67cfa 100644 --- a/ndb/src/client/odbc/driver/SQLGetInfo.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetInfo.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetStmtAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp index 990ab68808a..990ab68808a 100644 --- a/ndb/src/client/odbc/driver/SQLGetStmtAttr.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetStmtAttr.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetStmtOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp index 0b5758b1212..0b5758b1212 100644 --- a/ndb/src/client/odbc/driver/SQLGetStmtOption.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetStmtOption.cpp diff --git a/ndb/src/client/odbc/driver/SQLGetTypeInfo.cpp b/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp index e6a016cc400..e6a016cc400 100644 --- a/ndb/src/client/odbc/driver/SQLGetTypeInfo.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLGetTypeInfo.cpp diff --git a/ndb/src/client/odbc/driver/SQLMoreResults.cpp b/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp index d23d653a319..d23d653a319 100644 --- a/ndb/src/client/odbc/driver/SQLMoreResults.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLMoreResults.cpp diff --git a/ndb/src/client/odbc/driver/SQLNativeSql.cpp b/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp index fb8a9bbf3d9..fb8a9bbf3d9 100644 --- a/ndb/src/client/odbc/driver/SQLNativeSql.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLNativeSql.cpp diff --git a/ndb/src/client/odbc/driver/SQLNumParams.cpp b/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp index 7b1a6a07aec..7b1a6a07aec 100644 --- a/ndb/src/client/odbc/driver/SQLNumParams.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLNumParams.cpp diff --git a/ndb/src/client/odbc/driver/SQLNumResultCols.cpp b/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp index 2e70897a9a2..2e70897a9a2 100644 --- a/ndb/src/client/odbc/driver/SQLNumResultCols.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLNumResultCols.cpp diff --git a/ndb/src/client/odbc/driver/SQLParamData.cpp b/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp index 4eb38a010f4..4eb38a010f4 100644 --- a/ndb/src/client/odbc/driver/SQLParamData.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLParamData.cpp diff --git a/ndb/src/client/odbc/driver/SQLParamOptions.cpp b/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp index 59b7dcf7fa9..59b7dcf7fa9 100644 --- a/ndb/src/client/odbc/driver/SQLParamOptions.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLParamOptions.cpp diff --git a/ndb/src/client/odbc/driver/SQLPrepare.cpp b/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp index b1205fa6e3a..b1205fa6e3a 100644 --- a/ndb/src/client/odbc/driver/SQLPrepare.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLPrepare.cpp diff --git a/ndb/src/client/odbc/driver/SQLPrimaryKeys.cpp b/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp index 2d562ae3e19..2d562ae3e19 100644 --- a/ndb/src/client/odbc/driver/SQLPrimaryKeys.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLPrimaryKeys.cpp diff --git a/ndb/src/client/odbc/driver/SQLProcedureColumns.cpp b/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp index 2e42e428b87..2e42e428b87 100644 --- a/ndb/src/client/odbc/driver/SQLProcedureColumns.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLProcedureColumns.cpp diff --git a/ndb/src/client/odbc/driver/SQLProcedures.cpp b/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp index 1f3a9f89073..1f3a9f89073 100644 --- a/ndb/src/client/odbc/driver/SQLProcedures.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLProcedures.cpp diff --git a/ndb/src/client/odbc/driver/SQLPutData.cpp b/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp index a4715a836d2..a4715a836d2 100644 --- a/ndb/src/client/odbc/driver/SQLPutData.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLPutData.cpp diff --git a/ndb/src/client/odbc/driver/SQLRowCount.cpp b/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp index d03f954386a..d03f954386a 100644 --- a/ndb/src/client/odbc/driver/SQLRowCount.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLRowCount.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetConnectAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp index 05bfce5e9cd..05bfce5e9cd 100644 --- a/ndb/src/client/odbc/driver/SQLSetConnectAttr.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetConnectAttr.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetConnectOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp index a4794316971..a4794316971 100644 --- a/ndb/src/client/odbc/driver/SQLSetConnectOption.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetConnectOption.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetCursorName.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp index 291ad817d42..291ad817d42 100644 --- a/ndb/src/client/odbc/driver/SQLSetCursorName.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetCursorName.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetDescField.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp index 19d34c2f46d..19d34c2f46d 100644 --- a/ndb/src/client/odbc/driver/SQLSetDescField.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetDescField.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetDescRec.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp index 80a00514a51..80a00514a51 100644 --- a/ndb/src/client/odbc/driver/SQLSetDescRec.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetDescRec.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetEnvAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp index 86364eac5e8..86364eac5e8 100644 --- a/ndb/src/client/odbc/driver/SQLSetEnvAttr.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetEnvAttr.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetParam.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp index 03bde1076d8..03bde1076d8 100644 --- a/ndb/src/client/odbc/driver/SQLSetParam.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetParam.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetPos.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp index 653030f90bc..653030f90bc 100644 --- a/ndb/src/client/odbc/driver/SQLSetPos.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetPos.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetScrollOptions.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp index a5e89d8568b..a5e89d8568b 100644 --- a/ndb/src/client/odbc/driver/SQLSetScrollOptions.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetScrollOptions.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetStmtAttr.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp index 9ed6a83b563..9ed6a83b563 100644 --- a/ndb/src/client/odbc/driver/SQLSetStmtAttr.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetStmtAttr.cpp diff --git a/ndb/src/client/odbc/driver/SQLSetStmtOption.cpp b/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp index b403fc8408c..b403fc8408c 100644 --- a/ndb/src/client/odbc/driver/SQLSetStmtOption.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSetStmtOption.cpp diff --git a/ndb/src/client/odbc/driver/SQLSpecialColumns.cpp b/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp index 5dd92c86053..5dd92c86053 100644 --- a/ndb/src/client/odbc/driver/SQLSpecialColumns.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLSpecialColumns.cpp diff --git a/ndb/src/client/odbc/driver/SQLStatistics.cpp b/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp index 941fb6249a5..941fb6249a5 100644 --- a/ndb/src/client/odbc/driver/SQLStatistics.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLStatistics.cpp diff --git a/ndb/src/client/odbc/driver/SQLTablePrivileges.cpp b/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp index 23c6ad9fc4b..23c6ad9fc4b 100644 --- a/ndb/src/client/odbc/driver/SQLTablePrivileges.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLTablePrivileges.cpp diff --git a/ndb/src/client/odbc/driver/SQLTables.cpp b/ndb/src/old_files/client/odbc/driver/SQLTables.cpp index b2496bfba87..b2496bfba87 100644 --- a/ndb/src/client/odbc/driver/SQLTables.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLTables.cpp diff --git a/ndb/src/client/odbc/driver/SQLTransact.cpp b/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp index da8b46b1596..da8b46b1596 100644 --- a/ndb/src/client/odbc/driver/SQLTransact.cpp +++ b/ndb/src/old_files/client/odbc/driver/SQLTransact.cpp diff --git a/ndb/src/client/odbc/driver/driver.cpp b/ndb/src/old_files/client/odbc/driver/driver.cpp index f992fa70878..f992fa70878 100644 --- a/ndb/src/client/odbc/driver/driver.cpp +++ b/ndb/src/old_files/client/odbc/driver/driver.cpp diff --git a/ndb/src/client/odbc/driver/driver.hpp b/ndb/src/old_files/client/odbc/driver/driver.hpp index 96d2e052c0d..96d2e052c0d 100644 --- a/ndb/src/client/odbc/driver/driver.hpp +++ b/ndb/src/old_files/client/odbc/driver/driver.hpp diff --git a/ndb/src/client/odbc/executor/Exec_comp_op.cpp b/ndb/src/old_files/client/odbc/executor/Exec_comp_op.cpp index 40d3950a592..40d3950a592 100644 --- a/ndb/src/client/odbc/executor/Exec_comp_op.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_comp_op.cpp diff --git a/ndb/src/client/odbc/executor/Exec_create_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_create_index.cpp index 3966c6d5db2..3966c6d5db2 100644 --- a/ndb/src/client/odbc/executor/Exec_create_index.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_create_index.cpp diff --git a/ndb/src/client/odbc/executor/Exec_create_table.cpp b/ndb/src/old_files/client/odbc/executor/Exec_create_table.cpp index d6274119371..d6274119371 100644 --- a/ndb/src/client/odbc/executor/Exec_create_table.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_create_table.cpp diff --git a/ndb/src/client/odbc/executor/Exec_delete_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_delete_index.cpp index 10814654a58..10814654a58 100644 --- a/ndb/src/client/odbc/executor/Exec_delete_index.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_delete_index.cpp diff --git a/ndb/src/client/odbc/executor/Exec_delete_lookup.cpp b/ndb/src/old_files/client/odbc/executor/Exec_delete_lookup.cpp index d0795286122..d0795286122 100644 --- a/ndb/src/client/odbc/executor/Exec_delete_lookup.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_delete_lookup.cpp diff --git a/ndb/src/client/odbc/executor/Exec_delete_scan.cpp b/ndb/src/old_files/client/odbc/executor/Exec_delete_scan.cpp index a0b3b8314b8..a0b3b8314b8 100644 --- a/ndb/src/client/odbc/executor/Exec_delete_scan.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_delete_scan.cpp diff --git a/ndb/src/client/odbc/executor/Exec_drop_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_drop_index.cpp index 6bf451f6911..6bf451f6911 100644 --- a/ndb/src/client/odbc/executor/Exec_drop_index.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_drop_index.cpp diff --git a/ndb/src/client/odbc/executor/Exec_drop_table.cpp b/ndb/src/old_files/client/odbc/executor/Exec_drop_table.cpp index 40d1d42fc61..40d1d42fc61 100644 --- a/ndb/src/client/odbc/executor/Exec_drop_table.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_drop_table.cpp diff --git a/ndb/src/client/odbc/executor/Exec_expr_conv.cpp b/ndb/src/old_files/client/odbc/executor/Exec_expr_conv.cpp index 636bfda7d59..636bfda7d59 100644 --- a/ndb/src/client/odbc/executor/Exec_expr_conv.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_expr_conv.cpp diff --git a/ndb/src/client/odbc/executor/Exec_expr_func.cpp b/ndb/src/old_files/client/odbc/executor/Exec_expr_func.cpp index 093d15c6e2b..093d15c6e2b 100644 --- a/ndb/src/client/odbc/executor/Exec_expr_func.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_expr_func.cpp diff --git a/ndb/src/client/odbc/executor/Exec_expr_op.cpp b/ndb/src/old_files/client/odbc/executor/Exec_expr_op.cpp index fc8b6df9f5b..fc8b6df9f5b 100644 --- a/ndb/src/client/odbc/executor/Exec_expr_op.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_expr_op.cpp diff --git a/ndb/src/client/odbc/executor/Exec_insert.cpp b/ndb/src/old_files/client/odbc/executor/Exec_insert.cpp index c2612c6aaab..c2612c6aaab 100644 --- a/ndb/src/client/odbc/executor/Exec_insert.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_insert.cpp diff --git a/ndb/src/client/odbc/executor/Exec_pred_op.cpp b/ndb/src/old_files/client/odbc/executor/Exec_pred_op.cpp index 7caa4656473..7caa4656473 100644 --- a/ndb/src/client/odbc/executor/Exec_pred_op.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_pred_op.cpp diff --git a/ndb/src/client/odbc/executor/Exec_query_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_index.cpp index 919743beac2..919743beac2 100644 --- a/ndb/src/client/odbc/executor/Exec_query_index.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_query_index.cpp diff --git a/ndb/src/client/odbc/executor/Exec_query_lookup.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_lookup.cpp index 599e1a36461..599e1a36461 100644 --- a/ndb/src/client/odbc/executor/Exec_query_lookup.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_query_lookup.cpp diff --git a/ndb/src/client/odbc/executor/Exec_query_range.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_range.cpp index 0bc878d760d..0bc878d760d 100644 --- a/ndb/src/client/odbc/executor/Exec_query_range.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_query_range.cpp diff --git a/ndb/src/client/odbc/executor/Exec_query_scan.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_scan.cpp index 213dfdd616d..213dfdd616d 100644 --- a/ndb/src/client/odbc/executor/Exec_query_scan.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_query_scan.cpp diff --git a/ndb/src/client/odbc/executor/Exec_query_sys.cpp b/ndb/src/old_files/client/odbc/executor/Exec_query_sys.cpp index acdc120e609..acdc120e609 100644 --- a/ndb/src/client/odbc/executor/Exec_query_sys.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_query_sys.cpp diff --git a/ndb/src/client/odbc/executor/Exec_update_index.cpp b/ndb/src/old_files/client/odbc/executor/Exec_update_index.cpp index 35b6159d8ca..35b6159d8ca 100644 --- a/ndb/src/client/odbc/executor/Exec_update_index.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_update_index.cpp diff --git a/ndb/src/client/odbc/executor/Exec_update_lookup.cpp b/ndb/src/old_files/client/odbc/executor/Exec_update_lookup.cpp index 2c801372de3..2c801372de3 100644 --- a/ndb/src/client/odbc/executor/Exec_update_lookup.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_update_lookup.cpp diff --git a/ndb/src/client/odbc/executor/Exec_update_scan.cpp b/ndb/src/old_files/client/odbc/executor/Exec_update_scan.cpp index a36fdd27142..a36fdd27142 100644 --- a/ndb/src/client/odbc/executor/Exec_update_scan.cpp +++ b/ndb/src/old_files/client/odbc/executor/Exec_update_scan.cpp diff --git a/ndb/src/client/odbc/executor/Executor.cpp b/ndb/src/old_files/client/odbc/executor/Executor.cpp index adabb28a4a5..adabb28a4a5 100644 --- a/ndb/src/client/odbc/executor/Executor.cpp +++ b/ndb/src/old_files/client/odbc/executor/Executor.cpp diff --git a/ndb/src/client/odbc/executor/Executor.hpp b/ndb/src/old_files/client/odbc/executor/Executor.hpp index 5edb9d509ac..5edb9d509ac 100644 --- a/ndb/src/client/odbc/executor/Executor.hpp +++ b/ndb/src/old_files/client/odbc/executor/Executor.hpp diff --git a/ndb/src/client/odbc/executor/Makefile b/ndb/src/old_files/client/odbc/executor/Makefile index d86781e212c..d86781e212c 100644 --- a/ndb/src/client/odbc/executor/Makefile +++ b/ndb/src/old_files/client/odbc/executor/Makefile diff --git a/ndb/src/client/odbc/handles/AttrDbc.cpp b/ndb/src/old_files/client/odbc/handles/AttrDbc.cpp index 4768a8995a2..4768a8995a2 100644 --- a/ndb/src/client/odbc/handles/AttrDbc.cpp +++ b/ndb/src/old_files/client/odbc/handles/AttrDbc.cpp diff --git a/ndb/src/client/odbc/handles/AttrEnv.cpp b/ndb/src/old_files/client/odbc/handles/AttrEnv.cpp index 3d57fddeb57..3d57fddeb57 100644 --- a/ndb/src/client/odbc/handles/AttrEnv.cpp +++ b/ndb/src/old_files/client/odbc/handles/AttrEnv.cpp diff --git a/ndb/src/client/odbc/handles/AttrRoot.cpp b/ndb/src/old_files/client/odbc/handles/AttrRoot.cpp index d1b264835b6..d1b264835b6 100644 --- a/ndb/src/client/odbc/handles/AttrRoot.cpp +++ b/ndb/src/old_files/client/odbc/handles/AttrRoot.cpp diff --git a/ndb/src/client/odbc/handles/AttrStmt.cpp b/ndb/src/old_files/client/odbc/handles/AttrStmt.cpp index ce9a9c03fd1..ce9a9c03fd1 100644 --- a/ndb/src/client/odbc/handles/AttrStmt.cpp +++ b/ndb/src/old_files/client/odbc/handles/AttrStmt.cpp diff --git a/ndb/src/client/odbc/handles/DescSpec.cpp b/ndb/src/old_files/client/odbc/handles/DescSpec.cpp index 83905cf9822..83905cf9822 100644 --- a/ndb/src/client/odbc/handles/DescSpec.cpp +++ b/ndb/src/old_files/client/odbc/handles/DescSpec.cpp diff --git a/ndb/src/client/odbc/handles/FuncTab.cpp b/ndb/src/old_files/client/odbc/handles/FuncTab.cpp index 6bd744d7a7f..6bd744d7a7f 100644 --- a/ndb/src/client/odbc/handles/FuncTab.cpp +++ b/ndb/src/old_files/client/odbc/handles/FuncTab.cpp diff --git a/ndb/src/client/odbc/handles/HandleBase.cpp b/ndb/src/old_files/client/odbc/handles/HandleBase.cpp index 27379cdc3f8..27379cdc3f8 100644 --- a/ndb/src/client/odbc/handles/HandleBase.cpp +++ b/ndb/src/old_files/client/odbc/handles/HandleBase.cpp diff --git a/ndb/src/client/odbc/handles/HandleBase.hpp b/ndb/src/old_files/client/odbc/handles/HandleBase.hpp index fc35c2b559b..fc35c2b559b 100644 --- a/ndb/src/client/odbc/handles/HandleBase.hpp +++ b/ndb/src/old_files/client/odbc/handles/HandleBase.hpp diff --git a/ndb/src/client/odbc/handles/HandleDbc.cpp b/ndb/src/old_files/client/odbc/handles/HandleDbc.cpp index 2d5ded2cc21..2d5ded2cc21 100644 --- a/ndb/src/client/odbc/handles/HandleDbc.cpp +++ b/ndb/src/old_files/client/odbc/handles/HandleDbc.cpp diff --git a/ndb/src/client/odbc/handles/HandleDbc.hpp b/ndb/src/old_files/client/odbc/handles/HandleDbc.hpp index 130df08d02c..130df08d02c 100644 --- a/ndb/src/client/odbc/handles/HandleDbc.hpp +++ b/ndb/src/old_files/client/odbc/handles/HandleDbc.hpp diff --git a/ndb/src/client/odbc/handles/HandleDesc.cpp b/ndb/src/old_files/client/odbc/handles/HandleDesc.cpp index 4cff1bb8892..4cff1bb8892 100644 --- a/ndb/src/client/odbc/handles/HandleDesc.cpp +++ b/ndb/src/old_files/client/odbc/handles/HandleDesc.cpp diff --git a/ndb/src/client/odbc/handles/HandleDesc.hpp b/ndb/src/old_files/client/odbc/handles/HandleDesc.hpp index 9419697f134..9419697f134 100644 --- a/ndb/src/client/odbc/handles/HandleDesc.hpp +++ b/ndb/src/old_files/client/odbc/handles/HandleDesc.hpp diff --git a/ndb/src/client/odbc/handles/HandleEnv.cpp b/ndb/src/old_files/client/odbc/handles/HandleEnv.cpp index bc9d8b420a6..bc9d8b420a6 100644 --- a/ndb/src/client/odbc/handles/HandleEnv.cpp +++ b/ndb/src/old_files/client/odbc/handles/HandleEnv.cpp diff --git a/ndb/src/client/odbc/handles/HandleEnv.hpp b/ndb/src/old_files/client/odbc/handles/HandleEnv.hpp index 2b13b0256bc..2b13b0256bc 100644 --- a/ndb/src/client/odbc/handles/HandleEnv.hpp +++ b/ndb/src/old_files/client/odbc/handles/HandleEnv.hpp diff --git a/ndb/src/client/odbc/handles/HandleRoot.cpp b/ndb/src/old_files/client/odbc/handles/HandleRoot.cpp index 13560d55028..13560d55028 100644 --- a/ndb/src/client/odbc/handles/HandleRoot.cpp +++ b/ndb/src/old_files/client/odbc/handles/HandleRoot.cpp diff --git a/ndb/src/client/odbc/handles/HandleRoot.hpp b/ndb/src/old_files/client/odbc/handles/HandleRoot.hpp index 08a22b3e400..08a22b3e400 100644 --- a/ndb/src/client/odbc/handles/HandleRoot.hpp +++ b/ndb/src/old_files/client/odbc/handles/HandleRoot.hpp diff --git a/ndb/src/client/odbc/handles/HandleStmt.cpp b/ndb/src/old_files/client/odbc/handles/HandleStmt.cpp index d33d33dbd5b..d33d33dbd5b 100644 --- a/ndb/src/client/odbc/handles/HandleStmt.cpp +++ b/ndb/src/old_files/client/odbc/handles/HandleStmt.cpp diff --git a/ndb/src/client/odbc/handles/HandleStmt.hpp b/ndb/src/old_files/client/odbc/handles/HandleStmt.hpp index 0bee138bfc6..0bee138bfc6 100644 --- a/ndb/src/client/odbc/handles/HandleStmt.hpp +++ b/ndb/src/old_files/client/odbc/handles/HandleStmt.hpp diff --git a/ndb/src/client/odbc/handles/InfoTab.cpp b/ndb/src/old_files/client/odbc/handles/InfoTab.cpp index 1a93c4da264..1a93c4da264 100644 --- a/ndb/src/client/odbc/handles/InfoTab.cpp +++ b/ndb/src/old_files/client/odbc/handles/InfoTab.cpp diff --git a/ndb/src/client/odbc/handles/Makefile b/ndb/src/old_files/client/odbc/handles/Makefile index d37e7d286ba..d37e7d286ba 100644 --- a/ndb/src/client/odbc/handles/Makefile +++ b/ndb/src/old_files/client/odbc/handles/Makefile diff --git a/ndb/src/client/odbc/handles/PoolNdb.cpp b/ndb/src/old_files/client/odbc/handles/PoolNdb.cpp index 45d3c67ec77..45d3c67ec77 100644 --- a/ndb/src/client/odbc/handles/PoolNdb.cpp +++ b/ndb/src/old_files/client/odbc/handles/PoolNdb.cpp diff --git a/ndb/src/client/odbc/handles/PoolNdb.hpp b/ndb/src/old_files/client/odbc/handles/PoolNdb.hpp index 35eac055c30..35eac055c30 100644 --- a/ndb/src/client/odbc/handles/PoolNdb.hpp +++ b/ndb/src/old_files/client/odbc/handles/PoolNdb.hpp diff --git a/ndb/src/client/odbc/handles/handles.hpp b/ndb/src/old_files/client/odbc/handles/handles.hpp index a9f0fcae888..a9f0fcae888 100644 --- a/ndb/src/client/odbc/handles/handles.hpp +++ b/ndb/src/old_files/client/odbc/handles/handles.hpp diff --git a/ndb/src/newtonapi/Makefile b/ndb/src/old_files/newtonapi/Makefile index bed179046a5..bed179046a5 100644 --- a/ndb/src/newtonapi/Makefile +++ b/ndb/src/old_files/newtonapi/Makefile diff --git a/ndb/src/newtonapi/dba_binding.cpp b/ndb/src/old_files/newtonapi/dba_binding.cpp index 63e48110b1d..63e48110b1d 100644 --- a/ndb/src/newtonapi/dba_binding.cpp +++ b/ndb/src/old_files/newtonapi/dba_binding.cpp diff --git a/ndb/src/newtonapi/dba_bulkread.cpp b/ndb/src/old_files/newtonapi/dba_bulkread.cpp index 1f75037046b..1f75037046b 100644 --- a/ndb/src/newtonapi/dba_bulkread.cpp +++ b/ndb/src/old_files/newtonapi/dba_bulkread.cpp diff --git a/ndb/src/newtonapi/dba_config.cpp b/ndb/src/old_files/newtonapi/dba_config.cpp index d84386a9438..d84386a9438 100644 --- a/ndb/src/newtonapi/dba_config.cpp +++ b/ndb/src/old_files/newtonapi/dba_config.cpp diff --git a/ndb/src/newtonapi/dba_dac.cpp b/ndb/src/old_files/newtonapi/dba_dac.cpp index fcb4e676e46..fcb4e676e46 100644 --- a/ndb/src/newtonapi/dba_dac.cpp +++ b/ndb/src/old_files/newtonapi/dba_dac.cpp diff --git a/ndb/src/newtonapi/dba_error.cpp b/ndb/src/old_files/newtonapi/dba_error.cpp index f05446522b0..f05446522b0 100644 --- a/ndb/src/newtonapi/dba_error.cpp +++ b/ndb/src/old_files/newtonapi/dba_error.cpp diff --git a/ndb/src/newtonapi/dba_init.cpp b/ndb/src/old_files/newtonapi/dba_init.cpp index aa5fef1171c..aa5fef1171c 100644 --- a/ndb/src/newtonapi/dba_init.cpp +++ b/ndb/src/old_files/newtonapi/dba_init.cpp diff --git a/ndb/src/newtonapi/dba_internal.hpp b/ndb/src/old_files/newtonapi/dba_internal.hpp index 84ae7ba222b..84ae7ba222b 100644 --- a/ndb/src/newtonapi/dba_internal.hpp +++ b/ndb/src/old_files/newtonapi/dba_internal.hpp diff --git a/ndb/src/newtonapi/dba_process.cpp b/ndb/src/old_files/newtonapi/dba_process.cpp index ddb6e62f180..ddb6e62f180 100644 --- a/ndb/src/newtonapi/dba_process.cpp +++ b/ndb/src/old_files/newtonapi/dba_process.cpp diff --git a/ndb/src/newtonapi/dba_process.hpp b/ndb/src/old_files/newtonapi/dba_process.hpp index ef24fbd9142..ef24fbd9142 100644 --- a/ndb/src/newtonapi/dba_process.hpp +++ b/ndb/src/old_files/newtonapi/dba_process.hpp diff --git a/ndb/src/newtonapi/dba_schema.cpp b/ndb/src/old_files/newtonapi/dba_schema.cpp index 1bf21f1fe80..1bf21f1fe80 100644 --- a/ndb/src/newtonapi/dba_schema.cpp +++ b/ndb/src/old_files/newtonapi/dba_schema.cpp diff --git a/ndb/src/rep/ExtSender.cpp b/ndb/src/old_files/rep/ExtSender.cpp index cf31001a85f..cf31001a85f 100644 --- a/ndb/src/rep/ExtSender.cpp +++ b/ndb/src/old_files/rep/ExtSender.cpp diff --git a/ndb/src/rep/ExtSender.hpp b/ndb/src/old_files/rep/ExtSender.hpp index 0bdabd68f37..0bdabd68f37 100644 --- a/ndb/src/rep/ExtSender.hpp +++ b/ndb/src/old_files/rep/ExtSender.hpp diff --git a/ndb/src/rep/Makefile b/ndb/src/old_files/rep/Makefile index 9688a68ec74..9688a68ec74 100644 --- a/ndb/src/rep/Makefile +++ b/ndb/src/old_files/rep/Makefile diff --git a/ndb/src/rep/NodeConnectInfo.hpp b/ndb/src/old_files/rep/NodeConnectInfo.hpp index 403f92a5999..403f92a5999 100644 --- a/ndb/src/rep/NodeConnectInfo.hpp +++ b/ndb/src/old_files/rep/NodeConnectInfo.hpp diff --git a/ndb/src/rep/README b/ndb/src/old_files/rep/README index 7be5e230eb3..7be5e230eb3 100644 --- a/ndb/src/rep/README +++ b/ndb/src/old_files/rep/README diff --git a/ndb/src/rep/RepApiInterpreter.cpp b/ndb/src/old_files/rep/RepApiInterpreter.cpp index 6e6f150713a..6e6f150713a 100644 --- a/ndb/src/rep/RepApiInterpreter.cpp +++ b/ndb/src/old_files/rep/RepApiInterpreter.cpp diff --git a/ndb/src/rep/RepApiInterpreter.hpp b/ndb/src/old_files/rep/RepApiInterpreter.hpp index 78f190156b3..78f190156b3 100644 --- a/ndb/src/rep/RepApiInterpreter.hpp +++ b/ndb/src/old_files/rep/RepApiInterpreter.hpp diff --git a/ndb/src/rep/RepApiService.cpp b/ndb/src/old_files/rep/RepApiService.cpp index d07f7a59375..d07f7a59375 100644 --- a/ndb/src/rep/RepApiService.cpp +++ b/ndb/src/old_files/rep/RepApiService.cpp diff --git a/ndb/src/rep/RepApiService.hpp b/ndb/src/old_files/rep/RepApiService.hpp index e1137e53258..e1137e53258 100644 --- a/ndb/src/rep/RepApiService.hpp +++ b/ndb/src/old_files/rep/RepApiService.hpp diff --git a/ndb/src/rep/RepCommandInterpreter.cpp b/ndb/src/old_files/rep/RepCommandInterpreter.cpp index a0daf9529ab..a0daf9529ab 100644 --- a/ndb/src/rep/RepCommandInterpreter.cpp +++ b/ndb/src/old_files/rep/RepCommandInterpreter.cpp diff --git a/ndb/src/rep/RepCommandInterpreter.hpp b/ndb/src/old_files/rep/RepCommandInterpreter.hpp index 398a7c0318c..398a7c0318c 100644 --- a/ndb/src/rep/RepCommandInterpreter.hpp +++ b/ndb/src/old_files/rep/RepCommandInterpreter.hpp diff --git a/ndb/src/rep/RepComponents.cpp b/ndb/src/old_files/rep/RepComponents.cpp index 04b2e0e5fa5..04b2e0e5fa5 100644 --- a/ndb/src/rep/RepComponents.cpp +++ b/ndb/src/old_files/rep/RepComponents.cpp diff --git a/ndb/src/rep/RepComponents.hpp b/ndb/src/old_files/rep/RepComponents.hpp index ff0f29e2128..ff0f29e2128 100644 --- a/ndb/src/rep/RepComponents.hpp +++ b/ndb/src/old_files/rep/RepComponents.hpp diff --git a/ndb/src/rep/RepMain.cpp b/ndb/src/old_files/rep/RepMain.cpp index d9f057be9a1..d9f057be9a1 100644 --- a/ndb/src/rep/RepMain.cpp +++ b/ndb/src/old_files/rep/RepMain.cpp diff --git a/ndb/src/rep/Requestor.cpp b/ndb/src/old_files/rep/Requestor.cpp index 3c93a6394a4..3c93a6394a4 100644 --- a/ndb/src/rep/Requestor.cpp +++ b/ndb/src/old_files/rep/Requestor.cpp diff --git a/ndb/src/rep/Requestor.hpp b/ndb/src/old_files/rep/Requestor.hpp index 735d2094bde..735d2094bde 100644 --- a/ndb/src/rep/Requestor.hpp +++ b/ndb/src/old_files/rep/Requestor.hpp diff --git a/ndb/src/rep/RequestorSubscriptions.cpp b/ndb/src/old_files/rep/RequestorSubscriptions.cpp index 75b41fae037..75b41fae037 100644 --- a/ndb/src/rep/RequestorSubscriptions.cpp +++ b/ndb/src/old_files/rep/RequestorSubscriptions.cpp diff --git a/ndb/src/rep/SignalQueue.cpp b/ndb/src/old_files/rep/SignalQueue.cpp index 9b356a14b7d..9b356a14b7d 100644 --- a/ndb/src/rep/SignalQueue.cpp +++ b/ndb/src/old_files/rep/SignalQueue.cpp diff --git a/ndb/src/rep/SignalQueue.hpp b/ndb/src/old_files/rep/SignalQueue.hpp index 697bca85893..697bca85893 100644 --- a/ndb/src/rep/SignalQueue.hpp +++ b/ndb/src/old_files/rep/SignalQueue.hpp diff --git a/ndb/src/rep/TODO b/ndb/src/old_files/rep/TODO index a2462fae6cd..a2462fae6cd 100644 --- a/ndb/src/rep/TODO +++ b/ndb/src/old_files/rep/TODO diff --git a/ndb/src/rep/adapters/AppNDB.cpp b/ndb/src/old_files/rep/adapters/AppNDB.cpp index 05f6d52807f..05f6d52807f 100644 --- a/ndb/src/rep/adapters/AppNDB.cpp +++ b/ndb/src/old_files/rep/adapters/AppNDB.cpp diff --git a/ndb/src/rep/adapters/AppNDB.hpp b/ndb/src/old_files/rep/adapters/AppNDB.hpp index 9563a1e41ab..9563a1e41ab 100644 --- a/ndb/src/rep/adapters/AppNDB.hpp +++ b/ndb/src/old_files/rep/adapters/AppNDB.hpp diff --git a/ndb/src/rep/adapters/ExtAPI.cpp b/ndb/src/old_files/rep/adapters/ExtAPI.cpp index 0dcd1e85465..0dcd1e85465 100644 --- a/ndb/src/rep/adapters/ExtAPI.cpp +++ b/ndb/src/old_files/rep/adapters/ExtAPI.cpp diff --git a/ndb/src/rep/adapters/ExtAPI.hpp b/ndb/src/old_files/rep/adapters/ExtAPI.hpp index f10b6c7d682..f10b6c7d682 100644 --- a/ndb/src/rep/adapters/ExtAPI.hpp +++ b/ndb/src/old_files/rep/adapters/ExtAPI.hpp diff --git a/ndb/src/rep/adapters/ExtNDB.cpp b/ndb/src/old_files/rep/adapters/ExtNDB.cpp index 6642b750b57..6642b750b57 100644 --- a/ndb/src/rep/adapters/ExtNDB.cpp +++ b/ndb/src/old_files/rep/adapters/ExtNDB.cpp diff --git a/ndb/src/rep/adapters/ExtNDB.hpp b/ndb/src/old_files/rep/adapters/ExtNDB.hpp index 228c980fd06..228c980fd06 100644 --- a/ndb/src/rep/adapters/ExtNDB.hpp +++ b/ndb/src/old_files/rep/adapters/ExtNDB.hpp diff --git a/ndb/src/rep/adapters/Makefile b/ndb/src/old_files/rep/adapters/Makefile index bdd711510c3..bdd711510c3 100644 --- a/ndb/src/rep/adapters/Makefile +++ b/ndb/src/old_files/rep/adapters/Makefile diff --git a/ndb/src/rep/adapters/TableInfoPs.hpp b/ndb/src/old_files/rep/adapters/TableInfoPs.hpp index 3fa25979255..3fa25979255 100644 --- a/ndb/src/rep/adapters/TableInfoPs.hpp +++ b/ndb/src/old_files/rep/adapters/TableInfoPs.hpp diff --git a/ndb/src/rep/dbug_hack.cpp b/ndb/src/old_files/rep/dbug_hack.cpp index 74e5f080777..74e5f080777 100644 --- a/ndb/src/rep/dbug_hack.cpp +++ b/ndb/src/old_files/rep/dbug_hack.cpp diff --git a/ndb/src/rep/rep_version.hpp b/ndb/src/old_files/rep/rep_version.hpp index 3830f9c351c..3830f9c351c 100644 --- a/ndb/src/rep/rep_version.hpp +++ b/ndb/src/old_files/rep/rep_version.hpp diff --git a/ndb/src/rep/repapi/Makefile b/ndb/src/old_files/rep/repapi/Makefile index fdd153f1060..fdd153f1060 100644 --- a/ndb/src/rep/repapi/Makefile +++ b/ndb/src/old_files/rep/repapi/Makefile diff --git a/ndb/src/rep/repapi/repapi.cpp b/ndb/src/old_files/rep/repapi/repapi.cpp index d34ab098c9c..d34ab098c9c 100644 --- a/ndb/src/rep/repapi/repapi.cpp +++ b/ndb/src/old_files/rep/repapi/repapi.cpp diff --git a/ndb/src/rep/repapi/repapi.h b/ndb/src/old_files/rep/repapi/repapi.h index 170e493cd86..170e493cd86 100644 --- a/ndb/src/rep/repapi/repapi.h +++ b/ndb/src/old_files/rep/repapi/repapi.h diff --git a/ndb/src/rep/state/Channel.cpp b/ndb/src/old_files/rep/state/Channel.cpp index a7f7b90d3fe..a7f7b90d3fe 100644 --- a/ndb/src/rep/state/Channel.cpp +++ b/ndb/src/old_files/rep/state/Channel.cpp diff --git a/ndb/src/rep/state/Channel.hpp b/ndb/src/old_files/rep/state/Channel.hpp index cdf4eecca63..cdf4eecca63 100644 --- a/ndb/src/rep/state/Channel.hpp +++ b/ndb/src/old_files/rep/state/Channel.hpp diff --git a/ndb/src/rep/state/Interval.cpp b/ndb/src/old_files/rep/state/Interval.cpp index 8266f19c58d..8266f19c58d 100644 --- a/ndb/src/rep/state/Interval.cpp +++ b/ndb/src/old_files/rep/state/Interval.cpp diff --git a/ndb/src/rep/state/Interval.hpp b/ndb/src/old_files/rep/state/Interval.hpp index 935adaf26b1..935adaf26b1 100644 --- a/ndb/src/rep/state/Interval.hpp +++ b/ndb/src/old_files/rep/state/Interval.hpp diff --git a/ndb/src/rep/state/Makefile b/ndb/src/old_files/rep/state/Makefile index 3eed69a97dd..3eed69a97dd 100644 --- a/ndb/src/rep/state/Makefile +++ b/ndb/src/old_files/rep/state/Makefile diff --git a/ndb/src/rep/state/RepState.cpp b/ndb/src/old_files/rep/state/RepState.cpp index d8a50961a3c..d8a50961a3c 100644 --- a/ndb/src/rep/state/RepState.cpp +++ b/ndb/src/old_files/rep/state/RepState.cpp diff --git a/ndb/src/rep/state/RepState.hpp b/ndb/src/old_files/rep/state/RepState.hpp index 06bbca19f7e..06bbca19f7e 100644 --- a/ndb/src/rep/state/RepState.hpp +++ b/ndb/src/old_files/rep/state/RepState.hpp diff --git a/ndb/src/rep/state/RepStateEvent.cpp b/ndb/src/old_files/rep/state/RepStateEvent.cpp index 9be304c8bfa..9be304c8bfa 100644 --- a/ndb/src/rep/state/RepStateEvent.cpp +++ b/ndb/src/old_files/rep/state/RepStateEvent.cpp diff --git a/ndb/src/rep/state/RepStateRequests.cpp b/ndb/src/old_files/rep/state/RepStateRequests.cpp index 02677e141f6..02677e141f6 100644 --- a/ndb/src/rep/state/RepStateRequests.cpp +++ b/ndb/src/old_files/rep/state/RepStateRequests.cpp diff --git a/ndb/src/rep/state/testInterval/Makefile b/ndb/src/old_files/rep/state/testInterval/Makefile index fbb0b48c280..fbb0b48c280 100644 --- a/ndb/src/rep/state/testInterval/Makefile +++ b/ndb/src/old_files/rep/state/testInterval/Makefile diff --git a/ndb/src/rep/state/testInterval/testInterval.cpp b/ndb/src/old_files/rep/state/testInterval/testInterval.cpp index 463e4adffb7..463e4adffb7 100644 --- a/ndb/src/rep/state/testInterval/testInterval.cpp +++ b/ndb/src/old_files/rep/state/testInterval/testInterval.cpp diff --git a/ndb/src/rep/state/testRepState/Makefile b/ndb/src/old_files/rep/state/testRepState/Makefile index 33c6076eff3..33c6076eff3 100644 --- a/ndb/src/rep/state/testRepState/Makefile +++ b/ndb/src/old_files/rep/state/testRepState/Makefile diff --git a/ndb/src/rep/state/testRepState/testRequestor.cpp b/ndb/src/old_files/rep/state/testRepState/testRequestor.cpp index 8989f7098b8..8989f7098b8 100644 --- a/ndb/src/rep/state/testRepState/testRequestor.cpp +++ b/ndb/src/old_files/rep/state/testRepState/testRequestor.cpp diff --git a/ndb/src/rep/state/testRepState/testRequestor.hpp b/ndb/src/old_files/rep/state/testRepState/testRequestor.hpp index 726b289114d..726b289114d 100644 --- a/ndb/src/rep/state/testRepState/testRequestor.hpp +++ b/ndb/src/old_files/rep/state/testRepState/testRequestor.hpp diff --git a/ndb/src/rep/storage/GCIBuffer.cpp b/ndb/src/old_files/rep/storage/GCIBuffer.cpp index 013600b30a5..013600b30a5 100644 --- a/ndb/src/rep/storage/GCIBuffer.cpp +++ b/ndb/src/old_files/rep/storage/GCIBuffer.cpp diff --git a/ndb/src/rep/storage/GCIBuffer.hpp b/ndb/src/old_files/rep/storage/GCIBuffer.hpp index 8a8473d1d49..8a8473d1d49 100644 --- a/ndb/src/rep/storage/GCIBuffer.hpp +++ b/ndb/src/old_files/rep/storage/GCIBuffer.hpp diff --git a/ndb/src/rep/storage/GCIContainer.cpp b/ndb/src/old_files/rep/storage/GCIContainer.cpp index c161db0769b..c161db0769b 100644 --- a/ndb/src/rep/storage/GCIContainer.cpp +++ b/ndb/src/old_files/rep/storage/GCIContainer.cpp diff --git a/ndb/src/rep/storage/GCIContainer.hpp b/ndb/src/old_files/rep/storage/GCIContainer.hpp index 48cbc66bfbd..48cbc66bfbd 100644 --- a/ndb/src/rep/storage/GCIContainer.hpp +++ b/ndb/src/old_files/rep/storage/GCIContainer.hpp diff --git a/ndb/src/rep/storage/GCIContainerPS.cpp b/ndb/src/old_files/rep/storage/GCIContainerPS.cpp index 5adb53f965c..5adb53f965c 100644 --- a/ndb/src/rep/storage/GCIContainerPS.cpp +++ b/ndb/src/old_files/rep/storage/GCIContainerPS.cpp diff --git a/ndb/src/rep/storage/GCIContainerPS.hpp b/ndb/src/old_files/rep/storage/GCIContainerPS.hpp index 7f5aaac4840..7f5aaac4840 100644 --- a/ndb/src/rep/storage/GCIContainerPS.hpp +++ b/ndb/src/old_files/rep/storage/GCIContainerPS.hpp diff --git a/ndb/src/rep/storage/GCIPage.cpp b/ndb/src/old_files/rep/storage/GCIPage.cpp index 05ecde2fee1..05ecde2fee1 100644 --- a/ndb/src/rep/storage/GCIPage.cpp +++ b/ndb/src/old_files/rep/storage/GCIPage.cpp diff --git a/ndb/src/rep/storage/GCIPage.hpp b/ndb/src/old_files/rep/storage/GCIPage.hpp index 50c5ab0cfba..50c5ab0cfba 100644 --- a/ndb/src/rep/storage/GCIPage.hpp +++ b/ndb/src/old_files/rep/storage/GCIPage.hpp diff --git a/ndb/src/rep/storage/LogRecord.hpp b/ndb/src/old_files/rep/storage/LogRecord.hpp index a0bf3d52372..a0bf3d52372 100644 --- a/ndb/src/rep/storage/LogRecord.hpp +++ b/ndb/src/old_files/rep/storage/LogRecord.hpp diff --git a/ndb/src/rep/storage/Makefile b/ndb/src/old_files/rep/storage/Makefile index 89b3af455e8..89b3af455e8 100644 --- a/ndb/src/rep/storage/Makefile +++ b/ndb/src/old_files/rep/storage/Makefile diff --git a/ndb/src/rep/storage/NodeConnectInfo.hpp b/ndb/src/old_files/rep/storage/NodeConnectInfo.hpp index 403f92a5999..403f92a5999 100644 --- a/ndb/src/rep/storage/NodeConnectInfo.hpp +++ b/ndb/src/old_files/rep/storage/NodeConnectInfo.hpp diff --git a/ndb/src/rep/storage/NodeGroup.cpp b/ndb/src/old_files/rep/storage/NodeGroup.cpp index 33451efb104..33451efb104 100644 --- a/ndb/src/rep/storage/NodeGroup.cpp +++ b/ndb/src/old_files/rep/storage/NodeGroup.cpp diff --git a/ndb/src/rep/storage/NodeGroup.hpp b/ndb/src/old_files/rep/storage/NodeGroup.hpp index 1f515e02a23..1f515e02a23 100644 --- a/ndb/src/rep/storage/NodeGroup.hpp +++ b/ndb/src/old_files/rep/storage/NodeGroup.hpp diff --git a/ndb/src/rep/storage/NodeGroupInfo.cpp b/ndb/src/old_files/rep/storage/NodeGroupInfo.cpp index 8c250268997..8c250268997 100644 --- a/ndb/src/rep/storage/NodeGroupInfo.cpp +++ b/ndb/src/old_files/rep/storage/NodeGroupInfo.cpp diff --git a/ndb/src/rep/storage/NodeGroupInfo.hpp b/ndb/src/old_files/rep/storage/NodeGroupInfo.hpp index 3d0499d4425..3d0499d4425 100644 --- a/ndb/src/rep/storage/NodeGroupInfo.hpp +++ b/ndb/src/old_files/rep/storage/NodeGroupInfo.hpp diff --git a/ndb/src/rep/transfer/Makefile b/ndb/src/old_files/rep/transfer/Makefile index 0d8851e287a..0d8851e287a 100644 --- a/ndb/src/rep/transfer/Makefile +++ b/ndb/src/old_files/rep/transfer/Makefile diff --git a/ndb/src/rep/transfer/TransPS.cpp b/ndb/src/old_files/rep/transfer/TransPS.cpp index 11fb0203cbc..11fb0203cbc 100644 --- a/ndb/src/rep/transfer/TransPS.cpp +++ b/ndb/src/old_files/rep/transfer/TransPS.cpp diff --git a/ndb/src/rep/transfer/TransPS.hpp b/ndb/src/old_files/rep/transfer/TransPS.hpp index 0464b9e47c0..0464b9e47c0 100644 --- a/ndb/src/rep/transfer/TransPS.hpp +++ b/ndb/src/old_files/rep/transfer/TransPS.hpp diff --git a/ndb/src/rep/transfer/TransSS.cpp b/ndb/src/old_files/rep/transfer/TransSS.cpp index 376c6375bc4..376c6375bc4 100644 --- a/ndb/src/rep/transfer/TransSS.cpp +++ b/ndb/src/old_files/rep/transfer/TransSS.cpp diff --git a/ndb/src/rep/transfer/TransSS.hpp b/ndb/src/old_files/rep/transfer/TransSS.hpp index 3340038c8d1..3340038c8d1 100644 --- a/ndb/src/rep/transfer/TransSS.hpp +++ b/ndb/src/old_files/rep/transfer/TransSS.hpp diff --git a/ndb/src/rep/transfer/TransSSSubscriptions.cpp b/ndb/src/old_files/rep/transfer/TransSSSubscriptions.cpp index 582ba8040a6..582ba8040a6 100644 --- a/ndb/src/rep/transfer/TransSSSubscriptions.cpp +++ b/ndb/src/old_files/rep/transfer/TransSSSubscriptions.cpp diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am index c535344ac54..2e0f30df9d4 100644 --- a/ndb/test/Makefile.am +++ b/ndb/test/Makefile.am @@ -1,5 +1,4 @@ -SUBDIRS = src $(ndb_opt_test_subdirs) -DIST_SUBDIRS = src tools ndbapi run-test +SUBDIRS = src tools ndbapi run-test EXTRA_DIST = include diff --git a/ndb/test/Makefile_old b/ndb/test/Makefile_old deleted file mode 100644 index 19472917560..00000000000 --- a/ndb/test/Makefile_old +++ /dev/null @@ -1,19 +0,0 @@ -include .defs.mk - -DIRS := src tools ndbapi run-test - -EXTRA_DIRS = newtonapi - -ifeq ($(NDB_ARCH), x86_64) -EXTRA_DIRS = -endif - -DIRS += $(EXTRA_DIRS) - -ifneq ($(NDB_ODBC),N) -DIRS += odbc -endif - -include $(NDB_TOP)/Epilogue.mk - -_bins_ndbapi : _libs_src diff --git a/ndb/include/ndbapi/NdbSchemaCon.hpp b/ndb/test/include/NdbSchemaCon.hpp index 313daf0094b..313daf0094b 100644 --- a/ndb/include/ndbapi/NdbSchemaCon.hpp +++ b/ndb/test/include/NdbSchemaCon.hpp diff --git a/ndb/include/ndbapi/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index 43f76c8c253..43f76c8c253 100644 --- a/ndb/include/ndbapi/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index f583823c87f..52058c306fb 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -14,6 +14,7 @@ flexTT \ testBackup \ testBasic \ testBasicAsynch \ +testBlobs \ testDataBuffers \ testDict \ testIndex \ @@ -47,7 +48,7 @@ flexTT_SOURCES = flexTT.cpp testBackup_SOURCES = testBackup.cpp testBasic_SOURCES = testBasic.cpp testBasicAsynch_SOURCES = testBasicAsynch.cpp -#testBlobs_SOURCES = testBlobs.cpp +testBlobs_SOURCES = testBlobs.cpp testDataBuffers_SOURCES = testDataBuffers.cpp testDict_SOURCES = testDict.cpp testIndex_SOURCES = testIndex.cpp @@ -77,3 +78,4 @@ testBackup_LDADD = $(LDADD) bank/libbank.a # Don't update the files from bitkeeper %::SCCS/s.% + diff --git a/ndb/test/ndbapi/Makefile_old b/ndb/test/ndbapi/Makefile_old index 91f0c84c18e..34761e1eb9c 100644 --- a/ndb/test/ndbapi/Makefile_old +++ b/ndb/test/ndbapi/Makefile_old @@ -37,7 +37,8 @@ BIN_DIRS = \ indexTest \ test_event \ indexTest2 \ - testGrep + testGrep \ + testBlobs ifeq ($(NDB_OS), SOLARIS) ifeq ($(NDB_COMPILER), FORTE6) diff --git a/ndb/test/ndbapi/bank/Makefile.am b/ndb/test/ndbapi/bank/Makefile.am index 40a23d1dbfc..886d664aefb 100644 --- a/ndb/test/ndbapi/bank/Makefile.am +++ b/ndb/test/ndbapi/bank/Makefile.am @@ -3,7 +3,7 @@ ndbtest_PROGRAMS = testBank bankSumAccounts bankValidateAllGLs bankMakeGL bankTr noinst_LIBRARIES = libbank.a -libbank_a_SOURCES = Bank.cpp BankLoad.cpp +libbank_a_SOURCES = Bank.cpp BankLoad.cpp Bank.hpp testBank_SOURCES = testBank.cpp bankSumAccounts_SOURCES = bankSumAccounts.cpp diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index e2be1def71c..001ec83630a 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -19,176 +19,1195 @@ */ #include <ndb_global.h> - #include <NdbMain.h> #include <NdbOut.hpp> -#include <NdbThread.h> -#include <NdbMutex.h> -#include <NdbCondition.h> #include <NdbTest.hpp> -#include <NdbTick.h> + +struct Bcol { + bool m_nullable; + unsigned m_inline; + unsigned m_partsize; + unsigned m_stripe; + char m_btname[NdbBlob::BlobTableNameSize]; + Bcol(bool a, unsigned b, unsigned c, unsigned d) : + m_nullable(a), + m_inline(b), + m_partsize(c), + m_stripe(d) + {} +}; struct Opt { - bool m_core; - const char* m_table; - Opt() : - m_core(false), - m_table("TB1") - { - } + bool m_core; + bool m_dbg; + bool m_dbgall; + bool m_full; + unsigned m_loop; + unsigned m_parts; + unsigned m_rows; + unsigned m_seed; + char m_skip[255]; + // metadata + const char* m_tname; + const char* m_x1name; // hash index + const char* m_x2name; // ordered index + unsigned m_pk1off; + unsigned m_pk2len; + bool m_oneblob; + Bcol m_blob1; + Bcol m_blob2; + // bugs + int m_bug; + int (*m_bugtest)(); + Opt() : + m_core(false), + m_dbg(false), + m_dbgall(false), + m_full(false), + m_loop(1), + m_parts(10), + m_rows(100), + m_seed(0), + // metadata + m_tname("TBLOB1"), + m_x1name("TBLOB1X1"), + m_x2name("TBLOB1X2"), + m_pk1off(0x12340000), + m_pk2len(55), + m_oneblob(false), + m_blob1(false, 7, 1137, 10), + m_blob2(true, 99, 55, 1), + // bugs + m_bug(0), + m_bugtest(0) { + memset(m_skip, false, sizeof(m_skip)); + } }; -static Opt opt; +static const unsigned g_max_pk2len = 256; -static void printusage() +static void +printusage() { - Opt d; - ndbout - << "usage: testBlobs [options]" << endl - << "-core dump core on error - default " << d.m_core << endl - ; + Opt d; + ndbout + << "usage: testBlobs options [default/max]" << endl + << " -core dump core on error" << endl + << " -dbg print debug" << endl + << " -dbgall print also NDB API debug (if compiled in)" << endl + << " -full read/write only full blob values" << endl + << " -inline read/write only blobs which fit inline" << endl + << " -loop N loop N times 0=forever [" << d.m_loop << "]" << endl + << " -parts N max parts in blob value [" << d.m_parts << "]" << endl + << " -rows N number of rows [" << d.m_rows << "]" << endl + << " -seed N random seed 0=loop number [" << d.m_seed << "]" << endl + << " -skip xxx skip these tests (see list)" << endl + << "metadata" << endl + << " -pk2len N length of PK2 [" << d.m_pk2len << "/" << g_max_pk2len <<"]" << endl + << " -oneblob only 1 blob attribute [default 2]" << endl + << "testcases for -skip" << endl + << " k primary key ops" << endl + << " i hash index ops" << endl + << " s table scans" << endl + << " r ordered index scans" << endl + << " u update blob value" << endl + << " v getValue / setValue" << endl + << " w readData / writeData" << endl + << "bug tests (no blob test)" << endl + << " -bug 4088 ndb api hang with mixed ops on index table" << endl + << " -bug 2222 delete + write gives 626" << endl + << " -bug 3333 acc crash on delete and long key" << endl + ; } -static Ndb* myNdb = 0; -static NdbDictionary::Dictionary* myDic = 0; -static NdbConnection* myCon = 0; -static NdbOperation* myOp = 0; -static NdbBlob* myBlob = 0; +static Opt g_opt; -static void -fatal(const char* fmt, ...) -{ - va_list ap; - char buf[200]; - va_start(ap, fmt); - vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - ndbout << "fatal: " << buf << endl; - if (myNdb != 0 && myNdb->getNdbError().code != 0) - ndbout << "ndb - " << myNdb->getNdbError() << endl; - if (myDic != 0 && myDic->getNdbError().code != 0) - ndbout << "dic - " << myDic->getNdbError() << endl; - if (opt.m_core) - abort(); - NDBT_ProgramExit(NDBT_FAILED); - exit(1); +static char& +skip(unsigned x) +{ + assert(x < sizeof(g_opt.m_skip)); + return g_opt.m_skip[x]; } +static Ndb* g_ndb = 0; +static NdbDictionary::Dictionary* g_dic = 0; +static NdbConnection* g_con = 0; +static NdbOperation* g_opr = 0; +static NdbIndexOperation* g_opx = 0; +static NdbScanOperation* g_ops = 0; +static NdbBlob* g_bh1 = 0; +static NdbBlob* g_bh2 = 0; +static bool g_printerror = true; + static void -dropBlobsTable() +printerror(int line, const char* msg) { - NdbDictionary::Table tab(NDB_BLOB_TABLE_NAME); - if (myDic->dropTable(tab) == -1) - if (myDic->getNdbError().code != 709) - fatal("dropTable"); + ndbout << "line " << line << ": " << msg << " failed" << endl; + if (! g_printerror) { + return; + } + if (g_ndb != 0 && g_ndb->getNdbError().code != 0) { + ndbout << "ndb: " << g_ndb->getNdbError() << endl; + } + if (g_dic != 0 && g_dic->getNdbError().code != 0) { + ndbout << "dic: " << g_dic->getNdbError() << endl; + } + if (g_con != 0 && g_con->getNdbError().code != 0) { + ndbout << "con: " << g_con->getNdbError() << endl; + if (g_opr != 0 && g_opr->getNdbError().code != 0) { + ndbout << "opr: table=" << g_opr->getTableName() << " " << g_opr->getNdbError() << endl; + } + if (g_opx != 0 && g_opx->getNdbError().code != 0) { + ndbout << "opx: table=" << g_opx->getTableName() << " " << g_opx->getNdbError() << endl; + } + if (g_ops != 0 && g_ops->getNdbError().code != 0) { + ndbout << "ops: table=" << g_ops->getTableName() << " " << g_ops->getNdbError() << endl; + } + NdbOperation* ope = g_con->getNdbErrorOperation(); + if (ope != 0 && ope->getNdbError().code != 0) { + if (ope != g_opr && ope != g_opx && ope != g_ops) + ndbout << "ope: table=" << ope->getTableName() << " " << ope->getNdbError() << endl; + } + } + if (g_bh1 != 0 && g_bh1->getNdbError().code != 0) { + ndbout << "bh1: " << g_bh1->getNdbError() << endl; + } + if (g_bh2 != 0 && g_bh2->getNdbError().code != 0) { + ndbout << "bh2: " << g_bh2->getNdbError() << endl; + } + if (g_opt.m_core) { + abort(); + } + g_printerror = false; } -static void -createBlobsTable() -{ - NdbDictionary::Table tab(NDB_BLOB_TABLE_NAME); - // col 0 - NdbDictionary::Column col0("BLOBID"); - col0.setPrimaryKey(true); - col0.setType(NdbDictionary::Column::Bigunsigned); - tab.addColumn(col0); - // col 1 - NdbDictionary::Column col1("DATA"); - col1.setPrimaryKey(false); - col1.setType(NdbDictionary::Column::Binary); - col1.setLength(NDB_BLOB_PIECE_SIZE); - tab.addColumn(col1); - // create - if (myDic->createTable(tab) == -1) - fatal("createTable"); -} +#define CHK(x) \ + do { \ + if (x) break; \ + printerror(__LINE__, #x); return -1; \ + } while (0) +#define DBG(x) \ + do { \ + if (! g_opt.m_dbg) break; \ + ndbout << "line " << __LINE__ << " " << x << endl; \ + } while (0) -static void +static int dropTable() { - NdbDictionary::Table tab(opt.m_table); - if (myDic->dropTable(tab) == -1) - if (myDic->getNdbError().code != 709) - fatal("dropTable"); + NdbDictionary::Table tab(g_opt.m_tname); + if (g_dic->getTable(g_opt.m_tname) != 0) + CHK(g_dic->dropTable(tab) == 0); + return 0; } -static void +static int createTable() { - NdbDictionary::Table tab(opt.m_table); - // col 0 - NdbDictionary::Column col0("A"); - col0.setPrimaryKey(true); - col0.setType(NdbDictionary::Column::Unsigned); - tab.addColumn(col0); - // col 1 - NdbDictionary::Column col1("B"); - col1.setPrimaryKey(false); - col1.setType(NdbDictionary::Column::Blob); - tab.addColumn(col1); - // create - if (myDic->createTable(tab) == -1) - fatal("createTable"); + NdbDictionary::Table tab(g_opt.m_tname); + // col PK1 - Uint32 + { NdbDictionary::Column col("PK1"); + col.setType(NdbDictionary::Column::Unsigned); + col.setPrimaryKey(true); + tab.addColumn(col); + } + // col BL1 - Blob not-nullable + { NdbDictionary::Column col("BL1"); + const Bcol& b = g_opt.m_blob1; + col.setType(NdbDictionary::Column::Blob); + col.setInlineSize(b.m_inline); + col.setPartSize(b.m_partsize); + col.setStripeSize(b.m_stripe); + tab.addColumn(col); + } + // col PK2 - Char[55] + if (g_opt.m_pk2len != 0) + { NdbDictionary::Column col("PK2"); + col.setType(NdbDictionary::Column::Char); + col.setLength(g_opt.m_pk2len); + col.setPrimaryKey(true); + tab.addColumn(col); + } + // col BL2 - Clob nullable + if (! g_opt.m_oneblob) + { NdbDictionary::Column col("BL2"); + const Bcol& b = g_opt.m_blob2; + col.setType(NdbDictionary::Column::Clob); + col.setNullable(true); + col.setInlineSize(b.m_inline); + col.setPartSize(b.m_partsize); + col.setStripeSize(b.m_stripe); + tab.addColumn(col); + } + // create table + CHK(g_dic->createTable(tab) == 0); + // unique hash index on PK2 + if (g_opt.m_pk2len != 0) + { NdbDictionary::Index idx(g_opt.m_x1name); + idx.setType(NdbDictionary::Index::UniqueHashIndex); + idx.setTable(g_opt.m_tname); + idx.addColumnName("PK2"); + CHK(g_dic->createIndex(idx) == 0); + } + // ordered index on PK2 + if (g_opt.m_pk2len != 0) + { NdbDictionary::Index idx(g_opt.m_x2name); + idx.setType(NdbDictionary::Index::OrderedIndex); + idx.setLogging(false); + idx.setTable(g_opt.m_tname); + idx.addColumnName("PK2"); + CHK(g_dic->createIndex(idx) == 0); + } + return 0; +} + +// tuples + +struct Bval { + char* m_val; + unsigned m_len; + char* m_buf; + unsigned m_buflen; + Bval() : + m_val(0), + m_len(0), + m_buf(0), // read/write buffer + m_buflen(0) + {} + ~Bval() { delete [] m_val; delete [] m_buf; } + void alloc(unsigned buflen) { + m_buflen = buflen; + delete [] m_buf; + m_buf = new char [m_buflen]; + trash(); + } + void copy(const Bval& v) { + m_len = v.m_len; + delete [] m_val; + if (v.m_val == 0) + m_val = 0; + else + m_val = (char*)memcpy(new char [m_len], v.m_val, m_len); + } + void trash() const { + assert(m_buf != 0); + memset(m_buf, 'x', m_buflen); + } +private: + Bval(const Bval&); + Bval& operator=(const Bval&); +}; + +struct Tup { + bool m_exists; // exists in table + Uint32 m_pk1; // primary keys concatenated like keyinfo + char m_pk2[g_max_pk2len + 1]; + Bval m_blob1; + Bval m_blob2; + Tup() : + m_exists(false) + {} + ~Tup() { } + // alloc buffers of max size + void alloc() { + m_blob1.alloc(g_opt.m_blob1.m_inline + g_opt.m_blob1.m_partsize * g_opt.m_parts); + m_blob2.alloc(g_opt.m_blob2.m_inline + g_opt.m_blob2.m_partsize * g_opt.m_parts); + } + void copy(const Tup& tup) { + assert(m_pk1 == tup.m_pk1); + m_blob1.copy(tup.m_blob1); + m_blob2.copy(tup.m_blob2); + } +private: + Tup(const Tup&); + Tup& operator=(const Tup&); +}; + +static Tup* g_tups; + +static unsigned +urandom(unsigned n) +{ + return n == 0 ? 0 : random() % n; } static void -insertData(Uint32 key) +calcBval(const Bcol& b, Bval& v, bool keepsize) { + if (b.m_nullable && urandom(10) == 0) { + v.m_len = 0; + delete v.m_val; + v.m_val = 0; + v.m_buf = new char [1]; + } else { + if (keepsize && v.m_val != 0) + ; + else if (urandom(10) == 0) + v.m_len = urandom(b.m_inline); + else + v.m_len = urandom(b.m_inline + g_opt.m_parts * b.m_partsize + 1); + delete v.m_val; + v.m_val = new char [v.m_len + 1]; + for (unsigned i = 0; i < v.m_len; i++) + v.m_val[i] = 'a' + urandom(25); + v.m_val[v.m_len] = 0; + v.m_buf = new char [v.m_len]; + } + v.m_buflen = v.m_len; + v.trash(); } static void -insertTuples() -{ - for (Uint32 key = 0; key <= 99; key++) { - if ((myCon = myNdb->startTransaction()) == 0) - fatal("startTransaction"); - if ((myOp = myCon->getNdbOperation(opt.m_table)) == 0) - fatal("getNdbOperation"); - if (myOp->insertTuple() == -1) - fatal("insertTuple"); - if (myOp->setValue((unsigned)0, key) == -1) - fatal("setValue %u", (unsigned)key); - if ((myBlob = myOp->setBlob(1)) == 0) - fatal("setBlob"); - if (myCon->execute(NoCommit) == -1) - fatal("execute NoCommit"); - insertData(key); - if (myCon->execute(Commit) == -1) - fatal("execute Commit"); - myNdb->closeTransaction(myCon); - myOp = 0; - myBlob = 0; - myCon = 0; +calcTups(bool keepsize) +{ + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + tup.m_pk1 = g_opt.m_pk1off + k; + for (unsigned i = 0, n = k; i < g_opt.m_pk2len; i++) { + if (n != 0) { + tup.m_pk2[i] = '0' + n % 10; + n = n / 10; + } else { + tup.m_pk2[i] = 'a' + i % 26; + } } + calcBval(g_opt.m_blob1, tup.m_blob1, keepsize); + if (! g_opt.m_oneblob) + calcBval(g_opt.m_blob2, tup.m_blob2, keepsize); + } } -static void -testMain() +// blob handle ops + +static int +getBlobLength(NdbBlob* h, unsigned& len) +{ + Uint64 len2 = (unsigned)-1; + CHK(h->getLength(len2) == 0); + len = (unsigned)len2; + assert(len == len2); + return 0; +} + +static int +setBlobValue(NdbBlob* h, const Bval& v) +{ + bool null = (v.m_val == 0); + bool isNull; + unsigned len; + DBG("set " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null); + if (null) { + CHK(h->setNull() == 0); + isNull = false; + CHK(h->getNull(isNull) == 0 && isNull == true); + CHK(getBlobLength(h, len) == 0 && len == 0); + } else { + CHK(h->setValue(v.m_val, v.m_len) == 0); + CHK(h->getNull(isNull) == 0 && isNull == false); + CHK(getBlobLength(h, len) == 0 && len == v.m_len); + } + return 0; +} + +static int +getBlobValue(NdbBlob* h, const Bval& v) +{ + bool null = (v.m_val == 0); + DBG("get " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null); + CHK(h->getValue(v.m_buf, v.m_buflen) == 0); + return 0; +} + +static int +getBlobValue(const Tup& tup) +{ + CHK(getBlobValue(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(getBlobValue(g_bh2, tup.m_blob2) == 0); + return 0; +} + +static int +verifyBlobValue(NdbBlob* h, const Bval& v) +{ + bool null = (v.m_val == 0); + bool isNull; + unsigned len; + if (null) { + isNull = false; + CHK(h->getNull(isNull) == 0 && isNull == true); + CHK(getBlobLength(h, len) == 0 && len == 0); + } else { + isNull = true; + CHK(h->getNull(isNull) == 0 && isNull == false); + CHK(getBlobLength(h, len) == 0 && len == v.m_len); + for (unsigned i = 0; i < v.m_len; i++) + CHK(v.m_val[i] == v.m_buf[i]); + } + return 0; +} + +static int +verifyBlobValue(const Tup& tup) +{ + CHK(verifyBlobValue(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(verifyBlobValue(g_bh2, tup.m_blob2) == 0); + return 0; +} + +static int +writeBlobData(NdbBlob* h, const Bval& v) +{ + bool null = (v.m_val == 0); + bool isNull; + unsigned len; + DBG("write " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null); + if (null) { + CHK(h->setNull() == 0); + isNull = false; + CHK(h->getNull(isNull) == 0 && isNull == true); + CHK(getBlobLength(h, len) == 0 && len == 0); + } else { + unsigned n = 0; + do { + unsigned m = g_opt.m_full ? v.m_len : urandom(v.m_len + 1); + if (m > v.m_len - n) + m = v.m_len - n; + DBG("write pos=" << n << " cnt=" << m); + CHK(h->writeData(v.m_val + n, m) == 0); + n += m; + } while (n < v.m_len); + assert(n == v.m_len); + isNull = true; + CHK(h->getNull(isNull) == 0 && isNull == false); + CHK(getBlobLength(h, len) == 0 && len == v.m_len); + } + return 0; +} + +static int +readBlobData(NdbBlob* h, const Bval& v) +{ + bool null = (v.m_val == 0); + bool isNull; + unsigned len; + DBG("read " << h->getColumn()->getName() << " len=" << v.m_len << " null=" << null); + if (null) { + isNull = false; + CHK(h->getNull(isNull) == 0 && isNull == true); + CHK(getBlobLength(h, len) == 0 && len == 0); + } else { + isNull = true; + CHK(h->getNull(isNull) == 0 && isNull == false); + CHK(getBlobLength(h, len) == 0 && len == v.m_len); + v.trash(); + unsigned n = 0; + while (n < v.m_len) { + unsigned m = g_opt.m_full ? v.m_len : urandom(v.m_len + 1); + if (m > v.m_len - n) + m = v.m_len - n; + DBG("read pos=" << n << " cnt=" << m); + const unsigned m2 = m; + CHK(h->readData(v.m_buf + n, m) == 0); + CHK(m2 == m); + n += m; + } + assert(n == v.m_len); + // need to execute to see the data + CHK(g_con->execute(NoCommit) == 0); + for (unsigned i = 0; i < v.m_len; i++) + CHK(v.m_val[i] == v.m_buf[i]); + } + return 0; +} + +static int +readBlobData(const Tup& tup) +{ + CHK(readBlobData(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(readBlobData(g_bh2, tup.m_blob2) == 0); + return 0; +} + +// verify blob data + +static int +verifyHeadInline(const Bcol& c, const Bval& v, NdbRecAttr* ra) +{ + if (v.m_val == 0) { + CHK(ra->isNULL() == 1); + } else { + CHK(ra->isNULL() == 0); + CHK(ra->u_64_value() == v.m_len); + } + return 0; +} + +static int +verifyHeadInline(const Tup& tup) +{ + DBG("verifyHeadInline pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + NdbRecAttr* ra1; + NdbRecAttr* ra2; + CHK((ra1 = g_opr->getValue("BL1")) != 0); + if (! g_opt.m_oneblob) + CHK((ra2 = g_opr->getValue("BL2")) != 0); + if (tup.m_exists) { + CHK(g_con->execute(Commit) == 0); + DBG("verifyHeadInline BL1"); + CHK(verifyHeadInline(g_opt.m_blob1, tup.m_blob1, ra1) == 0); + if (! g_opt.m_oneblob) { + DBG("verifyHeadInline BL2"); + CHK(verifyHeadInline(g_opt.m_blob2, tup.m_blob2, ra2) == 0); + } + } else { + CHK(g_con->execute(Commit) == -1 && g_con->getNdbError().code == 626); + } + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + return 0; +} + +static int +verifyBlobTable(const Bcol& b, const Bval& v, Uint32 pk1, bool exists) +{ + DBG("verify " << b.m_btname << " pk1=" << pk1); + NdbRecAttr* ra_pk; + NdbRecAttr* ra_part; + NdbRecAttr* ra_data; + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(b.m_btname)) != 0); + CHK(g_opr->openScanRead() == 0); + CHK((ra_pk = g_opr->getValue("PK")) != 0); + CHK((ra_part = g_opr->getValue("PART")) != 0); + CHK((ra_data = g_opr->getValue("DATA")) != 0); + CHK(g_con->executeScan() == 0); + unsigned partcount; + if (! exists || v.m_len <= b.m_inline) + partcount = 0; + else + partcount = (v.m_len - b.m_inline + b.m_partsize - 1) / b.m_partsize; + char* seen = new char [partcount]; + memset(seen, 0, partcount); + while (1) { + int ret; + CHK((ret = g_con->nextScanResult()) == 0 || ret == 1); + if (ret == 1) + break; + if (pk1 != ra_pk->u_32_value()) + continue; + Uint32 part = ra_part->u_32_value(); + DBG("part " << part << " of " << partcount); + const char* data = ra_data->aRef(); + CHK(part < partcount && ! seen[part]); + seen[part] = 1; + unsigned n = b.m_inline + part * b.m_partsize; + assert(exists && v.m_val != 0 && n < v.m_len); + unsigned m = v.m_len - n; + if (m > b.m_partsize) + m = b.m_partsize; + CHK(memcmp(data, v.m_val + n, m) == 0); + } + for (unsigned i = 0; i < partcount; i++) + CHK(seen[i] == 1); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + return 0; +} + +static int +verifyBlobTable(const Tup& tup) +{ + CHK(verifyBlobTable(g_opt.m_blob1, tup.m_blob1, tup.m_pk1, tup.m_exists) == 0); + if (! g_opt.m_oneblob) + CHK(verifyBlobTable(g_opt.m_blob2, tup.m_blob2, tup.m_pk1, tup.m_exists) == 0); + return 0; +} + +static int +verifyBlob() { - myNdb = new Ndb("TEST_DB"); - if (myNdb->init() != 0) - fatal("init"); - if (myNdb->waitUntilReady() < 0) - fatal("waitUntilReady"); - myDic = myNdb->getDictionary(); - dropBlobsTable(); - createBlobsTable(); // until moved to Ndbcntr - dropTable(); - createTable(); - insertTuples(); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + const Tup& tup = g_tups[k]; + DBG("verifyBlob pk1=" << tup.m_pk1); + CHK(verifyHeadInline(tup) == 0); + CHK(verifyBlobTable(tup) == 0); + } + return 0; } +// operations + +static int +insertPk(bool rw) +{ + DBG("--- insertPk ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("insertPk pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->insertTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK((g_bh1 = g_opr->getBlobHandle("BL1")) != 0); + if (! g_opt.m_oneblob) + CHK((g_bh2 = g_opr->getBlobHandle("BL2")) != 0); + if (! rw) { + CHK(setBlobValue(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(setBlobValue(g_bh2, tup.m_blob2) == 0); + } else { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); + CHK(g_con->execute(NoCommit) == 0); + CHK(writeBlobData(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(writeBlobData(g_bh2, tup.m_blob2) == 0); + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + tup.m_exists = true; + } + return 0; +} + +static int +updatePk(bool rw) +{ + DBG("--- updatePk ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("updatePk pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->updateTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK((g_bh1 = g_opr->getBlobHandle("BL1")) != 0); + if (! g_opt.m_oneblob) + CHK((g_bh2 = g_opr->getBlobHandle("BL2")) != 0); + if (! rw) { + CHK(setBlobValue(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(setBlobValue(g_bh2, tup.m_blob2) == 0); + } else { + CHK(g_con->execute(NoCommit) == 0); + CHK(writeBlobData(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(writeBlobData(g_bh2, tup.m_blob2) == 0); + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + tup.m_exists = true; + } + return 0; +} + +static int +updateIdx(bool rw) +{ + DBG("--- updateIdx ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("updateIdx pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0); + CHK(g_opx->updateTuple() == 0); + CHK(g_opx->equal("PK2", tup.m_pk2) == 0); + CHK((g_bh1 = g_opx->getBlobHandle("BL1")) != 0); + if (! g_opt.m_oneblob) + CHK((g_bh2 = g_opx->getBlobHandle("BL2")) != 0); + if (! rw) { + CHK(setBlobValue(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(setBlobValue(g_bh2, tup.m_blob2) == 0); + } else { + CHK(g_con->execute(NoCommit) == 0); + CHK(writeBlobData(g_bh1, tup.m_blob1) == 0); + if (! g_opt.m_oneblob) + CHK(writeBlobData(g_bh2, tup.m_blob2) == 0); + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opx = 0; + g_con = 0; + tup.m_exists = true; + } + return 0; +} + +static int +readPk(bool rw) +{ + DBG("--- readPk ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("readPk pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK((g_bh1 = g_opr->getBlobHandle("BL1")) != 0); + if (! g_opt.m_oneblob) + CHK((g_bh2 = g_opr->getBlobHandle("BL2")) != 0); + if (! rw) { + CHK(getBlobValue(tup) == 0); + } else { + CHK(g_con->execute(NoCommit) == 0); + CHK(readBlobData(tup) == 0); + } + CHK(g_con->execute(Commit) == 0); + if (! rw) { + CHK(verifyBlobValue(tup) == 0); + } + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + } + return 0; +} + +static int +readIdx(bool rw) +{ + DBG("--- readIdx ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("readIdx pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0); + CHK(g_opx->readTuple() == 0); + CHK(g_opx->equal("PK2", tup.m_pk2) == 0); + CHK((g_bh1 = g_opx->getBlobHandle("BL1")) != 0); + if (! g_opt.m_oneblob) + CHK((g_bh2 = g_opx->getBlobHandle("BL2")) != 0); + if (! rw) { + CHK(getBlobValue(tup) == 0); + } else { + CHK(g_con->execute(NoCommit) == 0); + CHK(readBlobData(tup) == 0); + } + CHK(g_con->execute(Commit) == 0); + if (! rw) { + CHK(verifyBlobValue(tup) == 0); + } + g_ndb->closeTransaction(g_con); + g_opx = 0; + g_con = 0; + } + return 0; +} + +static int +readScan(bool rw, bool idx) +{ + const char* func = ! idx ? "scan read table" : "scan read index"; + DBG("--- " << func << " ---"); + Tup tup; + tup.alloc(); // allocate buffers + NdbResultSet* rs; + CHK((g_con = g_ndb->startTransaction()) != 0); + if (! idx) { + CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_tname)) != 0); + } else { + CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_x2name, g_opt.m_tname)) != 0); + } + CHK((rs = g_ops->readTuples(240, NdbScanOperation::LM_Exclusive)) != 0); + CHK(g_ops->getValue("PK1", (char*)&tup.m_pk1) != 0); + if (g_opt.m_pk2len != 0) + CHK(g_ops->getValue("PK2", tup.m_pk2) != 0); + CHK((g_bh1 = g_ops->getBlobHandle("BL1")) != 0); + if (! g_opt.m_oneblob) + CHK((g_bh2 = g_ops->getBlobHandle("BL2")) != 0); + if (! rw) { + CHK(getBlobValue(tup) == 0); + } + CHK(g_con->execute(NoCommit) == 0); + unsigned rows = 0; + while (1) { + int ret; + tup.m_pk1 = (Uint32)-1; + memset(tup.m_pk2, 'x', g_opt.m_pk2len); + CHK((ret = rs->nextResult(true)) == 0 || ret == 1); + if (ret == 1) + break; + DBG(func << " pk1=" << tup.m_pk1); + Uint32 k = tup.m_pk1 - g_opt.m_pk1off; + CHK(k < g_opt.m_rows && g_tups[k].m_exists); + tup.copy(g_tups[k]); + if (! rw) { + CHK(verifyBlobValue(tup) == 0); + } else { + CHK(readBlobData(tup) == 0); + } + rows++; + } + g_ndb->closeTransaction(g_con); + g_con = 0; + g_ops = 0; + CHK(g_opt.m_rows == rows); + return 0; +} + +static int +deletePk() +{ + DBG("--- deletePk ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("deletePk pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->deleteTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + tup.m_exists = false; + } + return 0; +} + +static int +deleteIdx() +{ + DBG("--- deleteIdx ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("deleteIdx pk1=" << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0); + CHK(g_opx->deleteTuple() == 0); + CHK(g_opx->equal("PK2", tup.m_pk2) == 0); + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opx = 0; + g_con = 0; + tup.m_exists = false; + } + return 0; +} + +static int +deleteScan(bool idx) +{ + const char* func = ! idx ? "scan delete table" : "scan delete index"; + DBG("--- " << func << " ---"); + Tup tup; + NdbResultSet* rs; + CHK((g_con = g_ndb->startTransaction()) != 0); + if (! idx) { + CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_tname)) != 0); + } else { + CHK((g_ops = g_con->getNdbScanOperation(g_opt.m_x2name, g_opt.m_tname)) != 0); + } + CHK((rs = g_ops->readTuples(240, NdbScanOperation::LM_Exclusive)) != 0); + CHK(g_ops->getValue("PK1", (char*)&tup.m_pk1) != 0); + if (g_opt.m_pk2len != 0) + CHK(g_ops->getValue("PK2", tup.m_pk2) != 0); + CHK(g_con->execute(NoCommit) == 0); + unsigned rows = 0; + while (1) { + int ret; + tup.m_pk1 = (Uint32)-1; + memset(tup.m_pk2, 'x', g_opt.m_pk2len); + CHK((ret = rs->nextResult()) == 0 || ret == 1); + if (ret == 1) + break; + DBG(func << " pk1=" << tup.m_pk1); + CHK(rs->deleteTuple() == 0); + CHK(g_con->execute(NoCommit) == 0); + Uint32 k = tup.m_pk1 - g_opt.m_pk1off; + CHK(k < g_opt.m_rows && g_tups[k].m_exists); + g_tups[k].m_exists = false; + rows++; + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_con = 0; + g_opr = 0; + g_ops = 0; + CHK(g_opt.m_rows == rows); + return 0; +} + +// main + +static int +testmain() +{ + g_ndb = new Ndb("TEST_DB"); + CHK(g_ndb->init() == 0); + CHK(g_ndb->waitUntilReady() == 0); + g_dic = g_ndb->getDictionary(); + g_tups = new Tup [g_opt.m_rows]; + CHK(dropTable() == 0); + CHK(createTable() == 0); + if (g_opt.m_bugtest != 0) { + // test a general bug instead of blobs + CHK((*g_opt.m_bugtest)() == 0); + return 0; + } + Bcol& b1 = g_opt.m_blob1; + CHK(NdbBlob::getBlobTableName(b1.m_btname, g_ndb, g_opt.m_tname, "BL1") == 0); + DBG("BL1: inline=" << b1.m_inline << " part=" << b1.m_partsize << " table=" << b1.m_btname); + if (! g_opt.m_oneblob) { + Bcol& b2 = g_opt.m_blob2; + CHK(NdbBlob::getBlobTableName(b2.m_btname, g_ndb, g_opt.m_tname, "BL2") == 0); + DBG("BL2: inline=" << b2.m_inline << " part=" << b2.m_partsize << " table=" << b2.m_btname); + } + if (g_opt.m_seed != 0) + srandom(g_opt.m_seed); + for (unsigned loop = 0; g_opt.m_loop == 0 || loop < g_opt.m_loop; loop++) { + DBG("=== loop " << loop << " ==="); + if (g_opt.m_seed == 0) + srandom(loop); + bool llim = skip('v') ? true : false; + bool ulim = skip('w') ? false : true; + // pk + for (int rw = llim; rw <= ulim; rw++) { + if (skip('k')) + continue; + DBG("--- pk ops " << (! rw ? "get/set" : "read/write") << " ---"); + calcTups(false); + CHK(insertPk(rw) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(rw) == 0); + if (! skip('u')) { + calcTups(rw); + CHK(updatePk(rw) == 0); + CHK(verifyBlob() == 0); + } + CHK(readPk(rw) == 0); + CHK(deletePk() == 0); + CHK(verifyBlob() == 0); + } + // hash index + for (int rw = llim; rw <= ulim; rw++) { + if (skip('i')) + continue; + DBG("--- idx ops " << (! rw ? "get/set" : "read/write") << " ---"); + calcTups(false); + CHK(insertPk(rw) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(rw) == 0); + calcTups(rw); + if (! skip('u')) { + CHK(updateIdx(rw) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(rw) == 0); + } + CHK(deleteIdx() == 0); + CHK(verifyBlob() == 0); + } + // scan table + for (int rw = llim; rw <= ulim; rw++) { + if (skip('s')) + continue; + DBG("--- table scan " << (! rw ? "get/set" : "read/write") << " ---"); + calcTups(false); + CHK(insertPk(rw) == 0); + CHK(verifyBlob() == 0); + CHK(readScan(rw, false) == 0); + CHK(deleteScan(false) == 0); + CHK(verifyBlob() == 0); + } + // scan index + for (int rw = llim; rw <= ulim; rw++) { + if (skip('r')) + continue; + DBG("--- index scan " << (! rw ? "get/set" : "read/write") << " ---"); + calcTups(false); + CHK(insertPk(rw) == 0); + CHK(verifyBlob() == 0); + CHK(readScan(rw, true) == 0); + CHK(deleteScan(true) == 0); + CHK(verifyBlob() == 0); + } + } + delete g_ndb; + return 0; +} + +// bug tests + +static int +bugtest_4088() +{ + DBG("bug test 4088 - ndb api hang with mixed ops on index table"); + // insert rows + calcTups(false); + CHK(insertPk(false) == 0); + // new trans + CHK((g_con = g_ndb->startTransaction()) != 0); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + // read table pk via index as a table + const unsigned pkcnt = 2; + Tup pktup[pkcnt]; + for (unsigned i = 0; i < pkcnt; i++) { + char name[20]; + // XXX guess table id + sprintf(name, "%d/%s", 4, g_opt.m_x1name); + CHK((g_opr = g_con->getNdbOperation(name)) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(g_opr->getValue("NDB$PK", (char*)&pktup[i].m_pk1) != 0); + } + // read blob inline via index as an index + CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0); + CHK(g_opx->readTuple() == 0); + CHK(g_opx->equal("PK2", tup.m_pk2) == 0); + assert(tup.m_blob1.m_buf != 0); + CHK(g_opx->getValue("BL1", (char*)tup.m_blob1.m_buf) != 0); + // execute + // BUG 4088: gets 1 tckeyconf, 1 tcindxconf, then hangs + CHK(g_con->execute(Commit) == 0); + // verify + for (unsigned i = 0; i < pkcnt; i++) { + CHK(pktup[i].m_pk1 == tup.m_pk1); + CHK(memcmp(pktup[i].m_pk2, tup.m_pk2, g_opt.m_pk2len) == 0); + } + CHK(memcmp(tup.m_blob1.m_val, tup.m_blob1.m_buf, 8 + g_opt.m_blob1.m_inline) == 0); + } + return 0; +} + +static int +bugtest_2222() +{ + return 0; +} + +static int +bugtest_3333() +{ + return 0; +} + +static struct { + int m_bug; + int (*m_test)(); +} g_bugtest[] = { + { 4088, bugtest_4088 }, + { 2222, bugtest_2222 }, + { 3333, bugtest_3333 } +}; + NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) { - while (++argv, --argc > 0) { - const char* arg = argv[0]; - if (strcmp(arg, "-core") == 0) { - opt.m_core = true; - continue; - } + while (++argv, --argc > 0) { + const char* arg = argv[0]; + if (strcmp(arg, "-core") == 0) { + g_opt.m_core = true; + continue; + } + if (strcmp(arg, "-dbg") == 0) { + g_opt.m_dbg = true; + continue; + } + if (strcmp(arg, "-dbgall") == 0) { + g_opt.m_dbg = true; + g_opt.m_dbgall = true; + putenv("NDB_BLOB_DEBUG=1"); + continue; + } + if (strcmp(arg, "-full") == 0) { + g_opt.m_full = true; + continue; + } + if (strcmp(arg, "-loop") == 0) { + if (++argv, --argc > 0) { + g_opt.m_loop = atoi(argv[0]); + continue; + } + } + if (strcmp(arg, "-parts") == 0) { + if (++argv, --argc > 0) { + g_opt.m_parts = atoi(argv[0]); + continue; + } + } + if (strcmp(arg, "-rows") == 0) { + if (++argv, --argc > 0) { + g_opt.m_rows = atoi(argv[0]); + continue; + } + } + if (strcmp(arg, "-seed") == 0) { + if (++argv, --argc > 0) { + g_opt.m_seed = atoi(argv[0]); + continue; + } + } + if (strcmp(arg, "-skip") == 0) { + if (++argv, --argc > 0) { + for (const char* p = argv[0]; *p != 0; p++) { + skip(*p) = true; + } + continue; + } + } + // metadata + if (strcmp(arg, "-pk2len") == 0) { + if (++argv, --argc > 0) { + g_opt.m_pk2len = atoi(argv[0]); + if (g_opt.m_pk2len == 0) { + skip('i') = true; + skip('r') = true; + } + if (g_opt.m_pk2len <= g_max_pk2len) + continue; + } + } + if (strcmp(arg, "-oneblob") == 0) { + g_opt.m_oneblob = true; + continue; + } + // bugs + if (strcmp(arg, "-bug") == 0) { + if (++argv, --argc > 0) { + g_opt.m_bug = atoi(argv[0]); + for (unsigned i = 0; i < sizeof(g_bugtest)/sizeof(g_bugtest[0]); i++) { + if (g_opt.m_bug == g_bugtest[i].m_bug) { + g_opt.m_bugtest = g_bugtest[i].m_test; + break; + } + } + if (g_opt.m_bugtest != 0) + continue; + } } - testMain(); - return NDBT_ProgramExit(NDBT_OK); + ndbout << "testOIBasic: unknown option " << arg << endl; + printusage(); + return NDBT_ProgramExit(NDBT_WRONGARGS); + } + if (testmain() == -1) { + return NDBT_ProgramExit(NDBT_FAILED); + } + return NDBT_ProgramExit(NDBT_OK); } -// vim: set sw=4: +// vim: set sw=2 et: diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index a47d9d2099e..0ca8ce79e2e 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -39,6 +39,7 @@ struct Opt { NdbDictionary::Object::FragmentType m_fragtype; const char* m_index; unsigned m_loop; + bool m_nologging; unsigned m_rows; unsigned m_scanrd; unsigned m_scanex; @@ -54,6 +55,7 @@ struct Opt { m_fragtype(NdbDictionary::Object::FragUndefined), m_index(0), m_loop(1), + m_nologging(false), m_rows(1000), m_scanrd(240), m_scanex(240), @@ -82,6 +84,7 @@ printhelp() << " -fragtype T fragment type single/small/medium/large" << endl << " -index xyz only given index numbers (digits 1-9)" << endl << " -loop N loop count full suite forever=0 [" << d.m_loop << "]" << endl + << " -nologging create tables in no-logging mode" << endl << " -rows N rows per thread [" << d.m_rows << "]" << endl << " -scanrd N scan read parallelism [" << d.m_scanrd << "]" << endl << " -scanex N scan exclusive parallelism [" << d.m_scanex << "]" << endl @@ -476,7 +479,7 @@ tt1 = { "TT1", 5, tt1col, 4, tt1itab }; -// tt2 + tt2x1 tt2x2 tt2x3 +// tt2 + tt2x1 tt2x2 tt2x3 tt2x4 static const Col tt2col[] = { @@ -505,6 +508,14 @@ tt2x3col[] = { { 1, tt2col[4] } }; +static const ICol +tt2x4col[] = { + { 0, tt2col[4] }, + { 1, tt2col[3] }, + { 2, tt2col[2] }, + { 3, tt2col[1] } +}; + static const ITab tt2x1 = { "TT2X1", 2, tt2x1col @@ -521,15 +532,21 @@ tt2x3 = { }; static const ITab +tt2x4 = { + "TT2X4", 4, tt2x4col +}; + +static const ITab tt2itab[] = { tt2x1, tt2x2, - tt2x3 + tt2x3, + tt2x4 }; static const Tab tt2 = { - "TT2", 5, tt2col, 3, tt2itab + "TT2", 5, tt2col, 4, tt2itab }; // all tables @@ -823,6 +840,9 @@ createtable(Par par) if (par.m_fragtype != NdbDictionary::Object::FragUndefined) { t.setFragmentType(par.m_fragtype); } + if (par.m_nologging) { + t.setLogging(false); + } for (unsigned k = 0; k < tab.m_cols; k++) { const Col& col = tab.m_col[k]; NdbDictionary::Column c(col.m_name); @@ -2202,7 +2222,6 @@ pkupdateindexbuild(Par par) { if (par.m_no == 0) { CHK(createindex(par) == 0); - CHK(invalidateindex(par) == 0); } else { CHK(pkupdate(par) == 0); } @@ -2493,6 +2512,7 @@ tbusybuild(Par par) RUNSTEP(par, pkinsert, MT); for (unsigned i = 0; i < par.m_subloop; i++) { RUNSTEP(par, pkupdateindexbuild, MT); + RUNSTEP(par, invalidateindex, MT); RUNSTEP(par, readverify, MT); RUNSTEP(par, dropindex, ST); } @@ -2500,9 +2520,28 @@ tbusybuild(Par par) } static int -ttiming(Par par) +ttimebuild(Par par) +{ + Tmr t1; + RUNSTEP(par, droptable, ST); + RUNSTEP(par, createtable, ST); + RUNSTEP(par, invalidatetable, MT); + for (unsigned i = 0; i < par.m_subloop; i++) { + RUNSTEP(par, pkinsert, MT); + t1.on(); + RUNSTEP(par, createindex, ST); + t1.off(par.m_totrows); + RUNSTEP(par, invalidateindex, MT); + RUNSTEP(par, dropindex, ST); + } + LL1("build index - " << t1.time()); + return 0; +} + +static int +ttimemaint(Par par) { - Tmr t0, t1, t2; + Tmr t1, t2; RUNSTEP(par, droptable, ST); RUNSTEP(par, createtable, ST); RUNSTEP(par, invalidatetable, MT); @@ -2511,16 +2550,13 @@ ttiming(Par par) t1.on(); RUNSTEP(par, pkupdate, MT); t1.off(par.m_totrows); - t0.on(); RUNSTEP(par, createindex, ST); RUNSTEP(par, invalidateindex, MT); - t0.off(par.m_totrows); t2.on(); RUNSTEP(par, pkupdate, MT); t2.off(par.m_totrows); RUNSTEP(par, dropindex, ST); } - LL1("build index - " << t0.time()); LL1("update - " << t1.time()); LL1("update indexed - " << t2.time()); LL1("overhead - " << t2.over(t1)); @@ -2551,7 +2587,8 @@ tcaselist[] = { TCase("b", tpkops, "pk operations and scan reads"), TCase("c", tmixedops, "pk operations and scan operations"), TCase("d", tbusybuild, "pk operations and index build"), - TCase("t", ttiming, "time index build and maintenance"), + TCase("t", ttimebuild, "time index build"), + TCase("u", ttimemaint, "time index maintenance"), TCase("z", tdrop, "drop test tables") }; @@ -2689,6 +2726,10 @@ NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535) continue; } } + if (strcmp(arg, "-nologging") == 0) { + g_opt.m_nologging = true; + continue; + } if (strcmp(arg, "-rows") == 0) { if (++argv, --argc > 0) { g_opt.m_rows = atoi(argv[0]); diff --git a/ndb/test/newtonapi/Makefile b/ndb/test/newtonapi/Makefile deleted file mode 100644 index e3eabd26c64..00000000000 --- a/ndb/test/newtonapi/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -include .defs.mk - -DIRS := \ - basic_test \ - perf_test - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/test/odbc/Makefile b/ndb/test/odbc/Makefile deleted file mode 100644 index eb9f2dc9e3e..00000000000 --- a/ndb/test/odbc/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -include .defs.mk - -DIRS += driver - -#ifneq ($(findstring odbc, $(wildcard /usr/lib/libodbc.so)),) -#DIRS += dm-unixodbc -#endif - -ifneq ($(findstring $(NDB_OS), SOLARIS),) -DIRS += dm-iodbc -endif - -include ${NDB_TOP}/Epilogue.mk diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index bb91ce42673..3dd9632ce4b 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -8,7 +8,7 @@ ndbtest_SCRIPTS = atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ EXTRA_DIST = $(ndbtest_SCRIPTS) INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient -LDADD_LOC = $(top_srcdir)/ndb/src/mgmclient/CpcClient.o $(top_srcdir)/ndb/src/libndbclient.la +LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o $(top_builddir)/ndb/src/libndbclient.la include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am diff --git a/ndb/test/run-test/README b/ndb/test/run-test/README new file mode 100644 index 00000000000..d5da8f05c17 --- /dev/null +++ b/ndb/test/run-test/README @@ -0,0 +1,43 @@ +run-test/README + +This document describes how atrt works and how to use it. + +atrt is a test program driver. +atrt supports fully distributed test and utilizes ndb_cpcd. + +================================= +atrt has the following main loop: + +/** + * Psuedo code for atrt + */ + read config file (default d.txt) + contact each ndb_cpcd + start each ndb_mgmd + connect to each ndb_mgmd + for each read(test case) + do + if previous test failed (or is first test) + stop each ndbd + start each ndbd + wait for ndbd to get started + + start each mysqld + + start each test prg + + wait while all is running and max time not elapsed + + stop each mysqld + + stop each test prg + + gather result + + done +/** + * End of psuedo code + */ + +================================= + diff --git a/ndb/test/run-test/atrt-example.tgz b/ndb/test/run-test/atrt-example.tgz Binary files differnew file mode 100644 index 00000000000..8455b2eb00d --- /dev/null +++ b/ndb/test/run-test/atrt-example.tgz diff --git a/ndb/test/run-test/basic.txt b/ndb/test/run-test/basic.txt new file mode 100644 index 00000000000..a952320db08 --- /dev/null +++ b/ndb/test/run-test/basic.txt @@ -0,0 +1,763 @@ +# BASIC FUNCTIONALITY +max-time: 500 +cmd: testBasic +args: -n PkRead + +max-time: 500 +cmd: testBasic +args: -n PkUpdate + +max-time: 500 +cmd: testBasic +args: -n PkDelete + +max-time: 500 +cmd: testBasic +args: -n PkInsert + +max-time: 600 +cmd: testBasic +args: -n UpdateAndRead + +max-time: 500 +cmd: testBasic +args: -n PkReadAndLocker T6 + +max-time: 500 +cmd: testBasic +args: -n PkReadAndLocker2 T6 + +max-time: 500 +cmd: testBasic +args: -n PkReadUpdateAndLocker T6 + +max-time: 500 +cmd: testBasic +args: -n ReadWithLocksAndInserts T6 + +max-time: 500 +cmd: testBasic +args: -n PkInsertTwice T1 T6 T10 + +max-time: 1500 +cmd: testBasic +args: -n Fill T1 + +max-time: 1500 +cmd: testBasic +args: -n Fill T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommitSleep T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommit626 T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommitAndClose T6 + +max-time: 500 +cmd: testBasic +args: -n Commit626 T6 + +max-time: 500 +cmd: testBasic +args: -n CommitTry626 T6 + +max-time: 500 +cmd: testBasic +args: -n CommitAsMuch626 T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommit626 T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommitRollback626 T1 T6 + +max-time: 500 +cmd: testBasic +args: -n Commit630 T1 T6 + +max-time: 500 +cmd: testBasic +args: -n CommitTry630 T1 T6 + +max-time: 500 +cmd: testBasic +args: -n CommitAsMuch630 T1 T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommit630 T1 T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommitRollback630 T1 T6 + +max-time: 500 +cmd: testBasic +args: -n NoCommitAndClose T1 T6 + +max-time: 500 +cmd: testBasic +args: -n RollbackUpdate T1 T6 + +max-time: 500 +cmd: testBasic +args: -n RollbackDeleteMultiple T1 T6 + +max-time: 500 +cmd: testBasic +args: -n ImplicitRollbackDelete T1 T6 + +max-time: 500 +cmd: testBasic +args: -n CommitDelete T1 T6 + +max-time: 500 +cmd: testBasic +args: -n RollbackNothing T1 T6 + +max-time: 500 +cmd: testBasicAsynch +args: -n PkInsertAsynch + +max-time: 500 +cmd: testBasicAsynch +args: -n PkReadAsynch + +max-time: 500 +cmd: testBasicAsynch +args: -n PkUpdateAsynch + +max-time: 500 +cmd: testBasicAsynch +args: -n PkDeleteAsynch + +max-time: 500 +cmd: testBasic +args: -n MassiveRollback T1 T6 T13 + +max-time: 500 +cmd: testBasic +args: -n MassiveRollback2 T1 T6 T13 + +#-m 500 1: testBasic -n ReadConsistency T6 +cmd: testTimeout +args: -n DontTimeoutTransaction T1 + +cmd: testTimeout +args: -n DontTimeoutTransaction5 T1 + +cmd: testTimeout +args: -n TimeoutTransaction T1 + +cmd: testTimeout +args: -n TimeoutTransaction5 T1 + +cmd: testTimeout +args: -n BuddyTransNoTimeout T1 + +cmd: testTimeout +args: -n BuddyTransNoTimeout5 T1 + +# +# SCAN TESTS +# +max-time: 500 +cmd: testScan +args: -n ScanRead16 + +max-time: 500 +cmd: testScan +args: -n ScanRead240 + +max-time: 500 +cmd: testScan +args: -n ScanReadCommitted240 + +max-time: 500 +cmd: testScan +args: -n ScanUpdate + +max-time: 500 +cmd: testScan +args: -n ScanUpdate2 T6 + +max-time: 500 +cmd: testScan +args: -n ScanDelete + +max-time: 500 +cmd: testScan +args: -n ScanDelete2 T10 + +max-time: 500 +cmd: testScan +args: -n ScanUpdateAndScanRead T6 + +max-time: 500 +cmd: testScan +args: -n ScanReadAndLocker T6 + +max-time: 500 +cmd: testScan +args: -n ScanReadAndPkRead T6 + +max-time: 500 +cmd: testScan +args: -n ScanRead488 -l 10 T6 + +max-time: 600 +cmd: testScan +args: -n ScanRead40 -l 100 T2 + +max-time: 1800 +cmd: testScan +args: -n ScanRead100 -l 100 T1 + +max-time: 600 +cmd: testScan +args: -n ScanRead40 -l 100 T1 + +max-time: 1800 +cmd: testScan +args: -n ScanRead40RandomTable -l 100 T1 + +max-time: 3600 +cmd: testScan +args: -n ScanRead40RandomTable -l 1000 T2 + +max-time: 500 +cmd: testScan +args: -n ScanWithLocksAndInserts T6 + +max-time: 500 +cmd: testScan +args: -n ScanReadAbort T6 + +max-time: 500 +cmd: testScan +args: -n ScanReadAbort15 T6 + +max-time: 500 +cmd: testScan +args: -n ScanReadAbort240 T6 + +max-time: 500 +cmd: testScan +args: -n ScanUpdateAbort16 T6 + +max-time: 3600 +cmd: testScan +args: -n ScanReadRestart T1 T6 T13 + +max-time: 500 +cmd: testScan +args: -n ScanUpdateRestart T6 + +max-time: 500 +cmd: testScan +args: -n CheckGetValue T6 + +max-time: 500 +cmd: testScan +args: -n CloseWithoutStop T6 + +max-time: 500 +cmd: testScan +args: -n NextScanWhenNoMore T6 + +max-time: 500 +cmd: testScan +args: -n ExecuteScanWithoutOpenScan T6 + +max-time: 500 +cmd: testScan +args: -n OnlyOpenScanOnce T6 + +max-time: 500 +cmd: testScan +args: -n OnlyOneOpInScanTrans T6 + +max-time: 500 +cmd: testScan +args: -n OnlyOneOpBeforeOpenScan T6 + +max-time: 500 +cmd: testScan +args: -n OnlyOneScanPerTrans T6 + +max-time: 500 +cmd: testScan +args: -n NoCloseTransaction T6 + +max-time: 500 +cmd: testScan +args: -n CheckInactivityTimeOut T6 + +max-time: 500 +cmd: testScan +args: -n CheckInactivityBeforeClose T6 + +max-time: 500 +cmd: testScan +args: -n CheckAfterTerror T6 + +max-time: 500 +cmd: testScan +args: -n ScanReadError5021 T1 + +max-time: 500 +cmd: testScan +args: -n ScanReaderror5022 T1 + +max-time: 500 +cmd: testScan +args: -n ScanReadError5023 T1 + +max-time: 500 +cmd: testScan +args: -n ScanReadError5024 T1 + +max-time: 500 +cmd: testScan +args: -n ScanReadError5025 T1 + +max-time: 500 +cmd: testScan +args: -n ScanReadError5030 T1 + +# OLD FLEX +max-time: 500 +cmd: flexBench +args: -c 25 -t 10 + +max-time: 500 +cmd: flexHammer +args: -r 5 -t 32 + +# +# DICT TESTS +max-time: 1500 +cmd: testDict +args: -n CreateAndDrop + +max-time: 1500 +cmd: testDict +args: -n CreateAndDropWithData + +max-time: 1500 +cmd: testDict +args: -n CreateAndDropDuring T6 T10 + +max-time: 1500 +cmd: testDict +args: -n CreateInvalidTables + +max-time: 1500 +cmd: testDict +args: -n CreateTableWhenDbIsFull T6 + +max-time: 1500 +cmd: testDict +args: -n CreateMaxTables T6 + +max-time: 500 +cmd: testDict +args: -n FragmentTypeSingle T1 + +max-time: 1500 +cmd: testDict +args: -n FragmentTypeAll T1 T6 T7 T8 + +max-time: 1500 +cmd: testDict +args: -n FragmentTypeAllLarge T1 T6 T7 T8 + +max-time: 1500 +cmd: testDict +args: -n TemporaryTables T1 T6 T7 T8 + +# +# TEST NDBAPI +# +max-time: 500 +cmd: testDataBuffers +args: + +# Testsuite: testNdbApi +# Number of tests: 5 +max-time: 500 +cmd: testNdbApi +args: -n MaxNdb T6 + +max-time: 500 +cmd: testNdbApi +args: -n MaxTransactions T1 T6 T7 T8 T13 + +max-time: 500 +cmd: testNdbApi +args: -n MaxOperations T1 T6 T7 T8 T13 + +max-time: 500 +cmd: testNdbApi +args: -n MaxGetValue T1 T6 T7 T8 T13 + +max-time: 500 +cmd: testNdbApi +args: -n MaxEqual + +max-time: 500 +cmd: testNdbApi +args: -n DeleteNdb T1 T6 + +max-time: 500 +cmd: testNdbApi +args: -n WaitUntilReady T1 T6 T7 T8 T13 + +max-time: 500 +cmd: testNdbApi +args: -n GetOperationNoTab T6 + +max-time: 500 +cmd: testNdbApi +args: -n NdbErrorOperation T6 + +max-time: 500 +cmd: testNdbApi +args: -n MissingOperation T6 + +max-time: 500 +cmd: testNdbApi +args: -n GetValueInUpdate T6 + +max-time: 500 +cmd: testNdbApi +args: -n UpdateWithoutKeys T6 + +max-time: 500 +cmd: testNdbApi +args: -n UpdateWithoutValues T6 + +max-time: 500 +cmd: testInterpreter +args: T1 + +max-time: 1500 +cmd: testOperations +args: -n ReadRead + +max-time: 1500 +cmd: testOperations +args: -n ReadReadEx + +max-time: 1500 +cmd: testOperations +args: -n ReadInsert + +max-time: 1500 +cmd: testOperations +args: -n ReadUpdate + +max-time: 1500 +cmd: testOperations +args: -n ReadDelete + +max-time: 1500 +cmd: testOperations +args: -n FReadRead + +max-time: 1500 +cmd: testOperations +args: -n FReadReadEx + +max-time: 1500 +cmd: testOperations +args: -n FReadInsert + +max-time: 1500 +cmd: testOperations +args: -n FReadUpdate + +max-time: 1500 +cmd: testOperations +args: -n FReadDelete + +max-time: 1500 +cmd: testOperations +args: -n ReadExRead + +max-time: 1500 +cmd: testOperations +args: -n ReadExReadEx + +max-time: 1500 +cmd: testOperations +args: -n ReadExInsert + +max-time: 1500 +cmd: testOperations +args: -n ReadExUpdate + +max-time: 1500 +cmd: testOperations +args: -n ReadExDelete + +max-time: 1500 +cmd: testOperations +args: -n InsertRead + +max-time: 1500 +cmd: testOperations +args: -n InsertReadEx + +max-time: 1500 +cmd: testOperations +args: -n InsertInsert + +max-time: 1500 +cmd: testOperations +args: -n InsertUpdate + +max-time: 1500 +cmd: testOperations +args: -n InsertDelete + +max-time: 1500 +cmd: testOperations +args: -n UpdateRead + +max-time: 1500 +cmd: testOperations +args: -n UpdateReadEx + +max-time: 1500 +cmd: testOperations +args: -n UpdateInsert + +max-time: 1500 +cmd: testOperations +args: -n UpdateUpdate + +max-time: 1500 +cmd: testOperations +args: -n UpdateDelete + +max-time: 1500 +cmd: testOperations +args: -n DeleteRead + +max-time: 1500 +cmd: testOperations +args: -n DeleteReadEx + +max-time: 1500 +cmd: testOperations +args: -n DeleteInsert + +max-time: 1500 +cmd: testOperations +args: -n DeleteUpdate + +max-time: 1500 +cmd: testOperations +args: -n DeleteDelete + +max-time: 1500 +cmd: testOperations +args: -n ReadSimpleRead + +max-time: 1500 +cmd: testOperations +args: -n ReadDirtyRead + +max-time: 1500 +cmd: testOperations +args: -n FReadSimpleRead + +max-time: 1500 +cmd: testOperations +args: -n FReadDirtyRead + +max-time: 1500 +cmd: testOperations +args: -n ReadExSimpleRead + +max-time: 1500 +cmd: testOperations +args: -n ReadExDirtyRead + +max-time: 1500 +cmd: testOperations +args: -n InsertSimpleRead + +max-time: 1500 +cmd: testOperations +args: -n InsertDirtyRead + +max-time: 1500 +cmd: testOperations +args: -n UpdateSimpleRead + +max-time: 1500 +cmd: testOperations +args: -n UpdateDirtyRead + +max-time: 1500 +cmd: testOperations +args: -n DeleteSimpleRead + +max-time: 1500 +cmd: testOperations +args: -n DeleteDirtyRead + +max-time: 1500 +cmd: testTransactions +args: -n ReadRead + +max-time: 1500 +cmd: testTransactions +args: -n ReadReadEx + +max-time: 1500 +cmd: testTransactions +args: -n ReadInsert + +max-time: 1500 +cmd: testTransactions +args: -n ReadUpdate + +max-time: 1500 +cmd: testTransactions +args: -n ReadDelete + +max-time: 1500 +cmd: testTransactions +args: -n ReadExRead + +max-time: 1500 +cmd: testTransactions +args: -n ReadExReadEx + +max-time: 1500 +cmd: testTransactions +args: -n ReadExInsert + +max-time: 1500 +cmd: testTransactions +args: -n ReadExUpdate + +max-time: 1500 +cmd: testTransactions +args: -n ReadExDelete + +max-time: 1500 +cmd: testTransactions +args: -n InsertRead + +max-time: 1500 +cmd: testTransactions +args: -n InsertReadEx + +max-time: 1500 +cmd: testTransactions +args: -n InsertInsert + +max-time: 1500 +cmd: testTransactions +args: -n InsertUpdate + +max-time: 1500 +cmd: testTransactions +args: -n InsertDelete + +max-time: 1500 +cmd: testTransactions +args: -n UpdateRead + +max-time: 1500 +cmd: testTransactions +args: -n UpdateReadEx + +max-time: 1500 +cmd: testTransactions +args: -n UpdateInsert + +max-time: 1500 +cmd: testTransactions +args: -n UpdateUpdate + +max-time: 1500 +cmd: testTransactions +args: -n UpdateDelete + +max-time: 1500 +cmd: testTransactions +args: -n DeleteRead + +max-time: 1500 +cmd: testTransactions +args: -n DeleteReadEx + +max-time: 1500 +cmd: testTransactions +args: -n DeleteInsert + +max-time: 1500 +cmd: testTransactions +args: -n DeleteUpdate + +max-time: 1500 +cmd: testTransactions +args: -n DeleteDelete + +max-time: 1500 +cmd: testTransactions +args: -n ReadSimpleRead + +max-time: 1500 +cmd: testTransactions +args: -n ReadDirtyRead + +max-time: 1500 +cmd: testTransactions +args: -n ReadExSimpleRead + +max-time: 1500 +cmd: testTransactions +args: -n ReadExDirtyRead + +max-time: 1500 +cmd: testTransactions +args: -n InsertSimpleRead + +max-time: 1500 +cmd: testTransactions +args: -n InsertDirtyRead + +max-time: 1500 +cmd: testTransactions +args: -n UpdateSimpleRead + +max-time: 1500 +cmd: testTransactions +args: -n UpdateDirtyRead + +max-time: 1500 +cmd: testTransactions +args: -n DeleteSimpleRead + +max-time: 1500 +cmd: testTransactions +args: -n DeleteDirtyRead + +max-time: 1500 +cmd: testRestartGci +args: T6 + diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index 7fc7d375dc2..9e318b0219e 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -30,35 +30,6 @@ #include <mgmapi.h> #include "CpcClient.hpp" -/** - psuedo code for run-test.bin - - define autotest_wrapper process at each host - start ndb-processes - - for each testcase - do - start mysqld processes - start replication processes - start test programs - - wait until test program finished or max time passed - - stop test program - stop replication processes - stop mysqld processes - - write report data-file - if test failed and ! last test - restart ndb processes - - drop all tables created by test - done - - stop ndb processes - undefined wrapper processes -*/ - /** Global variables */ static const char progname[] = "ndb_atrt"; static const char * g_gather_progname = "atrt-gather-result.sh"; @@ -75,6 +46,7 @@ static const char * g_report_filename = 0; static const char * g_default_user = 0; static const char * g_default_base_dir = 0; static int g_default_base_port = 0; +static int g_mysqld_use_base = 1; static int g_report = 0; static int g_verbosity = 0; @@ -158,10 +130,17 @@ main(int argc, const char ** argv){ if(!start_processes(g_config, atrt_process::NDB_DB)) goto end; - - if(!wait_ndb(g_config, NDB_MGM_NODE_STATUS_STARTED)) - goto end; - + + if(!wait_ndb(g_config, NDB_MGM_NODE_STATUS_NOT_STARTED)) + goto end; + + for(Uint32 i = 0; i<3; i++) + if(wait_ndb(g_config, NDB_MGM_NODE_STATUS_STARTED)) + goto started; + + goto end; + +started: g_logger.info("Ndb start completed"); } @@ -347,7 +326,7 @@ parse_args(int argc, const char** argv){ return false; } - g_default_user = strdup(getenv("USER")); + g_default_user = strdup(getenv("LOGNAME")); return true; } @@ -378,6 +357,7 @@ setup_config(atrt_config& config){ int lineno = 0; char buf[2048]; BaseString connect_string; + int mysql_port_offset = 0; while(fgets(buf, 2048, f)){ lineno++; @@ -409,6 +389,11 @@ setup_config(atrt_config& config){ continue; } + if(split1[0].trim() == "mysqld-use-base" && split1[1].trim() == "no"){ + g_mysqld_use_base = 0; + continue; + } + Vector<BaseString> hosts; if(split1[1].trim().split(hosts) <= 0){ g_logger.warning("Invalid line %d in %s - ignoring", @@ -483,6 +468,21 @@ setup_config(atrt_config& config){ proc.m_proc.m_path.assign(dir).append("/libexec/ndbd"); proc.m_proc.m_args = "-i -n"; proc.m_proc.m_cwd.appfmt("%d.ndbd", index); + } else if(split1[0] == "mysqld"){ + proc.m_type = atrt_process::MYSQL_SERVER; + proc.m_proc.m_name.assfmt("%d-%s", index, "mysqld"); + proc.m_proc.m_path.assign(dir).append("/libexec/mysqld"); + proc.m_proc.m_args = "--core-file --ndbcluster"; + proc.m_proc.m_cwd.appfmt("%d.mysqld", index); + if(mysql_port_offset > 0 || g_mysqld_use_base){ + // setup mysql specific stuff + const char * basedir = proc.m_proc.m_cwd.c_str(); + proc.m_proc.m_args.appfmt("--datadir=%s", basedir); + proc.m_proc.m_args.appfmt("--pid-file=%s/mysql.pid", basedir); + proc.m_proc.m_args.appfmt("--socket=%s/mysql.sock", basedir); + proc.m_proc.m_args.appfmt("--port=%d", + g_default_base_port-(++mysql_port_offset)); + } } else if(split1[0] == "api"){ proc.m_type = atrt_process::NDB_API; proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api"); @@ -707,7 +707,7 @@ bool start_processes(atrt_config& config, int types){ for(size_t i = 0; i<config.m_processes.size(); i++){ atrt_process & proc = config.m_processes[i]; - if((types & proc.m_type) != 0){ + if((types & proc.m_type) != 0 && proc.m_proc.m_path != ""){ if(!start_process(proc)){ return false; } @@ -775,18 +775,24 @@ update_status(atrt_config& config, int){ for(size_t i = 0; i<config.m_processes.size(); i++){ atrt_process & proc = config.m_processes[i]; - Vector<SimpleCpcClient::Process> & h_procs = m_procs[proc.m_host->m_index]; - bool found = false; - for(size_t j = 0; j<h_procs.size(); j++){ - if(proc.m_proc.m_id == h_procs[j].m_id){ - found = true; - proc.m_proc.m_status = h_procs[j].m_status; - break; + if(proc.m_proc.m_id != -1){ + Vector<SimpleCpcClient::Process> &h_procs= m_procs[proc.m_host->m_index]; + bool found = false; + for(size_t j = 0; j<h_procs.size(); j++){ + if(proc.m_proc.m_id == h_procs[j].m_id){ + found = true; + proc.m_proc.m_status = h_procs[j].m_status; + break; + } + } + if(!found){ + g_logger.error("update_status: not found"); + g_logger.error("id: %d host: %s cmd: %s", + proc.m_proc.m_id, + proc.m_hostname.c_str(), + proc.m_proc.m_path.c_str()); + return false; } - } - if(!found){ - g_logger.error("update_status: not found"); - return false; } } return true; @@ -893,16 +899,24 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){ return false; } - for(size_t i = 0; i<config.m_processes.size(); i++){ + size_t i = 0; + for(; i<config.m_processes.size(); i++){ atrt_process & proc = config.m_processes[i]; if(proc.m_type == atrt_process::NDB_API){ - proc.m_proc.m_path.assign(proc.m_host->m_base_dir).append("/bin/").append(tc.m_command); + proc.m_proc.m_path.assfmt("%s/bin/%s", proc.m_host->m_base_dir.c_str(), + tc.m_command.c_str()); proc.m_proc.m_args.assign(tc.m_args); - return true; + break; } } - - return false; + for(i++; i<config.m_processes.size(); i++){ + atrt_process & proc = config.m_processes[i]; + if(proc.m_type == atrt_process::NDB_API){ + proc.m_proc.m_path.assign(""); + proc.m_proc.m_args.assign(""); + } + } + return true; } bool diff --git a/ndb/test/run-test/make-html-reports.sh b/ndb/test/run-test/make-html-reports.sh index 079650a729f..89f13a4b62a 100755 --- a/ndb/test/run-test/make-html-reports.sh +++ b/ndb/test/run-test/make-html-reports.sh @@ -1,106 +1,23 @@ #!/bin/sh -# NAME -# make-html-reports.sh -# -# SYNOPSIS -# make-html-reports.sh [-q] [ -R <YYYY-MM-DD> ] [ -s <src dir> ] [ -d <dst dir> ] [ -c <conf dir> ] -# -# DESCRIPTION -# -# OPTIONS -# -# EXAMPLES -# -# -# ENVIRONMENT -# NDB_PROJ_HOME Home dir for ndb -# -# FILES -# $NDB_PROJ_HOME/lib/funcs.sh general shell script functions -# -# -# SEE ALSO -# -# DIAGNOSTICTS -# -# VERSION -# 1.0 -# -# AUTHOR -# Jonas Oreland -# - -progname=`basename $0` -synopsis="make-html-reports.sh [ -R <YYYY-MM-DD> ] [ -s <src dir> ] [ -d <dst dir> ] [ -c <conf dir> ]" - -: ${NDB_PROJ_HOME:?} # If undefined, exit with error message - -: ${NDB_LOCAL_BUILD_OPTIONS:=--} # If undef, set to --. Keeps getopts happy. - # You may have to experiment a bit - # to get quoting right (if you need it). - - -. $NDB_PROJ_HOME/lib/funcs.sh # Load some good stuff - -# defaults for options related variables -# - - -src_dir=`pwd` -dst_dir=`pwd` -conf_dir=`pwd` -report_date=`date '+%Y-%m-%d'` -uniq_id=$$.$$ -verbose=yes - -# used if error when parsing the options environment variable -# -env_opterr="options environment variable: <<$options>>" - -# Option parsing, for the options variable as well as the command line. -# -# We want to be able to set options in an environment variable, -# as well as on the command line. In order not to have to repeat -# the same getopts information twice, we loop two times over the -# getopts while loop. The first time, we process options from -# the options environment variable, the second time we process -# options from the command line. -# -# The things to change are the actual options and what they do. -# -# - -for optstring in "$options" "" # 1. options variable 2. cmd line -do - - while getopts q:s:R:d:c: i $optstring # optstring empty => no arg => cmd line - do - case $i in - - q) verbose="";; # echo important things - d) dst_dir=$OPTARG;; # Destination directory - s) src_dir=$OPTARG;; # Destination directory - c) conf_dir=$OPTARG;; # - R) report_date=$OPTARG;; # - \?) syndie $env_opterr;; # print synopsis and exit - - esac - done - - [ -n "$optstring" ] && OPTIND=1 # Reset for round 2, cmdline options - env_opterr= # Round 2 should not use the value +src_dir=$1 +run=$2 +date=$3 +src_file=$src_dir/report.txt -done -shift `expr $OPTIND - 1` - -src_dir=`abspath $src_dir` -dst_dir=`abspath $dst_dir` -conf_dir=`abspath $conf_dir` +if [ ! -f $src_dir/report.txt ] +then + echo "$src_dir/report.txt is missing" + exit 1 +fi ### # # General html functions +trim(){ + echo $* +} + header(){ cat <<EOF <html><head><title>$*</title></head> @@ -166,64 +83,7 @@ hr(){ EOF } -# --- option parsing done --- - # -- Verify -trace "Verifying arguments" -summary_file=$src_dir/reports/summary.$report_date - -if [ ! -r $summary_file ] -then - syndie "Invalid src directory or report date: $summary_file not found" -fi - -if [ ! -d $conf_dir/configurations ] -then - syndie "Invalid src directory: $conf_dir/configurations not found" -fi - -if [ ! -d $conf_dir/testcases ] -then - syndie "Invalid src directory: $conf_dir/testcases not found" -fi - -if [ ! -d $dst_dir ] -then - syndie "Invalid dst dir..." -fi - -# --- option verifying done --- - -trace "src_dir: $src_dir" -trace "dst_dir: $dst_dir" -trace "conf_dir: $conf_dir" -trace "report date: $report_date" - -### -config_spec(){ - cat <<EOF -<a href=#$1>$1</a> -EOF -} - -config_spec_include(){ - # Print the $1 file to the file we are generating - cat <<EOF -<a name=$1><pre> -EOF - if [ -r $conf_dir/configurations/$1 ] - then - cat -E $conf_dir/configurations/$1 | sed 's/\$/<BR>/g' - else - cat <<EOF - Config spec $1 not found -EOF - fi -cat <<EOF -</pre></a> -EOF -} - time_spec(){ # $1 - secs _ts_tmp=$1 @@ -232,8 +92,14 @@ time_spec(){ _ts_tmp=`expr $_ts_tmp / 60` _ts_m=`expr $_ts_tmp % 60` - _ts_tmp=`expr $_ts_tmp / 60` + if [ $_ts_tmp -ge 60 ] + then + _ts_tmp=`expr $_ts_tmp / 60` + else + _ts_tmp=0 + fi + a=3 _ts_h=$_ts_tmp if [ $_ts_h -gt 0 ] @@ -247,191 +113,77 @@ time_spec(){ echo $ret } -log_spec(){ - _ff_=$src_dir/log/$report_date/$1.$2/test.$3.out - if [ -r $_ff_ ] && [ -s $_ff_ ] - then - _f2_=$dst_dir/log.$report_date.$1.$2.$3.out.gz - if [ -r $_f2_ ] - then - rm $_f2_ - fi - cp $_ff_ $dst_dir/log.$report_date.$1.$2.$3.out - gzip $dst_dir/log.$report_date.$1.$2.$3.out - rm -f $dst_dir/log.$report_date.$1.$2.$3.out - echo "<a href=log.$report_date.$1.$2.$3.out.gz>Log file</a>" - else - echo "-" - fi -} +### Main -err_spec(){ - _ff_=$src_dir/log/$report_date/$1.$2/test.$3.err.tar - if [ -r $_ff_ ] && [ -s $_ff_ ] - then - cp $_ff_ $dst_dir/err.$report_date.$1.$2.$3.err.tar - gzip $dst_dir/err.$report_date.$1.$2.$3.err.tar - rm -f $dst_dir/err.$report_date.$1.$2.$3.err.tar - echo "<a href=err.$report_date.$1.$2.$3.err.tar.gz>Error tarball</a>" - else - echo "-" - fi -} +report_file=$src_dir/report.html +summary_file=$src_dir/summary.html -command_spec(){ - echo $* | sed 's/;/<BR>/g' -} +passed=0 +failed=0 +total=0 -### Main +pass(){ + passed=`expr $passed + 1` +} -html_summary_file=$dst_dir/summary.$report_date.html +fail(){ + failed=`expr $failed + 1` +} -trace "Creating summary" ( - eval `grep "TOTAL" $summary_file | awk -F";" '{ printf("test_file=\"%s\"; elapsed=\"%s\"; started=\"%s\"; stopped=\"%s\"", $2, $3, $4, $5); }'` - - header "Autotest summary $report_date" - heading 1 "Autotest summary $report_date" - table - row ; column `bold test file: `; column $test_file ; end_row - row ; column `bold Started:` ; column "$started "; end_row - row ; column `bold Stopped:` ; column "$stopped "; end_row - row ; column `bold Elapsed:` ; column "`time_spec $elapsed secs`" ; end_row - end_table - hr - - table "border=1" - row - c_column `bold Report` - c_column `bold Tag` - c_column `bold Version` - c_column `bold Distr-Config` - c_column `bold Db-Config` - c_column `bold Type` - c_column `bold Test file` - c_column `bold Make` - c_column `bold Config` - c_column `bold Test time` - c_column `bold Passed` - c_column `bold Failed` - end_row - - grep -v "^#" $summary_file | grep -v TOTAL | sed 's/;/ /g' | \ - while read tag version config template type test_file make_res make_time conf_res conf_time test_time passed failed - do + header Report $run $date + table "border=1" row - if [ -r $src_dir/reports/report.$tag.$version.$config.$template.$type.$test_file.$report_date ] - then - column "<a href=\"report.$tag.$version.$config.$template.$type.$test_file.$report_date.html\">report</a>" - else - column "-" - fi - - column $tag - column $version - column $config - column $template - column $type - column $test_file - column "$make_res(`time_spec $make_time`)" - column "$conf_res(`time_spec $conf_time`)" - c_column "`time_spec $test_time`" - c_column `bold $passed` - c_column `bold $failed` + column `bold Test case` + column `bold Result` + column `bold Elapsed` + column `bold Log` end_row - done - end_table +) > $report_file - footer -) > $html_summary_file - -for i in $src_dir/reports/report.*.$report_date +cat $src_file | while read line do - f=`basename $i` - trace "Creating report: $f" - eval `echo $f | awk -F"." '{printf("tag=%s;version=%s;config=%s;template=%s;type=%s;test_file=%s", $2, $3, $4, $5, $6, $7);}'` - - ( - header "Autotest report $report_date" - heading 1 "Autotest report $report_date" - table #"border=1" - row ; column `bold Tag:`; column $tag ; end_row - row ; column `bold Version:` ; column $version ; end_row - row ; column `bold Configuration:` ; column `config_spec $config`; end_row - row ; column `bold Template:` ; column `config_spec $template`; end_row - row ; column `bold Type:` ; column $type ; end_row - row ; column `bold Test file:` ; column $test_file; end_row - end_table - hr - - table "border=1" - row - c_column `bold Test case` - c_column `bold Result` - c_column `bold Test time` - c_column `bold Logfile` - c_column `bold Error tarfile` - end_row - - grep -v "^#" $i | sed 's/;/ /g' | \ - while read test_no test_res test_time cmd - do - row - column "`command_spec $cmd`" - case "$test_res" in - 0) - column "PASSED";; - 1001) - column "API error";; - 1002) - column "Max time expired";; - 1003) - column "Mgm port busy";; - *) - column "Unknown: $test_res";; - esac - - column "`time_spec $test_time`" - - column "`log_spec $tag $version $test_no`" - column "`err_spec $tag $version $test_no`" - end_row - done - end_table - - # Last on page we include spec - # of used machines and template for config - # for future reference - hr - table "border=1" - row; column `bold Configuration:` $config; end_row - row; column `config_spec_include $config`; end_row - end_table - hr - table "border=1" - row; column `bold Template:` $template; end_row - row; column `config_spec_include $template`; end_row - end_table - - footer - - ) > $dst_dir/$f.html + eval `echo $line | awk -F";" '{ printf("prg=\"%s\"; no=\"%s\"; res=\"%s\"; time=\"%s\"", $1, $2, $3, $4); }'` + + prg=`trim $prg` + no=`trim $no` + res=`trim $res` + time=`trim $time` + res_dir="<a href=\"result.$no/\">log</a>" + + ts=`time_spec $time` + res_txt="" + case $res in + 0) pass; res_txt="PASSED"; res_dir=" ";; + *) fail; res_txt="FAILED";; + esac + total=`expr $total + $time` + + ( + row + column $prg + column $res_txt + column $ts + column $res_dir + end_row + ) >> $report_file + + ( + row + column $run + column $date + column $passed + column $failed + column `time_spec $total` + column "<a href=\"result-$run/$date/report.html\">report</a>" + column "<a href=\"result-$run/$date/log.txt\">log.txt</a>" + end_row + ) > $summary_file done -# Re creating index -trace "Recreating index" ( - header "Autotest super-duper index" - heading 1 "<center>Autotest super-duper index</center>" - hr - for i in `ls $dst_dir/summary.*.html | sort -r -n` - do - f=`basename $i` - cat <<EOF -<p><a href=$f>$f</a></p> -EOF - done - footer -) > $dst_dir/index.html + end_table + footer +) >> $report_file exit 0 diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index d062eeae76c..a513086dc33 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -8,7 +8,8 @@ libNDBT_a_SOURCES = \ HugoOperations.cpp HugoTransactions.cpp \ HugoAsynchTransactions.cpp UtilTransactions.cpp \ NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \ - NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp + NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp \ + NdbSchemaCon.cpp NdbSchemaOp.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/common/mgmcommon -I$(top_srcdir)/ndb/include/mgmcommon -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/src/mgmapi diff --git a/ndb/test/src/NDBT_ResultRow.cpp b/ndb/test/src/NDBT_ResultRow.cpp index 350a9719c2c..7c419444760 100644 --- a/ndb/test/src/NDBT_ResultRow.cpp +++ b/ndb/test/src/NDBT_ResultRow.cpp @@ -110,86 +110,10 @@ BaseString NDBT_ResultRow::c_str() { return str; } - -/** - * TODO This should share the same printer function as in - * NdbEventOperationImpl.cpp, using new types of course :) - */ - NdbOut & operator << (NdbOut& ndbout, const NDBT_ResultRow & res) { - for(int i = 0; i<res.cols; i++){ - if(res.data[i]->isNULL()) - ndbout << "NULL"; - else{ - const int size = res.data[i]->attrSize(); - const int aSize = res.data[i]->arraySize(); - switch(convertColumnTypeToAttrType(res.data[i]->getType())){ - case UnSigned: - switch(size){ - case 8: - ndbout << res.data[i]->u_64_value(); - break; - case 4: - ndbout << res.data[i]->u_32_value(); - break; - case 2: - ndbout << res.data[i]->u_short_value(); - break; - case 1: - ndbout << (unsigned) res.data[i]->u_char_value(); - break; - default: - ndbout << "Unknown size"; - } - break; - - case Signed: - switch(size){ - case 8: - ndbout << res.data[i]->int64_value(); - break; - case 4: - ndbout << res.data[i]->int32_value(); - break; - case 2: - ndbout << res.data[i]->short_value(); - break; - case 1: - ndbout << (int) res.data[i]->char_value(); - break; - default: - ndbout << "Unknown size"; - } - break; - - case String: - { - char * buf = new char[aSize+1]; - memcpy(buf, res.data[i]->aRef(), aSize); - buf[aSize] = 0; - ndbout << buf; - delete [] buf; - // Null terminate string - //res.data[i][res.sizes[i]] = 0; - //ndbout << res.data[i]; - } - break; - - case Float: - ndbout_c("%f", res.data[i]->float_value()); - break; - - default: - ndbout << "Unknown(" << - convertColumnTypeToAttrType(res.data[i]->getType()) << ")"; - break; - } - } - if (i < res.cols-1) - ndbout << res.ad; - } - + for(int i = 0; i<res.cols; i++) + ndbout << *(res.data[i]) << "\t"; return ndbout; } diff --git a/ndb/test/src/NDBT_Table.cpp b/ndb/test/src/NDBT_Table.cpp index 48c8567e10e..485377e690a 100644 --- a/ndb/test/src/NDBT_Table.cpp +++ b/ndb/test/src/NDBT_Table.cpp @@ -14,105 +14,35 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "NDBT_Table.hpp" +#include <NDBT_Table.hpp> #include <NdbTimer.hpp> #include <NDBT.hpp> - class NdbOut& operator <<(class NdbOut& ndbout, const NDBT_Attribute & attr){ NdbDictionary::Column::Type type = attr.getType(); - bool key = attr.getPrimaryKey(); - bool null = attr.getNullable(); - ndbout << attr.getName() << " "; - char tmp[100]; - if(attr.getLength() != 1) - snprintf(tmp, 100," [%d]", attr.getLength()); - else - tmp[0] = 0; + ndbout << attr.getName() << " " << type; switch(type){ - case NdbDictionary::Column::Tinyint: - ndbout << "Tinyint" << tmp; - break; - case NdbDictionary::Column::Tinyunsigned: - ndbout << "Tinyunsigned" << tmp; - break; - case NdbDictionary::Column::Smallint: - ndbout << "Smallint" << tmp; - break; - case NdbDictionary::Column::Smallunsigned: - ndbout << "Smallunsigned" << tmp; - break; - case NdbDictionary::Column::Mediumint: - ndbout << "Mediumint" << tmp; - break; - case NdbDictionary::Column::Mediumunsigned: - ndbout << "Mediumunsigned" << tmp; - break; - case NdbDictionary::Column::Int: - ndbout << "Int" << tmp; - break; - case NdbDictionary::Column::Unsigned: - ndbout << "Unsigned" << tmp; - break; - case NdbDictionary::Column::Bigint: - ndbout << "Bigint" << tmp; - break; - case NdbDictionary::Column::Bigunsigned: - ndbout << "Bigunsigned" << tmp; - break; - case NdbDictionary::Column::Float: - ndbout << "Float" << tmp; - break; - case NdbDictionary::Column::Double: - ndbout << "Double" << tmp; - break; case NdbDictionary::Column::Decimal: - ndbout << "Decimal(" - << attr.getScale() << ", " << attr.getPrecision() << ")" - << tmp; - break; - case NdbDictionary::Column::Char: - ndbout << "Char(" << attr.getLength() << ")"; - break; - case NdbDictionary::Column::Varchar: - ndbout << "Varchar(" << attr.getLength() << ")"; - break; - case NdbDictionary::Column::Binary: - ndbout << "Binary(" << attr.getLength() << ")"; - break; - case NdbDictionary::Column::Varbinary: - ndbout << "Varbinary(" << attr.getLength() << ")"; - break; - case NdbDictionary::Column::Datetime: - ndbout << "Datetime" << tmp; - break; - case NdbDictionary::Column::Timespec: - ndbout << "Timespec" << tmp; - break; - case NdbDictionary::Column::Blob: - ndbout << "Blob" << tmp; - break; - case NdbDictionary::Column::Undefined: - ndbout << "Undefined" << tmp; + ndbout << "(" << attr.getScale() << ", " << attr.getPrecision() << ")"; break; default: - ndbout << "Unknown(" << type << ")"; + break; } - ndbout << " "; - if(null){ - ndbout << "NULL"; - } else { - ndbout << "NOT NULL"; - } - ndbout << " "; + if(attr.getLength() != 1) + ndbout << "[" << attr.getLength() << "]"; + + if(attr.getNullable()) + ndbout << " NULL"; + else + ndbout << " NOT NULL"; - if(key) - ndbout << "PRIMARY KEY"; + if(attr.getPrimaryKey()) + ndbout << " PRIMARY KEY"; return ndbout; } diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 13dc67748a5..169034e0c07 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -90,8 +90,9 @@ NdbBackup::getFileSystemPathForNode(int _node_id){ ndbout << "Invalid configuration fetched, DB missing" << endl; return NULL; } - unsigned int type; - if(!iter.get(CFG_TYPE_OF_SECTION, &type) || type != NODE_TYPE_DB){ + unsigned int type = 123456; + if(iter.get(CFG_TYPE_OF_SECTION, &type) || type != NODE_TYPE_DB){ + ndbout <<"type = " << type << endl; ndbout <<"Invalid configuration fetched, I'm wrong type of node" << endl; return NULL; } @@ -114,10 +115,13 @@ NdbBackup::execRestore(bool _restore_data, const int buf_len = 1000; char buf[buf_len]; + ndbout << "getFileSystemPathForNode "<< _node_id <<endl; + const char* path = getFileSystemPathForNode(_node_id); if (path == NULL) return -1; + ndbout << "getHostName "<< _node_id <<endl; const char *host; if (!getHostName(_node_id, &host)){ return -1; @@ -138,7 +142,7 @@ NdbBackup::execRestore(bool _restore_data, ndbout << "res: " << res << endl; #if 0 - snprintf(buf, 255, "restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s %s/BACKUP/BACKUP-%d", + snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s %s/BACKUP/BACKUP-%d", ownNodeId, addr, _node_id, @@ -150,7 +154,7 @@ NdbBackup::execRestore(bool _restore_data, #endif - snprintf(buf, 255, "restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s .", + snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s .", ownNodeId, addr, _node_id, diff --git a/ndb/src/ndbapi/NdbSchemaCon.cpp b/ndb/test/src/NdbSchemaCon.cpp index 88e90f9957f..0de49ff983f 100644 --- a/ndb/src/ndbapi/NdbSchemaCon.cpp +++ b/ndb/test/src/NdbSchemaCon.cpp @@ -35,9 +35,10 @@ Adjust: 980126 UABMNST First version. New programs should use NdbDictionary.hpp *********************************************************************/ -#include "NdbSchemaCon.hpp" -#include "NdbSchemaOp.hpp" -#include "NdbApiSignal.hpp" +#include <ndb_global.h> +#include <NdbApi.hpp> +#include <NdbSchemaCon.hpp> +#include <NdbSchemaOp.hpp> /********************************************************************* @@ -142,20 +143,22 @@ NdbSchemaCon::release() return; }//NdbSchemaCon::release() - - - - - - - - - - - - - - +#include <NdbError.hpp> + +static void +update(const NdbError & _err){ + NdbError & error = (NdbError &) _err; + ndberror_struct ndberror = (ndberror_struct)error; + ndberror_update(&ndberror); + error = NdbError(ndberror); +} + +const +NdbError & +NdbSchemaCon::getNdbError() const { + update(theError); + return theError; +} diff --git a/ndb/src/ndbapi/NdbSchemaOp.cpp b/ndb/test/src/NdbSchemaOp.cpp index aa2d0be311f..a296094ea9d 100644 --- a/ndb/src/ndbapi/NdbSchemaOp.cpp +++ b/ndb/test/src/NdbSchemaOp.cpp @@ -34,11 +34,11 @@ Adjust: 980125 UABMNST First version. NOTE: This file is only used as a compatibility layer for old test programs, New programs should use NdbDictionary.hpp *****************************************************************************/ -#include <assert.h> -#include "NdbSchemaOp.hpp" -#include "NdbSchemaCon.hpp" -#include "API.hpp" +#include <ndb_global.h> +#include <NdbApi.hpp> +#include <NdbSchemaOp.hpp> +#include <NdbSchemaCon.hpp> /***************************************************************************** diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am index 8489bc85fe9..8d94c21b721 100644 --- a/ndb/test/tools/Makefile.am +++ b/ndb/test/tools/Makefile.am @@ -25,7 +25,7 @@ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am -ndb_cpcc_LDADD = $(LDADD) $(top_srcdir)/ndb/src/mgmclient/CpcClient.o +ndb_cpcc_LDADD = $(LDADD) $(top_builddir)/ndb/src/mgmclient/CpcClient.o # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 3ca1cf1b1da..64625f69ea2 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -9,19 +9,28 @@ ndbtools_PROGRAMS = \ ndb_select_all \ ndb_select_count -ndb_waiter_SOURCES = waiter.cpp -ndb_delete_all_SOURCES = delete_all.cpp -ndb_desc_SOURCES = desc.cpp -ndb_drop_index_SOURCES = drop_index.cpp -ndb_drop_table_SOURCES = drop_tab.cpp -ndb_show_tables_SOURCES = listTables.cpp -ndb_select_all_SOURCES = select_all.cpp -ndb_select_count_SOURCES = select_count.cpp +tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp ../test/src/NDBT_Table.cpp ../test/src/NDBT_Output.cpp + +ndb_waiter_SOURCES = waiter.cpp $(tools_common_sources) +ndb_delete_all_SOURCES = delete_all.cpp $(tools_common_sources) +ndb_desc_SOURCES = desc.cpp $(tools_common_sources) +ndb_drop_index_SOURCES = drop_index.cpp $(tools_common_sources) +ndb_drop_table_SOURCES = drop_tab.cpp $(tools_common_sources) +ndb_show_tables_SOURCES = listTables.cpp $(tools_common_sources) +ndb_select_all_SOURCES = select_all.cpp ../test/src/NDBT_ResultRow.cpp $(tools_common_sources) +ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources) include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am -AM_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_waiter_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_drop_table_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_delete_all_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_desc_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_drop_index_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_show_tables_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_select_all_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index 9cbba503e68..dabd9a0e8fa 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -23,19 +23,16 @@ #include <getarg.h> -#include <UtilTransactions.hpp> +static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240); int main(int argc, const char** argv){ const char* _tabname = NULL; const char* _dbname = "TEST_DB"; int _help = 0; - int _ver2 = 1; struct getargs args[] = { { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "ver2", '2', arg_flag, &_ver2, "Use version 2 of clearTable (default)", "" }, - { "ver2", '1', arg_negative_flag, &_ver2, "Use version 1 of clearTable", "" }, { "database", 'd', arg_string, &_dbname, "dbname", "Name of database table is in"} }; @@ -74,20 +71,111 @@ int main(int argc, const char** argv){ } ndbout << "Deleting all from " << argv[i] << "..."; - UtilTransactions utilTrans(*pTab); - int tmp = NDBT_OK; - if (_ver2 == 0){ - if(utilTrans.clearTable(&MyNdb) == NDBT_FAILED) - tmp = NDBT_FAILED; - } else { - if(utilTrans.clearTable3(&MyNdb) == NDBT_FAILED) - tmp = NDBT_FAILED; - } - if(tmp == NDBT_FAILED){ - res = tmp; + if(clear_table(&MyNdb, pTab) == NDBT_FAILED){ + res = NDBT_FAILED; ndbout << "FAILED" << endl; } } return NDBT_ProgramExit(res); } + +int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism) +{ + // Scan all records exclusive and delete + // them one by one + int retryAttempt = 0; + const int retryMax = 10; + int deletedRows = 0; + int check; + NdbConnection *pTrans; + NdbScanOperation *pOp; + NdbError err; + + int par = parallelism; + while (true){ + restart: + if (retryAttempt++ >= retryMax){ + g_info << "ERROR: has retried this operation " << retryAttempt + << " times, failing!" << endl; + return NDBT_FAILED; + } + + pTrans = pNdb->startTransaction(); + if (pTrans == NULL) { + err = pNdb->getNdbError(); + if (err.status == NdbError::TemporaryError){ + ERR(err); + NdbSleep_MilliSleep(50); + continue; + } + goto failed; + } + + pOp = pTrans->getNdbScanOperation(pTab->getName()); + if (pOp == NULL) { + goto failed; + } + + NdbResultSet * rs = pOp->readTuplesExclusive(par); + if( rs == 0 ) { + goto failed; + } + + if(pTrans->execute(NoCommit) != 0){ + err = pTrans->getNdbError(); + if(err.status == NdbError::TemporaryError){ + ERR(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + continue; + } + goto failed; + } + + while((check = rs->nextResult(true)) == 0){ + do { + if (rs->deleteTuple() != 0){ + goto failed; + } + deletedRows++; + } while((check = rs->nextResult(false)) == 0); + + if(check != -1){ + check = pTrans->execute(Commit); + pTrans->releaseCompletedOperations(); + } + + err = pTrans->getNdbError(); + if(check == -1){ + if(err.status == NdbError::TemporaryError){ + ERR(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + par = 1; + goto restart; + } + goto failed; + } + } + if(check == -1){ + err = pTrans->getNdbError(); + if(err.status == NdbError::TemporaryError){ + ERR(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + par = 1; + goto restart; + } + goto failed; + } + pNdb->closeTransaction(pTrans); + return NDBT_OK; + } + return NDBT_FAILED; + + failed: + if(pTrans != 0) pNdb->closeTransaction(pTrans); + ERR(err); + return (err.code != 0 ? err.code : NDBT_FAILED); +} diff --git a/ndb/tools/ndbsql.cpp b/ndb/tools/ndbsql.cpp index 33a3e39776a..6af5f47f6f4 100644 --- a/ndb/tools/ndbsql.cpp +++ b/ndb/tools/ndbsql.cpp @@ -33,6 +33,12 @@ #include <ctype.h> #include <wctype.h> +#ifndef SQL_BLOB +#define SQL_BLOB 30 +#endif +#ifndef SQL_CLOB +#define SQL_CLOB 40 +#endif /************************************************************************** * ------------------------------------------------------------------------ @@ -211,8 +217,10 @@ SQLINTEGER display_length(SQLSMALLINT coltype, SQLINTEGER collen, switch (coltype) { case SQL_VARCHAR: case SQL_CHAR: - //case SQL_BLOB: - //case SQL_CLOB: + case SQL_VARBINARY: + case SQL_BINARY: + case SQL_BLOB: + case SQL_CLOB: case SQL_BIT: //case SQL_REF: //case SQL_BIT_VARYING: diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index b1513ad4135..cae91feb378 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -26,6 +26,12 @@ #include <getarg.h> #include <UtilTransactions.hpp> +static int +select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, + int parallelism, + int* count_rows, + UtilTransactions::ScanLock lock, + NdbConnection* pBuddyTrans=0); int main(int argc, const char** argv){ const char* _dbname = "TEST_DB"; @@ -75,9 +81,8 @@ int main(int argc, const char** argv){ } int rows = 0; - UtilTransactions utilTrans(*pTab); - if (utilTrans.selectCount(&MyNdb, _parallelism, &rows, - (UtilTransactions::ScanLock)_lock) != 0){ + if (select_count(&MyNdb, pTab, _parallelism, &rows, + (UtilTransactions::ScanLock)_lock) != 0){ return NDBT_ProgramExit(NDBT_FAILED); } @@ -86,5 +91,109 @@ int main(int argc, const char** argv){ return NDBT_ProgramExit(NDBT_OK); } +int +select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, + int parallelism, + int* count_rows, + UtilTransactions::ScanLock lock, + NdbConnection* pBuddyTrans){ + + int retryAttempt = 0; + const int retryMax = 100; + int check; + NdbConnection *pTrans; + NdbOperation *pOp; + + while (true){ + + if (retryAttempt >= retryMax){ + g_info << "ERROR: has retried this operation " << retryAttempt + << " times, failing!" << endl; + return NDBT_FAILED; + } + + pTrans = pNdb->hupp(pBuddyTrans); + if (pTrans == NULL) { + const NdbError err = pNdb->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + return NDBT_FAILED; + } + pOp = pTrans->getNdbOperation(pTab->getName()); + if (pOp == NULL) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + switch(lock){ + case UtilTransactions::SL_ReadHold: + check = pOp->openScanReadHoldLock(parallelism); + break; + case UtilTransactions::SL_Exclusive: + check = pOp->openScanExclusive(parallelism); + break; + case UtilTransactions::SL_Read: + default: + check = pOp->openScanRead(parallelism); + } + + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + check = pOp->interpret_exit_ok(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + check = pTrans->executeScan(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + int eof; + int rows = 0; + eof = pTrans->nextScanResult(); + + while(eof == 0){ + rows++; + eof = pTrans->nextScanResult(); + } + if (eof == -1) { + const NdbError err = pTrans->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + pNdb->closeTransaction(pTrans); + + if (count_rows != NULL){ + *count_rows = rows; + } + + return NDBT_OK; + } + return NDBT_FAILED; +} diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index d57daff3aea..7ce2739a157 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -15,17 +15,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "mgmapi.h" +#include <mgmapi.h> #include <string.h> #include <NdbMain.h> #include <NdbOut.hpp> #include <NdbSleep.h> #include <getarg.h> +#include <kernel/ndb_limits.h> +#include "../src/common/mgmcommon/LocalConfig.hpp" - -#include <NdbRestarter.hpp> #include <NDBT.hpp> +int +waitClusterStarted(const char* _addr, unsigned int _timeout= 120); + int main(int argc, const char** argv){ const char* _hostName = NULL; @@ -45,12 +48,252 @@ int main(int argc, const char** argv){ arg_printusage(args, num_args, argv[0], desc); return NDBT_ProgramExit(NDBT_WRONGARGS); } + + char buf[255]; _hostName = argv[optind]; - NdbRestarter restarter(_hostName); + if (_hostName == NULL){ + LocalConfig lcfg; + if(!lcfg.init()) + { + lcfg.printError(); + lcfg.printUsage(); + g_err << "Error parsing local config file" << endl; + return NDBT_ProgramExit(NDBT_FAILED); + } + + for (int i = 0; i<lcfg.items; i++) + { + MgmtSrvrId * m = lcfg.ids[i]; + + switch(m->type){ + case MgmId_TCP: + snprintf(buf, 255, "%s:%d", m->data.tcp.remoteHost, m->data.tcp.port); + _hostName = buf; + break; + case MgmId_File: + break; + default: + break; + } + if (_hostName != NULL) + break; + } + if (_hostName == NULL) + { + g_err << "No management servers configured in local config file" << endl; + return NDBT_ProgramExit(NDBT_FAILED); + } + } - if (restarter.waitClusterStarted() != 0) + if (waitClusterStarted(_hostName) != 0) return NDBT_ProgramExit(NDBT_FAILED); return NDBT_ProgramExit(NDBT_OK); } + +#define MGMERR(h) \ + ndbout << "latest_error="<<ndb_mgm_get_latest_error(h) \ + << ", line="<<ndb_mgm_get_latest_error_line(h) \ + << endl; + +NdbMgmHandle handle= NULL; + +Vector<ndb_mgm_node_state> ndbNodes; +Vector<ndb_mgm_node_state> mgmNodes; +Vector<ndb_mgm_node_state> apiNodes; + +int +getStatus(){ + int retries = 0; + struct ndb_mgm_cluster_state * status; + struct ndb_mgm_node_state * node; + + ndbNodes.clear(); + mgmNodes.clear(); + apiNodes.clear(); + + while(retries < 10){ + status = ndb_mgm_get_status(handle); + if (status == NULL){ + ndbout << "status==NULL, retries="<<retries<<endl; + MGMERR(handle); + retries++; + continue; + } + for (int i = 0; i < status->no_of_nodes; i++){ + node = &status->node_states[i]; + switch(node->node_type){ + case NDB_MGM_NODE_TYPE_NDB: + ndbNodes.push_back(*node); + break; + case NDB_MGM_NODE_TYPE_MGM: + mgmNodes.push_back(*node); + break; + case NDB_MGM_NODE_TYPE_API: + apiNodes.push_back(*node); + break; + default: + if(node->node_status == NDB_MGM_NODE_STATUS_UNKNOWN || + node->node_status == NDB_MGM_NODE_STATUS_NO_CONTACT){ + retries++; + ndbNodes.clear(); + mgmNodes.clear(); + apiNodes.clear(); + free(status); + status = NULL; + i = status->no_of_nodes; + + ndbout << "kalle"<< endl; + break; + } + abort(); + break; + } + } + if(status == 0){ + ndbout << "status == 0" << endl; + continue; + } + free(status); + return 0; + } + + g_err << "getStatus failed" << endl; + return -1; +} + +int +waitClusterStarted(const char* _addr, unsigned int _timeout) +{ + ndb_mgm_node_status _status = NDB_MGM_NODE_STATUS_STARTED; + int _startphase = -1; + + int _nodes[MAX_NDB_NODES]; + int _num_nodes = 0; + + handle = ndb_mgm_create_handle(); + if (handle == NULL){ + g_err << "handle == NULL" << endl; + return -1; + } + g_info << "Connecting to mgmsrv at " << _addr << endl; + if (ndb_mgm_connect(handle, _addr) == -1) { + MGMERR(handle); + g_err << "Connection to " << _addr << " failed" << endl; + return -1; + } + + if (getStatus() != 0) + return -1; + + // Collect all nodes into nodes + for (size_t i = 0; i < ndbNodes.size(); i++){ + _nodes[i] = ndbNodes[i].node_id; + _num_nodes++; + } + + unsigned int attempts = 0; + unsigned int resetAttempts = 0; + const unsigned int MAX_RESET_ATTEMPTS = 10; + bool allInState = false; + while (allInState == false){ + if (_timeout > 0 && attempts > _timeout){ + /** + * Timeout has expired waiting for the nodes to enter + * the state we want + */ + bool waitMore = false; + /** + * Make special check if we are waiting for + * cluster to become started + */ + if(_status == NDB_MGM_NODE_STATUS_STARTED){ + waitMore = true; + /** + * First check if any node is not starting + * then it's no idea to wait anymore + */ + for (size_t n = 0; n < ndbNodes.size(); n++){ + if (ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTED && + ndbNodes[n].node_status != NDB_MGM_NODE_STATUS_STARTING) + waitMore = false; + + } + } + + if (!waitMore || resetAttempts > MAX_RESET_ATTEMPTS){ + g_err << "waitNodeState(" + << ndb_mgm_get_node_status_string(_status) + <<", "<<_startphase<<")" + << " timeout after " << attempts <<" attemps" << endl; + return -1; + } + + g_err << "waitNodeState(" + << ndb_mgm_get_node_status_string(_status) + <<", "<<_startphase<<")" + << " resetting number of attempts " + << resetAttempts << endl; + attempts = 0; + resetAttempts++; + + } + + allInState = true; + if (getStatus() != 0){ + g_err << "getStatus != 0" << endl; + return -1; + } + + // ndbout << "waitNodeState; _num_nodes = " << _num_nodes << endl; + // for (int i = 0; i < _num_nodes; i++) + // ndbout << " node["<<i<<"] =" <<_nodes[i] << endl; + + for (int i = 0; i < _num_nodes; i++){ + ndb_mgm_node_state* ndbNode = NULL; + for (size_t n = 0; n < ndbNodes.size(); n++){ + if (ndbNodes[n].node_id == _nodes[i]) + ndbNode = &ndbNodes[n]; + } + + if(ndbNode == NULL){ + allInState = false; + continue; + } + + g_info << "State node " << ndbNode->node_id << " " + << ndb_mgm_get_node_status_string(ndbNode->node_status)<< endl; + + assert(ndbNode != NULL); + + if(_status == NDB_MGM_NODE_STATUS_STARTING && + ((ndbNode->node_status == NDB_MGM_NODE_STATUS_STARTING && + ndbNode->start_phase >= _startphase) || + (ndbNode->node_status == NDB_MGM_NODE_STATUS_STARTED))) + continue; + + if (_status == NDB_MGM_NODE_STATUS_STARTING){ + g_info << "status = " + << ndb_mgm_get_node_status_string(ndbNode->node_status) + <<", start_phase="<<ndbNode->start_phase<<endl; + if (ndbNode->node_status != _status) { + if (ndbNode->node_status < _status) + allInState = false; + else + g_info << "node_status(" << ndbNode->node_status + <<") != _status("<<_status<<")"<<endl; + } else if (ndbNode->start_phase < _startphase) + allInState = false; + } else { + if (ndbNode->node_status != _status) + allInState = false; + } + } + g_info << "Waiting for cluster enter state" + << ndb_mgm_get_node_status_string(_status)<< endl; + NdbSleep_SecSleep(1); + attempts++; + } + return 0; +} diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv index 7eca2711a79..22de9a4ad87 100755 --- a/netware/BUILD/mwenv +++ b/netware/BUILD/mwenv @@ -1,10 +1,10 @@ #! /bin/sh -# WINE_BUILD_DIR, BUILD_DIR, and VERSION must be correct before compiling +# F:/mydev, /home/kp/mydev, and 4.0.21 must be correct before compiling # This values are normally changed by the nwbootstrap script # the default is "F:/mydev" -export MYDEV="WINE_BUILD_DIR" +export MYDEV="F:/mydev" export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV/zlib-1.1.4;$MYDEV" export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/openssl;$MYDEV/mysql-VERSION/netware/BUILD" @@ -13,7 +13,7 @@ export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib; export WINEPATH="$MYDEV/mw/bin" # the default added path is "$HOME/mydev/mysql-x.x-x/netware/BUILD" -export PATH="$PATH:BUILD_DIR/mysql-VERSION/netware/BUILD" +export PATH="$PATH:/home/kp/mydev/mysql-VERSION/netware/BUILD" export AR='mwldnlm' export AR_FLAGS='-type library -o' diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index 7737dd8898a..25e843c87e3 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -176,6 +176,11 @@ done echo "generating llibmysql.imp file..." awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp +# create the libmysql.imp file in netware folder from libmysql/libmysql.def file +echo "generating llibmysql.imp file..." +awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp + + # build linux tools echo "compiling linux tools..." ./netware/BUILD/compile-linux-tools diff --git a/netware/Makefile.am b/netware/Makefile.am index 324c6fd13fa..2467270f27b 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -16,6 +16,8 @@ if HAVE_NETWARE INCLUDES = -I$(srcdir)/../include -I../include -I.. +LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \ + ../dbug/libdbug.a ../strings/libmystrings.a bin_PROGRAMS = mysqld_safe mysql_install_db mysql_test_run libmysql mysqld_safe_SOURCES= mysqld_safe.c my_manage.c mysql_install_db_SOURCES= mysql_install_db.c my_manage.c diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index 9c99e8a64b5..37985b9058e 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -16,20 +16,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <stdlib.h> -#include <stdio.h> -#include <errno.h> +#include <my_global.h> +#include <m_string.h> #include <dirent.h> -#include <string.h> #include <screen.h> #include <nks/vm.h> #include <ctype.h> #include <sys/stat.h> -#include <unistd.h> -#include <fcntl.h> #include <sys/mode.h> -#include "my_config.h" #include "my_manage.h" /****************************************************************************** @@ -1286,7 +1281,6 @@ int main(int argc, char **argv) return 0; } - /* Synopsis: This function breaks the string into a sequence of tokens. The difference diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c index 8d4a5c4a296..a307b52bb7e 100644 --- a/netware/mysqld_safe.c +++ b/netware/mysqld_safe.c @@ -1,20 +1,20 @@ /*
- Copyright (c) 2003 Novell, Inc. All Rights Reserved.
+ Copyright (c) 2003 Novell, Inc. All Rights Reserved. - 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.
+ 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
+ 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 <stdlib.h>
#include <stdio.h>
@@ -32,7 +32,7 @@ /******************************************************************************
global variables
-
+ ******************************************************************************/
char autoclose;
char basedir[PATH_MAX];
@@ -47,38 +47,38 @@ char mysqld[PATH_MAX]; char hostname[PATH_MAX];
char default_option[PATH_MAX];
-FILE *log_fd = NULL;
+FILE *log_fd= NULL; /******************************************************************************
prototypes
-
+ ******************************************************************************/
void usage(void); void vlog(char *, va_list);
void log(char *, ...);
-void start_defaults(int, char*[]);
+void start_defaults(int, char *[]); void finish_defaults();
void read_defaults(arg_list_t *); -void parse_args(int, char*[]);
-void get_options(int, char*[]);
+void parse_args(int, char *[]); +void get_options(int, char *[]); void check_data_vol();
void check_setup();
void check_tables();
-void mysql_start(int, char*[]);
+void mysql_start(int, char *[]); void parse_setvar(char *arg); /******************************************************************************
functions
-
+ ******************************************************************************/
/******************************************************************************
usage() - + Show usage. ******************************************************************************/ @@ -86,7 +86,7 @@ void usage(void) { // keep the screen up setscreenmode(SCR_NO_MODE); - + puts("\ \n\ usage: mysqld_safe [options]\n\ @@ -107,14 +107,14 @@ options:\n\ --mysqld=<file> Use the <file> MySQL daemon.\n\ \n\ "); - + exit(-1); } /****************************************************************************** vlog()
-
+ Log the message.
******************************************************************************/
@@ -122,7 +122,7 @@ void vlog(char *format, va_list ap) {
vfprintf(stdout, format, ap);
fflush(stdout);
-
+ if (log_fd)
{
vfprintf(log_fd, format, ap);
@@ -133,25 +133,25 @@ void vlog(char *format, va_list ap) /******************************************************************************
log()
-
+ Log the message.
******************************************************************************/
void log(char *format, ...)
{
va_list ap;
-
+ va_start(ap, format);
vlog(format, ap);
-
+ va_end(ap);
}
/******************************************************************************
start_defaults()
-
+ Start setting the defaults.
******************************************************************************/
@@ -159,30 +159,30 @@ void start_defaults(int argc, char *argv[]) {
struct stat buf;
int i;
-
+ // default options
- static char *default_options[] =
+ static char *default_options[]= {
- "--no-defaults",
- "--defaults-file=",
- "--defaults-extra-file=",
- NULL
+ "--no-defaults", + "--defaults-file=", + "--defaults-extra-file=", + NULL };
-
+ // autoclose
- autoclose = FALSE;
-
+ autoclose= FALSE; + // basedir
get_basedir(argv[0], basedir);
-
+ // check-tables - checktables = FALSE; - + checktables= FALSE; + // hostname
- if (gethostname(hostname,PATH_MAX) < 0)
+ if (gethostname(hostname, PATH_MAX) < 0) {
// default
- strcpy(hostname,"mysql");
+ strcpy(hostname, "mysql"); }
// address
@@ -190,30 +190,30 @@ void start_defaults(int argc, char *argv[]) // port
snprintf(port, PATH_MAX, "3306");
-
+ // default option
- default_option[0] = NULL;
- for (i=0; (argc > 1) && default_options[i]; i++)
- {
- if(!strnicmp(argv[1], default_options[i], strlen(default_options[i])))
- {
- strncpy(default_option, argv[1], PATH_MAX);
- break;
- }
- }
-
+ default_option[0]= NULL; + for (i= 0; (argc > 1) && default_options[i]; i++) + { + if (!strnicmp(argv[1], default_options[i], strlen(default_options[i]))) + { + strncpy(default_option, argv[1], PATH_MAX); + break; + } + } + // set after basedir is established
- datadir[0] = NULL;
- pid_file[0] = NULL;
- err_log[0] = NULL;
- safe_log[0] = NULL;
- mysqld[0] = NULL;
+ datadir[0]= NULL; + pid_file[0]= NULL; + err_log[0]= NULL; + safe_log[0]= NULL; + mysqld[0]= NULL; }
/******************************************************************************
finish_defaults()
-
+ Finish settig the defaults.
******************************************************************************/
@@ -221,22 +221,27 @@ void finish_defaults() {
struct stat buf;
int i;
-
+ // datadir
- if (!datadir[0]) snprintf(datadir, PATH_MAX, "%s/data", basedir);
-
+ if (!datadir[0]) + snprintf(datadir, PATH_MAX, "%s/data", basedir); + // pid-file
- if (!pid_file[0]) snprintf(pid_file, PATH_MAX, "%s/%s.pid", datadir, hostname);
-
+ if (!pid_file[0]) + snprintf(pid_file, PATH_MAX, "%s/%s.pid", datadir, hostname); + // err-log
- if (!err_log[0]) snprintf(err_log, PATH_MAX, "%s/%s.err", datadir, hostname);
+ if (!err_log[0]) + snprintf(err_log, PATH_MAX, "%s/%s.err", datadir, hostname); // safe-log
- if (!safe_log[0]) snprintf(safe_log, PATH_MAX, "%s/%s.safe", datadir, hostname); + if (!safe_log[0]) + snprintf(safe_log, PATH_MAX, "%s/%s.safe", datadir, hostname); // mysqld
- if (!mysqld[0]) snprintf(mysqld, PATH_MAX, "%s/bin/mysqld-max", basedir);
-
+ if (!mysqld[0]) + snprintf(mysqld, PATH_MAX, "%s/bin/mysqld-max", basedir); + if (stat(mysqld, &buf))
{
snprintf(mysqld, PATH_MAX, "%s/bin/mysqld", basedir);
@@ -246,7 +251,7 @@ void finish_defaults() /******************************************************************************
read_defaults()
-
+ Read the defaults.
******************************************************************************/
@@ -257,64 +262,66 @@ void read_defaults(arg_list_t *pal) char mydefaults[PATH_MAX];
char line[PATH_MAX];
FILE *fp;
-
- // defaults output file
- snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir);
- remove(defaults_file);
- // mysqladmin file
+ // defaults output file + snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir); + remove(defaults_file); + + // mysqladmin file snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir);
-
+ // args
init_args(&al); add_arg(&al, mydefaults); - if (default_option[0]) add_arg(&al, default_option); + if (default_option[0]) + add_arg(&al, default_option); add_arg(&al, "mysqld"); add_arg(&al, "server"); add_arg(&al, "mysqld_safe"); add_arg(&al, "safe_mysqld"); - spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL); + spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL); free_args(&al); - // gather defaults
- if((fp = fopen(defaults_file, "r")) != NULL)
- {
- while(fgets(line, PATH_MAX, fp))
- {
+ // gather defaults + if ((fp= fopen(defaults_file, "r")) != NULL) + { + while (fgets(line, PATH_MAX, fp)) + { char *p;
-
+ // remove end-of-line character
- if ((p = strrchr(line, '\n')) != NULL) *p = '\0';
-
+ if ((p= strrchr(line, '\n')) != NULL) + *p= '\0'; + // add the option as an argument
- add_arg(pal, line);
- }
-
- fclose(fp);
- }
-
- // remove file
- remove(defaults_file);
+ add_arg(pal, line); + } + + fclose(fp); + } + + // remove file + remove(defaults_file); }
/******************************************************************************
parse_args()
-
+ Get the options.
******************************************************************************/
void parse_args(int argc, char *argv[])
{
- int index = 0;
+ int index= 0; int c;
-
+ // parse options
enum opts
{
- OPT_BASEDIR = 0xFF,
+ OPT_BASEDIR= 0xFF, OPT_DATADIR,
OPT_PID_FILE,
OPT_BIND_ADDRESS,
@@ -325,65 +332,64 @@ void parse_args(int argc, char *argv[]) OPT_HELP, OPT_SETVAR };
-
- static struct option options[] =
+ + static struct option options[]= {
- {"autoclose", no_argument, &autoclose, TRUE},
- {"basedir", required_argument, 0, OPT_BASEDIR},
- {"check-tables", no_argument, &checktables, TRUE}, - {"datadir", required_argument, 0, OPT_DATADIR},
- {"pid-file", required_argument, 0, OPT_PID_FILE},
- {"bind-address", required_argument, 0, OPT_BIND_ADDRESS},
- {"port", required_argument, 0, OPT_PORT},
- {"err-log", required_argument, 0, OPT_ERR_LOG},
- {"safe-log", required_argument, 0, OPT_SAFE_LOG},
- {"mysqld", required_argument, 0, OPT_MYSQLD},
- {"help", no_argument, 0, OPT_HELP}, - {"set-variable", required_argument, 0, OPT_SETVAR}, - {0, 0, 0, 0}
+ {"autoclose", no_argument, &autoclose, TRUE}, + {"basedir", required_argument, 0, OPT_BASEDIR}, + {"check-tables", no_argument, &checktables, TRUE}, + {"datadir", required_argument, 0, OPT_DATADIR}, + {"pid-file", required_argument, 0, OPT_PID_FILE}, + {"bind-address", required_argument, 0, OPT_BIND_ADDRESS}, + {"port", required_argument, 0, OPT_PORT}, + {"err-log", required_argument, 0, OPT_ERR_LOG}, + {"safe-log", required_argument, 0, OPT_SAFE_LOG}, + {"mysqld", required_argument, 0, OPT_MYSQLD}, + {"help", no_argument, 0, OPT_HELP}, + {"set-variable", required_argument, 0, OPT_SETVAR}, + {0, 0, 0, 0} };
-
+ // we have to reset getopt_long because we use it multiple times
- optind = 1;
-
+ optind= 1; + // turn off error reporting
- opterr = 0;
-
- while ((c = getopt_long(argc, argv, "b:h:P:", options, &index)) >= 0)
+ opterr= 0; + + while ((c= getopt_long(argc, argv, "b:h:P:", options, &index)) >= 0) {
- switch (c)
- {
+ switch (c) { case OPT_BASEDIR:
case 'b':
strcpy(basedir, optarg);
break;
-
+ case OPT_DATADIR:
case 'h':
strcpy(datadir, optarg);
break;
-
+ case OPT_PID_FILE:
strcpy(pid_file, optarg);
break;
-
+ case OPT_BIND_ADDRESS:
strcpy(address, optarg);
break;
-
+ case OPT_PORT:
case 'P':
strcpy(port, optarg);
break;
-
+ case OPT_ERR_LOG:
strcpy(err_log, optarg);
break;
-
+ case OPT_SAFE_LOG:
strcpy(safe_log, optarg);
break;
-
+ case OPT_MYSQLD:
strcpy(mysqld, optarg);
break;
@@ -391,11 +397,11 @@ void parse_args(int argc, char *argv[]) case OPT_SETVAR: parse_setvar(optarg); break; - + case OPT_HELP: usage(); break; - + default:
// ignore
break;
@@ -410,14 +416,15 @@ void parse_args(int argc, char *argv[]) void parse_setvar(char *arg) { char *pos; - + if ((pos= strindex(arg, "port"))) { - for (; *pos && *pos != '='; pos++) ; + for (; *pos && *pos != '='; pos++); if (*pos) strcpy(port, pos + 1); } } + /****************************************************************************** @@ -425,14 +432,14 @@ void parse_setvar(char *arg) /******************************************************************************
get_options()
-
+ Get the options.
******************************************************************************/
void get_options(int argc, char *argv[])
{
arg_list_t al; -
+ // start defaults
start_defaults(argc, argv);
@@ -442,10 +449,10 @@ void get_options(int argc, char *argv[]) read_defaults(&al); parse_args(al.argc, al.argv); free_args(&al); -
+ // command-line arguments
parse_args(argc, argv);
-
+ // finish defaults
finish_defaults();
}
@@ -453,7 +460,7 @@ void get_options(int argc, char *argv[]) /******************************************************************************
check_data_vol()
-
+ Check the database volume.
******************************************************************************/
@@ -463,23 +470,23 @@ void check_data_vol() struct volume_info vol;
char buff[PATH_MAX];
char *p;
-
+ // clear struct
memset(&vol, 0, sizeof(vol));
-
+ // find volume name
strcpy(buff, datadir);
- if (p = strchr(buff, ':'))
+ if (p= strchr(buff, ':')) {
// terminate after volume name
- *p = 0;
+ *p= 0; }
else
{
// assume SYS volume
strcpy(buff, "SYS");
}
-
+ // retrieve information
netware_vol_info_from_name(&vol, buff);
@@ -493,25 +500,25 @@ void check_data_vol() /******************************************************************************
check_setup()
-
+ Check the current setup.
******************************************************************************/
void check_setup()
{
- struct stat info;
+ struct stat info; char temp[PATH_MAX];
-
+ // remove any current pid_file
- if (!stat(pid_file, &info) && (remove(pid_file) < 0))
- {
+ if (!stat(pid_file, &info) && (remove(pid_file) < 0)) + { log("ERROR: Unable to remove current pid file!\n\n");
exit(-1);
- }
-
- // check the data volume
+ } + + // check the data volume check_data_vol();
-
+ // check for a database
snprintf(temp, PATH_MAX, "%s/mysql/host.frm", datadir);
if (stat(temp, &info))
@@ -524,7 +531,7 @@ void check_setup() /******************************************************************************
check_tables()
-
+ Check the database tables.
******************************************************************************/
@@ -532,21 +539,21 @@ void check_tables() {
arg_list_t al; char mycheck[PATH_MAX];
- char table[PATH_MAX];
- char db[PATH_MAX];
- DIR *datadir_entry, *db_entry, *table_entry;
-
- // status
+ char table[PATH_MAX]; + char db[PATH_MAX]; + DIR *datadir_entry, *db_entry, *table_entry; + + // status log("checking tables...\n");
-
+ // list databases
- if ((datadir_entry = opendir(datadir)) == NULL)
- {
- return;
- }
+ if ((datadir_entry= opendir(datadir)) == NULL) + { + return; + } - while((db_entry = readdir(datadir_entry)) != NULL)
- {
+ while ((db_entry= readdir(datadir_entry)) != NULL) + { if (db_entry->d_name[0] == '.')
{
// Skip
@@ -555,71 +562,71 @@ void check_tables() {
// create long db name
snprintf(db, PATH_MAX, "%s/%s", datadir, db_entry->d_name);
-
+ // list tables
- if ((db_entry = opendir(db)) == NULL)
+ if ((db_entry= opendir(db)) == NULL) {
- continue;
+ continue; }
-
- while((table_entry = readdir(db_entry)) != NULL)
+ + while ((table_entry= readdir(db_entry)) != NULL) {
- // create long table name
- snprintf(table, PATH_MAX, "%s/%s", db, strlwr(table_entry->d_name));
-
- if (strindex(table, ".myi"))
- {
- // ** myisamchk
-
- // mysqladmin file
- snprintf(mycheck, PATH_MAX, "%s/bin/myisamchk", basedir);
-
- // args
- init_args(&al); - add_arg(&al, mycheck); - add_arg(&al, "--silent"); - add_arg(&al, "--force"); - add_arg(&al, "--fast"); - add_arg(&al, "--medium-check"); - add_arg(&al, "-O"); - add_arg(&al, "key_buffer=64M"); - add_arg(&al, "-O"); - add_arg(&al, "sort_buffer=64M"); - add_arg(&al, table); -
- spawn(mycheck, &al, TRUE, NULL, NULL, NULL); -
- free_args(&al); - }
- else if (strindex(table, ".ism"))
- {
- // ** isamchk
-
- // mysqladmin file
- snprintf(mycheck, PATH_MAX, "%s/bin/isamchk", basedir);
-
- // args
- init_args(&al); - add_arg(&al, mycheck); - add_arg(&al, "--silent"); - add_arg(&al, "--force"); - add_arg(&al, "-O"); - add_arg(&al, "sort_buffer=64M"); - add_arg(&al, table); -
- spawn(mycheck, &al, TRUE, NULL, NULL, NULL); -
- free_args(&al); - }
+ // create long table name + snprintf(table, PATH_MAX, "%s/%s", db, strlwr(table_entry->d_name)); + + if (strindex(table, ".myi")) + { + // ** myisamchk + + // mysqladmin file + snprintf(mycheck, PATH_MAX, "%s/bin/myisamchk", basedir); +
+ // args + init_args(&al); + add_arg(&al, mycheck); + add_arg(&al, "--silent"); + add_arg(&al, "--force"); + add_arg(&al, "--fast"); + add_arg(&al, "--medium-check"); + add_arg(&al, "-O"); + add_arg(&al, "key_buffer=64M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=64M"); + add_arg(&al, table); +
+ spawn(mycheck, &al, TRUE, NULL, NULL, NULL); + + free_args(&al); + } + else if (strindex(table, ".ism")) + { + // ** isamchk + + // mysqladmin file + snprintf(mycheck, PATH_MAX, "%s/bin/isamchk", basedir); + + // args + init_args(&al); + add_arg(&al, mycheck); + add_arg(&al, "--silent"); + add_arg(&al, "--force"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=64M"); + add_arg(&al, table); + + spawn(mycheck, &al, TRUE, NULL, NULL, NULL); + + free_args(&al); + } }
}
- }
+ } }
/******************************************************************************
mysql_start()
-
+ Start the mysql server.
******************************************************************************/
@@ -632,9 +639,9 @@ void mysql_start(int argc, char *argv[]) struct tm lt; char stamp[PATH_MAX]; char skip; -
+ // private options
- static char *private_options[] =
+ static char *private_options[]= {
"--autoclose", "--check-tables", @@ -643,56 +650,57 @@ void mysql_start(int argc, char *argv[]) "--mysqld=", NULL };
-
+ // args init_args(&al); add_arg(&al, "%s", mysqld); - + // parent args - for(i = 1; i < argc; i++) + for (i= 1; i < argc; i++) { - skip = FALSE;
-
+ skip= FALSE; + // skip private arguments
- for (j=0; private_options[j]; j++)
+ for (j= 0; private_options[j]; j++) {
- if(!strnicmp(argv[i], private_options[j], strlen(private_options[j])))
+ if (!strnicmp(argv[i], private_options[j], strlen(private_options[j]))) {
- skip = TRUE;
- consoleprintf("The argument skipped is %s\n",argv[i]); - break;
+ skip= TRUE; + consoleprintf("The argument skipped is %s\n", argv[i]); + break; }
}
- + if (!skip) { add_arg(&al, "%s", argv[i]); - consoleprintf("The final argument is %s\n",argv[i]); + consoleprintf("The final argument is %s\n", argv[i]); } } // spawn
do { // check the database tables - if (checktables) check_tables(); - + if (checktables) + check_tables(); + // status time(&cal);
localtime_r(&cal, <);
strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", <);
log("mysql started : %s\n", stamp);
- + // spawn mysqld spawn(mysqld, &al, TRUE, NULL, NULL, err_log); } while (!stat(pid_file, &info)); - + // status time(&cal);
localtime_r(&cal, <);
strftime(stamp, PATH_MAX, "%d %b %Y %H:%M:%S", <);
log("mysql stopped : %s\n\n", stamp);
-
+ // free args free_args(&al); }
@@ -700,43 +708,45 @@ void mysql_start(int argc, char *argv[]) /******************************************************************************
main()
-
+ ******************************************************************************/
int main(int argc, char **argv)
{
- char temp[PATH_MAX];
-
+ char temp[PATH_MAX]; + // get the options
- get_options(argc, argv);
+ get_options(argc, argv); // keep the screen up
- if (!autoclose) setscreenmode(SCR_NO_MODE);
-
+ if (!autoclose) + setscreenmode(SCR_NO_MODE); + // create log file
- log_fd = fopen(safe_log, "w+");
-
+ log_fd= fopen(safe_log, "w+"); + // header
log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
-
- // status
- log("address : %s\n", address);
- log("port : %s\n", port);
+ + // status + log("address : %s\n", address); + log("port : %s\n", port); log("daemon : %s\n", mysqld);
- log("base directory : %s\n", basedir);
- log("data directory : %s\n", datadir);
- log("pid file : %s\n", pid_file);
- log("error file : %s\n", err_log);
- log("log file : %s\n", safe_log);
+ log("base directory : %s\n", basedir); + log("data directory : %s\n", datadir); + log("pid file : %s\n", pid_file); + log("error file : %s\n", err_log); + log("log file : %s\n", safe_log); log("\n");
-
+ // check setup
check_setup();
-
+ // start the MySQL server
- mysql_start(argc, argv);
-
- // close log file
- if (log_fd) fclose(log_fd);
-
+ mysql_start(argc, argv); + + // close log file + if (log_fd) + fclose(log_fd); + return 0;
}
diff --git a/regex/regcomp.c b/regex/regcomp.c index b939429e16e..31899609e3c 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -884,7 +884,7 @@ int ch; register char *oldend = p->end; char bracket[3]; - assert(othercase(ch) != ch); /* p_bracket() would recurse */ + assert(othercase(p->charset, ch) != ch); /* p_bracket() would recurse */ p->next = bracket; p->end = bracket+2; bracket[0] = ch; diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index 5129c028238..85835498bc1 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -39,6 +39,8 @@ c_hc="" c_hr="" c_hk="" i_ht="" +c_tzn="" c_tz="" c_tzt="" c_tztt="" c_tzls="" +i_tzn="" i_tz="" i_tzt="" i_tztt="" i_tzls="" # Check for old tables if test ! -f $mdata/db.frm @@ -285,6 +287,332 @@ then c_hr="$c_hr comment='keyword-topic relation';" fi +if test ! -f $mdata/time_zone_name.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_name table" 1>&2; + fi + + c_tzn="$c_tzn CREATE TABLE time_zone_name (" + c_tzn="$c_tzn Name char(64) NOT NULL," + c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL," + c_tzn="$c_tzn PRIMARY KEY Name (Name)" + c_tzn="$c_tzn ) DEFAULT CHARACTER SET latin1" + c_tzn="$c_tzn comment='Time zone names';" + + if test "$1" = "test" + then + i_tzn="$i_tzn INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" + i_tzn="$i_tzn ('MET', 1), ('UTC', 2), ('Universal', 2), " + i_tzn="$i_tzn ('Europe/Moscow',3), ('leap/Europe/Moscow',4);" + fi +fi + +if test ! -f $mdata/time_zone.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone table" 1>&2; + fi + + c_tz="$c_tz CREATE TABLE time_zone (" + c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," + c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" + c_tz="$c_tz ) DEFAULT CHARACTER SET latin1" + c_tz="$c_tz comment='Time zones';" + + if test "$1" = "test" + then + i_tz="$i_tz INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" + i_tz="$i_tz VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');" + fi +fi + +if test ! -f $mdata/time_zone_transition.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_transition table" 1>&2; + fi + + c_tzt="$c_tzt CREATE TABLE time_zone_transition (" + c_tzt="$c_tzt Time_zone_id int unsigned NOT NULL," + c_tzt="$c_tzt Transition_time bigint signed NOT NULL," + c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL," + c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" + c_tzt="$c_tzt ) DEFAULT CHARACTER SET latin1" + c_tzt="$c_tzt comment='Time zone transitions';" + + if test "$1" = "test" + then + i_tzt="$i_tzt INSERT INTO time_zone_transition" + i_tzt="$i_tzt (Time_zone_id, Transition_time, Transition_type_id)" + i_tzt="$i_tzt VALUES" + i_tzt="$i_tzt (1, -1693706400, 0) ,(1, -1680483600, 1)" + i_tzt="$i_tzt ,(1, -1663455600, 2) ,(1, -1650150000, 3)" + i_tzt="$i_tzt ,(1, -1632006000, 2) ,(1, -1618700400, 3)" + i_tzt="$i_tzt ,(1, -938905200, 2) ,(1, -857257200, 3)" + i_tzt="$i_tzt ,(1, -844556400, 2) ,(1, -828226800, 3)" + i_tzt="$i_tzt ,(1, -812502000, 2) ,(1, -796777200, 3)" + i_tzt="$i_tzt ,(1, 228877200, 2) ,(1, 243997200, 3)" + i_tzt="$i_tzt ,(1, 260326800, 2) ,(1, 276051600, 3)" + i_tzt="$i_tzt ,(1, 291776400, 2) ,(1, 307501200, 3)" + i_tzt="$i_tzt ,(1, 323830800, 2) ,(1, 338950800, 3)" + i_tzt="$i_tzt ,(1, 354675600, 2) ,(1, 370400400, 3)" + i_tzt="$i_tzt ,(1, 386125200, 2) ,(1, 401850000, 3)" + i_tzt="$i_tzt ,(1, 417574800, 2) ,(1, 433299600, 3)" + i_tzt="$i_tzt ,(1, 449024400, 2) ,(1, 465354000, 3)" + i_tzt="$i_tzt ,(1, 481078800, 2) ,(1, 496803600, 3)" + i_tzt="$i_tzt ,(1, 512528400, 2) ,(1, 528253200, 3)" + i_tzt="$i_tzt ,(1, 543978000, 2) ,(1, 559702800, 3)" + i_tzt="$i_tzt ,(1, 575427600, 2) ,(1, 591152400, 3)" + i_tzt="$i_tzt ,(1, 606877200, 2) ,(1, 622602000, 3)" + i_tzt="$i_tzt ,(1, 638326800, 2) ,(1, 654656400, 3)" + i_tzt="$i_tzt ,(1, 670381200, 2) ,(1, 686106000, 3)" + i_tzt="$i_tzt ,(1, 701830800, 2) ,(1, 717555600, 3)" + i_tzt="$i_tzt ,(1, 733280400, 2) ,(1, 749005200, 3)" + i_tzt="$i_tzt ,(1, 764730000, 2) ,(1, 780454800, 3)" + i_tzt="$i_tzt ,(1, 796179600, 2) ,(1, 811904400, 3)" + i_tzt="$i_tzt ,(1, 828234000, 2) ,(1, 846378000, 3)" + i_tzt="$i_tzt ,(1, 859683600, 2) ,(1, 877827600, 3)" + i_tzt="$i_tzt ,(1, 891133200, 2) ,(1, 909277200, 3)" + i_tzt="$i_tzt ,(1, 922582800, 2) ,(1, 941331600, 3)" + i_tzt="$i_tzt ,(1, 954032400, 2) ,(1, 972781200, 3)" + i_tzt="$i_tzt ,(1, 985482000, 2) ,(1, 1004230800, 3)" + i_tzt="$i_tzt ,(1, 1017536400, 2) ,(1, 1035680400, 3)" + i_tzt="$i_tzt ,(1, 1048986000, 2) ,(1, 1067130000, 3)" + i_tzt="$i_tzt ,(1, 1080435600, 2) ,(1, 1099184400, 3)" + i_tzt="$i_tzt ,(1, 1111885200, 2) ,(1, 1130634000, 3)" + i_tzt="$i_tzt ,(1, 1143334800, 2) ,(1, 1162083600, 3)" + i_tzt="$i_tzt ,(1, 1174784400, 2) ,(1, 1193533200, 3)" + i_tzt="$i_tzt ,(1, 1206838800, 2) ,(1, 1224982800, 3)" + i_tzt="$i_tzt ,(1, 1238288400, 2) ,(1, 1256432400, 3)" + i_tzt="$i_tzt ,(1, 1269738000, 2) ,(1, 1288486800, 3)" + i_tzt="$i_tzt ,(1, 1301187600, 2) ,(1, 1319936400, 3)" + i_tzt="$i_tzt ,(1, 1332637200, 2) ,(1, 1351386000, 3)" + i_tzt="$i_tzt ,(1, 1364691600, 2) ,(1, 1382835600, 3)" + i_tzt="$i_tzt ,(1, 1396141200, 2) ,(1, 1414285200, 3)" + i_tzt="$i_tzt ,(1, 1427590800, 2) ,(1, 1445734800, 3)" + i_tzt="$i_tzt ,(1, 1459040400, 2) ,(1, 1477789200, 3)" + i_tzt="$i_tzt ,(1, 1490490000, 2) ,(1, 1509238800, 3)" + i_tzt="$i_tzt ,(1, 1521939600, 2) ,(1, 1540688400, 3)" + i_tzt="$i_tzt ,(1, 1553994000, 2) ,(1, 1572138000, 3)" + i_tzt="$i_tzt ,(1, 1585443600, 2) ,(1, 1603587600, 3)" + i_tzt="$i_tzt ,(1, 1616893200, 2) ,(1, 1635642000, 3)" + i_tzt="$i_tzt ,(1, 1648342800, 2) ,(1, 1667091600, 3)" + i_tzt="$i_tzt ,(1, 1679792400, 2) ,(1, 1698541200, 3)" + i_tzt="$i_tzt ,(1, 1711846800, 2) ,(1, 1729990800, 3)" + i_tzt="$i_tzt ,(1, 1743296400, 2) ,(1, 1761440400, 3)" + i_tzt="$i_tzt ,(1, 1774746000, 2) ,(1, 1792890000, 3)" + i_tzt="$i_tzt ,(1, 1806195600, 2) ,(1, 1824944400, 3)" + i_tzt="$i_tzt ,(1, 1837645200, 2) ,(1, 1856394000, 3)" + i_tzt="$i_tzt ,(1, 1869094800, 2) ,(1, 1887843600, 3)" + i_tzt="$i_tzt ,(1, 1901149200, 2) ,(1, 1919293200, 3)" + i_tzt="$i_tzt ,(1, 1932598800, 2) ,(1, 1950742800, 3)" + i_tzt="$i_tzt ,(1, 1964048400, 2) ,(1, 1982797200, 3)" + i_tzt="$i_tzt ,(1, 1995498000, 2) ,(1, 2014246800, 3)" + i_tzt="$i_tzt ,(1, 2026947600, 2) ,(1, 2045696400, 3)" + i_tzt="$i_tzt ,(1, 2058397200, 2) ,(1, 2077146000, 3)" + i_tzt="$i_tzt ,(1, 2090451600, 2) ,(1, 2108595600, 3)" + i_tzt="$i_tzt ,(1, 2121901200, 2) ,(1, 2140045200, 3)" + i_tzt="$i_tzt ,(3, -1688265000, 2) ,(3, -1656819048, 1)" + i_tzt="$i_tzt ,(3, -1641353448, 2) ,(3, -1627965048, 3)" + i_tzt="$i_tzt ,(3, -1618716648, 1) ,(3, -1596429048, 3)" + i_tzt="$i_tzt ,(3, -1593829848, 5) ,(3, -1589860800, 4)" + i_tzt="$i_tzt ,(3, -1542427200, 5) ,(3, -1539493200, 6)" + i_tzt="$i_tzt ,(3, -1525323600, 5) ,(3, -1522728000, 4)" + i_tzt="$i_tzt ,(3, -1491188400, 7) ,(3, -1247536800, 4)" + i_tzt="$i_tzt ,(3, 354920400, 5) ,(3, 370728000, 4)" + i_tzt="$i_tzt ,(3, 386456400, 5) ,(3, 402264000, 4)" + i_tzt="$i_tzt ,(3, 417992400, 5) ,(3, 433800000, 4)" + i_tzt="$i_tzt ,(3, 449614800, 5) ,(3, 465346800, 8)" + i_tzt="$i_tzt ,(3, 481071600, 9) ,(3, 496796400, 8)" + i_tzt="$i_tzt ,(3, 512521200, 9) ,(3, 528246000, 8)" + i_tzt="$i_tzt ,(3, 543970800, 9) ,(3, 559695600, 8)" + i_tzt="$i_tzt ,(3, 575420400, 9) ,(3, 591145200, 8)" + i_tzt="$i_tzt ,(3, 606870000, 9) ,(3, 622594800, 8)" + i_tzt="$i_tzt ,(3, 638319600, 9) ,(3, 654649200, 8)" + i_tzt="$i_tzt ,(3, 670374000, 10) ,(3, 686102400, 11)" + i_tzt="$i_tzt ,(3, 695779200, 8) ,(3, 701812800, 5)" + i_tzt="$i_tzt ,(3, 717534000, 4) ,(3, 733273200, 9)" + i_tzt="$i_tzt ,(3, 748998000, 8) ,(3, 764722800, 9)" + i_tzt="$i_tzt ,(3, 780447600, 8) ,(3, 796172400, 9)" + i_tzt="$i_tzt ,(3, 811897200, 8) ,(3, 828226800, 9)" + i_tzt="$i_tzt ,(3, 846370800, 8) ,(3, 859676400, 9)" + i_tzt="$i_tzt ,(3, 877820400, 8) ,(3, 891126000, 9)" + i_tzt="$i_tzt ,(3, 909270000, 8) ,(3, 922575600, 9)" + i_tzt="$i_tzt ,(3, 941324400, 8) ,(3, 954025200, 9)" + i_tzt="$i_tzt ,(3, 972774000, 8) ,(3, 985474800, 9)" + i_tzt="$i_tzt ,(3, 1004223600, 8) ,(3, 1017529200, 9)" + i_tzt="$i_tzt ,(3, 1035673200, 8) ,(3, 1048978800, 9)" + i_tzt="$i_tzt ,(3, 1067122800, 8) ,(3, 1080428400, 9)" + i_tzt="$i_tzt ,(3, 1099177200, 8) ,(3, 1111878000, 9)" + i_tzt="$i_tzt ,(3, 1130626800, 8) ,(3, 1143327600, 9)" + i_tzt="$i_tzt ,(3, 1162076400, 8) ,(3, 1174777200, 9)" + i_tzt="$i_tzt ,(3, 1193526000, 8) ,(3, 1206831600, 9)" + i_tzt="$i_tzt ,(3, 1224975600, 8) ,(3, 1238281200, 9)" + i_tzt="$i_tzt ,(3, 1256425200, 8) ,(3, 1269730800, 9)" + i_tzt="$i_tzt ,(3, 1288479600, 8) ,(3, 1301180400, 9)" + i_tzt="$i_tzt ,(3, 1319929200, 8) ,(3, 1332630000, 9)" + i_tzt="$i_tzt ,(3, 1351378800, 8) ,(3, 1364684400, 9)" + i_tzt="$i_tzt ,(3, 1382828400, 8) ,(3, 1396134000, 9)" + i_tzt="$i_tzt ,(3, 1414278000, 8) ,(3, 1427583600, 9)" + i_tzt="$i_tzt ,(3, 1445727600, 8) ,(3, 1459033200, 9)" + i_tzt="$i_tzt ,(3, 1477782000, 8) ,(3, 1490482800, 9)" + i_tzt="$i_tzt ,(3, 1509231600, 8) ,(3, 1521932400, 9)" + i_tzt="$i_tzt ,(3, 1540681200, 8) ,(3, 1553986800, 9)" + i_tzt="$i_tzt ,(3, 1572130800, 8) ,(3, 1585436400, 9)" + i_tzt="$i_tzt ,(3, 1603580400, 8) ,(3, 1616886000, 9)" + i_tzt="$i_tzt ,(3, 1635634800, 8) ,(3, 1648335600, 9)" + i_tzt="$i_tzt ,(3, 1667084400, 8) ,(3, 1679785200, 9)" + i_tzt="$i_tzt ,(3, 1698534000, 8) ,(3, 1711839600, 9)" + i_tzt="$i_tzt ,(3, 1729983600, 8) ,(3, 1743289200, 9)" + i_tzt="$i_tzt ,(3, 1761433200, 8) ,(3, 1774738800, 9)" + i_tzt="$i_tzt ,(3, 1792882800, 8) ,(3, 1806188400, 9)" + i_tzt="$i_tzt ,(3, 1824937200, 8) ,(3, 1837638000, 9)" + i_tzt="$i_tzt ,(3, 1856386800, 8) ,(3, 1869087600, 9)" + i_tzt="$i_tzt ,(3, 1887836400, 8) ,(3, 1901142000, 9)" + i_tzt="$i_tzt ,(3, 1919286000, 8) ,(3, 1932591600, 9)" + i_tzt="$i_tzt ,(3, 1950735600, 8) ,(3, 1964041200, 9)" + i_tzt="$i_tzt ,(3, 1982790000, 8) ,(3, 1995490800, 9)" + i_tzt="$i_tzt ,(3, 2014239600, 8) ,(3, 2026940400, 9)" + i_tzt="$i_tzt ,(3, 2045689200, 8) ,(3, 2058390000, 9)" + i_tzt="$i_tzt ,(3, 2077138800, 8) ,(3, 2090444400, 9)" + i_tzt="$i_tzt ,(3, 2108588400, 8) ,(3, 2121894000, 9)" + i_tzt="$i_tzt ,(3, 2140038000, 8)" + i_tzt="$i_tzt ,(4, -1688265000, 2) ,(4, -1656819048, 1)" + i_tzt="$i_tzt ,(4, -1641353448, 2) ,(4, -1627965048, 3)" + i_tzt="$i_tzt ,(4, -1618716648, 1) ,(4, -1596429048, 3)" + i_tzt="$i_tzt ,(4, -1593829848, 5) ,(4, -1589860800, 4)" + i_tzt="$i_tzt ,(4, -1542427200, 5) ,(4, -1539493200, 6)" + i_tzt="$i_tzt ,(4, -1525323600, 5) ,(4, -1522728000, 4)" + i_tzt="$i_tzt ,(4, -1491188400, 7) ,(4, -1247536800, 4)" + i_tzt="$i_tzt ,(4, 354920409, 5) ,(4, 370728010, 4)" + i_tzt="$i_tzt ,(4, 386456410, 5) ,(4, 402264011, 4)" + i_tzt="$i_tzt ,(4, 417992411, 5) ,(4, 433800012, 4)" + i_tzt="$i_tzt ,(4, 449614812, 5) ,(4, 465346812, 8)" + i_tzt="$i_tzt ,(4, 481071612, 9) ,(4, 496796413, 8)" + i_tzt="$i_tzt ,(4, 512521213, 9) ,(4, 528246013, 8)" + i_tzt="$i_tzt ,(4, 543970813, 9) ,(4, 559695613, 8)" + i_tzt="$i_tzt ,(4, 575420414, 9) ,(4, 591145214, 8)" + i_tzt="$i_tzt ,(4, 606870014, 9) ,(4, 622594814, 8)" + i_tzt="$i_tzt ,(4, 638319615, 9) ,(4, 654649215, 8)" + i_tzt="$i_tzt ,(4, 670374016, 10) ,(4, 686102416, 11)" + i_tzt="$i_tzt ,(4, 695779216, 8) ,(4, 701812816, 5)" + i_tzt="$i_tzt ,(4, 717534017, 4) ,(4, 733273217, 9)" + i_tzt="$i_tzt ,(4, 748998018, 8) ,(4, 764722818, 9)" + i_tzt="$i_tzt ,(4, 780447619, 8) ,(4, 796172419, 9)" + i_tzt="$i_tzt ,(4, 811897219, 8) ,(4, 828226820, 9)" + i_tzt="$i_tzt ,(4, 846370820, 8) ,(4, 859676420, 9)" + i_tzt="$i_tzt ,(4, 877820421, 8) ,(4, 891126021, 9)" + i_tzt="$i_tzt ,(4, 909270021, 8) ,(4, 922575622, 9)" + i_tzt="$i_tzt ,(4, 941324422, 8) ,(4, 954025222, 9)" + i_tzt="$i_tzt ,(4, 972774022, 8) ,(4, 985474822, 9)" + i_tzt="$i_tzt ,(4, 1004223622, 8) ,(4, 1017529222, 9)" + i_tzt="$i_tzt ,(4, 1035673222, 8) ,(4, 1048978822, 9)" + i_tzt="$i_tzt ,(4, 1067122822, 8) ,(4, 1080428422, 9)" + i_tzt="$i_tzt ,(4, 1099177222, 8) ,(4, 1111878022, 9)" + i_tzt="$i_tzt ,(4, 1130626822, 8) ,(4, 1143327622, 9)" + i_tzt="$i_tzt ,(4, 1162076422, 8) ,(4, 1174777222, 9)" + i_tzt="$i_tzt ,(4, 1193526022, 8) ,(4, 1206831622, 9)" + i_tzt="$i_tzt ,(4, 1224975622, 8) ,(4, 1238281222, 9)" + i_tzt="$i_tzt ,(4, 1256425222, 8) ,(4, 1269730822, 9)" + i_tzt="$i_tzt ,(4, 1288479622, 8) ,(4, 1301180422, 9)" + i_tzt="$i_tzt ,(4, 1319929222, 8) ,(4, 1332630022, 9)" + i_tzt="$i_tzt ,(4, 1351378822, 8) ,(4, 1364684422, 9)" + i_tzt="$i_tzt ,(4, 1382828422, 8) ,(4, 1396134022, 9)" + i_tzt="$i_tzt ,(4, 1414278022, 8) ,(4, 1427583622, 9)" + i_tzt="$i_tzt ,(4, 1445727622, 8) ,(4, 1459033222, 9)" + i_tzt="$i_tzt ,(4, 1477782022, 8) ,(4, 1490482822, 9)" + i_tzt="$i_tzt ,(4, 1509231622, 8) ,(4, 1521932422, 9)" + i_tzt="$i_tzt ,(4, 1540681222, 8) ,(4, 1553986822, 9)" + i_tzt="$i_tzt ,(4, 1572130822, 8) ,(4, 1585436422, 9)" + i_tzt="$i_tzt ,(4, 1603580422, 8) ,(4, 1616886022, 9)" + i_tzt="$i_tzt ,(4, 1635634822, 8) ,(4, 1648335622, 9)" + i_tzt="$i_tzt ,(4, 1667084422, 8) ,(4, 1679785222, 9)" + i_tzt="$i_tzt ,(4, 1698534022, 8) ,(4, 1711839622, 9)" + i_tzt="$i_tzt ,(4, 1729983622, 8) ,(4, 1743289222, 9)" + i_tzt="$i_tzt ,(4, 1761433222, 8) ,(4, 1774738822, 9)" + i_tzt="$i_tzt ,(4, 1792882822, 8) ,(4, 1806188422, 9)" + i_tzt="$i_tzt ,(4, 1824937222, 8) ,(4, 1837638022, 9)" + i_tzt="$i_tzt ,(4, 1856386822, 8) ,(4, 1869087622, 9)" + i_tzt="$i_tzt ,(4, 1887836422, 8) ,(4, 1901142022, 9)" + i_tzt="$i_tzt ,(4, 1919286022, 8) ,(4, 1932591622, 9)" + i_tzt="$i_tzt ,(4, 1950735622, 8) ,(4, 1964041222, 9)" + i_tzt="$i_tzt ,(4, 1982790022, 8) ,(4, 1995490822, 9)" + i_tzt="$i_tzt ,(4, 2014239622, 8) ,(4, 2026940422, 9)" + i_tzt="$i_tzt ,(4, 2045689222, 8) ,(4, 2058390022, 9)" + i_tzt="$i_tzt ,(4, 2077138822, 8) ,(4, 2090444422, 9)" + i_tzt="$i_tzt ,(4, 2108588422, 8) ,(4, 2121894022, 9)" + i_tzt="$i_tzt ,(4, 2140038022, 8);" + fi +fi + +if test ! -f $mdata/time_zone_transition_type.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_transition_type table" 1>&2; + fi + + c_tztt="$c_tztt CREATE TABLE time_zone_transition_type (" + c_tztt="$c_tztt Time_zone_id int unsigned NOT NULL," + c_tztt="$c_tztt Transition_type_id int unsigned NOT NULL," + c_tztt="$c_tztt Offset int signed DEFAULT 0 NOT NULL," + c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL," + c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL," + c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" + c_tztt="$c_tztt ) DEFAULT CHARACTER SET latin1" + c_tztt="$c_tztt comment='Time zone transition types';" + + if test "$1" = "test" + then + i_tztt="$i_tztt INSERT INTO time_zone_transition_type (Time_zone_id," + i_tztt="$i_tztt Transition_type_id, Offset, Is_DST, Abbreviation) VALUES" + i_tztt="$i_tztt (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')" + i_tztt="$i_tztt ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')" + i_tztt="$i_tztt ,(2, 0, 0, 0, 'UTC')" + i_tztt="$i_tztt ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')" + i_tztt="$i_tztt ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')" + i_tztt="$i_tztt ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')" + i_tztt="$i_tztt ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')" + i_tztt="$i_tztt ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')" + i_tztt="$i_tztt ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')" + i_tztt="$i_tztt ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" + i_tztt="$i_tztt ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" + i_tztt="$i_tztt ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');" + fi +fi + +if test ! -f $mdata/time_zone_leap_second.frm +then + if test "$1" = "verbose" ; then + echo "Preparing time_zone_leap_second table" 1>&2; + fi + + c_tzls="$c_tzls CREATE TABLE time_zone_leap_second (" + c_tzls="$c_tzls Transition_time bigint signed NOT NULL," + c_tzls="$c_tzls Correction int signed NOT NULL," + c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)" + c_tzls="$c_tzls ) DEFAULT CHARACTER SET latin1" + c_tzls="$c_tzls comment='Leap seconds information for time zones';" + + if test "$1" = "test" + then + i_tzls="$i_tzls INSERT INTO time_zone_leap_second " + i_tzls="$i_tzls (Transition_time, Correction) VALUES " + i_tzls="$i_tzls (78796800, 1) ,(94694401, 2) ,(126230402, 3)" + i_tzls="$i_tzls ,(157766403, 4) ,(189302404, 5) ,(220924805, 6)" + i_tzls="$i_tzls ,(252460806, 7) ,(283996807, 8) ,(315532808, 9)" + i_tzls="$i_tzls ,(362793609, 10) ,(394329610, 11) ,(425865611, 12)" + i_tzls="$i_tzls ,(489024012, 13) ,(567993613, 14) ,(631152014, 15)" + i_tzls="$i_tzls ,(662688015, 16) ,(709948816, 17) ,(741484817, 18)" + i_tzls="$i_tzls ,(773020818, 19) ,(820454419, 20) ,(867715220, 21)" + i_tzls="$i_tzls ,(915148821, 22);" + fi +fi + cat << END_OF_DATA use mysql; $c_d @@ -306,5 +634,16 @@ $c_ht $c_hc $c_hr $c_hk + +$c_tzn +$i_tzn +$c_tz +$i_tz +$c_tzt +$i_tzt +$c_tztt +$i_tztt +$c_tzls +$i_tzls END_OF_DATA diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index dabc653bcbb..41d991250c2 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -179,3 +179,42 @@ name varchar(64) not null, primary key (help_keyword_id), unique index (name) ) comment='help keywords'; + +# +# Create missing time zone related tables +# + +CREATE TABLE IF NOT EXISTS time_zone_name ( +Name char(64) NOT NULL, +Time_zone_id int unsigned NOT NULL, +PRIMARY KEY Name (Name) +) DEFAULT CHARACTER SET latin1 comment='Time zone names'; + +CREATE TABLE IF NOT EXISTS time_zone ( +Time_zone_id int unsigned NOT NULL auto_increment, +Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, +PRIMARY KEY TzId (Time_zone_id) +) DEFAULT CHARACTER SET latin1 comment='Time zones'; + +CREATE TABLE IF NOT EXISTS time_zone_transition ( +Time_zone_id int unsigned NOT NULL, +Transition_time bigint signed NOT NULL, +Transition_type_id int unsigned NOT NULL, +PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) +) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; + +CREATE TABLE IF NOT EXISTS time_zone_transition_type ( +Time_zone_id int unsigned NOT NULL, +Transition_type_id int unsigned NOT NULL, +Offset int signed DEFAULT 0 NOT NULL, +Is_DST tinyint unsigned DEFAULT 0 NOT NULL, +Abbreviation char(8) DEFAULT '' NOT NULL, +PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) +) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; + +CREATE TABLE IF NOT EXISTS time_zone_leap_second ( +Transition_time bigint signed NOT NULL, +Correction int signed NOT NULL, +PRIMARY KEY TranTime (Transition_time) +) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; + diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index abde6ecbe73..558b0e2da0c 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -10,6 +10,7 @@ in_rpm=0 windows=0 defaults="" +user="" tmp_file=/tmp/mysql_install_db.$$ case "$1" in @@ -34,7 +35,11 @@ parse_arguments() { --force) force=1 ;; --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; - --user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; + --user=*) + # Note that the user will be passed to mysqld so that it runs + # as 'user' (crucial e.g. if log-bin=/some_other_path/ + # where a chown of datadir won't help) + user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --skip-name-resolve) ip_only=1 ;; --verbose) verbose=1 ;; --rpm) in_rpm=1 ;; @@ -155,7 +160,7 @@ then resolved=`$bindir/resolveip localhost 2>&1` if [ $? -ne 0 ] then - echo "Neither host '$hostname' and 'localhost' could not be looked up with" + echo "Neither host '$hostname' nor 'localhost' could be looked up with" echo "$bindir/resolveip" echo "Please configure the 'hostname' command to return a correct hostname." echo "If you want to solve this at a later stage, restart this script with" @@ -198,6 +203,10 @@ else create_option="real" fi +if test -n "$user"; then + args="$args --user=$user" +fi + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "Installing all prepared tables" diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 779438e75c3..7b77bf449cd 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -43,13 +43,7 @@ parse_arguments() { --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e "s;--pid-file=;;"` ;; - --user=*) - if test $SET_USER -eq 0 - then - user=`echo "$arg" | sed -e "s;--[^=]*=;;"` - fi - SET_USER=1 - ;; + --user=*) user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1 ;; # these two might have been set in a [mysqld_safe] section of my.cnf # they are added to mysqld command line to override settings from my.cnf diff --git a/sql-common/client.c b/sql-common/client.c index 87e62b5cd11..5c1a718c5bb 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -63,7 +63,6 @@ my_bool net_flush(NET *net); #include "mysqld_error.h" #include "errmsg.h" #include <violite.h> -#include <assert.h> #if defined(THREAD) && !defined(__WIN__) #include <my_pthread.h> /* because of signal() */ #endif /* defined(THREAD) && !defined(__WIN__) */ @@ -1733,7 +1732,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno); goto error; } - memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length); + memcpy(&sock_addr.sin_addr, hp->h_addr, + min(sizeof(sock_addr.sin_addr), (size_t) hp->h_length)); my_gethostbyname_r_free(); } sock_addr.sin_port = (ushort) htons((ushort) port); @@ -1835,40 +1835,39 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, } /* Set character set */ - if (mysql->options.charset_name) + if (!mysql->options.charset_name && + !(mysql->options.charset_name= + my_strdup(MYSQL_DEFAULT_CHARSET_NAME,MYF(MY_WME)))) + goto error; + { const char *save= charsets_dir; if (mysql->options.charset_dir) charsets_dir=mysql->options.charset_dir; mysql->charset=get_charset_by_csname(mysql->options.charset_name, - MY_CS_PRIMARY, - MYF(MY_WME)); + MY_CS_PRIMARY, MYF(MY_WME)); charsets_dir= save; - - if (!mysql->charset) - { - net->last_errno=CR_CANT_READ_CHARSET; - strmov(net->sqlstate, unknown_sqlstate); - if (mysql->options.charset_dir) - my_snprintf(net->last_error, sizeof(net->last_error)-1, - ER(net->last_errno), - mysql->options.charset_name, - mysql->options.charset_dir); - else - { - char cs_dir_name[FN_REFLEN]; - get_charsets_dir(cs_dir_name); - my_snprintf(net->last_error, sizeof(net->last_error)-1, - ER(net->last_errno), - mysql->options.charset_name, - cs_dir_name); - } - goto error; - } } - else + + if (!mysql->charset) { - mysql->charset= default_charset_info; + net->last_errno=CR_CANT_READ_CHARSET; + strmov(net->sqlstate, unknown_sqlstate); + if (mysql->options.charset_dir) + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), + mysql->options.charset_name, + mysql->options.charset_dir); + else + { + char cs_dir_name[FN_REFLEN]; + get_charsets_dir(cs_dir_name); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), + mysql->options.charset_name, + cs_dir_name); + } + goto error; } diff --git a/sql/Makefile.am b/sql/Makefile.am index 469b82f95fa..9fecf6a0d8f 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -27,6 +27,7 @@ WRAPLIBS= @WRAPLIBS@ SUBDIRS = share libexec_PROGRAMS = mysqld noinst_PROGRAMS = gen_lex_hash +bin_PROGRAMS = mysql_tzinfo_to_sql gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@ LDADD = @isam_libs@ \ ../myisam/libmyisam.a \ @@ -57,8 +58,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ lex.h lex_symbol.h sql_acl.h sql_crypt.h \ log_event.h sql_repl.h slave.h \ stacktrace.h sql_sort.h sql_cache.h set_var.h \ - spatial.h gstream.h client_settings.h \ - examples/ha_example.h + spatial.h gstream.h client_settings.h tzfile.h \ + tztime.h examples/ha_example.h examples/ha_archive.h mysqld_SOURCES = sql_lex.cc sql_handler.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \ @@ -88,10 +89,14 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \ client.c sql_client.cc mini_client_errors.c pack.c\ stacktrace.c repl_failsafe.h repl_failsafe.cc \ gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \ - examples/ha_example.cc + tztime.cc examples/ha_example.cc examples/ha_archive.cc gen_lex_hash_SOURCES = gen_lex_hash.cc gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS) +mysql_tzinfo_to_sql_SOURCES = mysql_tzinfo_to_sql_tztime.cc +mysql_tzinfo_to_sql_CXXFLAGS = -DTZINFO2SQL $(AM_CXXFLAGS) +mysql_tzinfo_to_sql_LDADD = $(LDADD) $(CXXLDFLAGS) + DEFS = -DMYSQL_SERVER \ -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ @@ -113,6 +118,10 @@ link_sources: gen_lex_hash.o: gen_lex_hash.cc lex.h $(CXXCOMPILE) -c $(INCLUDES) $< +mysql_tzinfo_to_sql_tztime.cc: tztime.cc + rm -f $(srcdir)/mysql_tzinfo_to_sql_tztime.cc + @LN_CP_F@ $(srcdir)/tztime.cc $(srcdir)/mysql_tzinfo_to_sql_tztime.cc + # Try to get better dependencies for the grammar. Othervise really bad # things like different grammars for different pars of MySQL can # happen if you are unlucky. diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc new file mode 100644 index 00000000000..001ab735497 --- /dev/null +++ b/sql/examples/ha_archive.cc @@ -0,0 +1,586 @@ +/* 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 */ + +#ifdef __GNUC__ +#pragma implementation // gcc: Class implementation +#endif + +#include <mysql_priv.h> + +#ifdef HAVE_ARCHIVE_DB +#include "ha_archive.h" + +/* + First, if you want to understand storage engines you should look at + ha_example.cc and ha_example.h. + This example was written as a test case for a customer who needed + a storage engine without indexes that could compress data very well. + So, welcome to a completely compressed storage engine. This storage + engine only does inserts. No replace, deletes, or updates. All reads are + complete table scans. Compression is done through gzip (bzip compresses + better, but only marginally, if someone asks I could add support for + it too, but beaware that it costs a lot more in CPU time then gzip). + + We keep a file pointer open for each instance of ha_archive for each read + but for writes we keep one open file handle just for that. We flush it + only if we have a read occur. gzip handles compressing lots of records + at once much better then doing lots of little records between writes. + It is possible to not lock on writes but this would then mean we couldn't + handle bulk inserts as well (that is if someone was trying to read at + the same time since we would want to flush). + + No attempts at durability are made. You can corrupt your data. + + For performance as far as table scans go it is quite fast. I don't have + good numbers but locally it has out performed both Innodb and MyISAM. For + Innodb the question will be if the table can be fit into the buffer + pool. For MyISAM its a question of how much the file system caches the + MyISAM file. With enough free memory MyISAM is faster. Its only when the OS + doesn't have enough memory to cache entire table that archive turns out + to be any faster. For writes it is always a bit slower then MyISAM. It has no + internal limits though for row length. + + Examples between MyISAM (packed) and Archive. + + Table with 76695844 identical rows: + 29680807 a_archive.ARZ + 920350317 a.MYD + + + Table with 8991478 rows (all of Slashdot's comments): + 1922964506 comment_archive.ARZ + 2944970297 comment_text.MYD + + + TODO: + Add bzip optional support. + Allow users to set compression level. + Add truncate table command. + Implement versioning, should be easy. + Implement optimize so we can fix broken tables. + Allow for errors, find a way to mark bad rows. + See if during an optimize you can make the table smaller. + Talk to the gzip guys, come up with a writable format so that updates are doable + without switching to a block method. + Add optional feature so that rows can be flushed at interval (which will cause less + compression but may speed up ordered searches). + + -Brian +*/ + +/* Variables for archive share methods */ +pthread_mutex_t archive_mutex; +static HASH archive_open_tables; +static int archive_init= 0; + +/* The file extension */ +#define ARZ ".ARZ" + +/* + Used for hash table that tracks open tables. +*/ +static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length, + my_bool not_used __attribute__((unused))) +{ + *length=share->table_name_length; + return (byte*) share->table_name; +} + + +/* + Example of simple lock controls. + See ha_example.cc for a description. +*/ +static ARCHIVE_SHARE *get_share(const char *table_name, TABLE *table) +{ + ARCHIVE_SHARE *share; + uint length; + char *tmp_name; + + if (!archive_init) + { + /* Hijack a mutex for init'ing the storage engine */ + pthread_mutex_lock(&LOCK_mysql_create_db); + if (!archive_init) + { + archive_init++; + VOID(pthread_mutex_init(&archive_mutex,MY_MUTEX_INIT_FAST)); + (void) hash_init(&archive_open_tables,system_charset_info,32,0,0, + (hash_get_key) archive_get_key,0,0); + } + pthread_mutex_unlock(&LOCK_mysql_create_db); + } + pthread_mutex_lock(&archive_mutex); + length=(uint) strlen(table_name); + + if (!(share=(ARCHIVE_SHARE*) hash_search(&archive_open_tables, + (byte*) table_name, + length))) + { + if (!(share=(ARCHIVE_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &share, sizeof(*share), + &tmp_name, length+1, + NullS))) + { + pthread_mutex_unlock(&archive_mutex); + return NULL; + } + + share->use_count=0; + share->table_name_length=length; + share->table_name=tmp_name; + fn_format(share->data_file_name,table_name,"",ARZ,MY_REPLACE_EXT|MY_UNPACK_FILENAME); + strmov(share->table_name,table_name); + /* + It is expensive to open and close the data files and since you can't have + a gzip file that can be both read and written we keep a writer open + that is shared amoung all open tables. + */ + if ((share->archive_write= gzopen(share->data_file_name, "ab")) == NULL) + goto error; + if (my_hash_insert(&archive_open_tables, (byte*) share)) + goto error; + thr_lock_init(&share->lock); + if (pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST)) + goto error2; + } + share->use_count++; + pthread_mutex_unlock(&archive_mutex); + + return share; + +error2: + thr_lock_delete(&share->lock); + /* We close, but ignore errors since we already have errors */ + (void)gzclose(share->archive_write); +error: + pthread_mutex_unlock(&archive_mutex); + my_free((gptr) share, MYF(0)); + + return NULL; +} + + +/* + Free lock controls. + See ha_example.cc for a description. +*/ +static int free_share(ARCHIVE_SHARE *share) +{ + int rc= 0; + pthread_mutex_lock(&archive_mutex); + if (!--share->use_count) + { + hash_delete(&archive_open_tables, (byte*) share); + thr_lock_delete(&share->lock); + pthread_mutex_destroy(&share->mutex); + my_free((gptr) share, MYF(0)); + if (gzclose(share->archive_write) == Z_ERRNO) + rc= -1; + } + pthread_mutex_unlock(&archive_mutex); + + return rc; +} + + +/* + We just implement one additional file extension. +*/ +const char **ha_archive::bas_ext() const +{ static const char *ext[]= { ARZ, NullS }; return ext; } + + +/* + When opening a file we: + Create/get our shared structure. + Init out lock. + We open the file we will read from. + Set the size of ref_length. +*/ +int ha_archive::open(const char *name, int mode, uint test_if_locked) +{ + DBUG_ENTER("ha_archive::open"); + + if (!(share= get_share(name, table))) + DBUG_RETURN(1); + thr_lock_data_init(&share->lock,&lock,NULL); + + if ((archive= gzopen(share->data_file_name, "rb")) == NULL) + { + (void)free_share(share); //We void since we already have an error + DBUG_RETURN(-1); + } + + DBUG_RETURN(0); +} + + +/* + Closes the file. We first close this storage engines file handle to the + archive and then remove our reference count to the table (and possibly + free it as well). + */ +int ha_archive::close(void) +{ + DBUG_ENTER("ha_archive::close"); + int rc= 0; + if (gzclose(archive) == Z_ERRNO) + rc =-1; + rc |= free_share(share); + DBUG_RETURN(rc); +} + + +/* + We create our data file here. The format is pretty simple. The first bytes in + any file are the version number. Currently we do nothing with this, but in + the future this gives us the ability to figure out version if we change the + format at all. After the version we starting writing our rows. Unlike other + storage engines we do not "pack" our data. Since we are about to do a general + compression, packing would just be a waste of CPU time. If the table has blobs + they are written after the row in the order of creation. + So to read a row we: + Read the version + Read the record and copy it into buf + Loop through any blobs and read them + */ +int ha_archive::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *create_info) +{ + File create_file; + char name_buff[FN_REFLEN]; + size_t written; + DBUG_ENTER("ha_archive::create"); + + if ((create_file= my_create(fn_format(name_buff,name,"",ARZ,MY_REPLACE_EXT|MY_UNPACK_FILENAME),0, + O_RDWR | O_TRUNC,MYF(MY_WME))) < 0) + DBUG_RETURN(-1); + if ((archive= gzdopen(create_file, "ab")) == NULL) + { + delete_table(name); + DBUG_RETURN(-1); + } + version= ARCHIVE_VERSION; + written= gzwrite(archive, &version, sizeof(version)); + if (written == 0 || written != sizeof(version)) + { + delete_table(name); + DBUG_RETURN(-1); + } + if (gzclose(archive)) + { + delete_table(name); + DBUG_RETURN(-1); + } + + DBUG_RETURN(0); +} + +/* + Look at ha_archive::open() for an explanation of the row format. + Here we just write out the row. +*/ +int ha_archive::write_row(byte * buf) +{ + char *pos; + z_off_t written; + DBUG_ENTER("ha_archive::write_row"); + + statistic_increment(ha_write_count,&LOCK_status); + if (table->timestamp_default_now) + update_timestamp(buf+table->timestamp_default_now-1); + written= gzwrite(share->archive_write, buf, table->reclength); + share->dirty= true; + if (written == 0 || written != table->reclength) + DBUG_RETURN(-1); + + for (Field_blob **field=table->blob_field ; *field ; field++) + { + char *ptr; + uint32 size= (*field)->get_length(); + + (*field)->get_ptr(&ptr); + written= gzwrite(share->archive_write, ptr, (unsigned)size); + if (written == 0 || written != size) + DBUG_RETURN(-1); + } + + DBUG_RETURN(0); +} + + +/* + All calls that need to scan the table start with this method. If we are told + that it is a table scan we rewind the file to the beginning, otherwise + we assume the position will be set. +*/ +int ha_archive::rnd_init(bool scan) +{ + DBUG_ENTER("ha_archive::rnd_init"); + int read; // gzread() returns int, and we use this to check the header + + /* We rewind the file so that we can read from the beginning if scan */ + if(scan) + { + records= 0; + if (gzrewind(archive)) + DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); + } + + /* + If dirty, we lock, and then reset/flush the data. + I found that just calling gzflush() doesn't always work. + */ + if (share->dirty == true) + { + pthread_mutex_lock(&share->mutex); + if (share->dirty == true) + { +/* I was having problems with OSX, but it worked for 10.3 so I am wrapping this with and ifdef */ +#ifdef BROKEN_GZFLUSH + gzclose(share->archive_write); + if ((share->archive_write= gzopen(share->data_file_name, "ab")) == NULL) + { + pthread_mutex_unlock(&share->mutex); + DBUG_RETURN(-1); + } +#else + gzflush(share->archive_write, Z_SYNC_FLUSH); +#endif + share->dirty= false; + } + pthread_mutex_unlock(&share->mutex); + } + + /* + At the moment we just check the size of version to make sure the header is + intact. + */ + if (scan) + { + read= gzread(archive, &version, sizeof(version)); + if (read == 0 || read != sizeof(version)) + DBUG_RETURN(-1); + } + + DBUG_RETURN(0); +} + + +/* + This is the method that is used to read a row. It assumes that the row is + positioned where you want it. +*/ +int ha_archive::get_row(byte *buf) +{ + int read; // Bytes read, gzread() returns int + char *last; + size_t total_blob_length= 0; + DBUG_ENTER("ha_archive::get_row"); + + read= gzread(archive, buf, table->reclength); + + /* If we read nothing we are at the end of the file */ + if (read == 0) + DBUG_RETURN(HA_ERR_END_OF_FILE); + + /* If the record is the wrong size, the file is probably damaged */ + if (read != table->reclength) + DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); + + /* Calculate blob length, we use this for our buffer */ + for (Field_blob **field=table->blob_field; *field ; field++) + total_blob_length += (*field)->get_length(); + + /* Adjust our row buffer if we need be */ + buffer.alloc(total_blob_length); + last= (char *)buffer.ptr(); + + /* Loop through our blobs and read them */ + for (Field_blob **field=table->blob_field; *field ; field++) + { + size_t size= (*field)->get_length(); + read= gzread(archive, last, size); + if (read == 0 || read != size) + DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); + (*field)->set_ptr(size, last); + last += size; + } + DBUG_RETURN(0); +} + +/* + Called during ORDER BY. Its position is either from being called sequentially + or by having had ha_archive::rnd_pos() called before it is called. +*/ +int ha_archive::rnd_next(byte *buf) +{ + DBUG_ENTER("ha_archive::rnd_next"); + int rc; + + statistic_increment(ha_read_rnd_next_count,&LOCK_status); + current_position= gztell(archive); + rc= get_row(buf); + if (!(HA_ERR_END_OF_FILE == rc)) + records++; + + DBUG_RETURN(rc); +} + + +/* + Thanks to the table flag HA_REC_NOT_IN_SEQ this will be called after + each call to ha_archive::rnd_next() if an ordering of the rows is + needed. +*/ +void ha_archive::position(const byte *record) +{ + DBUG_ENTER("ha_archive::position"); + ha_store_ptr(ref, ref_length, current_position); + DBUG_VOID_RETURN; +} + + +/* + This is called after a table scan for each row if the results of the scan need + to be ordered. It will take *pos and use it to move the cursor in the file so + that the next row that is called is the correctly ordered row. +*/ +int ha_archive::rnd_pos(byte * buf, byte *pos) +{ + DBUG_ENTER("ha_archive::rnd_pos"); + statistic_increment(ha_read_rnd_count,&LOCK_status); + current_position= ha_get_ptr(pos, ref_length); + z_off_t seek= gzseek(archive, current_position, SEEK_SET); + + DBUG_RETURN(get_row(buf)); +} + +/****************************************************************************** + + Everything below here is default, please look at ha_example.cc for + descriptions. + + ******************************************************************************/ + +int ha_archive::update_row(const byte * old_data, byte * new_data) +{ + + DBUG_ENTER("ha_archive::update_row"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + +int ha_archive::delete_row(const byte * buf) +{ + DBUG_ENTER("ha_archive::delete_row"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + +int ha_archive::index_read(byte * buf, const byte * key, + uint key_len __attribute__((unused)), + enum ha_rkey_function find_flag + __attribute__((unused))) +{ + DBUG_ENTER("ha_archive::index_read"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + +int ha_archive::index_read_idx(byte * buf, uint index, const byte * key, + uint key_len __attribute__((unused)), + enum ha_rkey_function find_flag + __attribute__((unused))) +{ + DBUG_ENTER("ha_archive::index_read_idx"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + + +int ha_archive::index_next(byte * buf) +{ + DBUG_ENTER("ha_archive::index_next"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + +int ha_archive::index_prev(byte * buf) +{ + DBUG_ENTER("ha_archive::index_prev"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + +int ha_archive::index_first(byte * buf) +{ + DBUG_ENTER("ha_archive::index_first"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + +int ha_archive::index_last(byte * buf) +{ + DBUG_ENTER("ha_archive::index_last"); + DBUG_RETURN(HA_ERR_NOT_IMPLEMENTED); +} + + +void ha_archive::info(uint flag) +{ + DBUG_ENTER("ha_archive::info"); + + /* This is a lie, but you don't want the optimizer to see zero or 1 */ + if (records < 2) + records= 2; + + DBUG_VOID_RETURN; +} + +int ha_archive::extra(enum ha_extra_function operation) +{ + DBUG_ENTER("ha_archive::extra"); + DBUG_RETURN(0); +} + +int ha_archive::reset(void) +{ + DBUG_ENTER("ha_archive::reset"); + DBUG_RETURN(0); +} + + +int ha_archive::external_lock(THD *thd, int lock_type) +{ + DBUG_ENTER("ha_archive::external_lock"); + DBUG_RETURN(0); +} + +THR_LOCK_DATA **ha_archive::store_lock(THD *thd, + THR_LOCK_DATA **to, + enum thr_lock_type lock_type) +{ + if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) + lock.type=lock_type; + *to++= &lock; + return to; +} + +ha_rows ha_archive::records_in_range(int inx, + const byte *start_key,uint start_key_len, + enum ha_rkey_function start_search_flag, + const byte *end_key,uint end_key_len, + enum ha_rkey_function end_search_flag) +{ + DBUG_ENTER("ha_archive::records_in_range "); + DBUG_RETURN(records); // HA_ERR_NOT_IMPLEMENTED +} +#endif /* HAVE_ARCHIVE_DB */ diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h new file mode 100644 index 00000000000..90f64b4c01c --- /dev/null +++ b/sql/examples/ha_archive.h @@ -0,0 +1,123 @@ +/* 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 */ + +#ifdef __GNUC__ +#pragma interface /* gcc class implementation */ +#endif + +#include <zlib.h> + +/* + Please read ha_archive.cc first. If you are looking for more general + answers on how storage engines work, look at ha_example.cc and + ha_example.h. +*/ + +typedef struct st_archive_share { + char *table_name; + char data_file_name[FN_REFLEN]; + uint table_name_length,use_count; + pthread_mutex_t mutex; + THR_LOCK lock; + gzFile archive_write; /* Archive file we are working with */ + bool dirty; /* Flag for if a flush should occur */ +} ARCHIVE_SHARE; + +/* + Version for file format. + 1 - Initial Version +*/ +#define ARCHIVE_VERSION 1 + +class ha_archive: public handler +{ + THR_LOCK_DATA lock; /* MySQL lock */ + ARCHIVE_SHARE *share; /* Shared lock info */ + gzFile archive; /* Archive file we are working with */ + z_off_t current_position; /* The position of the row we just read */ + byte byte_buffer[IO_SIZE]; /* Initial buffer for our string */ + String buffer; /* Buffer used for blob storage */ + unsigned int version; /* Used for recording version */ + +public: + ha_archive(TABLE *table): handler(table) + { + /* Set our original buffer from pre-allocated memory */ + buffer.set(byte_buffer, IO_SIZE, system_charset_info); + + /* The size of the offset value we will use for position() */ + ref_length = sizeof(z_off_t); + } + ~ha_archive() + { + } + const char *table_type() const { return "ARCHIVE"; } + const char *index_type(uint inx) { return "NONE"; } + const char **bas_ext() const; + ulong table_flags() const + { + return (HA_REC_NOT_IN_SEQ | HA_NOT_EXACT_COUNT | HA_NO_WRITE_DELAYED | + HA_NO_AUTO_INCREMENT); + } + ulong index_flags(uint inx) const + { + return 0; + } + /* + This is just a default, there is no real limit as far as + archive is concerned. + */ + uint max_record_length() const { return HA_MAX_REC_LENGTH; } + uint max_keys() const { return 0; } + uint max_key_parts() const { return 0; } + uint max_key_length() const { return 0; } + /* + Called in test_quick_select to determine if indexes should be used. + */ + virtual double scan_time() { return (double) (records) / 20.0+10; } + /* The next method will never be called */ + virtual double read_time(ha_rows rows) { return (double) rows / 20.0+1; } + int open(const char *name, int mode, uint test_if_locked); + int close(void); + int write_row(byte * buf); + int update_row(const byte * old_data, byte * new_data); + int delete_row(const byte * buf); + int index_read(byte * buf, const byte * key, + uint key_len, enum ha_rkey_function find_flag); + int index_read_idx(byte * buf, uint idx, const byte * key, + uint key_len, enum ha_rkey_function find_flag); + int index_next(byte * buf); + int index_prev(byte * buf); + int index_first(byte * buf); + int index_last(byte * buf); + int rnd_init(bool scan=1); + int rnd_next(byte *buf); + int rnd_pos(byte * buf, byte *pos); + int get_row(byte *buf); + void position(const byte *record); + void info(uint); + int extra(enum ha_extra_function operation); + int reset(void); + int external_lock(THD *thd, int lock_type); + ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len, + enum ha_rkey_function start_search_flag, + const byte *end_key,uint end_key_len, + enum ha_rkey_function end_search_flag); + int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); + + THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type); +}; diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index 2d17caf1a83..4c192a94b4b 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -596,6 +596,10 @@ THR_LOCK_DATA **ha_example::store_lock(THD *thd, shared references released. The variable name will just be the name of the table. You will need to remove any files you have created at this point. + If you do not implement this, the default delete_table() is called from + handler.cc and it will delete all files with the file extentions returned + by bas_ext(). + Called from handler.cc by delete_table and ha_create_table(). Only used during create if the table_flag HA_DROP_BEFORE_CREATE was specified for the storage engine. @@ -610,6 +614,10 @@ int ha_example::delete_table(const char *name) /* Renames a table from one name to another from alter table call. + If you do not implement this, the default rename_table() is called from + handler.cc and it will delete all files with the file extentions returned + by bas_ext(). + Called from sql_table.cc by mysql_rename_table(). */ int ha_example::rename_table(const char * from, const char * to) diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h index 2228f04284a..cd8baac2017 100644 --- a/sql/examples/ha_example.h +++ b/sql/examples/ha_example.h @@ -21,6 +21,10 @@ that you can implement. */ +#ifdef __GNUC__ +#pragma interface /* gcc class implementation */ +#endif + /* EXAMPLE_SHARE is a structure that will be shared amoung all open handlers The example implements the minimum of what you will probably need. @@ -87,7 +91,6 @@ public: The next method will never be called if you do not implement indexes. */ virtual double read_time(ha_rows rows) { return (double) rows / 20.0+1; } - virtual bool fast_key_read() { return 1;} /* Everything below are methods that we implment in ha_example.cc. diff --git a/sql/field.cc b/sql/field.cc index 44bca1ecc3c..ab444e35a8c 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -398,7 +398,7 @@ bool Field::get_date(TIME *ltime,uint fuzzydate) char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; if (!(res=val_str(&tmp)) || - str_to_TIME(res->ptr(),res->length(),ltime,fuzzydate) <= + str_to_TIME_with_warn(res->ptr(), res->length(), ltime, fuzzydate) <= TIMESTAMP_DATETIME_ERROR) return 1; return 0; @@ -409,7 +409,7 @@ bool Field::get_time(TIME *ltime) char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; if (!(res=val_str(&tmp)) || - str_to_time(res->ptr(),res->length(),ltime)) + str_to_time_with_warn(res->ptr(), res->length(), ltime)) return 1; return 0; } @@ -462,7 +462,7 @@ void Field_decimal::overflow(bool negative) uint len=field_length; char *to=ptr, filler= '9'; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); if (negative) { if (!unsigned_flag) @@ -546,7 +546,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) char *left_wall,*right_wall; char tmp_char; /* - To remember if current_thd->cuted_fields has already been incremented, + To remember if table->in_use->cuted_fields has already been incremented, to do that only once */ bool is_cuted_fields_incr=0; @@ -572,7 +572,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) from++; if (from == end) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); is_cuted_fields_incr=1; } else if (*from == '+' || *from == '-') // Found some sign ? @@ -642,13 +642,13 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) it makes the code easer to read. */ - if (current_thd->count_cuted_fields) + if (table->in_use->count_cuted_fields) { // Skip end spaces for (;from != end && my_isspace(&my_charset_bin, *from); from++) ; if (from != end) // If still something left, warn { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); is_cuted_fields_incr=1; } } @@ -794,7 +794,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) /* Write digits of the frac_% parts ; - Depending on current_thd->count_cutted_fields, we may also want + Depending on table->in_use->count_cutted_fields, we may also want to know if some non-zero tail of these parts will be truncated (for example, 0.002->0.00 will generate a warning, while 0.000->0.00 will not) @@ -812,7 +812,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) { if (pos == right_wall) { - if (current_thd->count_cuted_fields && !is_cuted_fields_incr) + if (table->in_use->count_cuted_fields && !is_cuted_fields_incr) break; // Go on below to see if we lose non zero digits return 0; } @@ -826,7 +826,8 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) if (tmp_char != '0') // Losing a non zero digit ? { if (!is_cuted_fields_incr) - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_TRUNCATED, 1); return 0; } continue; @@ -843,7 +844,7 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) if (tmp_char != '0') // Losing a non zero digit ? { if (!is_cuted_fields_incr) - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); return 0; } continue; @@ -1061,18 +1062,18 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs) if (tmp < 0) { tmp=0; /* purecov: inspected */ - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (tmp > 255) { tmp= 255; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs)) + else if (table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs)) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } } @@ -1081,18 +1082,18 @@ int Field_tiny::store(const char *from,uint len,CHARSET_INFO *cs) if (tmp < -128) { tmp= -128; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (tmp >= 128) { tmp= 127; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs)) + else if (table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs)) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } } @@ -1110,13 +1111,13 @@ int Field_tiny::store(double nr) if (nr < 0.0) { *ptr=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > 255.0) { *ptr=(char) 255; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1127,13 +1128,13 @@ int Field_tiny::store(double nr) if (nr < -128.0) { *ptr= (char) -128; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > 127.0) { *ptr=127; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1150,13 +1151,13 @@ int Field_tiny::store(longlong nr) if (nr < 0L) { *ptr=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > 255L) { *ptr= (char) 255; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1167,13 +1168,13 @@ int Field_tiny::store(longlong nr) if (nr < -128L) { *ptr= (char) -128; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > 127L) { *ptr=127; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1265,18 +1266,18 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs) if (tmp < 0) { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (tmp > (uint16) ~0) { tmp=(uint16) ~0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs)) + else if (table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs)) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } } @@ -1285,18 +1286,18 @@ int Field_short::store(const char *from,uint len,CHARSET_INFO *cs) if (tmp < INT_MIN16) { tmp= INT_MIN16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (tmp > INT_MAX16) { tmp=INT_MAX16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs)) + else if (table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs)) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } } @@ -1322,13 +1323,13 @@ int Field_short::store(double nr) if (nr < 0) { res=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) (uint16) ~0) { res=(int16) (uint16) ~0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1339,13 +1340,13 @@ int Field_short::store(double nr) if (nr < (double) INT_MIN16) { res=INT_MIN16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) INT_MAX16) { res=INT_MAX16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1371,13 +1372,13 @@ int Field_short::store(longlong nr) if (nr < 0L) { res=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (longlong) (uint16) ~0) { res=(int16) (uint16) ~0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1388,13 +1389,13 @@ int Field_short::store(longlong nr) if (nr < INT_MIN16) { res=INT_MIN16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > INT_MAX16) { res=INT_MAX16; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1540,18 +1541,18 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs) if (tmp < 0) { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (tmp >= (long) (1L << 24)) { tmp=(long) (1L << 24)-1L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs)) + else if (table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs)) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } } @@ -1560,18 +1561,18 @@ int Field_medium::store(const char *from,uint len,CHARSET_INFO *cs) if (tmp < INT_MIN24) { tmp= INT_MIN24; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (tmp > INT_MAX24) { tmp=INT_MAX24; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs)) + else if (table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs)) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } } @@ -1590,14 +1591,14 @@ int Field_medium::store(double nr) if (nr < 0) { int3store(ptr,0); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr >= (double) (long) (1L << 24)) { uint32 tmp=(uint32) (1L << 24)-1L; int3store(ptr,tmp); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1609,14 +1610,14 @@ int Field_medium::store(double nr) { long tmp=(long) INT_MIN24; int3store(ptr,tmp); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) INT_MAX24) { long tmp=(long) INT_MAX24; int3store(ptr,tmp); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1633,14 +1634,14 @@ int Field_medium::store(longlong nr) if (nr < 0L) { int3store(ptr,0); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr >= (longlong) (long) (1L << 24)) { long tmp=(long) (1L << 24)-1L;; int3store(ptr,tmp); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1652,14 +1653,14 @@ int Field_medium::store(longlong nr) { long tmp=(long) INT_MIN24; int3store(ptr,tmp); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (longlong) INT_MAX24) { long tmp=(long) INT_MAX24; int3store(ptr,tmp); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1771,10 +1772,10 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) else tmp=my_strntol(cs,from,len,10,&end,&error); if (error || - (from+len != end && current_thd->count_cuted_fields && + (from+len != end && table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs))) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } #ifdef WORDS_BIGENDIAN @@ -1799,13 +1800,13 @@ int Field_long::store(double nr) if (nr < 0) { res=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) (ulong) ~0L) { res=(int32) (uint32) ~0L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1816,13 +1817,13 @@ int Field_long::store(double nr) if (nr < (double) INT_MIN32) { res=(int32) INT_MIN32; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (double) INT_MAX32) { res=(int32) INT_MAX32; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1844,18 +1845,26 @@ int Field_long::store(longlong nr) { int error= 0; int32 res; + + /* + This assert has nothing to do with this method per se, it was put here + only because it is one of the best places for catching places there its + condition is broken. + */ + DBUG_ASSERT(table->in_use == current_thd); + if (unsigned_flag) { if (nr < 0) { res=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr >= (LL(1) << 32)) { res=(int32) (uint32) ~0L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1866,13 +1875,13 @@ int Field_long::store(longlong nr) if (nr < (longlong) INT_MIN32) { res=(int32) INT_MIN32; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > (longlong) INT_MAX32) { res=(int32) INT_MAX32; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -1905,6 +1914,8 @@ double Field_long::val_real(void) longlong Field_long::val_int(void) { int32 j; + /* See the comment in Field_long::store(long long) */ + DBUG_ASSERT(table->in_use == current_thd); #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) j=sint4korr(ptr); @@ -2029,10 +2040,10 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs) else tmp=my_strntoll(cs,from,len,10,&end,&error); if (error || - (from+len != end && current_thd->count_cuted_fields && + (from+len != end && table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs))) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } #ifdef WORDS_BIGENDIAN @@ -2057,13 +2068,13 @@ int Field_longlong::store(double nr) if (nr < 0) { res=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr >= (double) ~ (ulonglong) 0) { res= ~(longlong) 0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -2074,13 +2085,13 @@ int Field_longlong::store(double nr) if (nr <= (double) LONGLONG_MIN) { res=(longlong) LONGLONG_MIN; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr >= (double) LONGLONG_MAX) { res=(longlong) LONGLONG_MAX; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -2251,10 +2262,10 @@ int Field_float::store(const char *from,uint len,CHARSET_INFO *cs) int error; char *end; double nr= my_strntod(cs,(char*) from,len,&end,&error); - if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields)) + if (error || ((uint) (end-from) != len && table->in_use->count_cuted_fields)) { error= 1; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } Field_float::store(nr); return error; @@ -2270,13 +2281,13 @@ int Field_float::store(double nr) { j= 0; set_null(); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (unsigned_flag && nr < 0) { j= 0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -2300,13 +2311,13 @@ int Field_float::store(double nr) if (nr < -max_value) { j= (float)-max_value; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > max_value) { j= (float)max_value; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -2331,7 +2342,7 @@ int Field_float::store(longlong nr) float j= (float) nr; if (unsigned_flag && j < 0) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); j=0; error= 1; } @@ -2553,10 +2564,10 @@ int Field_double::store(const char *from,uint len,CHARSET_INFO *cs) int error; char *end; double nr= my_strntod(cs,(char*) from, len, &end, &error); - if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields)) + if (error || ((uint) (end-from) != len && table->in_use->count_cuted_fields)) { error= 1; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } Field_double::store(nr); return error; @@ -2571,13 +2582,13 @@ int Field_double::store(double nr) { nr= 0; set_null(); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (unsigned_flag && nr < 0) { nr= 0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else @@ -2597,13 +2608,13 @@ int Field_double::store(double nr) if (nr < -max_value) { nr= -max_value; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } else if (nr > max_value) { nr= max_value; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } } @@ -2626,7 +2637,7 @@ int Field_double::store(longlong nr) int error= 0; if (unsigned_flag && j < 0) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; j=0; } @@ -2900,7 +2911,39 @@ void Field_timestamp::set_timestamp_offsets() int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs) { - long tmp=(long) str_to_timestamp(from,len); + TIME l_time; + my_time_t tmp= 0; + int error; + bool have_smth_to_conv; + bool in_dst_time_gap; + THD *thd= table->in_use; + + have_smth_to_conv= (str_to_TIME(from, len, &l_time, 0, &error) > + TIMESTAMP_DATETIME_ERROR); + + if (error) + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, + from, len, TIMESTAMP_DATETIME, 1); + + if (have_smth_to_conv) + { + if (!(tmp= TIME_to_timestamp(thd, &l_time, &in_dst_time_gap))) + { + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + from, len, TIMESTAMP_DATETIME, !error); + + error= 1; + } + else if (in_dst_time_gap) + { + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_INVALID_TIMESTAMP, + from, len, TIMESTAMP_DATETIME, !error); + error= 1; + } + } + #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -2909,7 +2952,7 @@ int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs) else #endif longstore(ptr,tmp); - return 0; + return error; } int Field_timestamp::store(double nr) @@ -2917,8 +2960,10 @@ int Field_timestamp::store(double nr) int error= 0; if (nr < 0 || nr > 99991231235959.0) { + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + nr, TIMESTAMP_DATETIME); nr= 0; // Avoid overflow on buff - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); error= 1; } error|= Field_timestamp::store((longlong) rint(nr)); @@ -2926,96 +2971,37 @@ int Field_timestamp::store(double nr) } -/* - Convert a datetime of formats YYMMDD, YYYYMMDD or YYMMDDHHMSS to - YYYYMMDDHHMMSS. The high date '99991231235959' is checked before this - function. -*/ - -static longlong fix_datetime(longlong nr, TIME *time_res, - const char *field_name, bool *error) -{ - long part1,part2; - - *error= 0; - if (nr == LL(0) || nr >= LL(10000101000000)) - goto ok; - if (nr < 101) - goto err; - if (nr <= (YY_PART_YEAR-1)*10000L+1231L) - { - nr= (nr+20000000L)*1000000L; // YYMMDD, year: 2000-2069 - goto ok; - } - if (nr < (YY_PART_YEAR)*10000L+101L) - goto err; - if (nr <= 991231L) - { - nr= (nr+19000000L)*1000000L; // YYMMDD, year: 1970-1999 - goto ok; - } - if (nr < 10000101L) - goto err; - if (nr <= 99991231L) - { - nr= nr*1000000L; - goto ok; - } - if (nr < 101000000L) - goto err; - if (nr <= (YY_PART_YEAR-1)*LL(10000000000)+LL(1231235959)) - { - nr= nr+LL(20000000000000); // YYMMDDHHMMSS, 2000-2069 - goto ok; - } - if (nr < YY_PART_YEAR*LL(10000000000)+ LL(101000000)) - goto err; - if (nr <= LL(991231235959)) - nr= nr+LL(19000000000000); // YYMMDDHHMMSS, 1970-1999 - - ok: - part1=(long) (nr/LL(1000000)); - part2=(long) (nr - (longlong) part1*LL(1000000)); - time_res->year= (int) (part1/10000L); part1%=10000L; - time_res->month= (int) part1 / 100; - time_res->day= (int) part1 % 100; - time_res->hour= (int) (part2/10000L); part2%=10000L; - time_res->minute=(int) part2 / 100; - time_res->second=(int) part2 % 100; - - if (time_res->year <= 9999 && time_res->month <= 12 && - time_res->day <= 31 && time_res->hour <= 23 && - time_res->minute <= 59 && time_res->second <= 59) - return nr; - - err: - THD *thd= current_thd; - if (thd->count_cuted_fields) - { - thd->cuted_fields++; - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_TRUNCATED, ER(ER_WARN_DATA_TRUNCATED), - field_name, thd->row_count); - } - *error= 1; - return LL(0); -} - - int Field_timestamp::store(longlong nr) { TIME l_time; - time_t timestamp= 0; - bool error; + my_time_t timestamp= 0; + int error; + bool in_dst_time_gap; + THD *thd= table->in_use; - if ((nr= fix_datetime(nr, &l_time, field_name, &error))) + if (number_to_TIME(nr, &l_time, 0, &error)) { - long not_used; - - if (!(timestamp= my_gmt_sec(&l_time, ¬_used))) - goto err; - } + if (!(timestamp= TIME_to_timestamp(thd, &l_time, &in_dst_time_gap))) + { + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + nr, TIMESTAMP_DATETIME, 1); + error= 1; + } + if (in_dst_time_gap) + { + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_INVALID_TIMESTAMP, + nr, TIMESTAMP_DATETIME, !error); + error= 1; + } + } + else if (error) + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_TRUNCATED, + nr, TIMESTAMP_DATETIME, 1); + #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -3024,12 +3010,8 @@ int Field_timestamp::store(longlong nr) else #endif longstore(ptr,(uint32) timestamp); + return error; - -err: - longstore(ptr,(uint32) 0); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); - return 1; } @@ -3040,12 +3022,9 @@ double Field_timestamp::val_real(void) longlong Field_timestamp::val_int(void) { - int part_time; uint32 temp; - time_t time_arg; - struct tm *l_time; - longlong res; - struct tm tm_tmp; + TIME time_tmp; + THD *thd= table->in_use; #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) @@ -3056,32 +3035,21 @@ longlong Field_timestamp::val_int(void) if (temp == 0L) // No time return(0); /* purecov: inspected */ - time_arg=(time_t) temp; - localtime_r(&time_arg,&tm_tmp); - l_time=&tm_tmp; - - part_time= l_time->tm_year % 100; - res= ((longlong) (part_time+ ((part_time < YY_PART_YEAR) ? 2000 : 1900))* - LL(10000000000)); - part_time= l_time->tm_mon+1; - res+= (longlong) part_time * LL(100000000); - part_time=l_time->tm_mday; - res+= (longlong) ((long) part_time * 1000000L); - part_time=l_time->tm_hour; - res+= (longlong) (part_time * 10000L); - part_time=l_time->tm_min; - res+= (longlong) (part_time * 100); - part_time=l_time->tm_sec; - return res+part_time; + + thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, (my_time_t)temp); + thd->time_zone_used= 1; + + return time_tmp.year * LL(10000000000) + time_tmp.month * LL(100000000) + + time_tmp.day * 1000000L + time_tmp.hour * 10000L + + time_tmp.minute * 100 + time_tmp.second; } String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) { uint32 temp, temp2; - time_t time_arg; - struct tm *l_time; - struct tm tm_tmp; + TIME time_tmp; + THD *thd= table->in_use; char *to; val_buffer->alloc(field_length+1); @@ -3101,11 +3069,11 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) return val_ptr; } val_buffer->set_charset(&my_charset_bin); // Safety - time_arg=(time_t) temp; - localtime_r(&time_arg,&tm_tmp); - l_time=&tm_tmp; + + thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp,(my_time_t)temp); + thd->time_zone_used= 1; - temp= l_time->tm_year % 100; + temp= time_tmp.year % 100; if (temp < YY_PART_YEAR) { *to++= '2'; @@ -3120,27 +3088,27 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) *to++= (char) ('0'+(char) (temp2)); *to++= (char) ('0'+(char) (temp)); *to++= '-'; - temp=l_time->tm_mon+1; + temp=time_tmp.month; temp2=temp/10; temp=temp-temp2*10; *to++= (char) ('0'+(char) (temp2)); *to++= (char) ('0'+(char) (temp)); *to++= '-'; - temp=l_time->tm_mday; + temp=time_tmp.day; temp2=temp/10; temp=temp-temp2*10; *to++= (char) ('0'+(char) (temp2)); *to++= (char) ('0'+(char) (temp)); *to++= ' '; - temp=l_time->tm_hour; + temp=time_tmp.hour; temp2=temp/10; temp=temp-temp2*10; *to++= (char) ('0'+(char) (temp2)); *to++= (char) ('0'+(char) (temp)); *to++= ':'; - temp=l_time->tm_min; + temp=time_tmp.minute; temp2=temp/10; temp=temp-temp2*10; *to++= (char) ('0'+(char) (temp2)); *to++= (char) ('0'+(char) (temp)); *to++= ':'; - temp=l_time->tm_sec; + temp=time_tmp.second; temp2=temp/10; temp=temp-temp2*10; *to++= (char) ('0'+(char) (temp2)); *to++= (char) ('0'+(char) (temp)); @@ -3152,6 +3120,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) bool Field_timestamp::get_date(TIME *ltime, uint fuzzydate) { long temp; + THD *thd= table->in_use; #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) temp=uint4korr(ptr); @@ -3166,19 +3135,8 @@ bool Field_timestamp::get_date(TIME *ltime, uint fuzzydate) } else { - struct tm tm_tmp; - time_t time_arg= (time_t) temp; - localtime_r(&time_arg,&tm_tmp); - struct tm *start= &tm_tmp; - ltime->year= start->tm_year+1900; - ltime->month= start->tm_mon+1; - ltime->day= start->tm_mday; - ltime->hour= start->tm_hour; - ltime->minute= start->tm_min; - ltime->second= start->tm_sec; - ltime->second_part= 0; - ltime->neg= 0; - ltime->time_type=TIMESTAMP_DATETIME; + thd->variables.time_zone->gmt_sec_to_TIME(ltime, (my_time_t)temp); + thd->time_zone_used= 1; } return 0; } @@ -3245,7 +3203,7 @@ void Field_timestamp::sql_type(String &res) const void Field_timestamp::set_time() { - long tmp= (long) current_thd->query_start(); + long tmp= (long) table->in_use->query_start(); #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -3267,25 +3225,35 @@ int Field_time::store(const char *from,uint len,CHARSET_INFO *cs) { TIME ltime; long tmp; - int error= 0; - if (str_to_time(from,len,<ime)) + int error; + + if (str_to_time(from, len, <ime, &error)) { tmp=0L; error= 1; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, + from, len, TIMESTAMP_TIME, 1); } else { + if (error) + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_TRUNCATED, + from, len, TIMESTAMP_TIME, 1); + if (ltime.month) ltime.day=0; tmp=(ltime.day*24L+ltime.hour)*10000L+(ltime.minute*100+ltime.second); if (tmp > 8385959) { tmp=8385959; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + from, len, TIMESTAMP_TIME, !error); error= 1; } } + if (ltime.neg) tmp= -tmp; error |= Field_time::store((longlong) tmp); @@ -3300,13 +3268,15 @@ int Field_time::store(double nr) if (nr > 8385959.0) { tmp=8385959L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME); error= 1; } else if (nr < -8385959.0) { tmp= -8385959L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME); error= 1; } else @@ -3317,7 +3287,8 @@ int Field_time::store(double nr) if (tmp % 100 > 59 || tmp/100 % 100 > 59) { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME); error= 1; } } @@ -3333,13 +3304,15 @@ int Field_time::store(longlong nr) if (nr > (longlong) 8385959L) { tmp=8385959L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME, 1); error= 1; } else if (nr < (longlong) -8385959L) { tmp= -8385959L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME, 1); error= 1; } else @@ -3348,7 +3321,8 @@ int Field_time::store(longlong nr) if (tmp % 100 > 59 || tmp/100 % 100 > 59) { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_TIME, 1); error= 1; } } @@ -3395,6 +3369,39 @@ String *Field_time::val_str(String *val_buffer, } +/* + Normally we would not consider 'time' as a vaild date, but we allow + get_date() here to be able to do things like + DATE_FORMAT(time, "%l.%i %p") +*/ + +bool Field_time::get_date(TIME *ltime, uint fuzzydate) +{ + long tmp; + if (!fuzzydate) + { + push_warning_printf(table->in_use, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + ER(ER_WARN_DATA_OUT_OF_RANGE), field_name, + table->in_use->row_count); + return 1; + } + tmp=(long) sint3korr(ptr); + ltime->neg=0; + if (tmp < 0) + { + ltime->neg= 1; + tmp=-tmp; + } + ltime->hour=tmp/10000; + tmp-=ltime->hour*10000; + ltime->minute= tmp/100; + ltime->second= tmp % 100; + ltime->year= ltime->month= ltime->day= ltime->second_part= 0; + return 0; +} + + bool Field_time::get_time(TIME *ltime) { long tmp=(long) sint3korr(ptr); @@ -3460,11 +3467,11 @@ int Field_year::store(const char *from, uint len,CHARSET_INFO *cs) if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155) { *ptr=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } - if (current_thd->count_cuted_fields && !test_if_int(from,len,end,cs)) - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + if (table->in_use->count_cuted_fields && !test_if_int(from,len,end,cs)) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); if (nr != 0 || len != 4) { if (nr < YY_PART_YEAR) @@ -3493,7 +3500,7 @@ int Field_year::store(longlong nr) if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155) { *ptr=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); return 1; } if (nr != 0 || field_length != 4) // 0000 -> 0; 00 -> 2000 @@ -3557,15 +3564,21 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs) { TIME l_time; uint32 tmp; - int error= 0; - if (str_to_TIME(from,len,&l_time,1) <= TIMESTAMP_DATETIME_ERROR) + int error; + + if (str_to_TIME(from, len, &l_time, 1, &error) <= + TIMESTAMP_DATETIME_ERROR) { tmp=0; error= 1; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); } else tmp=(uint32) l_time.year*10000L + (uint32) (l_time.month*100+l_time.day); + + if (error) + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, + from, len, TIMESTAMP_DATE, 1); + #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -3587,7 +3600,9 @@ int Field_date::store(double nr) if (nr < 0.0 || nr > 99991231.0) { tmp=0L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + nr, TIMESTAMP_DATE); error= 1; } else @@ -3613,7 +3628,9 @@ int Field_date::store(longlong nr) if (nr < 0 || nr > LL(99991231)) { tmp=0L; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + nr, TIMESTAMP_DATE, 0); error= 1; } else @@ -3740,15 +3757,20 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs) { TIME l_time; long tmp; - int error= 0; - if (str_to_TIME(from,len,&l_time,1) <= TIMESTAMP_DATETIME_ERROR) + int error; + if (str_to_TIME(from, len, &l_time, 1, &error) <= + TIMESTAMP_DATETIME_ERROR) { tmp=0L; error= 1; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); } else tmp= l_time.day + l_time.month*32 + l_time.year*16*32; + + if (error) + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, + from, len, TIMESTAMP_DATE, 1); + int3store(ptr,tmp); return error; } @@ -3758,7 +3780,8 @@ int Field_newdate::store(double nr) if (nr < 0.0 || nr > 99991231235959.0) { (void) Field_newdate::store((longlong) -1); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_TRUNCATED, nr, TIMESTAMP_DATE); return 1; } else @@ -3775,7 +3798,8 @@ int Field_newdate::store(longlong nr) if (nr < 0L || nr > 99991231L) { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_DATE, 1); error= 1; } else @@ -3793,7 +3817,8 @@ int Field_newdate::store(longlong nr) if (month > 12 || day > 31) { tmp=0L; // Don't allow date to change - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, nr, TIMESTAMP_DATE, 1); error= 1; } else @@ -3811,7 +3836,7 @@ void Field_newdate::store_time(TIME *ltime,timestamp_type type) else { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } int3store(ptr,tmp); } @@ -3910,12 +3935,19 @@ void Field_newdate::sql_type(String &res) const int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs) { - longlong tmp=str_to_datetime(from,len,1); - if (tmp < 0) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); - tmp= 0; - } + TIME time_tmp; + int error; + ulonglong tmp= 0; + + if (str_to_TIME(from, len, &time_tmp, 1, &error) > + TIMESTAMP_DATETIME_ERROR) + tmp= TIME_to_ulonglong_datetime(&time_tmp); + + if (error) + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + from, len, TIMESTAMP_DATETIME, 1); + #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -3924,7 +3956,7 @@ int Field_datetime::store(const char *from,uint len,CHARSET_INFO *cs) else #endif longlongstore(ptr,tmp); - return 0; + return error; } @@ -3933,8 +3965,10 @@ int Field_datetime::store(double nr) int error= 0; if (nr < 0.0 || nr > 99991231235959.0) { + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_OUT_OF_RANGE, + nr, TIMESTAMP_DATETIME); nr=0.0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); error= 1; } error |= Field_datetime::store((longlong) rint(nr)); @@ -3945,9 +3979,16 @@ int Field_datetime::store(double nr) int Field_datetime::store(longlong nr) { TIME not_used; - bool error; + int error; + longlong initial_nr= nr; - nr= fix_datetime(nr, ¬_used, field_name, &error); + nr= number_to_TIME(nr, ¬_used, 1, &error); + + if (error) + set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_TRUNCATED, initial_nr, + TIMESTAMP_DATETIME, 1); + #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -3969,7 +4010,7 @@ void Field_datetime::store_time(TIME *ltime,timestamp_type type) else { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) @@ -4146,7 +4187,10 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) char buff[80]; String tmpstr(buff,sizeof(buff), &my_charset_bin); uint copy_length; - + + /* See the comment for Field_long::store(long long) */ + DBUG_ASSERT(table->in_use == current_thd); + /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used)) { @@ -4168,7 +4212,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) field_charset->cset->fill(field_charset,ptr+copy_length, field_length-copy_length,' '); - if ((copy_length < length) && current_thd->count_cuted_fields) + if ((copy_length < length) && table->in_use->count_cuted_fields) { // Check if we loosed some info const char *end=from+length; from+= copy_length; @@ -4176,7 +4220,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) MY_SEQ_SPACES); if (from != end) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error=1; } } @@ -4224,6 +4268,8 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)), String *val_ptr) { uint length= field_charset->cset->lengthsp(field_charset, ptr, field_length); + /* See the comment for Field_long::store(long long) */ + DBUG_ASSERT(table->in_use == current_thd); val_ptr->set((const char*) ptr, length, field_charset); return val_ptr; } @@ -4351,7 +4397,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) if (length > field_length) { length=field_length; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } memcpy(ptr+HA_KEY_BLOB_LENGTH,from,length); @@ -4669,7 +4715,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) min(length, copy_length), copy_length); if (copy_length < length) - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); Field_blob::store_length(copy_length); if (was_conversion || table->copy_blobs || copy_length <= MAX_FIELD_WIDTH) @@ -5228,11 +5274,11 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs) if (err || end != from+length || tmp > typelib->count) { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } } else - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } store_type((ulonglong) tmp); return err; @@ -5250,7 +5296,7 @@ int Field_enum::store(longlong nr) int error= 0; if ((uint) nr > typelib->count || nr == 0) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); nr=0; error=1; } @@ -5406,11 +5452,11 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs) tmp > (ulonglong) (((longlong) 1 << typelib->count) - (longlong) 1)) { tmp=0; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } } else if (got_warning) - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); store_type(tmp); return err; } @@ -5423,7 +5469,7 @@ int Field_set::store(longlong nr) (longlong) 1)) { nr&= (longlong) (((longlong) 1 << typelib->count) - (longlong) 1); - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error=1; } store_type((ulonglong) nr); @@ -5802,13 +5848,148 @@ create_field::create_field(Field *old_field,Field *orig_field) /* Warning handling */ -void Field::set_warning(const uint level, const uint code) + +/* + Produce warning or note about data saved into field + + SYNOPSYS + set_warning() + level - level of message (Note/Warning/Error) + code - error code of message to be produced + cuted_increment - whenever we should increase cut fields count or not + + NOTE + This function won't produce warning and increase cut fields counter + if count_cuted_fields == FIELD_CHECK_IGNORE for current thread. + + RETURN VALUE + true - if count_cuted_fields == FIELD_CHECK_IGNORE + false - otherwise +*/ +bool +Field::set_warning(const uint level, const uint code, int cuted_increment) { - THD *thd= current_thd; + THD *thd= table->in_use; if (thd->count_cuted_fields) { - thd->cuted_fields++; - push_warning_printf(thd, (MYSQL_ERROR::enum_warning_level) level, - code, ER(code), field_name, thd->row_count); + thd->cuted_fields+= cuted_increment; + push_warning_printf(thd, (MYSQL_ERROR::enum_warning_level) level, + code, ER(code), field_name, thd->row_count); + return 0; + } + return 1; +} + + +/* + Produce warning or note about datetime string data saved into field + + SYNOPSYS + set_warning() + level - level of message (Note/Warning/Error) + code - error code of message to be produced + str - string value which we tried to save + str_len - length of string which we tried to save + ts_type - type of datetime value (datetime/date/time) + cuted_increment - whenever we should increase cut fields count or not + + NOTE + This function will always produce some warning but won't increase cut + fields counter if count_cuted_fields == FIELD_CHECK_IGNORE for current + thread. +*/ +void +Field::set_datetime_warning(const uint level, const uint code, + const char *str, uint str_length, + timestamp_type ts_type, int cuted_increment) +{ + if (set_warning(level, code, cuted_increment)) + make_truncated_value_warning(table->in_use, str, str_length, ts_type); +} + + +/* + Produce warning or note about integer datetime value saved into field + + SYNOPSYS + set_warning() + level - level of message (Note/Warning/Error) + code - error code of message to be produced + nr - numeric value which we tried to save + ts_type - type of datetime value (datetime/date/time) + cuted_increment - whenever we should increase cut fields count or not + + NOTE + This function will always produce some warning but won't increase cut + fields counter if count_cuted_fields == FIELD_CHECK_IGNORE for current + thread. +*/ +void +Field::set_datetime_warning(const uint level, const uint code, + longlong nr, timestamp_type ts_type, + int cuted_increment) +{ + if (set_warning(level, code, cuted_increment)) + { + char str_nr[22]; + char *str_end= longlong10_to_str(nr, str_nr, -10); + make_truncated_value_warning(table->in_use, str_nr, str_end - str_nr, + ts_type); + } +} + + +/* + Produce warning or note about double datetime data saved into field + + SYNOPSYS + set_warning() + level - level of message (Note/Warning/Error) + code - error code of message to be produced + nr - double value which we tried to save + ts_type - type of datetime value (datetime/date/time) + + NOTE + This function will always produce some warning but won't increase cut + fields counter if count_cuted_fields == FIELD_CHECK_IGNORE for current + thread. +*/ +void +Field::set_datetime_warning(const uint level, const uint code, + double nr, timestamp_type ts_type) +{ + if (set_warning(level, code, 1)) + { + /* DBL_DIG is enough to print '-[digits].E+###' */ + char str_nr[DBL_DIG + 8]; + uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr)); + make_truncated_value_warning(table->in_use, str_nr, str_len, ts_type); + } +} + +/* + maximum possible display length for blob + + SYNOPSIS + Field_blob::max_length() + + RETURN + length +*/ +uint32 Field_blob::max_length() +{ + switch (packlength) + { + case 1: + return 255; + case 2: + return 65535; + case 3: + return 16777215; + case 4: + return (uint32) 4294967295U; + default: + DBUG_ASSERT(0); // we should never go here + return 0; } } diff --git a/sql/field.h b/sql/field.h index 002a7228164..e7a30372e43 100644 --- a/sql/field.h +++ b/sql/field.h @@ -45,6 +45,10 @@ public: char *ptr; // Position to field in record uchar *null_ptr; // Byte where null_bit is + /* + Note that you can use table->in_use as replacement for current_thd member + only inside of val_*() and store() members (e.g. you can't use it in cons) + */ struct st_table *table; // Pointer for table struct st_table *orig_table; // Pointer to original table const char *table_name,*field_name; @@ -264,9 +268,20 @@ public: virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; } virtual bool has_charset(void) const { return FALSE; } virtual void set_charset(CHARSET_INFO *charset) { } - void set_warning(const unsigned int level, const unsigned int code); + bool set_warning(const unsigned int level, const unsigned int code, + int cuted_increment); + void set_datetime_warning(const uint level, const uint code, + const char *str, uint str_len, + timestamp_type ts_type, int cuted_increment); + void set_datetime_warning(const uint level, const uint code, + longlong nr, timestamp_type ts_type, + int cuted_increment); + void set_datetime_warning(const uint level, const uint code, + double nr, timestamp_type ts_type); virtual field_cast_enum field_cast_type()= 0; bool field_cast_compatible(field_cast_enum type); + /* maximum possible display length */ + virtual uint32 max_length()= 0; friend bool reopen_table(THD *,struct st_table *,bool); friend int cre_myisam(my_string name, register TABLE *form, uint options, ulonglong auto_increment_value); @@ -336,6 +351,7 @@ public: CHARSET_INFO *charset(void) const { return field_charset; } void set_charset(CHARSET_INFO *charset) { field_charset=charset; } bool binary() const { return field_charset->state & MY_CS_BINSORT ? 1 : 0; } + uint32 max_length() { return field_length; } friend class create_field; }; @@ -366,6 +382,7 @@ public: void overflow(bool negative); bool zero_pack() const { return 0; } void sql_type(String &str) const; + uint32 max_length() { return field_length; } field_cast_enum field_cast_type() { return FIELD_CAST_DECIMAL; } }; @@ -397,6 +414,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 1; } void sql_type(String &str) const; + uint32 max_length() { return 4; } field_cast_enum field_cast_type() { return FIELD_CAST_TINY; } }; @@ -433,6 +451,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 2; } void sql_type(String &str) const; + uint32 max_length() { return 6; } field_cast_enum field_cast_type() { return FIELD_CAST_SHORT; } }; @@ -464,6 +483,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 3; } void sql_type(String &str) const; + uint32 max_length() { return 8; } field_cast_enum field_cast_type() { return FIELD_CAST_MEDIUM; } }; @@ -500,6 +520,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return 4; } void sql_type(String &str) const; + uint32 max_length() { return 11; } field_cast_enum field_cast_type() { return FIELD_CAST_LONG; } }; @@ -539,6 +560,7 @@ public: uint32 pack_length() const { return 8; } void sql_type(String &str) const; bool store_for_compare() { return 1; } + uint32 max_length() { return 20; } field_cast_enum field_cast_type() { return FIELD_CAST_LONGLONG; } }; #endif @@ -573,6 +595,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return sizeof(float); } void sql_type(String &str) const; + uint32 max_length() { return 24; } field_cast_enum field_cast_type() { return FIELD_CAST_FLOAT; } }; @@ -607,6 +630,7 @@ public: void sort_string(char *buff,uint length); uint32 pack_length() const { return sizeof(double); } void sql_type(String &str) const; + uint32 max_length() { return 53; } field_cast_enum field_cast_type() { return FIELD_CAST_DOUBLE; } }; @@ -637,6 +661,7 @@ public: uint32 pack_length() const { return 0; } void sql_type(String &str) const; uint size_of() const { return sizeof(*this); } + uint32 max_length() { return 4; } field_cast_enum field_cast_type() { return FIELD_CAST_NULL; } }; @@ -800,6 +825,7 @@ public: double val_real(void); longlong val_int(void); String *val_str(String*,String *); + bool get_date(TIME *ltime, uint fuzzydate); bool send_binary(Protocol *protocol); bool get_time(TIME *ltime); int cmp(const char *,const char*); @@ -1034,6 +1060,7 @@ public: bool has_charset(void) const { return charset() == &my_charset_bin ? FALSE : TRUE; } field_cast_enum field_cast_type() { return FIELD_CAST_BLOB; } + uint32 max_length(); }; #ifdef HAVE_SPATIAL diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 0974c552364..e98068ef974 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -121,7 +121,8 @@ set_field_to_null(Field *field) field->reset(); if (current_thd->count_cuted_fields == CHECK_FIELD_WARN) { - field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,ER_WARN_DATA_TRUNCATED); + field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_DATA_TRUNCATED, 1); return 0; } if (!current_thd->no_errors) @@ -178,7 +179,8 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions) } if (current_thd->count_cuted_fields == CHECK_FIELD_WARN) { - field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,ER_WARN_NULL_TO_NOTNULL); + field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARN_NULL_TO_NOTNULL, 1); return 0; } if (!current_thd->no_errors) @@ -229,7 +231,7 @@ static void do_copy_not_null(Copy_field *copy) if (*copy->from_null_ptr & copy->from_bit) { copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_TRUNCATED); + ER_WARN_DATA_TRUNCATED, 1); copy->to_field->reset(); } else @@ -329,7 +331,7 @@ static void do_cut_string(Copy_field *copy) if (!my_isspace(system_charset_info, *ptr)) // QQ: ucs incompatible { copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_TRUNCATED); + ER_WARN_DATA_TRUNCATED, 1); break; } } @@ -350,7 +352,7 @@ static void do_varstring(Copy_field *copy) length=copy->to_length-2; if (current_thd->count_cuted_fields) copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_DATA_TRUNCATED); + ER_WARN_DATA_TRUNCATED, 1); } int2store(copy->to_ptr,length); memcpy(copy->to_ptr+2, copy->from_ptr,length); diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index be6b1e2ce9b..12b37540c0e 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -842,8 +842,8 @@ int ha_berkeley::write_row(byte * record) else { DB_TXN *sub_trans = transaction; - /* Don't use sub transactions in temporary tables (in_use == 0) */ - ulong thd_options = table->in_use ? table->in_use->options : 0; + /* Don't use sub transactions in temporary tables */ + ulong thd_options = table->tmp_table == NO_TMP_TABLE ? table->in_use->options : 0; for (uint retry=0 ; retry < berkeley_trans_retry ; retry++) { key_map changed_keys(0); @@ -1066,7 +1066,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row) DBT prim_key, key, old_prim_key; int error; DB_TXN *sub_trans; - ulong thd_options = table->in_use ? table->in_use->options : 0; + ulong thd_options = table->tmp_table == NO_TMP_TABLE ? table->in_use->options : 0; bool primary_key_changed; DBUG_ENTER("update_row"); LINT_INIT(error); @@ -1259,7 +1259,7 @@ int ha_berkeley::delete_row(const byte * record) int error; DBT row, prim_key; key_map keys=table->keys_in_use; - ulong thd_options = table->in_use ? table->in_use->options : 0; + ulong thd_options = table->tmp_table == NO_TMP_TABLE ? table->in_use->options : 0; DBUG_ENTER("delete_row"); statistic_increment(ha_delete_count,&LOCK_status); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index aad0ef2d9fd..b58460e30b2 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -66,6 +66,7 @@ extern "C" { #include "../innobase/include/trx0roll.h" #include "../innobase/include/trx0trx.h" #include "../innobase/include/trx0sys.h" +#include "../innobase/include/mtr0mtr.h" #include "../innobase/include/row0ins.h" #include "../innobase/include/row0mysql.h" #include "../innobase/include/row0sel.h" @@ -1735,7 +1736,12 @@ innobase_mysql_cmp( } } - ret = my_strnncoll(charset, + /* Starting from 4.1.3, we use strnncollsp() in comparisons of + non-latin1_swedish_ci strings. NOTE that the collation order + changes then: 'b\0\0...' is ordered BEFORE 'b ...'. Users + having indexes on such data need to rebuild their tables! */ + + ret = charset->coll->strnncollsp(charset, a, a_length, b, b_length); if (ret < 0) { @@ -4304,9 +4310,8 @@ ha_innobase::analyze( } /************************************************************************** -This is currently mapped to ::analyze. A better option would be to map this -to "ALTER TABLE tablename TYPE=InnoDB", which seems to rebuild the table in -MySQL. */ +This is mapped to "ALTER TABLE tablename TYPE=InnoDB", which rebuilds +the table in MySQL. */ int ha_innobase::optimize( @@ -4314,7 +4319,7 @@ ha_innobase::optimize( THD* thd, /* in: connection thread handle */ HA_CHECK_OPT* check_opt) /* in: currently ignored */ { - return(ha_innobase::analyze(thd, check_opt)); + return(HA_ADMIN_TRY_ALTER); } /*********************************************************************** @@ -4631,40 +4636,22 @@ ha_innobase::start_stmt( prepared for an update of a row */ prebuilt->select_lock_type = LOCK_X; - } else { - /* When we first come here after LOCK TABLES, - select_lock_type is set to LOCK_S or LOCK_X. Store the value - in case we run also consistent reads and need to restore the - value later. */ - - if (prebuilt->select_lock_type != LOCK_NONE) { - prebuilt->stored_select_lock_type = - prebuilt->select_lock_type; - } - - if (prebuilt->stored_select_lock_type != LOCK_S - && prebuilt->stored_select_lock_type != LOCK_X) { - fprintf(stderr, -"InnoDB: Error: select_lock_type is %lu inside ::start_stmt()!\n", - prebuilt->stored_select_lock_type); - - ut_error; - } - - if (thd->lex->sql_command == SQLCOM_SELECT - && thd->lex->lock_option == TL_READ) { - - /* For other than temporary tables, we obtain - no lock for consistent read (plain SELECT) */ - - prebuilt->select_lock_type = LOCK_NONE; - } else { - /* Not a consistent read: restore the - select_lock_type value */ - prebuilt->select_lock_type = - prebuilt->stored_select_lock_type; - } - } + } else { + if (thd->lex->sql_command == SQLCOM_SELECT + && thd->lex->lock_option == TL_READ) { + + /* For other than temporary tables, we obtain + no lock for consistent read (plain SELECT) */ + + prebuilt->select_lock_type = LOCK_NONE; + } else { + /* Not a consistent read: use LOCK_X as the + select_lock_type value (TODO: how could we know + whether it should be LOCK_S, LOCK_X, or LOCK_NONE?) */ + + prebuilt->select_lock_type = LOCK_X; + } + } /* Set the MySQL flag to mark that there is an active transaction */ thd->transaction.all.innodb_active_trans = 1; @@ -5043,7 +5030,7 @@ ha_innobase::store_lock( /*********************************************************************** This function initializes the auto-inc counter if it has not been initialized yet. This function does not change the value of the auto-inc -counter if it already has been initialized. In parameter ret returns +counter if it already has been initialized. In paramete ret returns the value of the auto-inc counter. */ int @@ -5169,4 +5156,35 @@ ha_innobase::get_auto_increment() return(nr); } +/*********************************************************************** +This function stores binlog offset and flushes logs */ + +void +innobase_store_binlog_offset_and_flush_log( +/*=============================*/ + char *binlog_name, /* in: binlog name */ + longlong offset /* in: binlog offset */ +) +{ + mtr_t mtr; + + assert(binlog_name != NULL); + + /* Start a mini-transaction */ + mtr_start_noninline(&mtr); + + /* Update the latest MySQL binlog name and offset info + in trx sys header */ + + trx_sys_update_mysql_binlog_offset( + binlog_name, + offset, + TRX_SYS_MYSQL_LOG_INFO, &mtr); + + /* Commits the mini-transaction */ + mtr_commit(&mtr); + + /* Syncronous flush of the log buffer to disk */ + log_buffer_flush_to_disk(); +} #endif /* HAVE_INNOBASE_DB */ diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 3b2f04c1679..cf026def5ca 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -222,3 +222,5 @@ int innodb_show_status(THD* thd); my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name, uint full_name_len); void innobase_release_temporary_latches(void* innobase_tid); + +void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset); diff --git a/sql/handler.cc b/sql/handler.cc index 3b694ed0eb8..2b3c91c9a93 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -35,6 +35,9 @@ #ifdef HAVE_EXAMPLE_DB #include "examples/ha_example.h" #endif +#ifdef HAVE_ARCHIVE_DB +#include "examples/ha_archive.h" +#endif #ifdef HAVE_INNOBASE_DB #include "ha_innodb.h" #endif @@ -86,6 +89,8 @@ struct show_table_type_st sys_table_types[]= "Alias for NDBCLUSTER", DB_TYPE_NDBCLUSTER}, {"EXAMPLE",&have_example_db, "Example storage engine", DB_TYPE_EXAMPLE_DB}, + {"ARCHIVE",&have_archive_db, + "Archive storage engine", DB_TYPE_ARCHIVE_DB}, {NullS, NULL, NullS, DB_TYPE_UNKNOWN} }; @@ -187,6 +192,10 @@ handler *get_new_handler(TABLE *table, enum db_type db_type) case DB_TYPE_EXAMPLE_DB: return new ha_example(table); #endif +#ifdef HAVE_ARCHIVE_DB + case DB_TYPE_ARCHIVE_DB: + return new ha_archive(table); +#endif #ifdef HAVE_NDBCLUSTER_DB case DB_TYPE_NDBCLUSTER: return new ha_ndbcluster(table); diff --git a/sql/handler.h b/sql/handler.h index 72188d2459c..3d5aaacb661 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -43,6 +43,7 @@ #define HA_ADMIN_INTERNAL_ERROR -4 #define HA_ADMIN_INVALID -5 #define HA_ADMIN_REJECT -6 +#define HA_ADMIN_TRY_ALTER -7 /* Bits in table_flags() to show what database can do */ #define HA_READ_RND_SAME (1 << 0) /* can switch index during the scan @@ -146,7 +147,7 @@ enum db_type DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM, DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER, - DB_TYPE_EXAMPLE_DB, + DB_TYPE_EXAMPLE_DB, DB_TYPE_ARCHIVE_DB, DB_TYPE_DEFAULT // Must be last }; diff --git a/sql/item.cc b/sql/item.cc index 7db1a448e55..35e1312b540 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -228,7 +228,7 @@ bool Item::get_date(TIME *ltime,uint fuzzydate) char buff[40]; String tmp(buff,sizeof(buff), &my_charset_bin),*res; if (!(res=val_str(&tmp)) || - str_to_TIME(res->ptr(),res->length(),ltime,fuzzydate) <= + str_to_TIME_with_warn(res->ptr(),res->length(),ltime,fuzzydate) <= TIMESTAMP_DATETIME_ERROR) { bzero((char*) ltime,sizeof(*ltime)); @@ -247,7 +247,7 @@ bool Item::get_time(TIME *ltime) char buff[40]; String tmp(buff,sizeof(buff),&my_charset_bin),*res; if (!(res=val_str(&tmp)) || - str_to_time(res->ptr(),res->length(),ltime)) + str_to_time_with_warn(res->ptr(), res->length(), ltime)) { bzero((char*) ltime,sizeof(*ltime)); return 1; @@ -255,7 +255,7 @@ bool Item::get_time(TIME *ltime) return 0; } -CHARSET_INFO * Item::default_charset() const +CHARSET_INFO *Item::default_charset() { return current_thd->variables.collation_connection; } @@ -628,7 +628,9 @@ default_set_param_func(Item_param *param, Item_param::Item_param(unsigned pos_in_query_arg) : state(NO_VALUE), item_result_type(STRING_RESULT), - item_type(STRING_ITEM), + /* Don't pretend to be a literal unless value for this item is set. */ + item_type(PARAM_ITEM), + param_type(MYSQL_TYPE_STRING), pos_in_query(pos_in_query_arg), set_param_func(default_set_param_func) { @@ -736,6 +738,69 @@ bool Item_param::set_longdata(const char *str, ulong length) /* + Set parameter value from user variable value. + + SYNOPSIS + set_from_user_var + thd Current thread + entry User variable structure (NULL means use NULL value) + + RETURN + 0 OK + 1 Out of memort +*/ + +bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) +{ + DBUG_ENTER("Item_param::set_from_user_var"); + if (entry && entry->value) + { + item_result_type= entry->type; + switch (entry->type) { + case REAL_RESULT: + set_double(*(double*)entry->value); + break; + case INT_RESULT: + set_int(*(longlong*)entry->value, 21); + break; + case STRING_RESULT: + { + CHARSET_INFO *fromcs= entry->collation.collation; + CHARSET_INFO *tocs= thd->variables.collation_connection; + uint32 dummy_offset; + + value.cs_info.character_set_client= fromcs; + /* + Setup source and destination character sets so that they + are different only if conversion is necessary: this will + make later checks easier. + */ + value.cs_info.final_character_set_of_str_value= + String::needs_conversion(0, fromcs, tocs, &dummy_offset) ? + tocs : fromcs; + /* + Exact value of max_length is not known unless data is converted to + charset of connection, so we have to set it later. + */ + item_type= Item::STRING_ITEM; + item_result_type= STRING_RESULT; + + if (set_str((const char *)entry->value, entry->length)) + DBUG_RETURN(1); + break; + } + default: + DBUG_ASSERT(0); + set_null(); + } + } + else + set_null(); + + DBUG_RETURN(0); +} + +/* Resets parameter after execution. SYNOPSIS @@ -762,13 +827,20 @@ void Item_param::reset() state= NO_VALUE; maybe_null= 1; null_value= 0; + /* + Don't reset item_type to PARAM_ITEM: it's only needed to guard + us from item optimizations at prepare stage, when item doesn't yet + contain a literal of some kind. + In all other cases when this object is accessed its value is + set (this assumption is guarded by 'state' and + DBUG_ASSERTS(state != NO_VALUE) in all Item_param::get_* + methods). + */ } int Item_param::save_in_field(Field *field, bool no_conversions) { - DBUG_ASSERT(current_thd->command == COM_EXECUTE); - field->set_notnull(); switch (state) { @@ -808,6 +880,17 @@ bool Item_param::get_time(TIME *res) } +bool Item_param::get_date(TIME *res, uint fuzzydate) +{ + if (state == TIME_VALUE) + { + *res= value.time; + return 0; + } + return Item::get_date(res, fuzzydate); +} + + double Item_param::val() { switch (state) { @@ -2345,6 +2428,7 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item) field_example= ((Item_field*) item)->field; else field_example= 0; + max_length= real_length(item); collation.set(item->collation); } @@ -2364,6 +2448,7 @@ static Item_result type_convertor[4][4]= bool Item_type_holder::join_types(THD *thd, Item *item) { + uint32 new_length= real_length(item); bool change_field= 0, skip_store_field= 0; Item_result new_type= type_convertor[item_type][item->result_type()]; @@ -2389,7 +2474,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) // size/type should be changed if (change_field || (new_type != item_type) || - (max_length < item->max_length) || + (max_length < new_length) || ((new_type == INT_RESULT) && (decimals < item->decimals)) || (!maybe_null && item->maybe_null) || @@ -2398,7 +2483,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) { // new field has some parameters worse then current skip_store_field|= (change_field && - (max_length > item->max_length) || + (max_length > new_length) || ((new_type == INT_RESULT) && (decimals > item->decimals)) || (maybe_null && !item->maybe_null) || @@ -2427,7 +2512,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) return 1; } - max_length= max(max_length, item->max_length); + max_length= max(max_length, new_length); decimals= max(decimals, item->decimals); maybe_null|= item->maybe_null; item_type= new_type; @@ -2436,6 +2521,26 @@ bool Item_type_holder::join_types(THD *thd, Item *item) return 0; } +uint32 Item_type_holder::real_length(Item *item) +{ + if (item->type() == Item::FIELD_ITEM) + { + return ((Item_field *)item)->max_disp_length(); + } + switch (item->result_type()) + { + case STRING_RESULT: + return item->max_length; + case REAL_RESULT: + return 53; + case INT_RESULT: + return 20; + case ROW_RESULT: + default: + DBUG_ASSERT(0); // we should never go there + return 0; + } +} double Item_type_holder::val() { diff --git a/sql/item.h b/sql/item.h index 885a34dce81..fe8c2cb0df1 100644 --- a/sql/item.h +++ b/sql/item.h @@ -98,7 +98,8 @@ public: COPY_STR_ITEM, FIELD_AVG_ITEM, DEFAULT_VALUE_ITEM, PROC_ITEM,COND_ITEM, REF_ITEM, FIELD_STD_ITEM, FIELD_VARIANCE_ITEM, INSERT_VALUE_ITEM, - SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER}; + SUBSELECT_ITEM, ROW_ITEM, CACHE_ITEM, TYPE_HOLDER, + PARAM_ITEM}; enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE }; @@ -245,7 +246,7 @@ public: virtual Item *real_item() { return this; } virtual Item *get_tmp_table_item(THD *thd) { return copy_or_same(thd); } - CHARSET_INFO *default_charset() const; + static CHARSET_INFO *default_charset(); virtual CHARSET_INFO *compare_collation() { return NULL; } virtual bool walk(Item_processor processor, byte *arg) @@ -382,6 +383,7 @@ public: bool is_null() { return field->is_null(); } Item *get_tmp_table_item(THD *thd); void cleanup(); + inline uint32 max_disp_length() { return field->max_length(); } friend class Item_default_value; friend class Item_insert_value; friend class st_select_lex_unit; @@ -465,6 +467,16 @@ public: /* Cached values for virtual methods to save us one switch. */ enum Item_result item_result_type; enum Type item_type; + + /* + Used when this item is used in a temporary table. + This is NOT placeholder metadata sent to client, as this value + is assigned after sending metadata (in setup_one_conversion_function). + For example in case of 'SELECT ?' you'll get MYSQL_TYPE_STRING both + in result set and placeholders metadata, no matter what type you will + supply for this placeholder in mysql_stmt_execute. + */ + enum enum_field_types param_type; /* Offset of placeholder inside statement text. Used to create no-placeholders version of this statement for the binary log. @@ -475,12 +487,13 @@ public: enum Item_result result_type () const { return item_result_type; } enum Type type() const { return item_type; } - enum_field_types field_type() const { return MYSQL_TYPE_STRING; } + enum_field_types field_type() const { return param_type; } double val(); longlong val_int(); String *val_str(String*); bool get_time(TIME *tm); + bool get_date(TIME *tm, uint fuzzydate); int save_in_field(Field *field, bool no_conversions); void set_null(); @@ -489,6 +502,7 @@ public: bool set_str(const char *str, ulong length); bool set_longdata(const char *str, ulong length); void set_time(TIME *tm, timestamp_type type, uint32 max_length_arg); + bool set_from_user_var(THD *thd, const user_var_entry *entry); void reset(); /* Assign placeholder value from bind data. @@ -808,7 +822,10 @@ public: void save_org_in_field(Field *field) { (*ref)->save_org_in_field(field); } enum Item_result result_type () const { return (*ref)->result_type(); } enum_field_types field_type() const { return (*ref)->field_type(); } - table_map used_tables() const { return (*ref)->used_tables(); } + table_map used_tables() const + { + return depended_from ? OUTER_REF_TABLE_BIT : (*ref)->used_tables(); + } void set_result_field(Field *field) { result_field= field; } bool is_result_field() { return 1; } void save_in_result_field(bool no_conversions) @@ -1187,6 +1204,7 @@ public: String *val_str(String*); bool join_types(THD *thd, Item *); Field *example() { return field_example; } + static uint32 real_length(Item *item); void cleanup() { DBUG_ENTER("Item_type_holder::cleanup"); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 446d72ac143..91257c31fb9 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -922,8 +922,8 @@ Item_func_if::fix_length_and_dec() decimals=max(args[1]->decimals,args[2]->decimals); enum Item_result arg1_type=args[1]->result_type(); enum Item_result arg2_type=args[2]->result_type(); - bool null1=args[1]->null_value; - bool null2=args[2]->null_value; + bool null1=args[1]->const_item() && args[1]->null_value; + bool null2=args[2]->const_item() && args[2]->null_value; if (null1) { @@ -2151,49 +2151,62 @@ Item_func::optimize_type Item_func_like::select_optimize() const bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref) { DBUG_ASSERT(fixed == 0); - if (Item_bool_func2::fix_fields(thd, tlist, ref)) + if (Item_bool_func2::fix_fields(thd, tlist, ref) || + escape_item->fix_fields(thd, tlist, &escape_item)) return 1; - /* - We could also do boyer-more for non-const items, but as we would have to - recompute the tables for each row it's not worth it. - */ - if (args[1]->const_item() && !use_strnxfrm(collation.collation) && - !(specialflag & SPECIAL_NO_NEW_FUNC)) + if (!escape_item->const_during_execution()) { - String* res2 = args[1]->val_str(&tmp_value2); - if (!res2) - return 0; // Null argument - - const size_t len = res2->length(); - const char* first = res2->ptr(); - const char* last = first + len - 1; + my_error(ER_WRONG_ARGUMENTS,MYF(0),"ESCAPE"); + return 1; + } + + if (escape_item->const_item()) + { + /* If we are on execution stage */ + String *escape_str= escape_item->val_str(&tmp_value1); + escape= escape_str ? *(escape_str->ptr()) : '\\'; + /* - len must be > 2 ('%pattern%') - heuristic: only do TurboBM for pattern_len > 2 + We could also do boyer-more for non-const items, but as we would have to + recompute the tables for each row it's not worth it. */ - - if (len > MIN_TURBOBM_PATTERN_LEN + 2 && - *first == wild_many && - *last == wild_many) - { - const char* tmp = first + 1; - for (; *tmp != wild_many && *tmp != wild_one && *tmp != escape; tmp++) ; - canDoTurboBM = (tmp == last) && !use_mb(args[0]->collation.collation); - } - - if (canDoTurboBM) + if (args[1]->const_item() && !use_strnxfrm(collation.collation) && + !(specialflag & SPECIAL_NO_NEW_FUNC)) { - pattern = first + 1; - pattern_len = len - 2; - DBUG_PRINT("info", ("Initializing pattern: '%s'", first)); - int *suff = (int*) thd->alloc(sizeof(int)*((pattern_len + 1)*2+ - alphabet_size)); - bmGs = suff + pattern_len + 1; - bmBc = bmGs + pattern_len + 1; - turboBM_compute_good_suffix_shifts(suff); - turboBM_compute_bad_character_shifts(); - DBUG_PRINT("info",("done")); + String* res2 = args[1]->val_str(&tmp_value2); + if (!res2) + return 0; // Null argument + + const size_t len = res2->length(); + const char* first = res2->ptr(); + const char* last = first + len - 1; + /* + len must be > 2 ('%pattern%') + heuristic: only do TurboBM for pattern_len > 2 + */ + + if (len > MIN_TURBOBM_PATTERN_LEN + 2 && + *first == wild_many && + *last == wild_many) + { + const char* tmp = first + 1; + for (; *tmp != wild_many && *tmp != wild_one && *tmp != escape; tmp++) ; + canDoTurboBM = (tmp == last) && !use_mb(args[0]->collation.collation); + } + if (canDoTurboBM) + { + pattern = first + 1; + pattern_len = len - 2; + DBUG_PRINT("info", ("Initializing pattern: '%s'", first)); + int *suff = (int*) thd->alloc(sizeof(int)*((pattern_len + 1)*2+ + alphabet_size)); + bmGs = suff + pattern_len + 1; + bmBc = bmGs + pattern_len + 1; + turboBM_compute_good_suffix_shifts(suff); + turboBM_compute_bad_character_shifts(); + DBUG_PRINT("info",("done")); + } } } return 0; @@ -2298,15 +2311,19 @@ longlong Item_func_regex::val_int() } -Item_func_regex::~Item_func_regex() +void Item_func_regex::cleanup() { + DBUG_ENTER("Item_func_regex::cleanup"); + Item_bool_func::cleanup(); if (regex_compiled) { regfree(&preg); regex_compiled=0; } + DBUG_VOID_RETURN; } + #endif /* USE_REGEX */ diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index ef80c060c03..7c96226b08a 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -841,12 +841,14 @@ class Item_func_like :public Item_bool_func2 bool turboBM_matches(const char* text, int text_len) const; enum { alphabet_size = 256 }; + Item *escape_item; + public: char escape; - Item_func_like(Item *a,Item *b, char* escape_arg) + Item_func_like(Item *a,Item *b, Item *escape_arg) :Item_bool_func2(a,b), canDoTurboBM(false), pattern(0), pattern_len(0), - bmGs(0), bmBc(0), escape(*escape_arg) {} + bmGs(0), bmBc(0), escape_item(escape_arg) {} longlong val_int(); enum Functype functype() const { return LIKE_FUNC; } optimize_type select_optimize() const; @@ -869,7 +871,7 @@ class Item_func_regex :public Item_bool_func public: Item_func_regex(Item *a,Item *b) :Item_bool_func(a,b), regex_compiled(0),regex_is_const(0) {} - ~Item_func_regex(); + void cleanup(); longlong val_int(); bool fix_fields(THD *thd, struct st_table_list *tlist, Item **ref); const char *func_name() const { return "regexp"; } diff --git a/sql/item_create.cc b/sql/item_create.cc index 74f36de11ac..4290a25e348 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -89,6 +89,11 @@ Item *create_func_conv(Item* a, Item *b, Item *c) return new Item_func_conv(a,b,c); } +Item *create_func_convert_tz(Item* a, Item *b, Item *c) +{ + return new Item_func_convert_tz(a,b,c); +} + Item *create_func_cos(Item* a) { return new Item_func_cos(a); @@ -149,7 +154,7 @@ Item *create_func_found_rows(void) { THD *thd=current_thd; thd->lex->safe_to_cache_query= 0; - return new Item_int(NullS,(longlong) thd->found_rows(),21); + return new Item_func_found_rows(); } Item *create_func_from_days(Item* a) @@ -373,7 +378,7 @@ Item *create_func_space(Item *a) CHARSET_INFO *cs= current_thd->variables.collation_connection; Item *sp; - if (cs->state & MY_CS_NONTEXT) + if (cs->mbminlen > 1) { sp= new Item_string("",0,cs); if (sp) diff --git a/sql/item_create.h b/sql/item_create.h index 7577627ef04..19f0c9133f2 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -31,6 +31,7 @@ Item *create_func_char_length(Item* a); Item *create_func_cast(Item *a, Cast_target cast_type, int len, CHARSET_INFO *cs); Item *create_func_connection_id(void); Item *create_func_conv(Item* a, Item *b, Item *c); +Item *create_func_convert_tz(Item* a, Item *b, Item *c); Item *create_func_cos(Item* a); Item *create_func_cot(Item* a); Item *create_func_crc32(Item* a); diff --git a/sql/item_func.cc b/sql/item_func.cc index f221e0dcc5c..e3874d8e4fa 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2583,27 +2583,39 @@ longlong Item_func_get_user_var::val_int() /* + Get variable by name and, if necessary, put the record of variable + use into the binary log. + + SYNOPSIS + get_var_with_binlog() + thd Current thread + name Variable name + out_entry [out] variable structure or NULL. The pointer is set + regardless of whether function succeeded or not. + When a user variable is invoked from an update query (INSERT, UPDATE etc), stores this variable and its value in thd->user_var_events, so that it can be written to the binlog (will be written just before the query is written, see log.cc). + + RETURN + 0 OK + 1 Failed to put appropiate record into binary log + */ -void Item_func_get_user_var::fix_length_and_dec() +int get_var_with_binlog(THD *thd, LEX_STRING &name, + user_var_entry **out_entry) { - THD *thd=current_thd; BINLOG_USER_VAR_EVENT *user_var_event; - maybe_null=1; - decimals=NOT_FIXED_DEC; - max_length=MAX_BLOB_WIDTH; - - if (!(var_entry= get_variable(&thd->user_vars, name, 0))) - null_value= 1; - else - collation.set(var_entry->collation); + user_var_entry *var_entry; + var_entry= get_variable(&thd->user_vars, name, 0); if (!(opt_bin_log && is_update_query(thd->lex->sql_command))) - return; + { + *out_entry= var_entry; + return 0; + } if (!var_entry) { @@ -2630,13 +2642,16 @@ void Item_func_get_user_var::fix_length_and_dec() if (!(var_entry= get_variable(&thd->user_vars, name, 0))) goto err; } - /* - If this variable was already stored in user_var_events by this query - (because it's used in more than one place in the query), don't store - it. - */ else if (var_entry->used_query_id == thd->query_id) - return; + { + /* + If this variable was already stored in user_var_events by this query + (because it's used in more than one place in the query), don't store + it. + */ + *out_entry= var_entry; + return 0; + } uint size; /* @@ -2671,11 +2686,34 @@ void Item_func_get_user_var::fix_length_and_dec() var_entry->used_query_id= thd->query_id; if (insert_dynamic(&thd->user_var_events, (gptr) &user_var_event)) goto err; - - return; + + *out_entry= var_entry; + return 0; err: - thd->fatal_error(); + *out_entry= var_entry; + return 1; +} + + +void Item_func_get_user_var::fix_length_and_dec() +{ + THD *thd=current_thd; + int error; + maybe_null=1; + decimals=NOT_FIXED_DEC; + max_length=MAX_BLOB_WIDTH; + + error= get_var_with_binlog(thd, name, &var_entry); + + if (var_entry) + collation.set(var_entry->collation); + else + null_value= 1; + + if (error) + thd->fatal_error(); + return; } @@ -3158,7 +3196,6 @@ longlong Item_func_is_free_lock::val_int() { DBUG_ASSERT(fixed == 1); String *res=args[0]->val_str(&value); - THD *thd=current_thd; User_level_lock *ull; null_value=0; @@ -3181,7 +3218,6 @@ longlong Item_func_is_used_lock::val_int() { DBUG_ASSERT(fixed == 1); String *res=args[0]->val_str(&value); - THD *thd=current_thd; User_level_lock *ull; null_value=1; @@ -3198,3 +3234,12 @@ longlong Item_func_is_used_lock::val_int() null_value=0; return ull->thread_id; } + + +longlong Item_func_found_rows::val_int() +{ + DBUG_ASSERT(fixed == 1); + THD *thd= current_thd; + + return thd->found_rows(); +} diff --git a/sql/item_func.h b/sql/item_func.h index 39c0a47ed7c..c05c1b01259 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1071,3 +1071,13 @@ enum Cast_target ITEM_CAST_BINARY, ITEM_CAST_SIGNED_INT, ITEM_CAST_UNSIGNED_INT, ITEM_CAST_DATE, ITEM_CAST_TIME, ITEM_CAST_DATETIME, ITEM_CAST_CHAR }; + + +class Item_func_found_rows :public Item_int_func +{ +public: + Item_func_found_rows() :Item_int_func() {} + longlong val_int(); + const char *func_name() const { return "found_rows"; } + void fix_length_and_dec() { decimals= 0; maybe_null=0; } +}; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index c6401218fe2..b0c685c1c46 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -950,17 +950,10 @@ String *Item_func_left::val_str(String *str) return 0; if (length <= 0) return &my_empty_string; - length= res->charpos(length); - if (res->length() > (ulong) length) - { // Safe even if const arg - if (!res->alloced_length()) - { // Don't change const str - str_value= *res; // Not malloced string - res= &str_value; - } - res->length((uint) length); - } - return res; + if (res->length() <= (uint) length) + return res; + str_value.set(*res, 0, res->charpos(length)); + return &str_value; } @@ -1461,6 +1454,7 @@ void Item_func_encode::fix_length_and_dec() { max_length=args[0]->max_length; maybe_null=args[0]->maybe_null; + collation.set(&my_charset_bin); } String *Item_func_encode::val_str(String *str) @@ -1476,6 +1470,7 @@ String *Item_func_encode::val_str(String *str) res=copy_if_not_alloced(str,res,res->length()); sql_crypt.init(); sql_crypt.encode((char*) res->ptr(),res->length()); + res->set_charset(&my_charset_bin); return res; } @@ -2097,10 +2092,8 @@ String *Item_func_lpad::val_str(String *str) count-= pad_char_length; } if (count > 0) - { - pad->length(pad->charpos(count)); - str->append(*pad); - } + str->append(pad->ptr(), pad->charpos(count), collation.collation); + str->append(*res); null_value= 0; return str; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 972de21ad86..366865cf93e 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -657,7 +657,6 @@ Item_in_subselect::single_value_transformer(JOIN *join, !(select_lex->next_select())) { Item *item; - subs_type type= substype(); if (func->l_op()) { /* diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 0c5b29fc069..7a8e15e0a9d 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -361,6 +361,16 @@ longlong Item_sum_count::val_int() return (longlong) count; } + +void Item_sum_count::cleanup() +{ + DBUG_ENTER("Item_sum_count::cleanup"); + Item_sum_int::cleanup(); + used_table_cache= ~(table_map) 0; + DBUG_VOID_RETURN; +} + + /* Avgerage */ @@ -575,6 +585,15 @@ Item_sum_hybrid::val_str(String *str) } +void Item_sum_hybrid::cleanup() +{ + DBUG_ENTER("Item_sum_hybrid::cleanup"); + Item_sum::cleanup(); + used_table_cache= ~(table_map) 0; + DBUG_VOID_RETURN; +} + + Item *Item_sum_min::copy_or_same(THD* thd) { return new (&thd->mem_root) Item_sum_min(thd, this); @@ -1666,6 +1685,9 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)), String tmp((char *)&buff,sizeof(buff),default_charset_info), tmp2; char *record= (char*) item->table->record[0]; + if (item->result.length()) + item->result.append(*item->separator); + tmp.length(0); for (uint i= 0; i < item->arg_count_field; i++) @@ -1695,14 +1717,6 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)), item->result.append(*res); } } - if (item->tree_mode) // Last item of tree - { - item->show_elements++; - if (item->show_elements < item->tree->elements_in_tree) - item->result.append(*item->separator); - } - else - item->result.append(*item->separator); /* stop if length of result more than group_concat_max_len */ if (item->result.length() > item->group_concat_max_len) @@ -1733,7 +1747,7 @@ Item_func_group_concat::Item_func_group_concat(bool is_distinct, tree_mode(0), distinct(is_distinct), warning_for_row(0), separator(is_separator), tree(&tree_base), table(0), order(0), tables_list(0), - show_elements(0), arg_count_order(0), arg_count_field(0), + arg_count_order(0), arg_count_field(0), count_cut_values(0) { Item *item_select; @@ -1799,7 +1813,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd, order(item->order), tables_list(item->tables_list), group_concat_max_len(item->group_concat_max_len), - show_elements(item->show_elements), arg_count_order(item->arg_count_order), arg_count_field(item->arg_count_field), field_list_offset(item->field_list_offset), @@ -2107,15 +2120,9 @@ String* Item_func_group_concat::val_str(String* str) return 0; if (tree_mode) { - show_elements= 0; tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this, left_root_right); } - else - { - if (!warning_for_row) - result.length(result.length()-separator->length()); - } if (count_cut_values && !warning_available) { warning_available= TRUE; diff --git a/sql/item_sum.h b/sql/item_sum.h index ef947900fd2..507a36194de 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -172,6 +172,7 @@ class Item_sum_count :public Item_sum_int void make_const(longlong count_arg) { count=count_arg; used_table_cache=0; } longlong val_int(); void reset_field(); + void cleanup(); void update_field(); const char *func_name() const { return "count"; } Item *copy_or_same(THD* thd); @@ -428,6 +429,7 @@ class Item_sum_hybrid :public Item_sum void min_max_update_str_field(); void min_max_update_real_field(); void min_max_update_int_field(); + void cleanup(); }; @@ -694,7 +696,6 @@ class Item_func_group_concat : public Item_sum ORDER **order; TABLE_LIST *tables_list; ulong group_concat_max_len; - uint show_elements; uint arg_count_order; uint arg_count_field; uint field_list_offset; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 45d66addc9f..a5ea72374c1 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -894,6 +894,9 @@ longlong Item_func_year::val_int() longlong Item_func_unix_timestamp::val_int() { + TIME ltime; + bool not_used; + DBUG_ASSERT(fixed == 1); if (arg_count == 0) return (longlong) current_thd->query_start(); @@ -903,12 +906,19 @@ longlong Item_func_unix_timestamp::val_int() if (field->type() == FIELD_TYPE_TIMESTAMP) return ((Field_timestamp*) field)->get_timestamp(); } - String *str=args[0]->val_str(&value); - if ((null_value=args[0]->null_value)) + + if (get_arg0_date(<ime, 0)) { - return 0; /* purecov: inspected */ + /* + We have to set null_value again because get_arg0_date will also set it + to true if we have wrong datetime parameter (and we should return 0 in + this case). + */ + null_value= args[0]->null_value; + return 0; } - return (longlong) str_to_timestamp(str->ptr(),str->length()); + + return (longlong) TIME_to_timestamp(current_thd, <ime, ¬_used); } @@ -1126,23 +1136,14 @@ bool Item_func_from_days::get_date(TIME *ltime, uint fuzzy_date) void Item_func_curdate::fix_length_and_dec() { - struct tm start; - collation.set(&my_charset_bin); decimals=0; max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; - store_now_in_tm(current_thd->query_start(),&start); + store_now_in_TIME(<ime); - /* For getdate */ - ltime.year= start.tm_year+1900; - ltime.month= start.tm_mon+1; - ltime.day= start.tm_mday; - ltime.hour= 0; - ltime.minute= 0; - ltime.second= 0; - ltime.second_part=0; - ltime.neg=0; + /* We don't need to set second_part and neg because they already 0 */ + ltime.hour= ltime.minute= ltime.second= 0; ltime.time_type=TIMESTAMP_DATE; value= (longlong) TIME_to_ulonglong_date(<ime); } @@ -1159,31 +1160,39 @@ String *Item_func_curdate::val_str(String *str) return str; } -bool Item_func_curdate::get_date(TIME *res, - uint fuzzy_date __attribute__((unused))) +/* + Converts current time in my_time_t to TIME represenatation for local + time zone. Defines time zone (local) used for whole CURDATE function. +*/ +void Item_func_curdate_local::store_now_in_TIME(TIME *now_time) { - *res=ltime; - return 0; + THD *thd= current_thd; + thd->variables.time_zone->gmt_sec_to_TIME(now_time, + (my_time_t)thd->query_start()); + thd->time_zone_used= 1; } /* - Converts time in time_t to struct tm represenatation for local timezone. - Defines timezone (local) used for whole CURDATE function + Converts current time in my_time_t to TIME represenatation for UTC + time zone. Defines time zone (UTC) used for whole UTC_DATE function. */ -void Item_func_curdate_local::store_now_in_tm(time_t now, struct tm *now_tm) +void Item_func_curdate_utc::store_now_in_TIME(TIME *now_time) { - localtime_r(&now,now_tm); + my_tz_UTC->gmt_sec_to_TIME(now_time, + (my_time_t)(current_thd->query_start())); + /* + We are not flagging this query as using time zone, since it uses fixed + UTC-SYSTEM time-zone. + */ } -/* - Converts time in time_t to struct tm represenatation for UTC - Defines timezone (UTC) used for whole UTC_DATE function -*/ -void Item_func_curdate_utc::store_now_in_tm(time_t now, struct tm *now_tm) +bool Item_func_curdate::get_date(TIME *res, + uint fuzzy_date __attribute__((unused))) { - gmtime_r(&now,now_tm); + *res=ltime; + return 0; } @@ -1197,17 +1206,12 @@ String *Item_func_curtime::val_str(String *str) void Item_func_curtime::fix_length_and_dec() { - struct tm start; - String tmp((char*) buff,sizeof(buff), &my_charset_bin); TIME ltime; + String tmp((char*) buff,sizeof(buff), &my_charset_bin); - decimals=0; - store_now_in_tm(current_thd->query_start(),&start); - ltime.hour= start.tm_hour; - ltime.minute= start.tm_min; - ltime.second= start.tm_sec; - ltime.second_part= 0; - ltime.neg= 0; + decimals=0; + collation.set(&my_charset_bin); + store_now_in_TIME(<ime); value= TIME_to_ulonglong_time(<ime); make_time((DATE_TIME_FORMAT *) 0, <ime, &tmp); max_length= buff_length= tmp.length(); @@ -1215,22 +1219,30 @@ void Item_func_curtime::fix_length_and_dec() /* - Converts time in time_t to struct tm represenatation for local timezone. - Defines timezone (local) used for whole CURTIME function + Converts current time in my_time_t to TIME represenatation for local + time zone. Defines time zone (local) used for whole CURTIME function. */ -void Item_func_curtime_local::store_now_in_tm(time_t now, struct tm *now_tm) +void Item_func_curtime_local::store_now_in_TIME(TIME *now_time) { - localtime_r(&now,now_tm); + THD *thd= current_thd; + thd->variables.time_zone->gmt_sec_to_TIME(now_time, + (my_time_t)thd->query_start()); + thd->time_zone_used= 1; } /* - Converts time in time_t to struct tm represenatation for UTC. - Defines timezone (UTC) used for whole UTC_TIME function + Converts current time in my_time_t to TIME represenatation for UTC + time zone. Defines time zone (UTC) used for whole UTC_TIME function. */ -void Item_func_curtime_utc::store_now_in_tm(time_t now, struct tm *now_tm) +void Item_func_curtime_utc::store_now_in_TIME(TIME *now_time) { - gmtime_r(&now,now_tm); + my_tz_UTC->gmt_sec_to_TIME(now_time, + (my_time_t)(current_thd->query_start())); + /* + We are not flagging this query as using time zone, since it uses fixed + UTC-SYSTEM time-zone. + */ } @@ -1244,18 +1256,12 @@ String *Item_func_now::val_str(String *str) void Item_func_now::fix_length_and_dec() { - struct tm start; String tmp((char*) buff,sizeof(buff),&my_charset_bin); decimals=0; collation.set(&my_charset_bin); - store_now_in_tm(current_thd->query_start(),&start); - - /* For getdate */ - localtime_to_TIME(<ime, &start); - ltime.time_type= TIMESTAMP_DATETIME; - + store_now_in_TIME(<ime); value= (longlong) TIME_to_ulonglong_datetime(<ime); make_datetime((DATE_TIME_FORMAT *) 0, <ime, &tmp); @@ -1263,39 +1269,47 @@ void Item_func_now::fix_length_and_dec() } -bool Item_func_now::get_date(TIME *res, - uint fuzzy_date __attribute__((unused))) +/* + Converts current time in my_time_t to TIME represenatation for local + time zone. Defines time zone (local) used for whole NOW function. +*/ +void Item_func_now_local::store_now_in_TIME(TIME *now_time) { - *res=ltime; - return 0; + THD *thd= current_thd; + thd->variables.time_zone->gmt_sec_to_TIME(now_time, + (my_time_t)thd->query_start()); + thd->time_zone_used= 1; } -int Item_func_now::save_in_field(Field *to, bool no_conversions) +/* + Converts current time in my_time_t to TIME represenatation for UTC + time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function. +*/ +void Item_func_now_utc::store_now_in_TIME(TIME *now_time) { - to->set_notnull(); - to->store_time(<ime,TIMESTAMP_DATETIME); - return 0; + my_tz_UTC->gmt_sec_to_TIME(now_time, + (my_time_t)(current_thd->query_start())); + /* + We are not flagging this query as using time zone, since it uses fixed + UTC-SYSTEM time-zone. + */ } -/* - Converts time in time_t to struct tm represenatation for local timezone. - Defines timezone (local) used for whole CURRENT_TIMESTAMP function -*/ -void Item_func_now_local::store_now_in_tm(time_t now, struct tm *now_tm) +bool Item_func_now::get_date(TIME *res, + uint fuzzy_date __attribute__((unused))) { - localtime_r(&now,now_tm); + *res=ltime; + return 0; } -/* - Converts time in time_t to struct tm represenatation for UTC. - Defines timezone (UTC) used for whole UTC_TIMESTAMP function -*/ -void Item_func_now_utc::store_now_in_tm(time_t now, struct tm *now_tm) +int Item_func_now::save_in_field(Field *to, bool no_conversions) { - gmtime_r(&now,now_tm); + to->set_notnull(); + to->store_time(<ime,TIMESTAMP_DATETIME); + return 0; } @@ -1455,7 +1469,7 @@ String *Item_func_date_format::val_str(String *str) { String *res; if (!(res=args[0]->val_str(str)) || - (str_to_time(res->ptr(),res->length(),&l_time))) + (str_to_time_with_warn(res->ptr(), res->length(), &l_time))) goto null_date; l_time.year=l_time.month=l_time.day=0; @@ -1489,24 +1503,31 @@ null_date: } +void Item_func_from_unixtime::fix_length_and_dec() +{ + thd= current_thd; + collation.set(&my_charset_bin); + decimals=0; + max_length=MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + thd->time_zone_used= 1; +} + + String *Item_func_from_unixtime::val_str(String *str) { - struct tm tm_tmp; - time_t tmp; - TIME ltime; + TIME time_tmp; + my_time_t tmp; DBUG_ASSERT(fixed == 1); tmp= (time_t) args[0]->val_int(); if ((null_value=args[0]->null_value)) goto null_date; - - localtime_r(&tmp,&tm_tmp); - - localtime_to_TIME(<ime, &tm_tmp); - + + thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, tmp); + if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN)) goto null_date; - make_datetime((DATE_TIME_FORMAT *) 0, <ime, str); + make_datetime((DATE_TIME_FORMAT *) 0, &time_tmp, str); return str; null_date: @@ -1517,28 +1538,109 @@ null_date: longlong Item_func_from_unixtime::val_int() { - TIME ltime; - struct tm tm_tmp; - time_t tmp; + TIME time_tmp; + my_time_t tmp; + DBUG_ASSERT(fixed == 1); tmp= (time_t) (ulong) args[0]->val_int(); if ((null_value=args[0]->null_value)) return 0; - localtime_r(&tmp,&tm_tmp); - localtime_to_TIME(<ime, &tm_tmp); - return (longlong) TIME_to_ulonglong_datetime(<ime); + + current_thd->variables.time_zone->gmt_sec_to_TIME(&time_tmp, tmp); + + return (longlong) TIME_to_ulonglong_datetime(&time_tmp); } bool Item_func_from_unixtime::get_date(TIME *ltime, uint fuzzy_date __attribute__((unused))) { - time_t tmp=(time_t) (ulong) args[0]->val_int(); + my_time_t tmp=(my_time_t) args[0]->val_int(); if ((null_value=args[0]->null_value)) return 1; - struct tm tm_tmp; - localtime_r(&tmp,&tm_tmp); - localtime_to_TIME(ltime, &tm_tmp); + + current_thd->variables.time_zone->gmt_sec_to_TIME(ltime, tmp); + + return 0; +} + + +void Item_func_convert_tz::fix_length_and_dec() +{ + String str; + + thd= current_thd; + collation.set(&my_charset_bin); + decimals= 0; + max_length= MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + + if (args[1]->const_item()) + from_tz= my_tz_find(thd, args[1]->val_str(&str)); + + if (args[2]->const_item()) + to_tz= my_tz_find(thd, args[2]->val_str(&str)); +} + + +String *Item_func_convert_tz::val_str(String *str) +{ + TIME time_tmp; + + if (get_date(&time_tmp, 0)) + return 0; + + if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN)) + { + null_value= 1; + return 0; + } + + make_datetime((DATE_TIME_FORMAT *) 0, &time_tmp, str); + return str; +} + + +longlong Item_func_convert_tz::val_int() +{ + TIME time_tmp; + + if (get_date(&time_tmp, 0)) + return 0; + + return (longlong)TIME_to_ulonglong_datetime(&time_tmp); +} + + +bool Item_func_convert_tz::get_date(TIME *ltime, + uint fuzzy_date __attribute__((unused))) +{ + my_time_t my_time_tmp; + bool not_used; + String str; + + if (!args[1]->const_item()) + from_tz= my_tz_find(thd, args[1]->val_str(&str)); + + if (!args[2]->const_item()) + to_tz= my_tz_find(thd, args[2]->val_str(&str)); + + if (from_tz==0 || to_tz==0 || get_arg0_date(ltime, 0)) + { + null_value= 1; + return 1; + } + + /* Check if we in range where we treat datetime values as non-UTC */ + if (ltime->year < TIMESTAMP_MAX_YEAR && ltime->year > TIMESTAMP_MIN_YEAR || + ltime->year==TIMESTAMP_MAX_YEAR && ltime->month==1 && ltime->day==1 || + ltime->year==TIMESTAMP_MIN_YEAR && ltime->month==12 && ltime->day==31) + { + my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used); + if (my_time_tmp >= TIMESTAMP_MIN_VALUE && my_time_tmp <= TIMESTAMP_MAX_VALUE) + to_tz->gmt_sec_to_TIME(ltime, my_time_tmp); + } + + null_value= 0; return 0; } @@ -1795,7 +1897,7 @@ longlong Item_extract::val_int() else { String *res= args[0]->val_str(&value); - if (!res || str_to_time(res->ptr(),res->length(),<ime)) + if (!res || str_to_time_with_warn(res->ptr(), res->length(), <ime)) { null_value=1; return 0; diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index f00eb93e0e5..a7ff2924786 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -348,6 +348,7 @@ public: Item_date_func() :Item_str_func() {} Item_date_func(Item *a) :Item_str_func(a) {} Item_date_func(Item *a,Item *b) :Item_str_func(a,b) {} + Item_date_func(Item *a,Item *b, Item *c) :Item_str_func(a,b,c) {} enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } Field *tmp_table_field(TABLE *t_arg) { @@ -356,7 +357,7 @@ public: }; -/* Abstract CURTIME function. Children should define what timezone is used */ +/* Abstract CURTIME function. Children should define what time zone is used */ class Item_func_curtime :public Item_func { @@ -378,10 +379,10 @@ public: } /* Abstract method that defines which time zone is used for conversion. - Converts time from time_t representation to broken down representation - in struct tm using gmtime_r or localtime_r functions. + Converts time current time in my_time_t representation to broken-down + TIME representation using UTC-SYSTEM or per-thread time zone. */ - virtual void store_now_in_tm(time_t now, struct tm *now_tm)=0; + virtual void store_now_in_TIME(TIME *now_time)=0; }; @@ -391,7 +392,7 @@ public: Item_func_curtime_local() :Item_func_curtime() {} Item_func_curtime_local(Item *a) :Item_func_curtime(a) {} const char *func_name() const { return "curtime"; } - void store_now_in_tm(time_t now, struct tm *now_tm); + virtual void store_now_in_TIME(TIME *now_time); }; @@ -401,7 +402,7 @@ public: Item_func_curtime_utc() :Item_func_curtime() {} Item_func_curtime_utc(Item *a) :Item_func_curtime(a) {} const char *func_name() const { return "utc_time"; } - void store_now_in_tm(time_t now, struct tm *now_tm); + virtual void store_now_in_TIME(TIME *now_time); }; @@ -413,12 +414,11 @@ class Item_func_curdate :public Item_date TIME ltime; public: Item_func_curdate() :Item_date() {} - void set_result_from_tm(struct tm *now); longlong val_int() { DBUG_ASSERT(fixed == 1); return (value) ; } String *val_str(String *str); void fix_length_and_dec(); bool get_date(TIME *res, uint fuzzy_date); - virtual void store_now_in_tm(time_t now, struct tm *now_tm)=0; + virtual void store_now_in_TIME(TIME *now_time)=0; }; @@ -427,7 +427,7 @@ class Item_func_curdate_local :public Item_func_curdate public: Item_func_curdate_local() :Item_func_curdate() {} const char *func_name() const { return "curdate"; } - void store_now_in_tm(time_t now, struct tm *now_tm); + void store_now_in_TIME(TIME *now_time); }; @@ -436,7 +436,7 @@ class Item_func_curdate_utc :public Item_func_curdate public: Item_func_curdate_utc() :Item_func_curdate() {} const char *func_name() const { return "utc_date"; } - void store_now_in_tm(time_t now, struct tm *now_tm); + void store_now_in_TIME(TIME *now_time); }; @@ -458,7 +458,7 @@ public: String *val_str(String *str); void fix_length_and_dec(); bool get_date(TIME *res, uint fuzzy_date); - virtual void store_now_in_tm(time_t now, struct tm *now_tm)=0; + virtual void store_now_in_TIME(TIME *now_time)=0; }; @@ -468,7 +468,7 @@ public: Item_func_now_local() :Item_func_now() {} Item_func_now_local(Item *a) :Item_func_now(a) {} const char *func_name() const { return "now"; } - void store_now_in_tm(time_t now, struct tm *now_tm); + virtual void store_now_in_TIME(TIME *now_time); virtual enum Functype functype() const { return NOW_FUNC; } }; @@ -479,7 +479,7 @@ public: Item_func_now_utc() :Item_func_now() {} Item_func_now_utc(Item *a) :Item_func_now(a) {} const char *func_name() const { return "utc_timestamp"; } - void store_now_in_tm(time_t now, struct tm *now_tm); + virtual void store_now_in_TIME(TIME *now_time); }; @@ -509,6 +509,7 @@ public: class Item_func_from_unixtime :public Item_date_func { + THD *thd; public: Item_func_from_unixtime(Item *a) :Item_date_func(a) {} double val() @@ -519,12 +520,29 @@ class Item_func_from_unixtime :public Item_date_func longlong val_int(); String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } - void fix_length_and_dec() - { - collation.set(&my_charset_bin); - decimals=0; - max_length=MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; - } + void fix_length_and_dec(); + bool get_date(TIME *res, uint fuzzy_date); +}; + + +/* + We need Time_zone class declaration for storing pointers in + Item_func_convert_tz. +*/ +class Time_zone; + +class Item_func_convert_tz :public Item_date_func +{ + THD *thd; + Time_zone *from_tz, *to_tz; + public: + Item_func_convert_tz(Item *a, Item *b, Item *c): + Item_date_func(a, b, c) {} + longlong val_int(); + double val() { return (double) val_int(); } + String *val_str(String *str); + const char *func_name() const { return "convert_tz"; } + void fix_length_and_dec(); bool get_date(TIME *res, uint fuzzy_date); }; diff --git a/sql/lex.h b/sql/lex.h index 966188e7667..218a1762a5c 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -133,6 +133,7 @@ static SYMBOL symbols[] = { { "DAY_MICROSECOND", SYM(DAY_MICROSECOND_SYM)}, { "DAY_MINUTE", SYM(DAY_MINUTE_SYM)}, { "DAY_SECOND", SYM(DAY_SECOND_SYM)}, + { "DEALLOCATE", SYM(DEALLOCATE_SYM)}, { "DEC", SYM(DECIMAL_SYM)}, { "DECIMAL", SYM(DECIMAL_SYM)}, { "DEFAULT", SYM(DEFAULT)}, @@ -325,6 +326,7 @@ static SYMBOL symbols[] = { { "POINT", SYM(POINT_SYM)}, { "POLYGON", SYM(POLYGON)}, { "PRECISION", SYM(PRECISION)}, + { "PREPARE", SYM(PREPARE_SYM)}, { "PREV", SYM(PREV_SYM)}, { "PRIMARY", SYM(PRIMARY_SYM)}, { "PRIVILEGES", SYM(PRIVILEGES)}, @@ -497,6 +499,7 @@ static SYMBOL sql_functions[] = { { "CONNECTION_ID", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_connection_id)}, { "CONTAINS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_contains)}, { "CONV", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_conv)}, + { "CONVERT_TZ", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_convert_tz)}, { "COUNT", SYM(COUNT_SYM)}, { "COS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cos)}, { "COT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cot)}, diff --git a/sql/log.cc b/sql/log.cc index e7a142230b1..09e83392dac 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -31,6 +31,7 @@ #include <m_ctype.h> // For test_if_number MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; +ulong sync_binlog_counter= 0; static bool test_if_number(const char *str, long *res, bool allow_wildcards); @@ -1164,6 +1165,13 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command, } +inline bool sync_binlog(IO_CACHE *cache) +{ + return (sync_binlog_period && + (sync_binlog_period == ++sync_binlog_counter) && + (sync_binlog_counter= 0, my_sync(cache->file, MYF(MY_WME)))); +} + /* Write an event to the binary log */ @@ -1261,10 +1269,24 @@ COLLATION_CONNECTION=%lu,COLLATION_DATABASE=%lu,COLLATION_SERVER=%lu", if (e.write(file)) goto err; } + /* + We use the same ONE_SHOT trick for making replication of time zones + working in 4.1. Again in 5.0 we have better means for doing this. + */ + if (thd->time_zone_used && + thd->variables.time_zone != global_system_variables.time_zone) + { + char buf[MAX_TIME_ZONE_NAME_LENGTH + 26]; + char *buf_end= strxmov(buf, "SET ONE_SHOT TIME_ZONE='", + thd->variables.time_zone->get_name()->ptr(), + "'", NullS); + Query_log_event e(thd, buf, buf_end - buf, 0); + e.set_log_pos(this); + if (e.write(file)) + goto err; + } #endif - /* Add logging of timezones here */ - if (thd->last_insert_id_used) { Intvar_log_event e(thd,(uchar) LAST_INSERT_ID_EVENT, @@ -1369,9 +1391,9 @@ COLLATION_CONNECTION=%lu,COLLATION_DATABASE=%lu,COLLATION_SERVER=%lu", if (file == &log_file) // we are writing to the real log (disk) { - if (flush_io_cache(file)) + if (flush_io_cache(file) || sync_binlog(file)) goto err; - + if (opt_using_transactions && !my_b_tell(&thd->transaction.trans_log)) { /* @@ -1529,7 +1551,8 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) commit_or_rollback ? 6 : 8, TRUE); qinfo.set_log_pos(this); - if (qinfo.write(&log_file) || flush_io_cache(&log_file)) + if (qinfo.write(&log_file) || flush_io_cache(&log_file) || + sync_binlog(&log_file)) goto err; } if (cache->error) // Error on read diff --git a/sql/log_event.cc b/sql/log_event.cc index a76725a95e0..315b0f670dd 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -202,6 +202,29 @@ static inline int read_str(char * &buf, char *buf_end, char * &str, return 0; } +/* + Transforms a string into "" or its expression in 0x... form. +*/ +static char *str_to_hex(char *to, 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; + } + else + p= strmov(p, "\"\""); + return p; // pointer to end 0 of 'to' +} + /************************************************************************** Log_event methods @@ -2210,9 +2233,9 @@ void User_var_log_event::pack_info(Protocol* protocol) } else { - char *p= strxmov(buf + val_offset, "_", cs->csname, "'", NullS); - p+= escape_string_for_mysql(&my_charset_bin, p, val, val_len); - p= strxmov(p, "' COLLATE ", cs->name, NullS); + char *p= strxmov(buf + val_offset, "_", cs->csname, " ", NullS); + p= str_to_hex(p, val, val_len); + p= strxmov(p, " COLLATE ", cs->name, NullS); event_len= p-buf; } break; @@ -2341,11 +2364,24 @@ void User_var_log_event::print(FILE* file, bool short_form, char* last_db) break; case STRING_RESULT: { - char *p; - if (!(p= (char *)my_alloca(2*val_len+1))) + /* + Let's express the string in hex. That's the most robust way. If we + print it in character form instead, we need to escape it with + character_set_client which we don't know (we will know it in 5.0, but + in 4.1 we don't know it easily when we are printing + User_var_log_event). Explanation why we would need to bother with + character_set_client (quoting Bar): + > Note, the parser doesn't switch to another unescaping mode after + > it has met a character set introducer. + > For example, if an SJIS client says something like: + > SET @a= _ucs2 \0a\0b' + > the string constant is still unescaped according to SJIS, not + > according to UCS2. + */ + char *p, *q; + if (!(p= (char *)my_alloca(2*val_len+1+2))) // 2 hex digits per byte break; // no error, as we are 'void' - escape_string_for_mysql(&my_charset_bin, p, val, val_len); -#if MYSQL_VERSION_ID < 50000 + str_to_hex(p, val, val_len); /* For proper behaviour when mysqlbinlog|mysql, we need to explicitely specify the variable's collation. It will however cause problems when @@ -2360,14 +2396,7 @@ void User_var_log_event::print(FILE* file, bool short_form, char* last_db) */ fprintf(file, ":=???;\n"); else - fprintf(file, ":=_%s'%s' COLLATE %s;\n", cs->csname, p, cs->name); -#else - /* - In 5.0 we will have some SET CHARACTER_SET_ect automatically printed - for all events where it's needed. - */ - fprintf(file, ":='%s';\n", p); -#endif + fprintf(file, ":=_%s %s COLLATE %s;\n", cs->csname, p, cs->name); my_afree(p); } break; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 368774877d0..db8d534064d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <my_global.h> -#include <assert.h> #include <mysql_version.h> #include <mysql_embed.h> #include <my_sys.h> @@ -40,6 +39,14 @@ extern const key_map key_map_empty; extern const key_map key_map_full; extern const char *primary_key_name; +/* + Portable time_t replacement. + Should be signed and hold seconds for 1902-2038 range. +*/ +typedef long my_time_t; +#define MY_TIME_T_MAX LONG_MAX +#define MY_TIME_T_MIN LONG_MIN + #include "mysql_com.h" #include <violite.h> #include "unireg.h" @@ -348,7 +355,9 @@ inline THD *_current_thd(void) #include "field.h" /* Field definitions */ #include "protocol.h" #include "sql_udf.h" +class user_var_entry; #include "item.h" +#include "tztime.h" typedef Comp_creator* (*chooser_compare_func_creator)(bool invert); /* sql_parse.cc */ void free_items(Item *item); @@ -378,6 +387,7 @@ struct Query_cache_query_flags uint character_set_results_num; uint collation_connection_num; ha_rows limit; + Time_zone *time_zone; }; #define QUERY_CACHE_FLAGS_SIZE sizeof(Query_cache_query_flags) #include "sql_cache.h" @@ -530,7 +540,8 @@ int mysql_alter_table(THD *thd, char *new_db, char *new_name, List<Key> &keys, uint order_num, ORDER *order, enum enum_duplicates handle_duplicates, - ALTER_INFO *alter_info); + ALTER_INFO *alter_info, bool do_send_ok=1); +int mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool do_send_ok); int mysql_create_like_table(THD *thd, TABLE_LIST *table, HA_CREATE_INFO *create_info, Table_ident *src_table); @@ -639,8 +650,10 @@ int mysqld_show_column_types(THD *thd); int mysqld_help (THD *thd, const char *text); /* sql_prepare.cc */ -void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length); +int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, + LEX_STRING *name=NULL); void mysql_stmt_execute(THD *thd, char *packet, uint packet_length); +void mysql_sql_stmt_execute(THD *thd, LEX_STRING *stmt_name); void mysql_stmt_free(THD *thd, char *packet); void mysql_stmt_reset(THD *thd, char *packet); void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length); @@ -819,7 +832,7 @@ extern Le_creator le_creator; extern uchar *days_in_month; extern char language[LIBLEN],reg_ext[FN_EXTLEN]; extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; -extern char pidfile_name[FN_REFLEN], time_zone[30], *opt_init_file; +extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file; extern char log_error_file[FN_REFLEN]; extern double log_10[32]; extern ulonglong log_10_int[20]; @@ -855,7 +868,7 @@ extern ulong max_binlog_size, max_relay_log_size; extern ulong rpl_recovery_rank, thread_cache_size; extern ulong com_stat[(uint) SQLCOM_END], com_other, back_log; extern ulong specialflag, current_pid; -extern ulong expire_logs_days; +extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter; extern my_bool relay_log_purge; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version, mysqld_port, dropping_tables; @@ -875,6 +888,7 @@ extern my_bool opt_enable_named_pipe, opt_sync_frm; extern my_bool opt_secure_auth; extern char *shared_memory_base_name, *mysqld_unix_port; extern bool opt_enable_shared_memory; +extern char *default_tz_name; extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; extern FILE *bootstrap_file; @@ -915,7 +929,8 @@ extern struct my_option my_long_options[]; /* optional things, have_* variables */ -extern SHOW_COMP_OPTION have_isam, have_innodb, have_berkeley_db, have_example_db; +extern SHOW_COMP_OPTION have_isam, have_innodb, have_berkeley_db; +extern SHOW_COMP_OPTION have_example_db, have_archive_db; extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink; extern SHOW_COMP_OPTION have_query_cache, have_berkeley_db, have_innodb; extern SHOW_COMP_OPTION have_geometry, have_rtree_keys; @@ -984,12 +999,16 @@ uint calc_days_in_year(uint year); void get_date_from_daynr(long daynr,uint *year, uint *month, uint *day); void init_time(void); -long my_gmt_sec(TIME *, long *current_timezone); -time_t str_to_timestamp(const char *str,uint length); -bool str_to_time(const char *str,uint length,TIME *l_time); -longlong str_to_datetime(const char *str,uint length, uint fuzzy_date); +my_time_t my_system_gmt_sec(const TIME *, long *current_timezone, bool *not_exist); +my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *not_exist); +bool str_to_time(const char *str,uint length,TIME *l_time, int *was_cut); +bool str_to_time_with_warn(const char *str,uint length,TIME *l_time); timestamp_type str_to_TIME(const char *str, uint length, TIME *l_time, - uint flags); + uint flags, int *was_cut); +timestamp_type str_to_TIME_with_warn(const char *str, uint length, + TIME *l_time, uint flags); +longlong number_to_TIME(longlong nr, TIME *time_res, bool fuzzy_date, + int *was_cut); void localtime_to_TIME(TIME *to, struct tm *from); void calc_time_from_sec(TIME *to, long seconds, long microseconds); @@ -1068,6 +1087,9 @@ Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name, LEX_STRING component); Item *get_system_var(THD *thd, enum_var_type var_type, const char *var_name, uint length, const char *item_name); +/* item_func.cc */ +int get_var_with_binlog(THD *thd, LEX_STRING &name, + user_var_entry **out_entry); /* log.cc */ bool flush_error_log(void); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 4f70c72f8ec..3c23ecd3c3d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -47,10 +47,6 @@ #define ONE_THREAD #endif -#define SHUTDOWN_THD -#define MAIN_THD -#define SIGNAL_THD - #ifdef HAVE_purify #define IF_PURIFY(A,B) (A) #else @@ -306,7 +302,7 @@ ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong max_connections,max_used_connections, max_connect_errors, max_user_connections = 0; ulong thread_id=1L,current_pid; -ulong slow_launch_threads = 0; +ulong slow_launch_threads = 0, sync_binlog_period; ulong expire_logs_days = 0; ulong rpl_recovery_rank=0; ulong my_bind_addr; /* the address we bind to */ @@ -324,12 +320,13 @@ ulonglong log_10_int[20]= time_t start_time; -char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], time_zone[30]; +char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30]; +char *default_tz_name; char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN]; char* log_error_file_ptr= log_error_file; char mysql_real_data_home[FN_REFLEN], language[LIBLEN],reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], - max_sort_char,*mysqld_user,*mysqld_chroot, *opt_init_file, + *mysqld_user,*mysqld_chroot, *opt_init_file, *opt_init_connect, *opt_init_slave, def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; @@ -375,8 +372,8 @@ KEY_CACHE *sql_key_cache; CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; -SHOW_COMP_OPTION have_berkeley_db, have_innodb, have_isam, - have_ndbcluster, have_example_db; +SHOW_COMP_OPTION have_berkeley_db, have_innodb, have_isam, have_ndbcluster, + have_example_db, have_archive_db; SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_query_cache; SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_crypt, have_compress; @@ -827,7 +824,6 @@ static void __cdecl kill_server(int sig_ptr) #if defined(USE_ONE_SIGNAL_HAND) || (defined(__NETWARE__) && defined(SIGNALS_DONT_BREAK_READ)) extern "C" pthread_handler_decl(kill_server_thread,arg __attribute__((unused))) { - SHUTDOWN_THD; my_thread_init(); // Initialize new thread kill_server(0); my_thread_end(); // Normally never reached @@ -911,6 +907,7 @@ void clean_up(bool print_message) if (use_slave_mask) bitmap_free(&slave_error_mask); #endif + my_tz_free(); #ifndef NO_EMBEDDED_ACCESS_CHECKS acl_free(1); grant_free(); @@ -1716,7 +1713,6 @@ static void init_signals(void) signal(SIGALRM, SIG_IGN); signal(SIGBREAK,SIG_IGN); signal_thread = pthread_self(); - SIGNAL_THD; } static void start_signal_handler(void) @@ -2116,7 +2112,6 @@ int uname(struct utsname *a) extern "C" pthread_handler_decl(handle_shutdown,arg) { MSG msg; - SHUTDOWN_THD; my_thread_init(); /* this call should create the message queue for this thread */ @@ -2145,7 +2140,6 @@ int STDCALL handle_kill(ulong ctrl_type) #ifdef OS2 extern "C" pthread_handler_decl(handle_shutdown,arg) { - SHUTDOWN_THD; my_thread_init(); // wait semaphore @@ -2270,9 +2264,17 @@ static int init_common_variables(const char *conf_file_name, int argc, { struct tm tm_tmp; localtime_r(&start_time,&tm_tmp); - strmov(time_zone,tzname[tm_tmp.tm_isdst != 0 ? 1 : 0]); + strmov(system_time_zone, tzname[tm_tmp.tm_isdst != 0 ? 1 : 0]); } #endif + /* + We set SYSTEM time zone as reasonable default and + also for failure of my_tz_init() and bootstrap mode. + If user explicitly set time zone with --default-time-zone + option we will change this value in my_tz_init(). + */ + global_system_variables.time_zone= my_tz_SYSTEM; + /* Init mutexes for the global MYSQL_LOG objects. @@ -2810,7 +2812,8 @@ we force server id to 2, but this MySQL server will not act as a slave."); */ error_handler_hook = my_message_sql; start_signal_handler(); // Creates pidfile - if (acl_init((THD *)0, opt_noacl)) + if (acl_init((THD *)0, opt_noacl) || + my_tz_init((THD *)0, default_tz_name, opt_bootstrap)) { abort_loop=1; select_thread_in_use=0; @@ -3884,7 +3887,7 @@ enum options_mysqld OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE, - OPT_SYNC_FRM, OPT_BDB_NOSYNC, + OPT_SYNC_FRM, OPT_SYNC_BINLOG, OPT_BDB_NOSYNC, OPT_ENABLE_SHARED_MEMORY, OPT_SHARED_MEMORY_BASE_NAME, OPT_OLD_PASSWORDS, @@ -3897,7 +3900,8 @@ enum options_mysqld OPT_DATE_FORMAT, OPT_TIME_FORMAT, OPT_DATETIME_FORMAT, - OPT_LOG_QUERIES_NOT_USING_INDEXES + OPT_LOG_QUERIES_NOT_USING_INDEXES, + OPT_DEFAULT_TIME_ZONE }; @@ -3959,6 +3963,12 @@ Disable with --skip-bdb (will save memory).", REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"character_set_server", 'C', "Set the default character set.", + (gptr*) &default_character_set_name, (gptr*) &default_character_set_name, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + {"collation_server", OPT_DEFAULT_COLLATION, "Set the default collation.", + (gptr*) &default_collation_name, (gptr*) &default_collation_name, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"console", OPT_CONSOLE, "Write error output on screen; Don't remove the console window on windows.", (gptr*) &opt_console, (gptr*) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -3992,10 +4002,10 @@ Disable with --skip-bdb (will save memory).", (gptr*) &des_key_file, (gptr*) &des_key_file, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif /* HAVE_OPENSSL */ - {"default-character-set", 'C', "Set the default character set.", + {"default-character-set", 'C', "Set the default character set (Deprecated option, use character_set_server instead).", (gptr*) &default_character_set_name, (gptr*) &default_character_set_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - {"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation.", + {"default-collation", OPT_DEFAULT_COLLATION, "Set the default collation (Deprecated option, use character_set_server instead).", (gptr*) &default_collation_name, (gptr*) &default_collation_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"default-storage-engine", OPT_STORAGE_ENGINE, @@ -4004,6 +4014,9 @@ Disable with --skip-bdb (will save memory).", {"default-table-type", OPT_STORAGE_ENGINE, "(deprecated) Use default-storage-engine.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.", + (gptr*) &default_tz_name, (gptr*) &default_tz_name, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, {"delay-key-write", OPT_DELAY_KEY_WRITE, "Type of DELAY_KEY_WRITE.", 0,0,0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"delay-key-write-for-all-tables", OPT_DELAY_KEY_WRITE_ALL, @@ -4860,6 +4873,12 @@ The minimum value for this variable is 4096.", (gptr*) &max_system_variables.sortbuff_size, 0, GET_ULONG, REQUIRED_ARG, MAX_SORT_MEMORY, MIN_SORT_MEMORY+MALLOC_OVERHEAD*2, ~0L, MALLOC_OVERHEAD, 1, 0}, + {"sync-binlog", OPT_SYNC_BINLOG, + "Sync the binlog to disk after every #th event. \ +#=0 (the default) does no sync. Syncing slows MySQL down", + (gptr*) &sync_binlog_period, + (gptr*) &sync_binlog_period, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1, + 0}, {"table_cache", OPT_TABLE_CACHE, "The number of open tables for all threads.", (gptr*) &table_cache_size, (gptr*) &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, 64, 1, 512*1024L, @@ -5017,6 +5036,12 @@ struct show_var_st status_vars[]= { {"Com_unlock_tables", (char*) (com_stat+(uint) SQLCOM_UNLOCK_TABLES),SHOW_LONG}, {"Com_update", (char*) (com_stat+(uint) SQLCOM_UPDATE),SHOW_LONG}, {"Com_update_multi", (char*) (com_stat+(uint) SQLCOM_UPDATE_MULTI),SHOW_LONG}, + {"Com_prepare_sql", (char*) (com_stat+(uint) SQLCOM_PREPARE), + SHOW_LONG}, + {"Com_execute_sql", (char*) (com_stat+(uint) SQLCOM_EXECUTE), + SHOW_LONG}, + {"Com_dealloc_sql", (char*) (com_stat+(uint) + SQLCOM_DEALLOCATE_PREPARE), SHOW_LONG}, {"Connections", (char*) &thread_id, SHOW_LONG_CONST}, {"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG}, {"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG}, @@ -5231,7 +5256,6 @@ static void mysql_init_variables(void) specialflag= opened_tables= created_tmp_tables= created_tmp_disk_tables= 0; binlog_cache_use= binlog_cache_disk_use= 0; max_used_connections= slow_launch_threads = 0; - max_sort_char= 0; mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0; errmesg= 0; mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS; @@ -5338,6 +5362,11 @@ static void mysql_init_variables(void) #else have_example_db= SHOW_OPTION_NO; #endif +#ifdef HAVE_ARCHIVE_DB + have_archive_db= SHOW_OPTION_YES; +#else + have_archive_db= SHOW_OPTION_NO; +#endif #ifdef HAVE_NDBCLUSTER_DB have_ndbcluster=SHOW_OPTION_DISABLED; #else @@ -5444,7 +5473,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), mysql_data_home= mysql_real_data_home; break; case 'u': - if (!mysqld_user) + if (!mysqld_user || !strcmp(mysqld_user, argument)) mysqld_user= argument; else fprintf(stderr, "Warning: Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n", argument, mysqld_user); diff --git a/sql/net_serv.cc b/sql/net_serv.cc index a0f7a779894..c2da47b480e 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -284,7 +284,9 @@ my_net_write(NET *net,const char *packet,ulong len) buff[3]= (uchar) net->pkt_nr++; if (net_write_buff(net,(char*) buff,NET_HEADER_SIZE)) return 1; +#ifndef DEBUG_DATA_PACKETS DBUG_DUMP("packet_header",(char*) buff,NET_HEADER_SIZE); +#endif return test(net_write_buff(net,packet,len)); } @@ -394,6 +396,9 @@ net_write_buff(NET *net,const char *packet,ulong len) else left_length= (ulong) (net->buff_end - net->write_pos); +#ifdef DEBUG_DATA_PACKETS + DBUG_DUMP("data", packet, len); +#endif if (len > left_length) { if (net->write_pos != net->buff) @@ -776,6 +781,8 @@ my_real_read(NET *net, ulong *complen) if (i == 0) { /* First parts is packet length */ ulong helping; + DBUG_DUMP("packet_header",(char*) net->buff+net->where_b, + NET_HEADER_SIZE); if (net->buff[net->where_b + 3] != (uchar) net->pkt_nr) { if (net->buff[net->where_b] != (uchar) 255) @@ -784,7 +791,6 @@ my_real_read(NET *net, ulong *complen) ("Packets out of order (Found: %d, expected %u)", (int) net->buff[net->where_b + 3], net->pkt_nr)); - DBUG_DUMP("packet_header",(char*) net->buff+net->where_b, 4); #ifdef EXTRA_DEBUG fprintf(stderr,"Packets out of order (Found: %d, expected %d)\n", (int) net->buff[net->where_b + 3], @@ -841,6 +847,10 @@ end: vio_blocking(net->vio, net_blocking, &old_mode); } net->reading_or_writing=0; +#ifdef DEBUG_DATA_PACKETS + if (len != packet_error) + DBUG_DUMP("data",(char*) net->buff+net->where_b, len); +#endif return(len); } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 4bf2f7b724e..3a1d441caac 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1559,7 +1559,7 @@ key_or(SEL_ARG *key1,SEL_ARG *key2) { swap_variables(SEL_ARG *,key1,key2); } - else if (!(key1=key1->clone_tree())) + if (key1->use_count > 0 || !(key1=key1->clone_tree())) return 0; // OOM } @@ -1628,10 +1628,10 @@ key_or(SEL_ARG *key1,SEL_ARG *key2) SEL_ARG *next=key2->next; // Keys are not overlapping if (key2_shared) { - SEL_ARG *tmp= new SEL_ARG(*key2); // Must make copy - if (!tmp) + SEL_ARG *cpy= new SEL_ARG(*key2); // Must make copy + if (!cpy) return 0; // OOM - key1=key1->insert(tmp); + key1=key1->insert(cpy); key2->increment_use_count(key1->use_count+1); } else @@ -1867,8 +1867,17 @@ SEL_ARG::find_range(SEL_ARG *key) /* -** Remove a element from the tree -** This also frees all sub trees that is used by the element + Remove a element from the tree + + SYNOPSIS + tree_delete() + key Key that is to be deleted from tree (this) + + NOTE + This also frees all sub trees that is used by the element + + RETURN + root of new tree (with key deleted) */ SEL_ARG * @@ -1876,7 +1885,10 @@ SEL_ARG::tree_delete(SEL_ARG *key) { enum leaf_color remove_color; SEL_ARG *root,*nod,**par,*fix_par; - root=this; this->parent= 0; + DBUG_ENTER("tree_delete"); + + root=this; + this->parent= 0; /* Unlink from list */ if (key->prev) @@ -1923,7 +1935,7 @@ SEL_ARG::tree_delete(SEL_ARG *key) } if (root == &null_element) - return 0; // Maybe root later + DBUG_RETURN(0); // Maybe root later if (remove_color == BLACK) root=rb_delete_fixup(root,nod,fix_par); test_rb_tree(root,root->parent); @@ -1931,7 +1943,7 @@ SEL_ARG::tree_delete(SEL_ARG *key) root->use_count=this->use_count; // Fix root counters root->elements=this->elements-1; root->maybe_flag=this->maybe_flag; - return root; + DBUG_RETURN(root); } diff --git a/sql/protocol.cc b/sql/protocol.cc index 44fc4eff9ad..7738349c742 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -26,6 +26,8 @@ #include "mysql_priv.h" #include <stdarg.h> +static const unsigned int PACKET_BUFFER_EXTRA_ALLOC= 1024; + #ifndef EMBEDDED_LIBRARY bool Protocol::net_store_data(const char *from, uint length) #else @@ -687,7 +689,7 @@ bool Protocol_simple::store_null() #endif char buff[1]; buff[0]= (char)251; - return packet->append(buff, sizeof(buff), PACKET_BUFFET_EXTRA_ALLOC); + return packet->append(buff, sizeof(buff), PACKET_BUFFER_EXTRA_ALLOC); } #endif @@ -990,7 +992,7 @@ bool Protocol_prep::store_tiny(longlong from) char buff[1]; field_pos++; buff[0]= (uchar) from; - return packet->append(buff, sizeof(buff), PACKET_BUFFET_EXTRA_ALLOC); + return packet->append(buff, sizeof(buff), PACKET_BUFFER_EXTRA_ALLOC); } @@ -1002,7 +1004,7 @@ bool Protocol_prep::store_short(longlong from) field_types[field_pos] == MYSQL_TYPE_YEAR); #endif field_pos++; - char *to= packet->prep_append(2, PACKET_BUFFET_EXTRA_ALLOC); + char *to= packet->prep_append(2, PACKET_BUFFER_EXTRA_ALLOC); if (!to) return 1; int2store(to, (int) from); @@ -1018,7 +1020,7 @@ bool Protocol_prep::store_long(longlong from) field_types[field_pos] == MYSQL_TYPE_LONG); #endif field_pos++; - char *to= packet->prep_append(4, PACKET_BUFFET_EXTRA_ALLOC); + char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC); if (!to) return 1; int4store(to, from); @@ -1033,7 +1035,7 @@ bool Protocol_prep::store_longlong(longlong from, bool unsigned_flag) field_types[field_pos] == MYSQL_TYPE_LONGLONG); #endif field_pos++; - char *to= packet->prep_append(8, PACKET_BUFFET_EXTRA_ALLOC); + char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC); if (!to) return 1; int8store(to, from); @@ -1048,7 +1050,7 @@ bool Protocol_prep::store(float from, uint32 decimals, String *buffer) field_types[field_pos] == MYSQL_TYPE_FLOAT); #endif field_pos++; - char *to= packet->prep_append(4, PACKET_BUFFET_EXTRA_ALLOC); + char *to= packet->prep_append(4, PACKET_BUFFER_EXTRA_ALLOC); if (!to) return 1; float4store(to, from); @@ -1063,7 +1065,7 @@ bool Protocol_prep::store(double from, uint32 decimals, String *buffer) field_types[field_pos] == MYSQL_TYPE_DOUBLE); #endif field_pos++; - char *to= packet->prep_append(8, PACKET_BUFFET_EXTRA_ALLOC); + char *to= packet->prep_append(8, PACKET_BUFFER_EXTRA_ALLOC); if (!to) return 1; float8store(to, from); @@ -1112,7 +1114,7 @@ bool Protocol_prep::store(TIME *tm) else length=0; buff[0]=(char) length; // Length is stored first - return packet->append(buff, length+1, PACKET_BUFFET_EXTRA_ALLOC); + return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC); } bool Protocol_prep::store_date(TIME *tm) @@ -1129,7 +1131,7 @@ bool Protocol_prep::store_time(TIME *tm) DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_TIME); #endif - char buff[15],*pos; + char buff[13], *pos; uint length; field_pos++; pos= buff+1; @@ -1140,13 +1142,13 @@ bool Protocol_prep::store_time(TIME *tm) pos[7]= (uchar) tm->second; int4store(pos+8, tm->second_part); if (tm->second_part) - length=11; + length=12; else if (tm->hour || tm->minute || tm->second || tm->day) length=8; else length=0; buff[0]=(char) length; // Length is stored first - return packet->append(buff, length+1, PACKET_BUFFET_EXTRA_ALLOC); + return packet->append(buff, length+1, PACKET_BUFFER_EXTRA_ALLOC); } #ifdef EMBEDDED_LIBRARY diff --git a/sql/protocol.h b/sql/protocol.h index 41885ec9f1f..d7ce5425ad1 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -18,7 +18,6 @@ #pragma interface /* gcc class implementation */ #endif -#define PACKET_BUFFET_EXTRA_ALLOC 1024 class i_string; class THD; @@ -36,8 +35,10 @@ protected: enum enum_field_types *field_types; #endif uint field_count; +#ifndef EMBEDDED_LIBRARY bool net_store_data(const char *from, uint length); -#ifdef EMBEDDED_LIBRARY +#else + virtual bool net_store_data(const char *from, uint length); char **next_field; MYSQL_FIELD *next_mysql_field; MEM_ROOT *alloc; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 2a5381ae478..4feb24f06b2 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -63,6 +63,11 @@ static Slave_log_event* find_slave_event(IO_CACHE* log, static int init_failsafe_rpl_thread(THD* thd) { DBUG_ENTER("init_failsafe_rpl_thread"); + /* + thd->bootstrap is to report errors barely to stderr; if this code is + enable again one day, one should check if bootstrap is still needed (maybe + this thread has no other error reporting method). + */ thd->system_thread = thd->bootstrap = 1; thd->host_or_ip= ""; thd->client_capabilities = 0; diff --git a/sql/set_var.cc b/sql/set_var.cc index b0935232f29..aa45afc3c30 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -325,6 +325,10 @@ sys_var_thd_table_type sys_table_type("table_type", &SV::table_type); sys_var_thd_storage_engine sys_storage_engine("storage_engine", &SV::table_type); +#ifdef HAVE_REPLICATION +sys_var_sync_binlog_period sys_sync_binlog_period("sync_binlog", &sync_binlog_period); +#endif +sys_var_bool_ptr sys_sync_frm("sync_frm", &opt_sync_frm); sys_var_long_ptr sys_table_cache_size("table_cache", &table_cache_size); sys_var_long_ptr sys_thread_cache_size("thread_cache_size", @@ -437,6 +441,7 @@ static sys_var_thd_ulong sys_default_week_format("default_week_format", sys_var_thd_ulong sys_group_concat_max_len("group_concat_max_len", &SV::group_concat_max_len); +sys_var_thd_time_zone sys_time_zone("time_zone"); /* Read only variables */ @@ -573,11 +578,16 @@ sys_var *sys_variables[]= &sys_sql_mode, &sys_sql_warnings, &sys_storage_engine, +#ifdef HAVE_REPLICATION + &sys_sync_binlog_period, +#endif + &sys_sync_frm, &sys_table_cache_size, &sys_table_type, &sys_thread_cache_size, &sys_time_format, &sys_timestamp, + &sys_time_zone, &sys_tmp_table_size, &sys_trans_alloc_block_size, &sys_trans_prealloc_size, @@ -638,6 +648,7 @@ struct show_var_st init_vars[]= { {"ft_query_expansion_limit",(char*) &ft_query_expansion_limit, SHOW_LONG}, {"ft_stopword_file", (char*) &ft_stopword_file, SHOW_CHAR_PTR}, {sys_group_concat_max_len.name, (char*) &sys_group_concat_max_len, SHOW_SYS}, + {"have_archive", (char*) &have_archive_db, SHOW_HAVE}, {"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE}, {"have_compress", (char*) &have_compress, SHOW_HAVE}, {"have_crypt", (char*) &have_crypt, SHOW_HAVE}, @@ -787,6 +798,10 @@ struct show_var_st init_vars[]= { {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS}, {sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS}, {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS}, +#ifdef HAVE_REPLICATION + {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS}, +#endif + {sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS}, {"table_cache", (char*) &table_cache_size, SHOW_LONG}, {sys_table_type.name, (char*) &sys_table_type, SHOW_SYS}, {sys_thread_cache_size.name,(char*) &sys_thread_cache_size, SHOW_SYS}, @@ -796,8 +811,9 @@ struct show_var_st init_vars[]= { {"thread_stack", (char*) &thread_stack, SHOW_LONG}, {sys_time_format.name, (char*) &sys_time_format, SHOW_SYS}, #ifdef HAVE_TZNAME - {"timezone", time_zone, SHOW_CHAR}, + {"system_time_zone", system_time_zone, SHOW_CHAR}, #endif + {"time_zone", (char*) &sys_time_zone, SHOW_SYS}, {sys_tmp_table_size.name, (char*) &sys_tmp_table_size, SHOW_SYS}, {"tmpdir", (char*) &opt_mysql_tmpdir, SHOW_CHAR_PTR}, {sys_trans_alloc_block_size.name, (char*) &sys_trans_alloc_block_size, @@ -2308,6 +2324,22 @@ bool sys_var_slave_skip_counter::update(THD *thd, set_var *var) pthread_mutex_unlock(&LOCK_active_mi); return 0; } + + +bool sys_var_sync_binlog_period::update(THD *thd, set_var *var) +{ + pthread_mutex_t *lock_log= mysql_bin_log.get_log_lock(); + sync_binlog_period= var->save_result.ulong_value; + /* + Must reset the counter otherwise it may already be beyond the new period + and so the new period will not be taken into account. Need mutex otherwise + might be cancelled by a simultanate ++ in MYSQL_LOG::write(). + */ + pthread_mutex_lock(lock_log); + sync_binlog_counter= 0; + pthread_mutex_unlock(lock_log); + return 0; +} #endif /* HAVE_REPLICATION */ bool sys_var_rand_seed1::update(THD *thd, set_var *var) @@ -2323,6 +2355,77 @@ bool sys_var_rand_seed2::update(THD *thd, set_var *var) } +bool sys_var_thd_time_zone::check(THD *thd, set_var *var) +{ + char buff[MAX_TIME_ZONE_NAME_LENGTH]; + String str(buff, sizeof(buff), &my_charset_latin1); + String *res= var->value->val_str(&str); + +#if defined(HAVE_REPLICATION) && (MYSQL_VERSION_ID < 50000) + if ((var->type == OPT_GLOBAL) && + (mysql_bin_log.is_open() || + active_mi->slave_running || active_mi->rli.slave_running)) + { + my_printf_error(0, "Binary logging and replication forbid changing " + "of the global server time zone", MYF(0)); + return 1; + } +#endif + + if (!(var->save_result.time_zone= my_tz_find(thd, res))) + { + my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), res ? res->c_ptr() : "NULL"); + return 1; + } + return 0; +} + + +bool sys_var_thd_time_zone::update(THD *thd, set_var *var) +{ + /* We are using Time_zone object found during check() phase */ + *get_tz_ptr(thd,var->type)= var->save_result.time_zone; + return 0; +} + + +byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type, + LEX_STRING *base) +{ + /* + We can use ptr() instead of c_ptr() here because String contaning + time zone name is guaranteed to be zero ended. + */ + return (byte *)((*get_tz_ptr(thd,type))->get_name()->ptr()); +} + + +Time_zone** sys_var_thd_time_zone::get_tz_ptr(THD *thd, + enum_var_type type) +{ + if (type == OPT_GLOBAL) + return &global_system_variables.time_zone; + else + return &thd->variables.time_zone; +} + + +void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type) +{ + if (type == OPT_GLOBAL) + { + if (default_tz_name) + { + String str(default_tz_name, &my_charset_latin1); + global_system_variables.time_zone= my_tz_find(thd, &str); + } + else + global_system_variables.time_zone= my_tz_SYSTEM; + } + else + thd->variables.time_zone= global_system_variables.time_zone; +} + /* Functions to update thd->options bits */ diff --git a/sql/set_var.h b/sql/set_var.h index 64bdfdb718b..c2b4ca34b2d 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -462,7 +462,7 @@ public: }; -#ifndef EMBEDDED_LIBRARY +#ifdef HAVE_REPLICATION class sys_var_slave_skip_counter :public sys_var { public: @@ -475,6 +475,14 @@ public: type() or value_ptr() */ }; + +class sys_var_sync_binlog_period :public sys_var_long_ptr +{ +public: + sys_var_sync_binlog_period(const char *name_arg, ulong *value_ptr) + :sys_var_long_ptr(name_arg,value_ptr) {} + bool update(THD *thd, set_var *var); +}; #endif class sys_var_rand_seed1 :public sys_var @@ -708,6 +716,29 @@ public: SHOW_TYPE type() { return show_type; } }; +class sys_var_thd_time_zone :public sys_var_thd +{ +public: + sys_var_thd_time_zone(const char *name_arg): + sys_var_thd(name_arg) + { +#if MYSQL_VERSION_ID < 50000 + no_support_one_shot= 0; +#endif + } + bool check(THD *thd, set_var *var); + SHOW_TYPE type() { return SHOW_CHAR; } + bool check_update_type(Item_result type) + { + return type != STRING_RESULT; /* Only accept strings */ + } + bool check_default(enum_var_type type) { return 0; } + bool update(THD *thd, set_var *var); + byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + virtual void set_default(THD *thd, enum_var_type type); + Time_zone **get_tz_ptr(THD *thd, enum_var_type type); +}; + /**************************************************************************** Classes for parsing of the SET command ****************************************************************************/ @@ -741,6 +772,7 @@ public: ulong ulong_value; ulonglong ulonglong_value; DATE_TIME_FORMAT *date_time_format; + Time_zone *time_zone; } save_result; LEX_STRING base; /* for structs */ diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 20a162a8080..2d377929229 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -174,7 +174,7 @@ character-set=latin2 "Zji-B¹tìn timeout pøi ètení komunikaèního packetu", "Zji-B¹tìna chyba pøi zápisu komunikaèního packetu", "Zji-B¹tìn timeout pøi zápisu komunikaèního packetu", -"V-Býsledný øetìzec je del¹í ne¾ max_allowed_packet", +"V-Býsledný øetìzec je del¹í ne¾ 'max_allowed_packet'", "Typ pou-B¾ité tabulky nepodporuje BLOB/TEXT sloupce", "Typ pou-B¾ité tabulky nepodporuje AUTO_INCREMENT sloupce", "INSERT DELAYED nen-Bí mo¾no s tabulkou '%-.64s' pou¾ít, proto¾e je zamèená pomocí LOCK TABLES", @@ -209,23 +209,23 @@ character-set=latin2 "Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a mìla by být opravena", "Tabulka '%-.64s' je ozna-Bèena jako poru¹ená a poslední (automatická?) oprava se nezdaøila", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -233,50 +233,50 @@ character-set=latin2 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -284,13 +284,13 @@ character-set=latin2 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -305,10 +305,10 @@ character-set=latin2 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", -"Got NDB error %d '%-.100s'", -"Got temporary NDB error %d '%-.100s'", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 4fe51036579..af7b8263e6b 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -126,7 +126,7 @@ character-set=latin1 "For mange felter", "For store poster. Max post størrelse, uden BLOB's, er %d. Du må lave nogle felter til BLOB's", "Thread stack brugt: Brugt: %ld af en %ld stak. Brug 'mysqld -O thread_stack=#' for at allokere en større stak om nødvendigt", -"Krydsreferencer fundet i OUTER JOIN. Check dine ON conditions", +"Krydsreferencer fundet i OUTER JOIN; check dine ON conditions", "Kolonne '%-.32s' bruges som UNIQUE eller INDEX men er ikke defineret som NOT NULL", "Kan ikke læse funktionen '%-.64s'", "Kan ikke starte funktionen '%-.64s'; %-.80s", @@ -168,7 +168,7 @@ character-set=latin1 "Timeout-fejl ved læsning af kommunukations-pakker (communication packets)", "Fik fejlmeddelelse ved skrivning af kommunukations-pakker (communication packets)", "Timeout-fejl ved skrivning af kommunukations-pakker (communication packets)", -"Strengen med resultater er større end max_allowed_packet", +"Strengen med resultater er større end 'max_allowed_packet'", "Denne tabeltype understøtter ikke brug af BLOB og TEXT kolonner", "Denne tabeltype understøtter ikke brug af AUTO_INCREMENT kolonner", "INSERT DELAYED kan ikke bruges med tabellen '%-.64s', fordi tabellen er låst med LOCK TABLES", @@ -208,7 +208,7 @@ character-set=latin1 "Denne handling kræver en kørende slave. Konfigurer en slave og brug kommandoen START SLAVE", "Denne server er ikke konfigureret som slave. Ret in config-filen eller brug kommandoen CHANGE MASTER TO", "Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Kunne ikke danne en slave-tråd. Check systemressourcerne", +"Kunne ikke danne en slave-tråd; check systemressourcerne", "Brugeren %-.64s har allerede mere end 'max_user_connections' aktive forbindelser", "Du må kun bruge konstantudtryk med SET", "Lock wait timeout overskredet", @@ -216,10 +216,10 @@ character-set=latin1 "Update lås kan ikke opnås under en READ UNCOMMITTED transaktion", "DROP DATABASE er ikke tilladt mens en tråd holder på globalt read lock", "CREATE DATABASE er ikke tilladt mens en tråd holder på globalt read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -227,26 +227,26 @@ character-set=latin1 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", -+ "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Variable '%-.64s' is a %s variable", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", "Unknown prepared statement handler (%ld) given to %s", @@ -254,23 +254,23 @@ character-set=latin1 "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -278,13 +278,13 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support, they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -299,8 +299,10 @@ character-set=latin1 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Modtog fejl %d '%-.100s' fra %s", "Modtog temporary fejl %d '%-.100s' fra %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 6b318256cd8..aa20996680e 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -176,7 +176,7 @@ character-set=latin1 "Timeout bij het lezen van communicatiepakketten", "Fout bij het schrijven van communicatiepakketten", "Timeout bij het schrijven van communicatiepakketten", -"Resultaat string is langer dan max_allowed_packet", +"Resultaat string is langer dan 'max_allowed_packet'", "Het gebruikte tabel type ondersteunt geen BLOB/TEXT kolommen", "Het gebruikte tabel type ondersteunt geen AUTO_INCREMENT kolommen", "INSERT DELAYED kan niet worden gebruikt bij table '%-.64s', vanwege een 'lock met LOCK TABLES", @@ -253,32 +253,32 @@ character-set=latin1 "Kreeg fatale fout %d: '%-.128s' van master tijdens lezen van data uit binaire log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -286,13 +286,13 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -307,8 +307,10 @@ character-set=latin1 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 61558f7fae5..b5a7f7962cf 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -24,8 +24,8 @@ character-set=latin1 "Can't read dir of '%-.64s' (errno: %d)", "Can't change dir to '%-.64s' (errno: %d)", "Record has changed since last read in table '%-.64s'", -"Disk full (%s). Waiting for someone to free some space...", -"Can't write, duplicate key in table '%-.64s'", +"Disk full (%s); waiting for someone to free some space...", +"Can't write; duplicate key in table '%-.64s'", "Error on close of '%-.64s' (errno: %d)", "Error reading file '%-.64s' (errno: %d)", "Error on rename of '%-.64s' to '%-.64s' (errno: %d)", @@ -37,25 +37,25 @@ character-set=latin1 "Table storage engine for '%-.64s' doesn't have this option", "Can't find record in '%-.64s'", "Incorrect information in file: '%-.64s'", -"Incorrect key file for table: '%-.64s'; try to repair it", +"Incorrect key file for table '%-.64s'; try to repair it", "Old key file for table '%-.64s'; repair it!", "Table '%-.64s' is read only", -"Out of memory. Restart daemon and try again (needed %d bytes)", -"Out of sort memory. Increase daemon sort buffer size", -"Unexpected eof found when reading file '%-.64s' (errno: %d)", +"Out of memory; restart server and try again (needed %d bytes)", +"Out of sort memory; increase server sort buffer size", +"Unexpected EOF found when reading file '%-.64s' (errno: %d)", "Too many connections", -"Out of memory; Check if mysqld or some other process uses all available memory. If not you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space", +"Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space", "Can't get hostname for your address", "Bad handshake", -"Access denied for user: '%-.32s'@'%-.64s' to database '%-.64s'", -"Access denied for user: '%-.32s'@'%-.64s' (Using password: %s)", -"No Database Selected", +"Access denied for user '%-.32s'@'%-.64s' to database '%-.64s'", +"Access denied for user '%-.32s'@'%-.64s' (using password: %s)", +"No database selected", "Unknown command", "Column '%-.64s' cannot be null", "Unknown database '%-.64s'", "Table '%-.64s' already exists", "Unknown table '%-.64s'", -"Column: '%-.64s' in %-.64s is ambiguous", +"Column '%-.64s' in %-.64s is ambiguous", "Server shutdown in progress", "Unknown column '%-.64s' in '%-.64s'", "'%-.64s' isn't in GROUP BY", @@ -73,28 +73,28 @@ character-set=latin1 "Invalid default value for '%-.64s'", "Multiple primary key defined", "Too many keys specified; max %d keys allowed", -"Too many key parts specified. Max %d parts allowed", +"Too many key parts specified; max %d parts allowed", "Specified key was too long; max key length is %d bytes", "Key column '%-.64s' doesn't exist in table", "BLOB column '%-.64s' can't be used in key specification with the used table type", -"Too big column length for column '%-.64s' (max = %d). Use BLOB instead", -"Incorrect table definition; There can only be one auto column and it must be defined as a key", +"Column length too big for column '%-.64s' (max = %d); use BLOB instead", +"Incorrect table definition; there can be only one auto column and it must be defined as a key", "%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d\n", "%s: Normal shutdown\n", "%s: Got signal %d. Aborting!\n", -"%s: Shutdown Complete\n", +"%s: Shutdown complete\n", "%s: Forcing close of thread %ld user: '%-.32s'\n", "Can't create IP socket", -"Table '%-.64s' has no index like the one used in CREATE INDEX. Recreate the table", -"Field separator argument is not what is expected. Check the manual", -"You can't use fixed rowlength with BLOBs. Please use 'fields terminated by'", +"Table '%-.64s' has no index like the one used in CREATE INDEX; recreate the table", +"Field separator argument is not what is expected; check the manual", +"You can't use fixed rowlength with BLOBs; please use 'fields terminated by'", "The file '%-.64s' must be in the database directory or be readable by all", "File '%-.80s' already exists", "Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld", "Records: %ld Duplicates: %ld", -"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", -"You can't delete all columns with ALTER TABLE. Use DROP TABLE instead", -"Can't DROP '%-.64s'. Check that column/key exists", +"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", +"You can't delete all columns with ALTER TABLE; use DROP TABLE instead", +"Can't DROP '%-.64s'; check that column/key exists", "Records: %ld Duplicates: %ld Warnings: %ld", "You can't specify target table '%-.64s' for update in FROM clause", "Unknown thread id: %lu", @@ -107,7 +107,7 @@ character-set=latin1 "BLOB/TEXT column '%-.64s' can't have a default value", "Incorrect database name '%-.100s'", "Incorrect table name '%-.100s'", -"The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok", +"The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay", "Unknown error", "Unknown procedure '%-.64s'", "Incorrect parameter count to procedure '%-.64s'", @@ -119,44 +119,44 @@ character-set=latin1 "A table must have at least 1 column", "The table '%-.64s' is full", "Unknown character set: '%-.64s'", -"Too many tables. MySQL can only use %d tables in a join", +"Too many tables; MySQL can only use %d tables in a join", "Too many columns", -"Too big row size. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some fields to TEXT or BLOBs", +"Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs", "Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=#' to specify a bigger stack if needed", -"Cross dependency found in OUTER JOIN. Examine your ON conditions", +"Cross dependency found in OUTER JOIN; examine your ON conditions", "Column '%-.64s' is used with UNIQUE or INDEX but is not defined as NOT NULL", "Can't load function '%-.64s'", "Can't initialize function '%-.64s'; %-.80s", "No paths allowed for shared library", -"Function '%-.64s' already exist", +"Function '%-.64s' already exists", "Can't open shared library '%-.64s' (errno: %d %-.64s)", "Can't find function '%-.64s' in library'", "Function '%-.64s' is not defined", -"Host '%-.64s' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'", +"Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", "Host '%-.64s' is not allowed to connect to this MySQL server", -"You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords", +"You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", "You must have privileges to update tables in the mysql database to be able to change passwords for others", "Can't find any matching row in the user table", "Rows matched: %ld Changed: %ld Warnings: %ld", -"Can't create a new thread (errno %d). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug", +"Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug", "Column count doesn't match value count at row %ld", "Can't reopen table: '%-.64s'", "Invalid use of NULL value", "Got error '%-.64s' from regexp", -"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", "There is no such grant defined for user '%-.32s' on host '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for table '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", -"Illegal GRANT/REVOKE command. Please consult the manual which privileges can be used", +"%-.16s command denied to user '%-.32s'@'%-.64s' for table '%-.64s'", +"%-.16s command denied to user '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", +"Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used", "The host or user argument to GRANT is too long", "Table '%-.64s.%-.64s' doesn't exist", "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", "The used command is not allowed with this MySQL version", -"You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use", +"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use", "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", "Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)", -"Got a packet bigger than 'max_allowed_packet'", +"Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", "Got packets out of order", @@ -165,7 +165,7 @@ character-set=latin1 "Got timeout reading communication packets", "Got an error writing communication packets", "Got timeout writing communication packets", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s' because it is locked with LOCK TABLES", @@ -174,7 +174,7 @@ character-set=latin1 "All tables in the MERGE table are not identically defined", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB/TEXT column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -200,23 +200,23 @@ character-set=latin1 "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded; Try restarting transaction", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add or update a child row: a foreign key constraint fails", @@ -224,50 +224,50 @@ character-set=latin1 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", "ZLIB: Not enough memory", "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", "ZLIB: Input data corrupted", -"%d line(s) was(were) cut by group_concat()", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -275,29 +275,31 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL. Otherwise you will get problems if you get an unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", -"Query cache failed to set size %lu, new query cache size is %lu", +"Query cache failed to set size %lu; new query cache size is %lu", "Column '%-.64s' cannot be part of FULLTEXT index", "Unknown key cache '%-.100s'", -"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work", "Unknown table engine '%s'", -"'%s' is deprecated, use '%s' instead", +"'%s' is deprecated; use '%s' instead", "The target table %-.100s of the %s is not updatable", -"The '%s' feature was disabled; you need MySQL built with '%s' to have it working", +"The '%s' feature is disabled; you need MySQL built with '%s' to have it working", "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" -"Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Truncated incorrect %-.32s value: '%-.128s'" +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 28da38a3691..0cc6e06ab26 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -206,11 +206,11 @@ character-set=latin7 "Tabel '%-.64s' on märgitud vigaseks ja viimane (automaatne?) parandus ebaõnnestus", "Hoiatus: mõnesid transaktsioone mittetoetavaid tabeleid ei suudetud tagasi kerida", "Mitme lausendiga transaktsioon nõudis rohkem ruumi kui lubatud 'max_binlog_cache_size' muutujaga. Suurenda muutuja väärtust ja proovi uuesti", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "Kasutajal %-.64s on juba rohkem ühendusi kui lubatud 'max_user_connections' muutujaga", "Ainult konstantsed suurused on lubatud SET klauslis", "Kontrollaeg ületatud luku järel ootamisel; Proovi transaktsiooni otsast alata", @@ -235,44 +235,44 @@ character-set=latin7 "Transaktsioone toetavate ning mittetoetavate tabelite kooskasutamine ei ole lubatud", "Määrangut '%s' on lauses kasutatud topelt", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -280,13 +280,13 @@ character-set=latin7 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -301,8 +301,10 @@ character-set=latin7 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 697cf5f7233..2e23db62ddb 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -165,7 +165,7 @@ character-set=latin1 "Timeout en lecture des paquets reçus", "Erreur d'écriture des paquets envoyés", "Timeout d'écriture des paquets envoyés", -"La chaîne résultat est plus grande que max_allowed_packet", +"La chaîne résultat est plus grande que 'max_allowed_packet'", "Ce type de table ne supporte pas les colonnes BLOB/TEXT", "Ce type de table ne supporte pas les colonnes AUTO_INCREMENT", "INSERT DELAYED ne peut être utilisé avec la table '%-.64s', car elle est verrouée avec LOCK TABLES", @@ -224,50 +224,50 @@ character-set=latin1 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -275,13 +275,13 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -296,8 +296,10 @@ character-set=latin1 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 3dc6aa34b5e..c63162c84f6 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -177,7 +177,7 @@ character-set=latin1 "Zeitüberschreitung beim Lesen eines Kommunikationspakets", "Fehler beim Schreiben eines Kommunikationspakets", "Zeitüberschreitung beim Schreiben eines Kommunikationspakets", -"Ergebnis ist länger als max_allowed_packet", +"Ergebnis ist länger als 'max_allowed_packet'", "Der verwendete Tabellentyp unterstützt keine BLOB- und TEXT-Spalten", "Der verwendete Tabellentyp unterstützt keine AUTO_INCREMENT-Spalten", "INSERT DELAYED kann nicht auf Tabelle '%-.64s' angewendet werden, da diese mit LOCK TABLES gesperrt ist", @@ -258,7 +258,7 @@ character-set=latin1 "Schlüssel- und Tabellenverweis passen nicht zusammen", "Operand solle %d Spalte(n) enthalten", "Unterabfrage lieferte mehr als einen Datensatz zurück", -"Unbekannter Prepared-Statement-Handler (%ld) für %s angegeben", +"Unbekannter Prepared-Statement-Handler (%.*s) für %s angegeben", "Die Hilfe-Datenbank ist beschädigt oder existiert nicht", "Zyklischer Verweis in Unterabfragen", "Spalte '%s' wird von %s nach %s umgewandelt", @@ -272,10 +272,10 @@ character-set=latin1 "Slave läuft bereits", "Slave wurde bereits angehalten", "Unkomprimierte Daten sind zu groß. Die maximale Größe beträgt %d", -"Z_MEM_ERROR: Für zlib steht nicht genug Speicher zur Verfügung", -"Z_BUF_ERROR: Im Ausgabepuffer ist nicht genug Platz für zlib vorhanden (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)", -"Z_DATA_ERROR: Eingabedaten für zlib beschädigt", -"%d Zeile(n) durch group_concat() abgeschnitten", +"ZLIB: Steht nicht genug Speicher zur Verfügung", +"ZLIB: Im Ausgabepuffer ist nicht genug Platz vorhanden (wahrscheinlich wurde die Länge der unkomprimierten Daten beschädigt)", +"ZLIB: Eingabedaten beschädigt", +"%d Zeile(n) durch GROUP_CONCAT() abgeschnitten", "Anzahl der Datensätze in Zeile %ld geringer als Anzahl der Spalten", "Anzahl der Datensätze in Zeile %ld größer als Anzahl der Spalten", "Daten abgeschnitten, NULL für NOT NULL-Spalte '%s' in Zeile %ld angegeben", @@ -308,8 +308,10 @@ character-set=latin1 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index c5f122a2a49..fa94b0f5107 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -138,16 +138,16 @@ character-set=greek "ÐñÝðåé íá Ý÷åôå äéêáßùìá äéüñèùóçò ðéíÜêùí (update) óôç âÜóç äåäïìÝíùí mysql ãéá íá ìðïñåßôå íá áëëÜîåôå ôá passwords Üëëùí ÷ñçóôþí", "Äåí åßíáé äõíáôÞ ç áíåýñåóç ôçò áíôßóôïé÷çò åããñáöÞò óôïí ðßíáêá ôùí ÷ñçóôþí", "Rows matched: %ld Changed: %ld Warnings: %ld", -"Can't create a new thread (errno %d). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug", +"Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug", "Column count doesn't match value count at row %ld", "Can't reopen table: '%-.64s'", "Invalid use of NULL value", "Got error '%-.64s' from regexp", -"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", "There is no such grant defined for user '%-.32s' on host '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for table '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", -"Illegal GRANT/REVOKE command. Please consult the manual which privileges can be used.", +"%-.16s command denied to user '%-.32s'@'%-.64s' for table '%-.64s'", +"%-.16s command denied to user '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", +"Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used.", "The host or user argument to GRANT is too long", "Table '%-.64s.%-.64s' doesn't exist", "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", @@ -156,7 +156,7 @@ character-set=greek "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", "Aborted connection %ld to db: '%-.64s' user: '%-32s' (%-.64s)", -"Got a packet bigger than 'max_allowed_packet'", +"Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", "Got packets out of order", @@ -165,7 +165,7 @@ character-set=greek "Got timeout reading communication packets", "Got an error writing communication packets", "Got timeout writing communication packets", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", @@ -174,7 +174,7 @@ character-set=greek "All tables in the MERGE table are not identically defined", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -200,23 +200,23 @@ character-set=greek "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -224,50 +224,50 @@ character-set=greek "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -275,13 +275,13 @@ character-set=greek "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -296,8 +296,10 @@ character-set=greek "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index e83f4ca5ca3..56fae82c438 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -109,7 +109,7 @@ character-set=latin2 "A(z) '%-.64s' blob objektumnak nem lehet alapertelmezett erteke", "Hibas adatbazisnev: '%-.100s'", "Hibas tablanev: '%-.100s'", -"A SELECT tul sok rekordot fog megvizsgalni es nagyon sokaig fog tartani. Ellenorizze a WHERE-t es hasznalja a SET SQL_BIG_SELECTS=1 beallitast, ha a SELECT ok", +"A SELECT tul sok rekordot fog megvizsgalni es nagyon sokaig fog tartani. Ellenorizze a WHERE-t es hasznalja a SET SQL_BIG_SELECTS=1 beallitast, ha a SELECT okay", "Ismeretlen hiba", "Ismeretlen eljaras: '%-.64s'", "Rossz parameter a(z) '%-.64s'eljaras szamitasanal", @@ -167,7 +167,7 @@ character-set=latin2 "Idotullepes a kommunikacios adatcsomagok olvasasa soran", "Hiba a kommunikacios csomagok irasa soran", "Idotullepes a kommunikacios csomagok irasa soran", -"Ez eredmeny sztring nagyobb, mint a lehetseges maximum: max_allowed_packet", +"Ez eredmeny sztring nagyobb, mint a lehetseges maximum: 'max_allowed_packet'", "A hasznalt tabla tipus nem tamogatja a BLOB/TEXT mezoket", "A hasznalt tabla tipus nem tamogatja az AUTO_INCREMENT tipusu mezoket", "Az INSERT DELAYED nem hasznalhato a '%-.64s' tablahoz, mert a tabla zarolt (LOCK TABLES)", @@ -202,23 +202,23 @@ character-set=latin2 "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -226,50 +226,50 @@ character-set=latin2 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -277,13 +277,13 @@ character-set=latin2 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -298,8 +298,10 @@ character-set=latin2 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 294ff333e66..31768f172b4 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -165,7 +165,7 @@ character-set=latin1 "Rilevato un timeout ricevendo i pacchetti di comunicazione", "Rilevato un errore inviando i pacchetti di comunicazione", "Rilevato un timeout inviando i pacchetti di comunicazione", -"La stringa di risposta e` piu` lunga di max_allowed_packet", +"La stringa di risposta e` piu` lunga di 'max_allowed_packet'", "Il tipo di tabella usata non supporta colonne di tipo BLOB/TEXT", "Il tipo di tabella usata non supporta colonne di tipo AUTO_INCREMENT", "L'inserimento ritardato (INSERT DELAYED) non puo` essere usato con la tabella '%-.64s', perche` soggetta a lock da 'LOCK TABLES'", @@ -242,32 +242,32 @@ character-set=latin1 "Errore fatale %d: '%-.128s' dal master leggendo i dati dal log binario", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -275,13 +275,13 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -296,8 +296,10 @@ character-set=latin1 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 7969c3b35b8..4385f25c991 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -50,7 +50,7 @@ character-set=ujis "¤½¤Î address ¤Î hostname ¤¬°ú¤±¤Þ¤»¤ó.", "Bad handshake", "¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s' ¤Î '%-.64s' ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤òµñÈݤ·¤Þ¤¹", -"¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s' ¤òµñÈݤ·¤Þ¤¹.(Using password: %s)", +"¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s' ¤òµñÈݤ·¤Þ¤¹.uUsing password: %s)", "¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó.", "¤½¤Î¥³¥Þ¥ó¥É¤Ï²¿¡©", "Column '%-.64s' ¤Ï null ¤Ë¤Ï¤Ç¤¤Ê¤¤¤Î¤Ç¤¹", @@ -75,12 +75,12 @@ character-set=ujis "Invalid default value for '%-.64s'", "Ê£¿ô¤Î primary key ¤¬ÄêµÁ¤µ¤ì¤Þ¤·¤¿", "key ¤Î»ØÄ꤬¿¤¹¤®¤Þ¤¹. key ¤ÏºÇÂç %d ¤Þ¤Ç¤Ç¤¹", -"Too many key parts specified. Max %d parts allowed", +"Too many key parts specified; max %d parts allowed", "key ¤¬Ä¹¤¹¤®¤Þ¤¹. key ¤ÎŤµ¤ÏºÇÂç %d ¤Ç¤¹", "Key column '%-.64s' ¤¬¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ê¤Þ¤»¤ó.", "BLOB column '%-.64s' can't be used in key specification with the used table type", "column '%-.64s' ¤Ï,³ÎÊݤ¹¤ë column ¤ÎÂ礤µ¤¬Â¿¤¹¤®¤Þ¤¹. (ºÇÂç %d ¤Þ¤Ç). BLOB ¤ò¤«¤ï¤ê¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤.", -"¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ¤¬°ã¤¤¤Þ¤¹; There can only be one auto column and it must be defined as a key", +"¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ¤¬°ã¤¤¤Þ¤¹; there can be only one auto column and it must be defined as a key", "%s: ½àÈ÷´°Î»\n", "%s: Normal shutdown\n", "%s: Got signal %d. ÃæÃÇ!\n", @@ -88,15 +88,15 @@ character-set=ujis "%s: ¥¹¥ì¥Ã¥É %ld ¶¯À©½ªÎ» user: '%-.64s'\n", "IP socket ¤¬ºî¤ì¤Þ¤»¤ó", "Table '%-.64s' ¤Ï¤½¤Î¤è¤¦¤Ê index ¤ò»ý¤Ã¤Æ¤¤¤Þ¤»¤ó(CREATE INDEX ¼Â¹Ô»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó). ¥Æ¡¼¥Ö¥ë¤òºî¤êľ¤·¤Æ¤¯¤À¤µ¤¤", -"Field separator argument is not what is expected. Check the manual", -"You can't use fixed rowlength with BLOBs. Please use 'fields terminated by'.", +"Field separator argument is not what is expected; check the manual", +"You can't use fixed rowlength with BLOBs; please use 'fields terminated by'.", "¥Õ¥¡¥¤¥ë '%-.64s' ¤Ï databse ¤Î directory ¤Ë¤¢¤ë¤«Á´¤Æ¤Î¥æ¡¼¥¶¡¼¤¬ÆÉ¤á¤ë¤è¤¦¤Ëµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó.", "File '%-.64s' ¤Ï´û¤Ë¸ºß¤·¤Þ¤¹", "¥ì¥³¡¼¥É¿ô: %ld ºï½ü: %ld Skipped: %ld Warnings: %ld", "¥ì¥³¡¼¥É¿ô: %ld ½ÅÊ£: %ld", -"Incorrect sub part key. The used key part isn't a string or the used length is longer than the key part", +"Incorrect sub part key; the used key part isn't a string or the used length is longer than the key part", "ALTER TABLE ¤ÇÁ´¤Æ¤Î column ¤Ïºï½ü¤Ç¤¤Þ¤»¤ó. DROP TABLE ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤", -"'%-.64s' ¤òÇË´þ¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿. Check that column/key exists", +"'%-.64s' ¤òÇË´þ¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿; check that column/key exists", "¥ì¥³¡¼¥É¿ô: %ld ½ÅÊ£¿ô: %ld Warnings: %ld", "You can't specify target table '%-.64s' for update in FROM clause", "thread id: %lu ¤Ï¤¢¤ê¤Þ¤»¤ó", @@ -109,7 +109,7 @@ character-set=ujis "BLOB column '%-.64s' can't have a default value", "»ØÄꤷ¤¿ database ̾ '%-.100s' ¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹", "»ØÄꤷ¤¿ table ̾ '%-.100s' ¤Ï¤Þ¤Á¤¬¤Ã¤Æ¤¤¤Þ¤¹", -"The SELECT would examine more rows than MAX_JOIN_SIZE. Check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is ok", +"The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay", "Unknown error", "Unknown procedure '%-.64s'", "Incorrect parameter count to procedure '%-.64s'", @@ -121,11 +121,11 @@ character-set=ujis "¥Æ¡¼¥Ö¥ë¤ÏºÇÄã 1 ¸Ä¤Î column ¤¬É¬ÍפǤ¹", "table '%-.64s' ¤Ï¤¤¤Ã¤Ñ¤¤¤Ç¤¹", "character set '%-.64s' ¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó", -"¥Æ¡¼¥Ö¥ë¤¬Â¿¤¹¤®¤Þ¤¹. MySQL can only use %d tables in a join", +"¥Æ¡¼¥Ö¥ë¤¬Â¿¤¹¤®¤Þ¤¹; MySQL can only use %d tables in a join", "column ¤¬Â¿¤¹¤®¤Þ¤¹", "row size ¤¬Â礤¹¤®¤Þ¤¹. BLOB ¤ò´Þ¤Þ¤Ê¤¤¾ì¹ç¤Î row size ¤ÎºÇÂç¤Ï %d ¤Ç¤¹. ¤¤¤¯¤Ä¤«¤Î field ¤ò BLOB ¤ËÊѤ¨¤Æ¤¯¤À¤µ¤¤.", "Thread stack overrun: Used: %ld of a %ld stack. ¥¹¥¿¥Ã¥¯Îΰè¤ò¿¤¯¤È¤ê¤¿¤¤¾ì¹ç¡¢'mysqld -O thread_stack=#' ¤È»ØÄꤷ¤Æ¤¯¤À¤µ¤¤", -"Cross dependency found in OUTER JOIN. Examine your ON conditions", +"Cross dependency found in OUTER JOIN; examine your ON conditions", "Column '%-.64s' ¤¬ UNIQUE ¤« INDEX ¤Ç»ÈÍѤµ¤ì¤Þ¤·¤¿. ¤³¤Î¥«¥é¥à¤Ï NOT NULL ¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó.", "function '%-.64s' ¤ò ¥í¡¼¥É¤Ç¤¤Þ¤»¤ó", "function '%-.64s' ¤ò½é´ü²½¤Ç¤¤Þ¤»¤ó; %-.80s", @@ -145,11 +145,11 @@ character-set=ujis "Can't reopen table: '%-.64s'", "NULL ÃͤλÈÍÑÊýË¡¤¬ÉÔŬÀڤǤ¹", "Got error '%-.64s' from regexp", -"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", "¥æ¡¼¥¶¡¼ '%-.32s' (¥Û¥¹¥È '%-.64s' ¤Î¥æ¡¼¥¶¡¼) ¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó", "¥³¥Þ¥ó¥É %-.16s ¤Ï ¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s' ,¥Æ¡¼¥Ö¥ë '%-.64s' ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó", "¥³¥Þ¥ó¥É %-.16s ¤Ï ¥æ¡¼¥¶¡¼ '%-.32s'@'%-.64s'\n ¥«¥é¥à '%-.64s' ¥Æ¡¼¥Ö¥ë '%-.64s' ¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó", -"Illegal GRANT/REVOKE command. Please consult the manual which privleges can be used.", +"Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used.", "The host or user argument to GRANT is too long", "Table '%-.64s.%s' doesn't exist", "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", @@ -158,7 +158,7 @@ character-set=ujis "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", "Aborted connection %ld to db: '%-.64s' user: '%-.64s' (%s)", -"Got a packet bigger than 'max_allowed_packet'", +"Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", "Got packets out of order", @@ -167,7 +167,7 @@ character-set=ujis "Got timeout reading communication packets", "Got an error writing communication packets", "Got timeout writing communication packets", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", @@ -176,7 +176,7 @@ character-set=ujis "All tables in the MERGE table are not defined identically", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -202,23 +202,23 @@ character-set=ujis "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -226,50 +226,50 @@ character-set=ujis "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -277,13 +277,13 @@ character-set=ujis "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -299,7 +299,9 @@ character-set=ujis "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" "Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got NDB error %d '%-.100s'", "Got temporary NDB error %d '%-.100s'", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 132d4f121b2..a6e84fad01e 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -48,7 +48,7 @@ character-set=euckr "´ç½ÅÀÇ ÄÄÇ»ÅÍÀÇ È£½ºÆ®À̸§À» ¾òÀ» ¼ö ¾øÀ¾´Ï´Ù.", "Bad handshake", "'%-.32s'@'%-.64s' »ç¿ëÀÚ´Â '%-.64s' µ¥ÀÌŸº£À̽º¿¡ Á¢±ÙÀÌ °ÅºÎ µÇ¾ú½À´Ï´Ù.", -"'%-.32s'@'%-.64s' »ç¿ëÀÚ´Â Á¢±ÙÀÌ °ÅºÎ µÇ¾ú½À´Ï´Ù. (Using password: %s)", +"'%-.32s'@'%-.64s' »ç¿ëÀÚ´Â Á¢±ÙÀÌ °ÅºÎ µÇ¾ú½À´Ï´Ù. (using password: %s)", "¼±ÅÃµÈ µ¥ÀÌŸº£À̽º°¡ ¾ø½À´Ï´Ù.", "¸í·É¾î°¡ ¹ºÁö ¸ð¸£°Ú¾î¿ä...", "Ä®·³ '%-.64s'´Â ³Î(Null)ÀÌ µÇ¸é ¾ÈµË´Ï´Ù. ", @@ -123,7 +123,7 @@ character-set=euckr "Ä®·³ÀÌ ³Ê¹« ¸¹½À´Ï´Ù.", "³Ê¹« Å« row »çÀÌÁîÀÔ´Ï´Ù. BLOB¸¦ °è»êÇÏÁö ¾Ê°í ÃÖ´ë row »çÀÌÁî´Â %dÀÔ´Ï´Ù. ¾ó¸¶°£ÀÇ ÇʵåµéÀ» BLOB·Î ¹Ù²Ù¼Å¾ß °Ú±º¿ä..", "¾²·¹µå ½ºÅÃÀÌ ³ÑÃÆ½À´Ï´Ù. »ç¿ë: %ld°³ ½ºÅÃ: %ld°³. ¸¸¾à ÇÊ¿ä½Ã ´õÅ« ½ºÅÃÀ» ¿øÇÒ¶§¿¡´Â 'mysqld -O thread_stack=#' ¸¦ Á¤ÀÇÇϼ¼¿ä", -"Cross dependency found in OUTER JOIN. Examine your ON conditions", +"Cross dependency found in OUTER JOIN; examine your ON conditions", "'%-.64s' Ä®·³ÀÌ UNIQUE³ª INDEX¸¦ »ç¿ëÇÏ¿´Áö¸¸ NOT NULLÀÌ Á¤ÀǵÇÁö ¾Ê¾Ò±º¿ä...", "'%-.64s' ÇÔ¼ö¸¦ ·ÎµåÇÏÁö ¸øÇß½À´Ï´Ù.", "'%-.64s' ÇÔ¼ö¸¦ ÃʱâÈ ÇÏÁö ¸øÇß½À´Ï´Ù.; %-.80s", @@ -143,7 +143,7 @@ character-set=euckr "Å×À̺íÀ» ´Ù½Ã ¿¼ö ¾ø±º¿ä: '%-.64s", "NULL °ªÀ» À߸ø »ç¿ëÇϼ̱º¿ä...", "regexp¿¡¼ '%-.64s'°¡ ³µ½À´Ï´Ù.", -"Mixing of GROUP Ä®·³s (MIN(),MAX(),COUNT()...) with no GROUP Ä®·³s is illegal if there is no GROUP BY clause", +"Mixing of GROUP Ä®·³s (MIN(),MAX(),COUNT(),...) with no GROUP Ä®·³s is illegal if there is no GROUP BY clause", "»ç¿ëÀÚ '%-.32s' (È£½ºÆ® '%-.64s')¸¦ À§ÇÏ¿© Á¤ÀÇµÈ ±×·± ½ÂÀÎÀº ¾ø½À´Ï´Ù.", "'%-.16s' ¸í·ÉÀº ´ÙÀ½ »ç¿ëÀÚ¿¡°Ô °ÅºÎµÇ¾ú½À´Ï´Ù. : '%-.32s'@'%-.64s' for Å×À̺í '%-.64s'", "'%-.16s' ¸í·ÉÀº ´ÙÀ½ »ç¿ëÀÚ¿¡°Ô °ÅºÎµÇ¾ú½À´Ï´Ù. : '%-.32s'@'%-.64s' for Ä®·³ '%-.64s' in Å×À̺í '%-.64s'", @@ -165,7 +165,7 @@ character-set=euckr "Åë½Å ÆÐŶÀ» Àд Áß timeoutÀÌ ¹ß»ýÇÏ¿´½À´Ï´Ù.", "Åë½Å ÆÐŶÀ» ±â·ÏÇÏ´Â Áß ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.", "Åë½Å ÆÐÆÂÀ» ±â·ÏÇÏ´Â Áß timeoutÀÌ ¹ß»ýÇÏ¿´½À´Ï´Ù.", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", @@ -174,7 +174,7 @@ character-set=euckr "All tables in the MERGE table are not defined identically", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -200,23 +200,23 @@ character-set=euckr "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -224,50 +224,50 @@ character-set=euckr "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -275,13 +275,13 @@ character-set=euckr "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -296,8 +296,10 @@ character-set=euckr "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 0416c4be926..eaf7b3482ee 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -121,35 +121,35 @@ character-set=latin1 "A table must have at least 1 column", "The table '%-.64s' is full", "Unknown character set: '%-.64s'", -"Too many tables. MySQL can only use %d tables in a join", -"Too many fields", -"Too big row size. The maximum row size, not counting blobs, is %d. You have to change some fields to blobs", +"Too many tables; MySQL can only use %d tables in a join", +"Too many columns", +"Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs", "Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=#' to specify a bigger stack if needed", -"Cross dependency found in OUTER JOIN. Examine your ON conditions", +"Cross dependency found in OUTER JOIN; examine your ON conditions", "Column '%-.32s' is used with UNIQUE or INDEX but is not defined as NOT NULL", "Can't load function '%-.64s'", "Can't initialize function '%-.64s'; %-.80s", "No paths allowed for shared library", -"Function '%-.64s' already exist", +"Function '%-.64s' already exists", "Can't open shared library '%-.64s' (errno: %d %s)", "Can't find function '%-.64s' in library'", "Function '%-.64s' is not defined", -"Host '%-.64s' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'", +"Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", "Host '%-.64s' is not allowed to connect to this MySQL server", -"You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords", +"You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", "You must have privileges to update tables in the mysql database to be able to change passwords for others", "Can't find any matching row in the user table", "Rows matched: %ld Changed: %ld Warnings: %ld", -"Can't create a new thread (errno %d). If you are not out of available memory you can consult the manual for any possible OS dependent bug", +"Can't create a new thread (errno %d); if you are not out of available memory you can consult the manual for any possible OS dependent bug", "Column count doesn't match value count at row %ld", "Can't reopen table: '%-.64s", "Invalid use of NULL value", "Got error '%-.64s' from regexp", -"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", "There is no such grant defined for user '%-.32s' on host '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for table '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", -"Illegal GRANT/REVOKE command. Please consult the manual which privleges can be used.", +"%-.16s command denied to user '%-.32s'@'%-.64s' for table '%-.64s'", +"%-.16s command denied to user '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", +"Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used.", "The host or user argument to GRANT is too long", "Table '%-.64s.%s' doesn't exist", "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", @@ -158,7 +158,7 @@ character-set=latin1 "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", "Aborted connection %ld to db: '%-.64s' user: '%-.64s' (%s)", -"Got a packet bigger than 'max_allowed_packet'", +"Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", "Got packets out of order", @@ -167,7 +167,7 @@ character-set=latin1 "Got timeout reading communication packets", "Got an error writing communication packets", "Got timeout writing communication packets", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", @@ -176,7 +176,7 @@ character-set=latin1 "All tables in the MERGE table are not defined identically", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -202,23 +202,23 @@ character-set=latin1 "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -226,50 +226,50 @@ character-set=latin1 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -277,13 +277,13 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -298,8 +298,10 @@ character-set=latin1 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Mottok feil %d '%-.100s' fra %s", "Mottok temporary feil %d '%-.100s' fra %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index ef6c2ee05b2..692c10db58f 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -121,35 +121,35 @@ character-set=latin1 "A table must have at least 1 column", "The table '%-.64s' is full", "Unknown character set: '%-.64s'", -"Too many tables. MySQL can only use %d tables in a join", -"Too many fields", -"Too big row size. The maximum row size, not counting blobs, is %d. You have to change some fields to blobs", +"Too many tables; MySQL can only use %d tables in a join", +"Too many columns", +"Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs", "Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=#' to specify a bigger stack if needed", -"Cross dependency found in OUTER JOIN. Examine your ON conditions", +"Cross dependency found in OUTER JOIN; examine your ON conditions", "Column '%-.32s' is used with UNIQUE or INDEX but is not defined as NOT NULL", "Can't load function '%-.64s'", "Can't initialize function '%-.64s'; %-.80s", "No paths allowed for shared library", -"Function '%-.64s' already exist", +"Function '%-.64s' already exists", "Can't open shared library '%-.64s' (errno: %d %s)", "Can't find function '%-.64s' in library'", "Function '%-.64s' is not defined", -"Host '%-.64s' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'", +"Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", "Host '%-.64s' is not allowed to connect to this MySQL server", -"You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords", +"You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", "You must have privileges to update tables in the mysql database to be able to change passwords for others", "Can't find any matching row in the user table", "Rows matched: %ld Changed: %ld Warnings: %ld", -"Can't create a new thread (errno %d). If you are not out of available memory you can consult the manual for any possible OS dependent bug", +"Can't create a new thread (errno %d); if you are not out of available memory you can consult the manual for any possible OS dependent bug", "Column count doesn't match value count at row %ld", "Can't reopen table: '%-.64s", "Invalid use of NULL value", "Got error '%-.64s' from regexp", -"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", "There is no such grant defined for user '%-.32s' on host '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for table '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", -"Illegal GRANT/REVOKE command. Please consult the manual which privleges can be used.", +"%-.16s command denied to user '%-.32s'@'%-.64s' for table '%-.64s'", +"%-.16s command denied to user '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", +"Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used.", "The host or user argument to GRANT is too long", "Table '%-.64s.%s' doesn't exist", "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", @@ -158,7 +158,7 @@ character-set=latin1 "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", "Aborted connection %ld to db: '%-.64s' user: '%-.64s' (%s)", -"Got a packet bigger than 'max_allowed_packet'", +"Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", "Got packets out of order", @@ -167,7 +167,7 @@ character-set=latin1 "Got timeout reading communication packets", "Got an error writing communication packets", "Got timeout writing communication packets", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", @@ -176,7 +176,7 @@ character-set=latin1 "All tables in the MERGE table are not defined identically", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -202,23 +202,23 @@ character-set=latin1 "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -226,50 +226,50 @@ character-set=latin1 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -277,13 +277,13 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -298,8 +298,10 @@ character-set=latin1 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Mottok feil %d '%-.100s' fa %s", "Mottok temporary feil %d '%-.100s' fra %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 348c9a07b8c..19f2c1c6983 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -51,8 +51,8 @@ character-set=latin2 "Zbyt ma³o miejsca/pamiêci dla w?tku", "Nie mo¿na otrzymaæ nazwy hosta dla twojego adresu", "Z³y uchwyt(handshake)", -"Access denied for user: '%-.32s'@'%-.64s' to database '%-.64s'", -"Access denied for user: '%-.32s'@'%-.64s' (Using password: %s)", +"Access denied for user '%-.32s'@'%-.64s' to database '%-.64s'", +"Access denied for user '%-.32s'@'%-.64s' (using password: %s)", "Nie wybrano ¿adnej bazy danych", "Nieznana komenda", "Kolumna '%-.64s' nie mo¿e byæ null", @@ -114,8 +114,8 @@ character-set=latin2 "Operacja SELECT bêdzie dotyczy³a zbyt wielu rekordów i prawdopodobnie zajmie bardzo du¿o czasu. Sprawd¥ warunek WHERE i u¿yj SQL_OPTION BIG_SELECTS=1 je?li operacja SELECT jest poprawna", "Unknown error", "Unkown procedure %s", -"Wrong parameter count to procedure %s", -"Wrong parameters to procedure %s", +"Incorrect parameter count to procedure %s", +"Incorrect parameters to procedure %s", "Unknown table '%-.64s' in %s", "Field '%-.64s' specified twice", "Invalid use of group function", @@ -123,35 +123,35 @@ character-set=latin2 "A table must have at least 1 column", "The table '%-.64s' is full", "Unknown character set: '%-.64s'", -"Too many tables. MySQL can only use %d tables in a join", -"Too many fields", -"Too big row size. The maximum row size, not counting blobs, is %d. You have to change some fields to blobs", +"Too many tables; MySQL can only use %d tables in a join", +"Too many columns", +"Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs", "Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld -O thread_stack=#' to specify a bigger stack if needed", -"Cross dependency found in OUTER JOIN. Examine your ON conditions", +"Cross dependency found in OUTER JOIN; examine your ON conditions", "Column '%-.32s' is used with UNIQUE or INDEX but is not defined as NOT NULL", "Can't load function '%-.64s'", "Can't initialize function '%-.64s'; %-.80s", "No paths allowed for shared library", -"Function '%-.64s' already exist", +"Function '%-.64s' already exists", "Can't open shared library '%-.64s' (errno: %d %s)", "Can't find function '%-.64s' in library'", "Function '%-.64s' is not defined", -"Host '%-.64s' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'", +"Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", "Host '%-.64s' is not allowed to connect to this MySQL server", -"You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords", +"You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", "You must have privileges to update tables in the mysql database to be able to change passwords for others", "Can't find any matching row in the user table", "Rows matched: %ld Changed: %ld Warnings: %ld", -"Can't create a new thread (errno %d). If you are not out of available memory you can consult the manual for any possible OS dependent bug", +"Can't create a new thread (errno %d); if you are not out of available memory you can consult the manual for any possible OS dependent bug", "Column count doesn't match value count at row %ld", "Can't reopen table: '%-.64s", "Invalid use of NULL value", "Got error '%-.64s' from regexp", -"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", "There is no such grant defined for user '%-.32s' on host '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for table '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", -"Illegal GRANT/REVOKE command. Please consult the manual which privleges can be used.", +"%-.16s command denied to user '%-.32s'@'%-.64s' for table '%-.64s'", +"%-.16s command denied to user '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", +"Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used.", "The host or user argument to GRANT is too long", "Table '%-.64s.%s' doesn't exist", "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", @@ -160,7 +160,7 @@ character-set=latin2 "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", "Aborted connection %ld to db: '%-.64s' user: '%-.64s' (%s)", -"Got a packet bigger than 'max_allowed_packet'", +"Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", "Got packets out of order", @@ -169,7 +169,7 @@ character-set=latin2 "Got timeout reading communication packets", "Got an error writing communication packets", "Got timeout writing communication packets", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", @@ -178,7 +178,7 @@ character-set=latin2 "All tables in the MERGE table are not defined identically", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -204,23 +204,23 @@ character-set=latin2 "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -228,50 +228,50 @@ character-set=latin2 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -279,13 +279,13 @@ character-set=latin2 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -300,8 +300,10 @@ character-set=latin2 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 3fe753a71cc..c77d10d83de 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -78,7 +78,7 @@ character-set=latin1 "Chave especificada longa demais. O comprimento de chave máximo permitido é %d", "Coluna chave '%-.64s' não existe na tabela", "Coluna BLOB '%-.64s' não pode ser utilizada na especificação de chave para o tipo de tabela usado", -"Comprimento da coluna '%-.64s' grande demais (max = %d). Use BLOB em seu lugar", +"Comprimento da coluna '%-.64s' grande demais (max = %d); use BLOB em seu lugar", "Definição incorreta de tabela. Somente é permitido um único campo auto-incrementado e ele tem que ser definido como chave", "%s: Pronto para conexões\n", "%s: 'Shutdown' normal\n", @@ -94,7 +94,7 @@ character-set=latin1 "Registros: %ld - Deletados: %ld - Ignorados: %ld - Avisos: %ld", "Registros: %ld - Duplicados: %ld", "Sub parte da chave incorreta. A parte da chave usada não é uma 'string' ou o comprimento usado é maior que parte da chave ou o manipulador de tabelas não suporta sub chaves únicas", -"Você não pode deletar todas as colunas com ALTER TABLE. Use DROP TABLE em seu lugar", +"Você não pode deletar todas as colunas com ALTER TABLE; use DROP TABLE em seu lugar", "Não se pode fazer DROP '%-.64s'. Confira se esta coluna/chave existe", "Registros: %ld - Duplicados: %ld - Avisos: %ld", "You can't specify target table '%-.64s' for update in FROM clause", @@ -123,8 +123,8 @@ character-set=latin1 "Tabelas demais. O MySQL pode usar somente %d tabelas em uma junção (JOIN)", "Colunas demais", "Tamanho de linha grande demais. O máximo tamanho de linha, não contando BLOBs, é %d. Você tem que mudar alguns campos para BLOBs", -"Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld . Use 'mysqld -O thread_stack=#' para especificar uma pilha maior, se necessário", -"Dependência cruzada encontrada em junção externa (OUTER JOIN). Examine as condições utilizadas nas cláusulas 'ON'", +"Estouro da pilha do 'thread'. Usados %ld de uma pilha de %ld. Use 'mysqld -O thread_stack=#' para especificar uma pilha maior, se necessário", +"Dependência cruzada encontrada em junção externa (OUTER JOIN); examine as condições utilizadas nas cláusulas 'ON'", "Coluna '%-.64s' é usada com única (UNIQUE) ou índice (INDEX), mas não está definida como não-nula (NOT NULL)", "Não pode carregar a função '%-.64s'", "Não pode inicializar a função '%-.64s' - '%-.80s'", @@ -247,24 +247,24 @@ character-set=latin1 "Referência da chave e referência da tabela não coincidem", "Operand should contain %d column(s)", "Subconsulta retorna mais que 1 registro", -"Desconhecido manipulador de declaração preparado (%ld) determinado para %s", +"Desconhecido manipulador de declaração preparado (%.*s) determinado para %s", "Banco de dado de ajuda corrupto ou não existente", "Referência cíclica em subconsultas", "Convertendo coluna '%s' de %s para %s", "Referência '%-.64s' não suportada (%s)", "Cada tabela derivada deve ter seu próprio alias", "Select %u foi reduzido durante otimização", -"Tabela '%-.64s' de um dos SELECT's não pode ser usada em %-.32s", +"Tabela '%-.64s' de um dos SELECTs não pode ser usada em %-.32s", "Cliente não suporta o protocolo de autenticação exigido pelo servidor; considere a atualização do cliente MySQL", "Todas as partes de uma SPATIAL KEY devem ser NOT NULL", "COLLATION '%s' não é válida para CHARACTER SET '%s'", "O slave já está rodando", "O slave já está parado", "Tamanho muito grande dos dados des comprimidos. O máximo tamanho é %d. (provavelmente, o comprimento dos dados descomprimidos está corrupto)", -"Z_MEM_ERROR: Não suficiente memória disponível para zlib", -"Z_BUF_ERROR: Não suficiente espaço no buffer emissor para zlib (provavelmente, o comprimento dos dados descomprimidos está corrupto)", -"Z_DATA_ERROR: Dados de entrada está corrupto para zlib", -"%d linha(s) foi(foram) cortada(s) por group_concat()", +"ZLIB: Não suficiente memória disponível", +"ZLIB: Não suficiente espaço no buffer emissor (provavelmente, o comprimento dos dados descomprimidos está corrupto)", +"ZLIB: Dados de entrada está corrupto", +"%d linha(s) foram cortada(s) por GROUP_CONCAT()", "Conta de registro é menor que a conta de coluna na linha %ld", "Conta de registro é maior que a conta de coluna na linha %ld", "Dado truncado, NULL fornecido para NOT NULL coluna '%s' na linha %ld", @@ -302,3 +302,5 @@ character-set=latin1 "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index b013aa1f109..5ee4efd0063 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -111,7 +111,7 @@ character-set=latin2 "Coloana BLOB '%-.64s' nu poate avea o valoare default", "Numele bazei de date este incorect '%-.100s'", "Numele tabelei este incorect '%-.100s'", -"SELECT-ul ar examina prea multe cimpuri si probabil ar lua prea mult timp. Verifica clauza WHERE si foloseste SET SQL_BIG_SELECTS=1 daca SELECT-ul e ok", +"SELECT-ul ar examina prea multe cimpuri si probabil ar lua prea mult timp; verifica clauza WHERE si foloseste SET SQL_BIG_SELECTS=1 daca SELECT-ul e okay", "Eroare unknown", "Procedura unknown '%-.64s'", "Procedura '%-.64s' are un numar incorect de parametri", @@ -169,7 +169,7 @@ character-set=latin2 "Timeout obtinut citind pachetele de comunicatie (communication packets)", "Eroare in scrierea pachetelor de comunicatie (communication packets)", "Timeout obtinut scriind pachetele de comunicatie (communication packets)", -"Sirul rezultat este mai lung decit max_allowed_packet", +"Sirul rezultat este mai lung decit 'max_allowed_packet'", "Tipul de tabela folosit nu suporta coloane de tip BLOB/TEXT", "Tipul de tabela folosit nu suporta coloane de tip AUTO_INCREMENT", "INSERT DELAYED nu poate fi folosit cu tabela '%-.64s', deoarece este locked folosing LOCK TABLES", @@ -204,23 +204,23 @@ character-set=latin2 "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", -"This operation cannot be performed with a running slave, run STOP SLAVE first", -"This operation requires a running slave, configure slave and do START SLAVE", -"The server is not configured as slave, fix in config file or with CHANGE MASTER TO", -"Could not initialize master info structure, more error messages can be found in the MySQL error log", -"Could not create slave thread, check system resources", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -228,50 +228,50 @@ character-set=latin2 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -279,13 +279,13 @@ character-set=latin2 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -300,8 +300,10 @@ character-set=latin2 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 8ed8aa03efb..20188723f6d 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -244,32 +244,32 @@ character-set=koi8r "ðÏÌÕÞÅÎÁ ÎÅÉÓÐÒÁ×ÉÍÁÑ ÏÛÉÂËÁ %d: '%-.128s' ÏÔ ÇÏÌÏ×ÎÏÇÏ ÓÅÒ×ÅÒÁ × ÐÒÏÃÅÓÓÅ ×ÙÂÏÒËÉ ÄÁÎÎÙÈ ÉÚ Ä×ÏÉÞÎÏÇÏ ÖÕÒÎÁÌÁ", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "ïÐÅÒÁÎÄ ÄÏÌÖÅÎ ÓÏÄÅÒÖÁÔØ %d ËÏÌÏÎÏË", "ðÏÄÚÁÐÒÏÓ ×ÏÚ×ÒÁÝÁÅÔ ÂÏÌÅÅ ÏÄÎÏÊ ÚÁÐÉÓÉ", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "ãÉËÌÉÞÅÓËÁÑ ÓÓÙÌËÁ ÎÁ ÐÏÄÚÁÐÒÏÓ", "ðÒÅÏÂÒÁÚÏ×ÁÎÉÅ ÐÏÌÑ '%s' ÉÚ %s × %s", "óÓÙÌËÁ '%-.64s' ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔÓÑ (%s)", -"Every derived table must have it's own alias", +"Every derived table must have its own alias", "Select %u ÂÙÌ ÕÐÒÁÚÄÎÅÎ × ÐÒÏÃÅÓÓÅ ÏÐÔÉÍÉÚÁÃÉÉ", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -277,13 +277,13 @@ character-set=koi8r "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "óÅÒ×ÅÒ ÚÁÐÕÝÅÎ × ÒÅÖÉÍÅ --secure-auth (ÂÅÚÏÐÁÓÎÏÊ Á×ÔÏÒÉÚÁÃÉÉ), ÎÏ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%s'@'%s' ÐÁÒÏÌØ ÓÏÈÒÁÎ£Î × ÓÔÁÒÏÍ ÆÏÒÍÁÔÅ; ÎÅÏÂÈÏÄÉÍÏ ÏÂÎÏ×ÉÔØ ÆÏÒÍÁÔ ÐÁÒÏÌÑ", "ðÏÌÅ ÉÌÉ ÓÓÙÌËÁ '%-.64s%s%-.64s%s%-.64s' ÉÚ SELECTÁ #%d ÂÙÌÁ ÎÁÊÄÅÎÁ × SELECTÅ #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -298,8 +298,10 @@ character-set=koi8r "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 051417b6c3d..cc822431464 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -236,20 +236,20 @@ character-set=cp1250 "Mešanje tabela koje podržavaju transakcije i onih koje ne podržavaju transakcije je iskljuèeno", "Opcija '%s' je upotrebljena dva puta u istom iskazu", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", "Unknown prepared statement handler (%ld) given to %s", @@ -257,23 +257,23 @@ character-set=cp1250 "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", "Row %ld was truncated; it contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -281,13 +281,13 @@ character-set=cp1250 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -302,8 +302,10 @@ character-set=cp1250 "The MySQL server is running with the %s option so it cannot execute this statement" "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 274f5ffa428..ee6aac5081b 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -100,8 +100,8 @@ character-set=latin2 "Súbor '%-.64s' u¾ existuje", "Záznamov: %ld Zmazaných: %ld Preskoèených: %ld Varovania: %ld", "Záznamov: %ld Opakovaných: %ld", -"Wrong sub part key. The used key part isn't a string or the used length is longer than the key part", -"One nemô¾em zmaza» all fields with ALTER TABLE. Use DROP TABLE instead", +"Incorrect sub part key; the used key part isn't a string or the used length is longer than the key part", +"One nemô¾em zmaza» all fields with ALTER TABLE; use DROP TABLE instead", "Nemô¾em zru¹i» (DROP) '%-.64s'. Skontrolujte, èi neexistujú záznamy/kµúèe", "Záznamov: %ld Opakovaných: %ld Varovania: %ld", "You can't specify target table '%-.64s' for update in FROM clause", @@ -140,22 +140,22 @@ character-set=latin2 "Nemô¾em otvori» zdieµanú kni¾nicu '%-.64s' (chybový kód: %d %s)", "Nemô¾em nájs» funkciu '%-.64s' v kni¾nici'", "Funkcia '%-.64s' nie je definovaná", -"Host '%-.64s' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'", +"Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'", "Host '%-.64s' is not allowed to connect to this MySQL server", -"You are using MySQL as an anonymous users and anonymous users are not allowed to change passwords", +"You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords", "You must have privileges to update tables in the mysql database to be able to change passwords for others", "Can't find any matching row in the user table", "Rows matched: %ld Changed: %ld Warnings: %ld", -"Can't create a new thread (errno %d). If you are not out of available memory, you can consult the manual for a possible OS-dependent bug", +"Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug", "Column count doesn't match value count at row %ld", "Can't reopen table: '%-.64s", "Invalid use of NULL value", "Got error '%-.64s' from regexp", -"Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", "There is no such grant defined for user '%-.32s' on host '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for table '%-.64s'", -"%-.16s command denied to user: '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", -"Illegal GRANT/REVOKE command. Please consult the manual which privleges can be used.", +"%-.16s command denied to user '%-.32s'@'%-.64s' for table '%-.64s'", +"%-.16s command denied to user '%-.32s'@'%-.64s' for column '%-.64s' in table '%-.64s'", +"Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used.", "The host or user argument to GRANT is too long", "Table '%-.64s.%s' doesn't exist", "There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", @@ -164,7 +164,7 @@ character-set=latin2 "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", "Aborted connection %ld to db: '%-.64s' user: '%-.64s' (%s)", -"Got a packet bigger than 'max_allowed_packet'", +"Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", "Got packets out of order", @@ -173,7 +173,7 @@ character-set=latin2 "Got timeout reading communication packets", "Got an error writing communication packets", "Got timeout writing communication packets", -"Result string is longer than max_allowed_packet", +"Result string is longer than 'max_allowed_packet' bytes", "The used table type doesn't support BLOB/TEXT columns", "The used table type doesn't support AUTO_INCREMENT columns", "INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", @@ -182,7 +182,7 @@ character-set=latin2 "All tables in the MERGE table are not defined identically", "Can't write, because of unique constraint, to table '%-.64s'", "BLOB column '%-.64s' used in key specification without a key length", -"All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", "Result consisted of more than one row", "This table type requires a primary key", "This version of MySQL is not compiled with RAID support", @@ -208,7 +208,7 @@ character-set=latin2 "Table '%-.64s' is marked as crashed and should be repaired", "Table '%-.64s' is marked as crashed and last (automatic?) repair failed", "Some non-transactional changed tables couldn't be rolled back", -"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage. Increase this mysqld variable and try again", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", "This operation cannot be performed with a running slave, run STOP SLAVE first", "This operation requires a running slave, configure slave and do START SLAVE", "The server is not configured as slave, fix in config file or with CHANGE MASTER TO", @@ -216,15 +216,15 @@ character-set=latin2 "Could not create slave thread, check system resources", "User %-.64s has already more than 'max_user_connections' active connections", "You may only use constant expressions with SET", -"Lock wait timeout exceeded", +"Lock wait timeout exceeded; try restarting transaction", "The total number of locks exceeds the lock table size", "Update locks cannot be acquired during a READ UNCOMMITTED transaction", "DROP DATABASE not allowed while thread is holding global read lock", "CREATE DATABASE not allowed while thread is holding global read lock", -"Wrong arguments to %s", +"Incorrect arguments to %s", "'%-.32s'@'%-.64s' is not allowed to create new users", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "The used table type doesn't support FULLTEXT indexes", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -232,50 +232,50 @@ character-set=latin2 "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "Operand should contain %d column(s)", "Subquery returns more than 1 row", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "Cyclic reference on subqueries", "Converting column '%s' from %s to %s", "Reference '%-.64s' not supported (%s)", -"Every derived table must have it's own alias", -"Select %u was reduced during optimisation", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -283,13 +283,13 @@ character-set=latin2 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -304,8 +304,10 @@ character-set=latin2 "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index 5e3007d2b4e..483ec7068a2 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -125,7 +125,7 @@ character-set=latin1 "Muchos campos", "Tamaño de línea muy grande. Máximo tamaño de línea, no contando blob, es %d. Tu tienes que cambiar algunos campos para blob", "Sobrecarga de la pila de thread: Usada: %ld de una %ld pila. Use 'mysqld -O thread_stack=#' para especificar una mayor pila si necesario", -"Dependencia cruzada encontrada en OUTER JOIN. Examine su condición ON", +"Dependencia cruzada encontrada en OUTER JOIN; examine su condición ON", "Columna '%-.32s' es usada con UNIQUE o INDEX pero no está definida como NOT NULL", "No puedo cargar función '%-.64s'", "No puedo inicializar función '%-.64s'; %-.80s", @@ -167,7 +167,7 @@ character-set=latin1 "Obtenido timeout leyendo paquetes de comunicación", "Obtenido un error de escribiendo paquetes de comunicación", "Obtenido timeout escribiendo paquetes de comunicación", -"La string resultante es mayor que max_allowed_packet", +"La string resultante es mayor que 'max_allowed_packet'", "El tipo de tabla usada no permite soporte para columnas BLOB/TEXT", "El tipo de tabla usada no permite soporte para columnas AUTO_INCREMENT", "INSERT DELAYED no puede ser usado con tablas '%-.64s', porque esta bloqueada con LOCK TABLES", @@ -248,7 +248,7 @@ character-set=latin1 "Referencia de llave y referencia de tabla no coinciden", "Operando debe tener %d columna(s)", "Subconsulta retorna mas que 1 línea", -"Desconocido preparado comando handler (%ld) dado para %s", +"Desconocido preparado comando handler (%.*s) dado para %s", "Base de datos Help está corrupto o no existe", "Cíclica referencia en subconsultas", "Convirtiendo columna '%s' de %s para %s", @@ -257,15 +257,15 @@ character-set=latin1 "Select %u fué reducido durante optimización", "Tabla '%-.64s' de uno de los SELECT no puede ser usada en %-.32s", "Cliente no soporta protocolo de autenticación solicitado por el servidor; considere actualizar el cliente MySQL", -"Todas las partes de una SPATIAL KEY deben ser NOT NULL", +"Todas las partes de una SPATIAL index deben ser NOT NULL", "COLLATION '%s' no es válido para CHARACTER SET '%s'", "Slave ya está funcionando", "Slave ya fué parado", "Tamaño demasiado grande para datos descomprimidos. El máximo tamaño es %d. (probablemente, extensión de datos descomprimidos fué corrompida)", -"Z_MEM_ERROR: No suficiente memoria para zlib", -"Z_BUF_ERROR: No suficiente espacio en el búfer de salida para zlib (probablemente, extensión de datos descomprimidos fué corrompida)", -"Z_DATA_ERROR: Dato de entrada fué corrompido para zlib", -"%d línea(s) fue(fueron) cortadas por group_concat()", +"ZLIB: No suficiente memoria", +"ZLIB: No suficiente espacio en el búfer de salida (probablemente, extensión de datos descomprimidos fué corrompida)", +"ZLIB: Dato de entrada fué corrompido", +"%d línea(s) fueron cortadas por GROUP_CONCAT()", "Línea %ld no contiene datos para todas las columnas", "Línea %ld fué truncada; La misma contine mas datos que las que existen en las columnas de entrada", "Datos truncado, NULL suministrado para NOT NULL columna '%s' en la línea %ld", @@ -303,3 +303,5 @@ character-set=latin1 "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 516e53fe34d..d9f3adf92d4 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -165,7 +165,7 @@ character-set=latin1 "Fick 'timeout' vid läsning från klienten", "Fick ett fel vid skrivning till klienten", "Fick 'timeout' vid skrivning till klienten", -"Resultatsträngen är längre än max_allowed_packet", +"Resultatsträngen är längre än 'max_allowed_packet'", "Den använda tabelltypen kan inte hantera BLOB/TEXT-kolumner", "Den använda tabelltypen kan inte hantera AUTO_INCREMENT-kolumner", "INSERT DELAYED kan inte användas med tabell '%-.64s', emedan den är låst med LOCK TABLES", @@ -246,7 +246,7 @@ character-set=latin1 "Nyckelreferensen och tabellreferensen stämmer inte överens", "Operand should contain %d column(s)", "Subquery returnerade mer än 1 rad", -"Okänd PREPARED STATEMENT id (%ld) var given till %s", +"Okänd PREPARED STATEMENT id (%.*s) var given till %s", "Hjälpdatabasen finns inte eller är skadad", "Cyklisk referens i subqueries", "Konvertar kolumn '%s' från %s till %s", @@ -255,19 +255,19 @@ character-set=latin1 "Select %u reducerades vid optimiering", "Tabell '%-.64s' från en SELECT kan inte användas i %-.32s", "Klienten stöder inte autentiseringsprotokollet som begärts av servern; överväg uppgradering av klientprogrammet.", -"Alla delar av en SPATIAL KEY måste vara NOT NULL", +"Alla delar av en SPATIAL index måste vara NOT NULL", "COLLATION '%s' är inte tillåtet för CHARACTER SET '%s'", "Slaven har redan startat", "Slaven har redan stoppat", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d rad(er) kapades av group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d rad(er) kapades av GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Använder handler %s för tabell '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -275,13 +275,13 @@ character-set=latin1 "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Felaktigt index namn '%-.100s'", "Felaktigt katalog namn '%-.100s'", @@ -296,8 +296,10 @@ character-set=latin1 "MySQL är startad med --skip-grant-tables. Pga av detta kan du inte använda detta kommando", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Fick felkod %d '%-.100s' från %s", "Fick tilfällig felkod %d '%-.100s' från %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index cf81afa8a5b..acf6f5121e8 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -161,7 +161,7 @@ character-set=koi8u "ç¦ÌËÁ ÄÌÑ INSERT DELAYED ÎÅ ÍÏÖÅ ÏÔÒÉÍÁÔÉ ÂÌÏËÕ×ÁÎÎÑ ÄÌÑ ÔÁÂÌÉæ %-.64s", "úÁÂÁÇÁÔÏ ÚÁÔÒÉÍÁÎÉÈ Ç¦ÌÏË ×ÉËÏÒÉÓÔÏ×Õ¤ÔØÓÑ", "ðÅÒÅÒ×ÁÎÏ Ú'¤ÄÎÁÎÎÑ %ld ÄÏ ÂÁÚÉ ÄÁÎÎÉÈ: '%-.64s' ËÏÒÉÓÔÕ×ÁÞÁ: '%-.32s' (%-.64s)", -"ïÔÒÉÍÁÎÏ ÐÁËÅÔ Â¦ÌØÛÉÊ Î¦Ö max_allowed_packet", +"ïÔÒÉÍÁÎÏ ÐÁËÅÔ Â¦ÌØÛÉÊ Î¦Ö 'max_allowed_packet'", "ïÔÒÉÍÁÎÏ ÐÏÍÉÌËÕ ÞÉÔÁÎÎÑ Ú ËÏÍÕΦËÁæÊÎÏÇÏ ËÁÎÁÌÕ", "ïÔÒÉÍÁÎÏ ÐÏÍÉÌËËÕ ×¦Ä fcntl()", "ïÔÒÉÍÁÎÏ ÐÁËÅÔÉ Õ ÎÅÎÁÌÅÖÎÏÍÕ ÐÏÒÑÄËÕ", @@ -170,7 +170,7 @@ character-set=koi8u "ïÔÒÉÍÁÎÏ ÚÁÔÒÉÍËÕ ÞÉÔÁÎÎÑ ËÏÍÕΦËÁæÊÎÉÈ ÐÁËÅÔ¦×", "ïÔÒÉÍÁÎÏ ÐÏÍÉÌËÕ ÚÁÐÉÓÕ ËÏÍÕΦËÁæÊÎÉÈ ÐÁËÅÔ¦×", "ïÔÒÉÍÁÎÏ ÚÁÔÒÉÍËÕ ÚÁÐÉÓÕ ËÏÍÕΦËÁæÊÎÉÈ ÐÁËÅÔ¦×", -"óÔÒÏËÁ ÒÅÚÕÌØÔÁÔÕ ÄÏ×ÛÁ Î¦Ö max_allowed_packet", +"óÔÒÏËÁ ÒÅÚÕÌØÔÁÔÕ ÄÏ×ÛÁ Î¦Ö 'max_allowed_packet'", "÷ÉËÏÒÉÓÔÁÎÉÊ ÔÉÐ ÔÁÂÌÉæ ΊЦÄÔÒÉÍÕ¤ BLOB/TEXT ÓÔÏ×Âæ", "÷ÉËÏÒÉÓÔÁÎÉÊ ÔÉÐ ÔÁÂÌÉæ ΊЦÄÔÒÉÍÕ¤ AUTO_INCREMENT ÓÔÏ×Âæ", "INSERT DELAYED ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÏ Ú ÔÁÂÌÉÃÅÀ '%-.64s', ÔÏÍÕ ÝÏ §§ ÚÁÂÌÏËÏ×ÁÎÏ Ú LOCK TABLES", @@ -221,7 +221,7 @@ character-set=koi8u "èÉÂÎÉÊ ÁÒÇÕÍÅÎÔ ÄÌÑ %s", "ëÏÒÉÓÔÕ×ÁÞÕ '%-.32s'@'%-.64s' ÎÅ ÄÏÚ×ÏÌÅÎÏ ÓÔ×ÏÒÀ×ÁÔÉ ÎÏ×ÉÈ ËÏÒÉÓÔÕ×ÁÞ¦×", "Incorrect table definition; all MERGE tables must be in the same database", -"Deadlock found when trying to get lock; Try restarting transaction", +"Deadlock found when trying to get lock; try restarting transaction", "÷ÉËÏÒÉÓÔÁÎÉÊ ÔÉÐ ÔÁÂÌÉæ ΊЦÄÔÒÉÍÕ¤ FULLTEXT ¦ÎÄÅËÓ¦×", "Cannot add foreign key constraint", "Cannot add a child row: a foreign key constraint fails", @@ -229,50 +229,50 @@ character-set=koi8u "Error connecting to master: %-.128s", "Error running query on master: %-.128s", "Error when executing command %s: %-.128s", -"Wrong usage of %s and %s", +"Incorrect usage of %s and %s", "The used SELECT statements have a different number of columns", "Can't execute the query because you have a conflicting read lock", "Mixing of transactional and non-transactional tables is disabled", "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", -"Access denied. You need the %-.128s privilege for this operation", +"Access denied; you need the %-.128s privilege for this operation", "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", -"Wrong argument type to variable '%-.64s'", +"Incorrect argument type to variable '%-.64s'", "Variable '%-.64s' can only be set, not read", -"Wrong usage/placement of '%s'", +"Incorrect usage/placement of '%s'", "This version of MySQL doesn't yet support '%s'", "Got fatal error %d: '%-.128s' from master when reading data from binary log", "Slave SQL thread ignored the query because of replicate-*-table rules", "Variable '%-.64s' is a %s variable", -"Wrong foreign key definition for '%-.64s': %s", -"Key reference and table reference doesn't match", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", "ïÐÅÒÁÎÄ ÍÁ¤ ÓËÌÁÄÁÔÉÓÑ Ú %d ÓÔÏ×Âæ×", "ð¦ÄÚÁÐÉÔ ÐÏ×ÅÒÔÁ¤ Â¦ÌØÛ ÎiÖ 1 ÚÁÐÉÓ", -"Unknown prepared statement handler (%ld) given to %s", +"Unknown prepared statement handler (%.*s) given to %s", "Help database is corrupt or does not exist", "ãÉË̦ÞÎÅ ÐÏÓÉÌÁÎÎÑ ÎÁ ЦÄÚÁÐÉÔ", "ðÅÒÅÔ×ÏÒÅÎÎÑ ÓÔÏ×ÂÃÁ '%s' Ú %s Õ %s", "ðÏÓÉÌÁÎÎÑ '%-.64s' ÎÅ ÐiÄÔÒÉÍÕÅÔÓÑ (%s)", -"Every derived table must have it's own alias", +"Every derived table must have its own alias", "Select %u was ÓËÁÓÏ×ÁÎÏ ÐÒÉ ÏÐÔÉÍiÚÁÃii", -"Table '%-.64s' from one of SELECT's can not be used in %-.32s", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", "Client does not support authentication protocol requested by server; consider upgrading MySQL client", -"All parts of a SPATIAL KEY must be NOT NULL", +"All parts of a SPATIAL index must be NOT NULL", "COLLATION '%s' is not valid for CHARACTER SET '%s'", "Slave is already running", "Slave has already been stopped", -"Too big size of uncompressed data. The maximum size is %d. (probably, length of uncompressed data was corrupted)", -"Z_MEM_ERROR: Not enough memory available for zlib", -"Z_BUF_ERROR: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"Z_DATA_ERROR: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", "Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there were input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", @@ -280,13 +280,13 @@ character-set=koi8u "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", "Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later when MySQL slave with SSL will be started", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", "óÔÏ×ÂÅÃØ ÁÂÏ ÐÏÓÉÌÁÎÎÑ '%-.64s%s%-.64s%s%-.64s' ¦Ú SELECTÕ #%d ÂÕÌÏ ÚÎÁÊÄÅÎÅ Õ SELECT¦ #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", "SQL thread is not to be started so UNTIL options are ignored", "Incorrect index name '%-.100s'", "Incorrect catalog name '%-.100s'", @@ -301,8 +301,10 @@ character-set=koi8u "The MySQL server is running with the %s option so it cannot execute this statement", "Column '%-.100s' has duplicated value '%-.64s' in %s" "Truncated wrong %-.32s value: '%-.128s'" -"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" -"Invalid ON UPDATE clause for '%-.64s' field", +"Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", "This command is not supported in the prepared statement protocol yet", "Got error %d '%-.100s' from %s", "Got temporary error %d '%-.100s' from %s", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", diff --git a/sql/slave.cc b/sql/slave.cc index a9b598d73db..7e46fb81053 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1248,7 +1248,30 @@ be equal for replication to work"; mysql_free_result(master_res); } - /* Add a timezones check here */ + /* + Perform analogous check for time zone. Theoretically we also should + perform check here to verify that SYSTEM time zones are the same on + slave and master, but we can't rely on value of @@system_time_zone + variable (it is time zone abbreviation) since it determined at start + time and so could differ for slave and master even if they are really + in the same system time zone. So we are omiting this check and just + relying on documentation. Also according to Monty there are many users + who are using replication between servers in various time zones. Hence + such check will broke everything for them. (And now everything will + work for them because by default both their master and slave will have + 'SYSTEM' time zone). + */ + if (!mysql_real_query(mysql, "SELECT @@GLOBAL.TIME_ZONE", 25) && + (master_res= mysql_store_result(mysql))) + { + if ((master_row= mysql_fetch_row(master_res)) && + strcmp(master_row[0], + global_system_variables.time_zone->get_name()->ptr())) + errmsg= "The slave I/O thread stops because master and slave have \ +different values for the TIME_ZONE global variable. The values must \ +be equal for replication to work"; + mysql_free_result(master_res); + } if (errmsg) { @@ -2516,7 +2539,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) DBUG_ENTER("init_slave_thread"); thd->system_thread = (thd_type == SLAVE_THD_SQL) ? SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO; - thd->bootstrap= 1; thd->host_or_ip= ""; thd->client_capabilities = 0; my_net_init(&thd->net, 0); @@ -3540,7 +3562,6 @@ err: static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev) { - int return_val= 1; DBUG_ENTER("process_io_rotate"); safe_mutex_assert_owner(&mi->data_lock); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ec018a8d296..a03e371dd63 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2820,7 +2820,7 @@ bool check_grant_all_columns(THD *thd, ulong want_access, TABLE *table) if (table->grant.version != grant_version) { table->grant.grant_table= - table_hash_search(thd->host,thd->ip,thd->db, + table_hash_search(thd->host, thd->ip, table->table_cache_key, thd->priv_user, table->real_name,0); /* purecov: inspected */ table->grant.version=grant_version; /* purecov: inspected */ @@ -2933,7 +2933,7 @@ ulong get_column_grant(THD *thd, TABLE_LIST *table, Field *field) if (table->grant.version != grant_version) { table->grant.grant_table= - table_hash_search(thd->host,thd->ip,thd->db, + table_hash_search(thd->host, thd->ip, table->db, thd->priv_user, table->real_name,0); /* purecov: inspected */ table->grant.version=grant_version; /* purecov: inspected */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e3fbfb2d0e3..f705b592e5a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1760,6 +1760,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db, } tmp_table->reginfo.lock_type=TL_WRITE; // Simulate locked + tmp_table->in_use= thd; tmp_table->tmp_table = (tmp_table->file->has_transactions() ? TRANSACTIONAL_TMP_TABLE : TMP_TABLE); tmp_table->table_cache_key=(char*) (tmp_table+1); @@ -2184,8 +2185,19 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, !((Item_field*) item)->field) { uint elem= fields.elements; - if (insert_fields(thd,tables,((Item_field*) item)->db_name, - ((Item_field*) item)->table_name, &it)) + Item_subselect *subsel= thd->lex->current_select->master_unit()->item; + if (subsel && + subsel->substype() == Item_subselect::EXISTS_SUBS) + { + /* + It is EXISTS(SELECT * ...) and we can replace * by any constant. + + Item_int do not need fix_fields() because it is basic constant. + */ + it.replace(new Item_int("Not_used", (longlong) 1, 21)); + } + else if (insert_fields(thd,tables,((Item_field*) item)->db_name, + ((Item_field*) item)->table_name, &it)) { if (stmt) thd->restore_backup_item_arena(stmt, &backup); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 4a5a41c4b40..5fe21d79aa0 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -786,6 +786,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags.collation_connection_num= thd->variables.collation_connection->number; flags.limit= thd->variables.select_limit; + flags.time_zone= thd->variables.time_zone; STRUCT_LOCK(&structure_guard_mutex); if (query_cache_size == 0) @@ -972,6 +973,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) UINT_MAX); flags.collation_connection_num= thd->variables.collation_connection->number; flags.limit= thd->variables.select_limit; + flags.time_zone= thd->variables.time_zone; memcpy((void *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)), &flags, QUERY_CACHE_FLAGS_SIZE); query_block = (Query_cache_block *) hash_search(&queries, (byte*) sql, @@ -3231,9 +3233,10 @@ void Query_cache::queries_dump() Query_cache_query_flags flags; memcpy(&flags, str+len, QUERY_CACHE_FLAGS_SIZE); str[len]= 0; // make zero ending DB name - DBUG_PRINT("qcache", ("F:%u C:%u L:%lu (%u) '%s' '%s'", + DBUG_PRINT("qcache", ("F:%u C:%u L:%lu T:'%s' (%u) '%s' '%s'", flags.client_long_flag, - flags.character_set_client_num, (ulong)flags.limit, + flags.character_set_client_num, + (ulong)flags.limit, flags.time_zone->get_name(), len, str, strend(str)+1)); DBUG_PRINT("qcache", ("-b- 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx", (ulong) block, (ulong) block->next, (ulong) block->prev, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 3ee9bd609a2..7aa3bbbdd7b 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -78,7 +78,6 @@ extern "C" void free_user_var(user_var_entry *entry) my_free((char*) entry,MYF(0)); } - bool key_part_spec::operator==(const key_part_spec& other) const { return length == other.length && !strcmp(field_name, other.field_name); @@ -158,12 +157,13 @@ bool foreign_key_prefix(Key *a, Key *b) THD::THD():user_time(0), current_statement(0), is_fatal_error(0), last_insert_id_used(0), - insert_id_used(0), rand_used(0), in_lock_tables(0), - global_read_lock(0), bootstrap(0) + insert_id_used(0), rand_used(0), time_zone_used(0), + in_lock_tables(0), global_read_lock(0), bootstrap(0) { host= user= priv_user= db= ip=0; host_or_ip= "connecting host"; - locked=killed=some_tables_deleted=no_errors=password= 0; + locked=some_tables_deleted=no_errors=password= 0; + killed=0; query_start_used= 0; count_cuted_fields= CHECK_FIELD_IGNORE; db_length= col_access= 0; @@ -1302,6 +1302,7 @@ Statement::Statement(THD *thd) query_length(0), free_list(0) { + name.str= NULL; init_sql_alloc(&mem_root, thd->variables.query_alloc_block_size, thd->variables.query_prealloc_size); @@ -1385,17 +1386,52 @@ static void delete_statement_as_hash_key(void *key) delete (Statement *) key; } +static byte *get_stmt_name_hash_key(Statement *entry, uint *length, + my_bool not_used __attribute__((unused))) +{ + *length=(uint) entry->name.length; + return (byte*) entry->name.str; +} + C_MODE_END Statement_map::Statement_map() : last_found_statement(0) { - enum { START_HASH_SIZE = 16 }; - hash_init(&st_hash, default_charset_info, START_HASH_SIZE, 0, 0, + enum + { + START_STMT_HASH_SIZE = 16, + START_NAME_HASH_SIZE = 16 + }; + hash_init(&st_hash, default_charset_info, START_STMT_HASH_SIZE, 0, 0, get_statement_id_as_hash_key, delete_statement_as_hash_key, MYF(0)); + hash_init(&names_hash, &my_charset_bin, START_NAME_HASH_SIZE, 0, 0, + (hash_get_key) get_stmt_name_hash_key, + NULL,MYF(0)); } +int Statement_map::insert(Statement *statement) +{ + int rc= my_hash_insert(&st_hash, (byte *) statement); + if (rc == 0) + last_found_statement= statement; + if (statement->name.str) + { + /* + If there is a statement with the same name, remove it. It is ok to + remove old and fail to insert new one at the same time. + */ + Statement *old_stmt; + if ((old_stmt= find_by_name(&statement->name))) + erase(old_stmt); + if ((rc= my_hash_insert(&names_hash, (byte*)statement))) + hash_delete(&st_hash, (byte*)statement); + } + return rc; +} + + bool select_dumpvar::send_data(List<Item> &items) { List_iterator_fast<Item_func_set_user_var> li(vars); diff --git a/sql/sql_class.h b/sql/sql_class.h index 867d3f49840..01387e28402 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -405,6 +405,8 @@ struct system_variables CHARSET_INFO *collation_database; CHARSET_INFO *collation_connection; + Time_zone *time_zone; + /* DATE, DATETIME and TIME formats */ DATE_TIME_FORMAT *date_format; DATE_TIME_FORMAT *datetime_format; @@ -461,6 +463,7 @@ public: */ bool allow_sum_func; + LEX_STRING name; /* name for named prepared statements */ LEX *lex; // parse tree descriptor /* Points to the query associated with this statement. It's const, but @@ -527,8 +530,14 @@ public: /* - Used to seek all existing statements in the connection - Deletes all statements in destructor. + Container for all statements created/used in a connection. + Statements in Statement_map have unique Statement::id (guaranteed by id + assignment in Statement::Statement) + Non-empty statement names are unique too: attempt to insert a new statement + with duplicate name causes older statement to be deleted + + Statements are auto-deleted when they are removed from the map and when the + map is deleted. */ class Statement_map @@ -536,34 +545,47 @@ class Statement_map public: Statement_map(); - int insert(Statement *statement) + int insert(Statement *statement); + + Statement *find_by_name(LEX_STRING *name) { - int rc= my_hash_insert(&st_hash, (byte *) statement); - if (rc == 0) - last_found_statement= statement; - return rc; + Statement *stmt; + stmt= (Statement*)hash_search(&names_hash, (byte*)name->str, + name->length); + return stmt; } Statement *find(ulong id) { if (last_found_statement == 0 || id != last_found_statement->id) - last_found_statement= (Statement *) hash_search(&st_hash, (byte *) &id, - sizeof(id)); + { + Statement *stmt; + stmt= (Statement *) hash_search(&st_hash, (byte *) &id, sizeof(id)); + if (stmt && stmt->name.str) + return NULL; + last_found_statement= stmt; + } return last_found_statement; } void erase(Statement *statement) { if (statement == last_found_statement) last_found_statement= 0; + if (statement->name.str) + { + hash_delete(&names_hash, (byte *) statement); + } hash_delete(&st_hash, (byte *) statement); } ~Statement_map() { hash_free(&st_hash); + hash_free(&names_hash); } private: HASH st_hash; + HASH names_hash; Statement *last_found_statement; }; @@ -806,6 +828,7 @@ public: bool last_cuted_field; bool no_errors, password, is_fatal_error; bool query_start_used,last_insert_id_used,insert_id_used,rand_used; + bool time_zone_used; bool in_lock_tables,global_read_lock; bool query_error, bootstrap, cleanup_done; bool tmp_table_used; diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 48c355b6cd9..9db2198268a 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -358,15 +358,25 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { error= -1; my_error(ER_DB_DROP_EXISTS,MYF(0),db); + goto exit; } else - { push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_DB_DROP_EXISTS, ER(ER_DB_DROP_EXISTS), db); - if (!silent) - send_ok(thd,0); + } + else + { + pthread_mutex_lock(&LOCK_open); + remove_db_from_cache(db); + pthread_mutex_unlock(&LOCK_open); + + error= -1; + if ((deleted= mysql_rm_known_files(thd, dirp, db, path, 0)) >= 0) + { + ha_drop_database(path); + query_cache_invalidate1(db); + error = 0; } - goto exit; } if (lower_case_table_names) { @@ -375,42 +385,30 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) my_casedn_str(files_charset_info, tmp_db); db= tmp_db; } - - pthread_mutex_lock(&LOCK_open); - remove_db_from_cache(db); - pthread_mutex_unlock(&LOCK_open); - - error = -1; - if ((deleted=mysql_rm_known_files(thd, dirp, db, path,0)) >= 0 && thd) + if (!silent && deleted>=0 && thd) { - ha_drop_database(path); - query_cache_invalidate1(db); - if (!silent) + const char *query; + ulong query_length; + if (!thd->query) { - const char *query; - ulong query_length; - if (!thd->query) - { - /* The client used the old obsolete mysql_drop_db() call */ - query= path; - query_length = (uint) (strxmov(path,"drop database `", db, "`", - NullS)- path); - } - else - { - query=thd->query; - query_length=thd->query_length; - } - mysql_update_log.write(thd, query, query_length); - if (mysql_bin_log.is_open()) - { - Query_log_event qinfo(thd, query, query_length, 0); - thd->clear_error(); - mysql_bin_log.write(&qinfo); - } - send_ok(thd,(ulong) deleted); + /* The client used the old obsolete mysql_drop_db() call */ + query= path; + query_length= (uint) (strxmov(path, "drop database `", db, "`", + NullS) - path); + } + else + { + query =thd->query; + query_length= thd->query_length; + } + mysql_update_log.write(thd, query, query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, query, query_length, 0); + thd->clear_error(); + mysql_bin_log.write(&qinfo); } - error = 0; + send_ok(thd, (ulong) deleted); } exit: diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 2ee880e79e7..b76bad2805b 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -200,7 +200,15 @@ cleanup: delete select; transactional_table= table->file->has_transactions(); log_delayed= (transactional_table || table->tmp_table); - if (deleted && (error <= 0 || !transactional_table)) + /* + We write to the binary log even if we deleted no row, because maybe the + user is using this command to ensure that a table is clean on master *and + on slave*. Think of the case of a user having played separately with the + master's table and slave's table and wanting to take a fresh identical + start now. + error < 0 means "really no error". error <= 0 means "maybe some error". + */ + if ((deleted || (error < 0)) && (error <= 0 || !transactional_table)) { mysql_update_log.write(thd,thd->query, thd->query_length); if (mysql_bin_log.is_open()) @@ -544,6 +552,8 @@ bool multi_delete::send_eof() rows and we succeeded, or also in an error case when there was a non-transaction-safe table involved, since modifications in it cannot be rolled back. + Note that if we deleted nothing we don't write to the binlog (TODO: + fix this). */ if (deleted && (error <= 0 || normal_tables)) { diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 2e2ad6786fc..01459d3fc7a 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -117,7 +117,6 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, select_union *derived_result; bool is_union= first_select->next_select() && first_select->next_select()->linkage == UNION_TYPE; - bool is_subsel= first_select->first_inner_unit() ? 1: 0; SELECT_LEX *save_current_select= lex->current_select; DBUG_ENTER("mysql_derived"); diff --git a/sql/sql_help.cc b/sql/sql_help.cc index de5509cff5d..eabe66d33bf 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -591,7 +591,7 @@ 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()), - (char*) "\\"); + new Item_string("\\",1,&my_charset_latin1)); if (thd->is_fatal_error) return 0; // OOM return prepare_simple_select(thd,cond,tables,table,error); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b5abb3b632d..a946dec4f35 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -945,6 +945,10 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) /* _rowid is not used with delayed insert */ copy->rowid_field=0; + + /* Adjust in_use for pointing to client thread */ + copy->in_use= client_thd; + return copy; /* Got fatal error */ diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index f98a6b43846..b6cb61fe10e 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -42,13 +42,6 @@ pthread_key(LEX*,THR_LEX); #define TOCK_NAME_LENGTH 24 /* - Map to default keyword characters. This is used to test if an identifer - is 'simple', in which case we don't have to do any character set conversions - on it -*/ -uchar *bin_ident_map= my_charset_bin.ident_map; - -/* The following data is based on the latin1 character set, and is only used when comparing keywords */ @@ -566,13 +559,9 @@ int yylex(void *arg, void *yythd) else #endif { - result_state= bin_ident_map[c] ? IDENT : IDENT_QUOTED; - while (ident_map[c=yyGet()]) - { - /* If not simple character, mark that we must convert it */ - if (!bin_ident_map[c]) - result_state= IDENT_QUOTED; - } + for (result_state= c; ident_map[c= yyGet()]; result_state|= c); + /* If there were non-ASCII characters, mark that we must convert */ + result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; } length= (uint) (lex->ptr - lex->tok_start)-1; if (lex->ignore_space) @@ -674,12 +663,11 @@ int yylex(void *arg, void *yythd) } else #endif - while (ident_map[c = yyGet()]) - { - /* If not simple character, mark that we must convert it */ - if (!bin_ident_map[c]) - result_state= IDENT_QUOTED; - } + { + for (result_state=0; ident_map[c= yyGet()]; result_state|= c); + /* If there were non-ASCII characters, mark that we must convert */ + result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; + } if (c == '.' && ident_map[yyPeek()]) lex->next_state=MY_LEX_IDENT_SEP;// Next is '.' @@ -953,13 +941,11 @@ int yylex(void *arg, void *yythd) We should now be able to handle: [(global | local | session) .]variable_name */ - result_state= IDENT; - while (ident_map[c=yyGet()]) - { - /* If not simple character, mark that we must convert it */ - if (!bin_ident_map[c]) - result_state= IDENT_QUOTED; - } + + for (result_state= 0; ident_map[c= yyGet()]; result_state|= c); + /* If there were non-ASCII characters, mark that we must convert */ + result_state= result_state & 0x80 ? IDENT_QUOTED : IDENT; + if (c == '.') lex->next_state=MY_LEX_IDENT_SEP; length= (uint) (lex->ptr - lex->tok_start)-1; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 3884c8f2674..54d9a09c1f3 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -76,6 +76,7 @@ enum enum_sql_command { SQLCOM_SHOW_COLUMN_TYPES, SQLCOM_SHOW_STORAGE_ENGINES, SQLCOM_SHOW_PRIVILEGES, SQLCOM_HELP, SQLCOM_DROP_USER, SQLCOM_REVOKE_ALL, SQLCOM_CHECKSUM, + SQLCOM_PREPARE, SQLCOM_EXECUTE, SQLCOM_DEALLOCATE_PREPARE, /* This should be the last !!! */ SQLCOM_END }; @@ -174,8 +175,8 @@ enum tablespace_op_type e||+-------------------------+ || V| neighbor | V| unit1.1<+==================>unit1.2 unit2.1 - fake1.1 fake2.1 - select1.1.1 select 1.1.2 select1.2.1 select2.1.1 select2.1.2 + fake1.1 + select1.1.1 select 1.1.2 select1.2.1 select2.1.1 |^ || V| @@ -616,6 +617,17 @@ typedef struct st_lex bool derived_tables; bool safe_to_cache_query; ALTER_INFO alter_info; + /* Prepared statements SQL syntax:*/ + LEX_STRING prepared_stmt_name; /* Statement name (in all queries) */ + /* + Prepared statement query text or name of variable that holds the + prepared statement (in PREPARE ... queries) + */ + LEX_STRING prepared_stmt_code; + /* If true, prepared_stmt_code is a name of variable that holds the query */ + bool prepared_stmt_code_is_varref; + /* Names of user variables holding parameters (in EXECUTE) */ + List<LEX_STRING> prepared_stmt_params; st_lex() {} inline void uncacheable(uint8 cause) { diff --git a/sql/sql_load.cc b/sql/sql_load.cc index f72fab9ea3a..167fb2daf8b 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -530,7 +530,7 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, ((Field_timestamp*) field)->set_time(); else if (field != table->next_number_field) field->set_warning((uint) MYSQL_ERROR::WARN_LEVEL_WARN, - ER_WARN_NULL_TO_NOTNULL); + ER_WARN_NULL_TO_NOTNULL, 1); } continue; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index bafd7dd4b2e..2d8facfa63f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1308,6 +1308,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (command != COM_STATISTICS && command != COM_PING) query_id++; thread_running++; + /* TODO: set thd->lex->sql_command to SQLCOM_END here */ VOID(pthread_mutex_unlock(&LOCK_thread_count)); thd->server_status&= @@ -1424,7 +1425,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } case COM_EXECUTE: { - thd->free_list= NULL; mysql_stmt_execute(thd, packet, packet_length); break; } @@ -1479,6 +1479,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->query_length= length; thd->query= packet; thd->query_id= query_id++; + /* TODO: set thd->lex->sql_command to SQLCOM_END here */ VOID(pthread_mutex_unlock(&LOCK_thread_count)); #ifndef EMBEDDED_LIBRARY mysql_parse(thd, packet, length); @@ -1587,7 +1588,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, break; } mysql_log.write(thd,command,db); - mysql_rm_db(thd,alias,0,0); + mysql_rm_db(thd, (lower_case_table_names == 2 ? alias : db), 0, 0); break; } #ifndef EMBEDDED_LIBRARY @@ -1632,10 +1633,28 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } #ifndef EMBEDDED_LIBRARY case COM_SHUTDOWN: + { statistic_increment(com_other,&LOCK_status); if (check_global_access(thd,SHUTDOWN_ACL)) break; /* purecov: inspected */ - DBUG_PRINT("quit",("Got shutdown command")); + /* + If the client is < 4.1.3, it is going to send us no argument; then + packet_length is 1, packet[0] is the end 0 of the packet. Note that + SHUTDOWN_DEFAULT is 0. If client is >= 4.1.3, the shutdown level is in + packet[0]. + */ + enum enum_shutdown_level level= + (enum enum_shutdown_level) (uchar) packet[0]; + DBUG_PRINT("quit",("Got shutdown command for level %u", level)); + if (level == SHUTDOWN_DEFAULT) + level= SHUTDOWN_WAIT_ALL_BUFFERS; // soon default will be configurable + else if (level != SHUTDOWN_WAIT_ALL_BUFFERS) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), "this shutdown level"); + send_error(thd); + break; + } + DBUG_PRINT("quit",("Got shutdown command for level %u", level)); mysql_log.write(thd,command,NullS); send_eof(thd); #ifdef __WIN__ @@ -1651,6 +1670,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, kill_mysql(); error=TRUE; break; + } #endif case COM_STATISTICS: { @@ -1976,7 +1996,98 @@ mysql_execute_command(THD *thd) } break; } - + case SQLCOM_PREPARE: + { + char *query_str; + uint query_len; + if (lex->prepared_stmt_code_is_varref) + { + /* This is PREPARE stmt FROM @var. */ + String str; + CHARSET_INFO *to_cs= thd->variables.collation_connection; + bool need_conversion; + user_var_entry *entry; + uint32 unused; + /* + Convert @var contents to string in connection character set. Although + it is known that int/real/NULL value cannot be a valid query we still + convert it for error messages to uniform. + */ + if ((entry= + (user_var_entry*)hash_search(&thd->user_vars, + (byte*)lex->prepared_stmt_code.str, + lex->prepared_stmt_code.length)) + && entry->value) + { + String *pstr; + my_bool is_var_null; + pstr= entry->val_str(&is_var_null, &str, NOT_FIXED_DEC); + DBUG_ASSERT(!is_var_null); + if (!pstr) + send_error(thd, ER_OUT_OF_RESOURCES); + DBUG_ASSERT(pstr == &str); + } + else + str.set("NULL", 4, &my_charset_latin1); + need_conversion= + String::needs_conversion(str.length(), str.charset(), to_cs, &unused); + + query_len= need_conversion? (str.length() * to_cs->mbmaxlen) : + str.length(); + if (!(query_str= alloc_root(&thd->mem_root, query_len+1))) + send_error(thd, ER_OUT_OF_RESOURCES); + + if (need_conversion) + query_len= copy_and_convert(query_str, query_len, to_cs, str.ptr(), + str.length(), str.charset()); + else + memcpy(query_str, str.ptr(), str.length()); + query_str[query_len]= 0; + } + else + { + query_str= lex->prepared_stmt_code.str; + query_len= lex->prepared_stmt_code.length; + DBUG_PRINT("info", ("PREPARE: %.*s FROM '%.*s' \n", + lex->prepared_stmt_name.length, + lex->prepared_stmt_name.str, + query_len, query_str)); + } + thd->command= COM_PREPARE; + if (!mysql_stmt_prepare(thd, query_str, query_len + 1, + &lex->prepared_stmt_name)) + send_ok(thd, 0L, 0L, "Statement prepared"); + break; + } + case SQLCOM_EXECUTE: + { + DBUG_PRINT("info", ("EXECUTE: %.*s\n", + lex->prepared_stmt_name.length, + lex->prepared_stmt_name.str)); + mysql_sql_stmt_execute(thd, &lex->prepared_stmt_name); + lex->prepared_stmt_params.empty(); + break; + } + case SQLCOM_DEALLOCATE_PREPARE: + { + Statement* stmt; + DBUG_PRINT("info", ("DEALLOCATE PREPARE: %.*s\n", + lex->prepared_stmt_name.length, + lex->prepared_stmt_name.str)); + if ((stmt= thd->stmt_map.find_by_name(&lex->prepared_stmt_name))) + { + thd->stmt_map.erase(stmt); + send_ok(thd); + } + else + { + res= -1; + my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), + lex->prepared_stmt_name.length, lex->prepared_stmt_name.str, + "DEALLOCATE PREPARE"); + } + break; + } case SQLCOM_DO: if (tables && ((res= check_table_access(thd, SELECT_ACL, tables,0)) || (res= open_and_lock_tables(thd,tables)))) @@ -2243,7 +2354,15 @@ mysql_execute_command(THD *thd) lex->create_list, lex->key_list, select_lex->item_list,lex->duplicates))) + { + /* + CREATE from SELECT give its SELECT_LEX for SELECT, + and item_list belong to SELECT + */ + select_lex->resolve_mode= SELECT_LEX::SELECT_MODE; res=handle_select(thd, lex, result); + select_lex->resolve_mode= SELECT_LEX::NOMATTER_MODE; + } //reset for PS lex->create_list.empty(); lex->key_list.empty(); @@ -2502,29 +2621,13 @@ unsent_create_error: case SQLCOM_OPTIMIZE: { - HA_CREATE_INFO create_info; if (check_db_used(thd,tables) || check_table_access(thd,SELECT_ACL | INSERT_ACL, tables,0)) goto error; /* purecov: inspected */ thd->slow_command=TRUE; - if (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) - { - /* Use ALTER TABLE */ - lex->create_list.empty(); - lex->key_list.empty(); - lex->col_list.empty(); - lex->alter_info.reset(); - bzero((char*) &create_info,sizeof(create_info)); - create_info.db_type=DB_TYPE_DEFAULT; - create_info.row_type=ROW_TYPE_DEFAULT; - create_info.default_table_charset=default_charset_info; - res= mysql_alter_table(thd, NullS, NullS, &create_info, - tables, lex->create_list, - lex->key_list, 0, (ORDER *) 0, - DUP_ERROR, &lex->alter_info); - } - else - res = mysql_optimize_table(thd, tables, &lex->check_opt); + res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ? + mysql_recreate_table(thd, tables, 1) : + mysql_optimize_table(thd, tables, &lex->check_opt); /* ! we write after unlocking the table */ if (!res && !lex->no_write_to_binlog) { @@ -2609,7 +2712,11 @@ unsent_create_error: lex->duplicates))) /* Skip first table, which is the table we are inserting in */ lex->select_lex.table_list.first= (byte*) first_local_table->next; - lex->select_lex.resolve_mode= SELECT_LEX::NOMATTER_MODE; + /* + insert/replace from SELECT give its SELECT_LEX for SELECT, + and item_list belong to SELECT + */ + lex->select_lex.resolve_mode= SELECT_LEX::SELECT_MODE; res=handle_select(thd,lex,result); /* revert changes for SP */ lex->select_lex.table_list.first= (byte*) first_local_table; @@ -3038,7 +3145,8 @@ purposes internal to the MySQL server", MYF(0)); send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION); goto error; } - res=mysql_rm_db(thd,alias,lex->drop_if_exists,0); + res=mysql_rm_db(thd, (lower_case_table_names == 2 ? alias : lex->name), + lex->drop_if_exists, 0); break; } case SQLCOM_ALTER_DB: @@ -3413,7 +3521,8 @@ purposes internal to the MySQL server", MYF(0)); thd->variables.collation_server= global_system_variables.collation_server; thd->update_charset(); - /* Add timezone stuff here */ + thd->variables.time_zone= + global_system_variables.time_zone; thd->one_shot_set= 0; } } @@ -3441,7 +3550,6 @@ error: */ int check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables) - { if (check_access(thd, privilege, tables->db, &tables->grant.privilege,0,0)) return 1; @@ -3772,7 +3880,7 @@ mysql_init_query(THD *thd) thd->total_warn_count=0; // Warnings for this query thd->last_insert_id_used= thd->query_start_used= thd->insert_id_used=0; thd->sent_row_count= thd->examined_row_count= 0; - thd->is_fatal_error= thd->rand_used= 0; + thd->is_fatal_error= thd->rand_used= thd->time_zone_used= 0; thd->server_status&= ~ (SERVER_MORE_RESULTS_EXISTS | SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED); @@ -4110,7 +4218,12 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, break; case FIELD_TYPE_DECIMAL: if (!length) - new_field->length= 10; // Default length for DECIMAL + { + if ((new_field->length= new_field->decimals)) + new_field->length++; + else + new_field->length= 10; // Default length for DECIMAL + } if (new_field->length < MAX_FIELD_WIDTH) // Skip wrong argument { new_field->length+=sign_len; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 23b87a41c1a..09b442f8dfc 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -91,16 +91,22 @@ public: bool get_longdata_error; #ifndef EMBEDDED_LIBRARY bool (*set_params)(Prepared_statement *st, uchar *data, uchar *data_end, - uchar *read_pos); + uchar *read_pos, String *expanded_query); #else - bool (*set_params_data)(Prepared_statement *st); + bool (*set_params_data)(Prepared_statement *st, String *expanded_query); #endif + bool (*set_params_from_vars)(Prepared_statement *stmt, + List<LEX_STRING>& varnames, + String *expanded_query); public: Prepared_statement(THD *thd_arg); virtual ~Prepared_statement(); + void setup_set_params(); virtual Statement::Type type() const; }; +static void execute_stmt(THD *thd, Prepared_statement *stmt, + String *expanded_query, bool set_context); /****************************************************************************** Implementation @@ -129,7 +135,8 @@ find_prepared_statement(THD *thd, ulong id, const char *where, if (stmt == 0 || stmt->type() != Statement::PREPARED_STATEMENT) { - my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), id, where); + char llbuf[22]; + my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), 22, llstr(id, llbuf), where); if (se == SEND_ERROR) send_error(thd); return 0; @@ -210,7 +217,13 @@ static ulong get_param_length(uchar **packet, ulong len) if (len < 5) return 0; (*packet)+=9; // Must be 254 when here - /* TODO: why uint4korr here? (should be uint8korr) */ + /* + In our client-server protocol all numbers bigger than 2^24 + stored as 8 bytes with uint8korr. Here we always know that + parameter length is less than 2^4 so don't look at the second + 4 bytes. But still we need to obey the protocol hence 9 in the + assignment above. + */ return (ulong) uint4korr(pos+1); } #else @@ -326,20 +339,19 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) { uchar *to= *pos; TIME tm; - - /* TODO: why length is compared with 8 here? */ - tm.second_part= (length > 8 ) ? (ulong) sint4korr(to+7): 0; + tm.neg= (bool) to[0]; + day= (uint) sint4korr(to+1); /* Note, that though ranges of hour, minute and second are not checked here we rely on them being < 256: otherwise we'll get buffer overflow in make_{date,time} functions, which are called when time value is converted to string. */ - day= (uint) sint4korr(to+1); tm.hour= (uint) to[5] + day * 24; tm.minute= (uint) to[6]; tm.second= (uint) to[7]; + tm.second_part= (length > 8) ? (ulong) sint4korr(to+8) : 0; if (tm.hour > 838) { /* TODO: add warning 'Data truncated' here */ @@ -348,7 +360,6 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) tm.second= 59; } tm.day= tm.year= tm.month= 0; - tm.neg= (bool)to[0]; param->set_time(&tm, TIMESTAMP_TIME, MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); @@ -359,14 +370,16 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) static void set_param_datetime(Item_param *param, uchar **pos, ulong len) { uint length; - + if ((length= get_param_length(pos, len)) >= 4) { uchar *to= *pos; TIME tm; - - tm.second_part= (length > 7 ) ? (ulong) sint4korr(to+7): 0; - + + tm.neg= 0; + tm.year= (uint) sint2korr(to); + tm.month= (uint) to[2]; + tm.day= (uint) to[3]; /* Note, that though ranges of hour, minute and second are not checked here we rely on them being < 256: otherwise @@ -380,11 +393,8 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len) } else tm.hour= tm.minute= tm.second= 0; - - tm.year= (uint) sint2korr(to); - tm.month= (uint) to[2]; - tm.day= (uint) to[3]; - tm.neg= 0; + + tm.second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; param->set_time(&tm, TIMESTAMP_DATETIME, MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); @@ -579,6 +589,7 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, param->item_result_type= STRING_RESULT; } } + param->param_type= (enum enum_field_types) param_type; } #ifndef EMBEDDED_LIBRARY @@ -588,19 +599,20 @@ static void setup_one_conversion_function(THD *thd, Item_param *param, */ static bool insert_params_withlog(Prepared_statement *stmt, uchar *null_array, - uchar *read_pos, uchar *data_end) + uchar *read_pos, uchar *data_end, + String *query) { THD *thd= stmt->thd; Item_param **begin= stmt->param_array; Item_param **end= begin + stmt->param_count; uint32 length= 0; - String str, query; + String str; const String *res; DBUG_ENTER("insert_params_withlog"); - if (query.copy(stmt->query, stmt->query_length, default_charset_info)) + if (query->copy(stmt->query, stmt->query_length, default_charset_info)) DBUG_RETURN(1); for (Item_param **it= begin; it < end; ++it) @@ -621,20 +633,18 @@ static bool insert_params_withlog(Prepared_statement *stmt, uchar *null_array, if (param->convert_str_value(thd)) DBUG_RETURN(1); /* out of memory */ - if (query.replace(param->pos_in_query+length, 1, *res)) + if (query->replace(param->pos_in_query+length, 1, *res)) DBUG_RETURN(1); length+= res->length()-1; } - if (alloc_query(thd, (char *)query.ptr(), query.length()+1)) - DBUG_RETURN(1); - DBUG_RETURN(0); } static bool insert_params(Prepared_statement *stmt, uchar *null_array, - uchar *read_pos, uchar *data_end) + uchar *read_pos, uchar *data_end, + String *expanded_query) { Item_param **begin= stmt->param_array; Item_param **end= begin + stmt->param_count; @@ -699,7 +709,7 @@ static bool setup_conversion_functions(Prepared_statement *stmt, #else -static bool emb_insert_params(Prepared_statement *stmt) +static bool emb_insert_params(Prepared_statement *stmt, String *expanded_query) { THD *thd= stmt->thd; Item_param **it= stmt->param_array; @@ -732,20 +742,20 @@ static bool emb_insert_params(Prepared_statement *stmt) } -static bool emb_insert_params_withlog(Prepared_statement *stmt) +static bool emb_insert_params_withlog(Prepared_statement *stmt, String *query) { THD *thd= stmt->thd; Item_param **it= stmt->param_array; Item_param **end= it + stmt->param_count; MYSQL_BIND *client_param= thd->client_params; - String str, query; + String str; const String *res; uint32 length= 0; DBUG_ENTER("emb_insert_params_withlog"); - if (query.copy(stmt->query, stmt->query_length, default_charset_info)) + if (query->copy(stmt->query, stmt->query_length, default_charset_info)) DBUG_RETURN(1); for (; it < end; ++it, ++client_param) @@ -764,18 +774,16 @@ static bool emb_insert_params_withlog(Prepared_statement *stmt) *client_param->length : client_param->buffer_length); } - res= param->query_val_str(&str); - if (param->convert_str_value(thd)) - DBUG_RETURN(1); /* out of memory */ } - if (query.replace(param->pos_in_query+length, 1, *res)) + res= param->query_val_str(&str); + if (param->convert_str_value(thd)) + DBUG_RETURN(1); /* out of memory */ + + if (query->replace(param->pos_in_query+length, 1, *res)) DBUG_RETURN(1); + length+= res->length()-1; } - - if (alloc_query(thd, (char *) query.ptr(), query.length()+1)) - DBUG_RETURN(1); - DBUG_RETURN(0); } @@ -783,6 +791,105 @@ static bool emb_insert_params_withlog(Prepared_statement *stmt) /* + Set prepared statement parameters from user variables. + SYNOPSIS + insert_params_from_vars() + stmt Statement + varnames List of variables. Caller must ensure that number of variables + in the list is equal to number of statement parameters + query Ignored +*/ + +static bool insert_params_from_vars(Prepared_statement *stmt, + List<LEX_STRING>& varnames, + String *query __attribute__((unused))) +{ + Item_param **begin= stmt->param_array; + Item_param **end= begin + stmt->param_count; + user_var_entry *entry; + LEX_STRING *varname; + List_iterator<LEX_STRING> var_it(varnames); + DBUG_ENTER("insert_params_from_vars"); + + for (Item_param **it= begin; it < end; ++it) + { + Item_param *param= *it; + varname= var_it++; + entry= (user_var_entry*)hash_search(&stmt->thd->user_vars, + (byte*) varname->str, + varname->length); + if (param->set_from_user_var(stmt->thd, entry) || + param->convert_str_value(stmt->thd)) + DBUG_RETURN(1); + } + DBUG_RETURN(0); +} + + +/* + Do the same as insert_params_from_vars but also construct query text for + binary log. + SYNOPSIS + insert_params_from_vars() + stmt Statement + varnames List of variables. Caller must ensure that number of variables + in the list is equal to number of statement parameters + query The query with parameter markers replaced with their values +*/ + +static bool insert_params_from_vars_with_log(Prepared_statement *stmt, + List<LEX_STRING>& varnames, + String *query) +{ + Item_param **begin= stmt->param_array; + Item_param **end= begin + stmt->param_count; + user_var_entry *entry; + LEX_STRING *varname; + DBUG_ENTER("insert_params_from_vars"); + + List_iterator<LEX_STRING> var_it(varnames); + String str; + uint32 length= 0; + if (query->copy(stmt->query, stmt->query_length, default_charset_info)) + DBUG_RETURN(1); + + for (Item_param **it= begin; it < end; ++it) + { + Item_param *param= *it; + varname= var_it++; + if (get_var_with_binlog(stmt->thd, *varname, &entry)) + DBUG_RETURN(1); + DBUG_ASSERT(entry); + + if (param->set_from_user_var(stmt->thd, entry)) + DBUG_RETURN(1); + /* Insert @'escaped-varname' instead of parameter in the query */ + char *buf, *ptr; + str.length(0); + if (str.reserve(entry->name.length*2+3)) + DBUG_RETURN(1); + + buf= str.c_ptr_quick(); + ptr= buf; + *ptr++= '@'; + *ptr++= '\''; + ptr+= + escape_string_for_mysql(&my_charset_utf8_general_ci, + ptr, entry->name.str, entry->name.length); + *ptr++= '\''; + str.length(ptr - buf); + + if (param->convert_str_value(stmt->thd)) + DBUG_RETURN(1); /* out of memory */ + + if (query->replace(param->pos_in_query+length, 1, str)) + DBUG_RETURN(1); + length+= str.length()-1; + } + DBUG_RETURN(0); +} + +/* Validate INSERT statement: SYNOPSIS @@ -978,7 +1085,7 @@ static int mysql_test_delete(Prepared_statement *stmt, */ static int mysql_test_select(Prepared_statement *stmt, - TABLE_LIST *tables) + TABLE_LIST *tables, bool text_protocol) { THD *thd= stmt->thd; LEX *lex= stmt->lex; @@ -1010,7 +1117,7 @@ static int mysql_test_select(Prepared_statement *stmt, if (lex->describe) { - if (send_prep_stmt(stmt, 0)) + if (!text_protocol && send_prep_stmt(stmt, 0)) goto err; } else @@ -1024,14 +1131,16 @@ static int mysql_test_select(Prepared_statement *stmt, goto err_prep; } - if (send_prep_stmt(stmt, lex->select_lex.item_list.elements) || + if (!text_protocol) + { + if (send_prep_stmt(stmt, lex->select_lex.item_list.elements) || thd->protocol_simple.send_fields(&lex->select_lex.item_list, 0) #ifndef EMBEDDED_LIBRARY - || net_flush(&thd->net) + || net_flush(&thd->net) #endif - ) - goto err_prep; - + ) + goto err_prep; + } unit->cleanup(); } thd->free_temporary_memory_pool_for_ps_preparing(); @@ -1198,6 +1307,7 @@ static int mysql_test_create_table(Prepared_statement *stmt, DBUG_ENTER("mysql_test_create_table"); THD *thd= stmt->thd; LEX *lex= stmt->lex; + SELECT_LEX *select_lex= &lex->select_lex; int res= 0; /* Skip first table, which is the table we are creating */ @@ -1206,8 +1316,12 @@ static int mysql_test_create_table(Prepared_statement *stmt, &create_table_local); if (!(res= create_table_precheck(thd, tables, create_table)) && - lex->select_lex.item_list.elements) + select_lex->item_list.elements) + { + select_lex->resolve_mode= SELECT_LEX::SELECT_MODE; res= select_like_statement_test(stmt, tables); + select_lex->resolve_mode= SELECT_LEX::NOMATTER_MODE; + } /* put tables back for PS rexecuting */ tables= lex->link_first_table_back(tables, create_table, @@ -1291,7 +1405,11 @@ static int mysql_test_insert_select(Prepared_statement *stmt, (TABLE_LIST *)lex->select_lex.table_list.first; /* Skip first table, which is the table we are inserting in */ lex->select_lex.table_list.first= (byte*) first_local_table->next; - lex->select_lex.resolve_mode= SELECT_LEX::NOMATTER_MODE; + /* + insert/replace from SELECT give its SELECT_LEX for SELECT, + and item_list belong to SELECT + */ + lex->select_lex.resolve_mode= SELECT_LEX::SELECT_MODE; res= select_like_statement_test(stmt, tables); /* revert changes*/ lex->select_lex.table_list.first= (byte*) first_local_table; @@ -1309,7 +1427,7 @@ static int mysql_test_insert_select(Prepared_statement *stmt, 0 success 1 error, sent to client */ -static int send_prepare_results(Prepared_statement *stmt) +static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) { THD *thd= stmt->thd; LEX *lex= stmt->lex; @@ -1346,7 +1464,7 @@ static int send_prepare_results(Prepared_statement *stmt) break; case SQLCOM_SELECT: - if ((res= mysql_test_select(stmt, tables))) + if ((res= mysql_test_select(stmt, tables, text_protocol))) goto error; /* Statement and field info has already been sent */ DBUG_RETURN(0); @@ -1404,7 +1522,7 @@ static int send_prepare_results(Prepared_statement *stmt) goto error; } if (res == 0) - DBUG_RETURN(send_prep_stmt(stmt, 0)); + DBUG_RETURN(text_protocol? 0 : send_prep_stmt(stmt, 0)); error: if (res < 0) send_error(thd, thd->killed ? ER_SERVER_SHUTDOWN : 0); @@ -1445,20 +1563,36 @@ static bool init_param_array(Prepared_statement *stmt) /* - Parse the query and send the total number of parameters - and resultset metadata information back to client (if any), - without executing the query i.e. without any log/disk - writes. This will allow the queries to be re-executed - without re-parsing during execute. - - If parameter markers are found in the query, then store - the information using Item_param along with maintaining a - list in lex->param_array, so that a fast and direct - retrieval can be made without going through all field - items. + Given a query string with parameter markers, create a Prepared Statement + from it and send PS info back to the client. + + SYNOPSIS + mysql_stmt_prepare() + packet query to be prepared + packet_length query string length, including ignored trailing NULL or + quote char. + name NULL or statement name. For unnamed statements binary PS + protocol is used, for named statements text protocol is + used. + RETURN + 0 OK, statement prepared successfully + other Error + + NOTES + This function parses the query and sends the total number of parameters + and resultset metadata information back to client (if any), without + executing the query i.e. without any log/disk writes. This allows the + queries to be re-executed without re-parsing during execute. + + If parameter markers are found in the query, then store the information + using Item_param along with maintaining a list in lex->param_array, so + that a fast and direct retrieval can be made without going through all + field items. + */ -void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length) +int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, + LEX_STRING *name) { LEX *lex; Prepared_statement *stmt= new Prepared_statement(thd); @@ -1470,14 +1604,26 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length) if (stmt == 0) { send_error(thd, ER_OUT_OF_RESOURCES); - DBUG_VOID_RETURN; + DBUG_RETURN(1); + } + + if (name) + { + stmt->name.length= name->length; + if (!(stmt->name.str= memdup_root(&stmt->mem_root, (byte*)name->str, + name->length))) + { + delete stmt; + send_error(thd, ER_OUT_OF_RESOURCES); + DBUG_RETURN(1); + } } if (thd->stmt_map.insert(stmt)) { delete stmt; send_error(thd, ER_OUT_OF_RESOURCES); - DBUG_VOID_RETURN; + DBUG_RETURN(1); } thd->stmt_backup.set_statement(thd); @@ -1494,7 +1640,7 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length) /* Statement map deletes statement on erase */ thd->stmt_map.erase(stmt); send_error(thd, ER_OUT_OF_RESOURCES); - DBUG_VOID_RETURN; + DBUG_RETURN(1); } mysql_log.write(thd, COM_PREPARE, "%s", packet); @@ -1506,7 +1652,7 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length) error= yyparse((void *)thd) || thd->is_fatal_error || init_param_array(stmt) || - send_prepare_results(stmt); + send_prepare_results(stmt, test(name)); /* restore to WAIT_PRIOR: QUERY_PRIOR is set inside alloc_query */ if (!(specialflag & SPECIAL_NO_PRIOR)) @@ -1522,10 +1668,12 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length) { /* Statement map deletes statement on erase */ thd->stmt_map.erase(stmt); + stmt= NULL; /* error is sent inside yyparse/send_prepare_results */ } else { + stmt->setup_set_params(); SELECT_LEX *sl= stmt->lex->all_selects_list; /* Save WHERE clause pointers, because they may be changed during query @@ -1535,8 +1683,10 @@ void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length) { sl->prep_where= sl->where; } + } - DBUG_VOID_RETURN; + + DBUG_RETURN(!stmt); } /* Reinit statement before execution */ @@ -1611,13 +1761,21 @@ static void reset_stmt_params(Prepared_statement *stmt) Executes previously prepared query. If there is any parameters, then replace markers with the data supplied from client, and then execute the query. - SYNOPSYS + SYNOPSIS mysql_stmt_execute() + thd Current thread + packet Query string + packet_length Query string length, including terminator character. */ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) { ulong stmt_id= uint4korr(packet); + /* + Query text for binary log, or empty string if the query is not put into + binary log. + */ + String expanded_query; #ifndef EMBEDDED_LIBRARY uchar *packet_end= (uchar *) packet + packet_length - 1; #endif @@ -1625,7 +1783,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) DBUG_ENTER("mysql_stmt_execute"); packet+= 9; /* stmt_id + 5 bytes of flags */ - + if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute", SEND_ERROR))) DBUG_VOID_RETURN; @@ -1639,15 +1797,13 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) DBUG_VOID_RETURN; } - thd->stmt_backup.set_statement(thd); - thd->set_statement(stmt); - reset_stmt_for_execute(stmt); #ifndef EMBEDDED_LIBRARY if (stmt->param_count) { uchar *null_array= (uchar *) packet; if (setup_conversion_functions(stmt, (uchar **) &packet, packet_end) || - stmt->set_params(stmt, null_array, (uchar *) packet, packet_end)) + stmt->set_params(stmt, null_array, (uchar *) packet, packet_end, + &expanded_query)) goto set_params_data_err; } #else @@ -1656,53 +1812,124 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) we set params, and also we don't need to parse packet. So we do it in one function. */ - if (stmt->param_count && stmt->set_params_data(stmt)) + if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query)) goto set_params_data_err; #endif + thd->protocol= &thd->protocol_prep; // Switch to binary protocol + execute_stmt(thd, stmt, &expanded_query, true); + thd->protocol= &thd->protocol_simple; // Use normal protocol + DBUG_VOID_RETURN; - if (!(specialflag & SPECIAL_NO_PRIOR)) - my_pthread_setprio(pthread_self(),QUERY_PRIOR); - +set_params_data_err: + reset_stmt_params(stmt); + my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute"); + send_error(thd); + DBUG_VOID_RETURN; +} + + +/* + Execute prepared statement using parameter values from + lex->prepared_stmt_params and send result to the client using text protocol. +*/ + +void mysql_sql_stmt_execute(THD *thd, LEX_STRING *stmt_name) +{ + Prepared_statement *stmt; /* - TODO: - Also, have checks on basic executions such as mysql_insert(), - mysql_delete(), mysql_update() and mysql_select() to not to - have re-check on setup_* and other things .. + Query text for binary log, or empty string if the query is not put into + binary log. */ - thd->protocol= &thd->protocol_prep; // Switch to binary protocol + String expanded_query; + DBUG_ENTER("mysql_sql_stmt_execute"); + + if (!(stmt= (Prepared_statement*)thd->stmt_map.find_by_name(stmt_name))) + { + my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), stmt_name->length, + stmt_name->str, "EXECUTE"); + send_error(thd); + DBUG_VOID_RETURN; + } + + if (stmt->param_count != thd->lex->prepared_stmt_params.elements) + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), "EXECUTE"); + send_error(thd); + DBUG_VOID_RETURN; + } + + thd->free_list= NULL; + thd->stmt_backup.set_statement(thd); + thd->set_statement(stmt); + if (stmt->set_params_from_vars(stmt, + thd->stmt_backup.lex->prepared_stmt_params, + &expanded_query)) + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), "EXECUTE"); + send_error(thd); + } + execute_stmt(thd, stmt, &expanded_query, false); + DBUG_VOID_RETURN; +} + + +/* + Execute prepared statement. + SYNOPSIS + execute_stmt() + thd Current thread + stmt Statement to execute + expanded_query If binary log is enabled, query string with parameter + placeholders replaced with actual values. Otherwise empty + string. + NOTES + Caller must set parameter values and thd::protocol. + thd->free_list is assumed to be garbage. +*/ + +static void execute_stmt(THD *thd, Prepared_statement *stmt, + String *expanded_query, bool set_context) +{ + DBUG_ENTER("execute_stmt"); + if (set_context) + { + thd->free_list= NULL; + thd->stmt_backup.set_statement(thd); + thd->set_statement(stmt); + } + reset_stmt_for_execute(stmt); + + if (expanded_query->length() && + alloc_query(thd, (char *)expanded_query->ptr(), + expanded_query->length()+1)) + { + my_error(ER_OUTOFMEMORY, 0, expanded_query->length()); + DBUG_VOID_RETURN; + } + + if (!(specialflag & SPECIAL_NO_PRIOR)) + my_pthread_setprio(pthread_self(),QUERY_PRIOR); mysql_execute_command(thd); thd->lex->unit.cleanup(); - thd->protocol= &thd->protocol_simple; // Use normal protocol - if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); + /* Free Items that were created during this execution of the PS. */ + free_items(thd->free_list); cleanup_items(stmt->free_list); reset_stmt_params(stmt); - close_thread_tables(thd); // to close derived tables - thd->set_statement(&thd->stmt_backup); - /* - Free Items that were created during this execution of the PS by query - optimizer. - */ - free_items(thd->free_list); - DBUG_VOID_RETURN; - -set_params_data_err: - reset_stmt_params(stmt); + close_thread_tables(thd); // to close derived tables thd->set_statement(&thd->stmt_backup); - my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_stmt_execute"); - send_error(thd); DBUG_VOID_RETURN; } /* - Reset a prepared statement in case there was a recoverable error. + Reset a prepared statement in case there was a recoverable error. SYNOPSIS mysql_stmt_reset() - thd Thread handle - packet Packet with stmt id + thd Thread handle + packet Packet with stmt id DESCRIPTION This function resets statement to the state it was right after prepare. @@ -1842,8 +2069,14 @@ Prepared_statement::Prepared_statement(THD *thd_arg) get_longdata_error(0) { *last_error= '\0'; - if (mysql_bin_log.is_open()) +} + +void Prepared_statement::setup_set_params() +{ + /* Setup binary logging */ + if (mysql_bin_log.is_open() && is_update_query(lex->sql_command)) { + set_params_from_vars= insert_params_from_vars_with_log; #ifndef EMBEDDED_LIBRARY set_params= insert_params_withlog; #else @@ -1851,14 +2084,16 @@ Prepared_statement::Prepared_statement(THD *thd_arg) #endif } else + { + set_params_from_vars= insert_params_from_vars; #ifndef EMBEDDED_LIBRARY set_params= insert_params; #else set_params_data= emb_insert_params; #endif + } } - Prepared_statement::~Prepared_statement() { free_items(free_list); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 582b1d185ac..fa0f8464404 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -919,7 +919,7 @@ JOIN::optimize() If having is not handled here, it will be checked before the row is sent to the client. */ - if (having && + if (tmp_having && (sort_and_group || (exec_tmp_table1->distinct && !group_list))) having= tmp_having; @@ -1074,12 +1074,14 @@ JOIN::exec() DBUG_ENTER("JOIN::exec"); error= 0; - thd->limit_found_rows= thd->examined_row_count= 0; if (procedure) { if (procedure->change_columns(fields_list) || result->prepare(fields_list, unit)) + { + thd->limit_found_rows= thd->examined_row_count= 0; DBUG_VOID_RETURN; + } } if (!tables_list) @@ -1105,8 +1107,10 @@ JOIN::exec() else error=(int) result->send_eof(); } + thd->limit_found_rows= thd->examined_row_count= 0; DBUG_VOID_RETURN; } + thd->limit_found_rows= thd->examined_row_count= 0; if (zero_result_cause) { @@ -4950,6 +4954,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, table->db_low_byte_first=1; // True for HEAP and MyISAM table->temp_pool_slot = temp_pool_slot; table->copy_blobs= 1; + table->in_use= thd; table->keys_for_keyread.init(); table->keys_in_use.init(); table->read_only_keys.init(); @@ -5112,6 +5117,10 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, recinfo->length=null_pack_length; recinfo++; bfill(null_flags,null_pack_length,255); // Set null fields + + table->null_flags= (uchar*) table->record[0]; + table->null_fields= null_count+ hidden_null_count; + table->null_bytes= null_pack_length; } null_count= (blob_count == 0) ? 1 : 0; hidden_field_count=param->hidden_field_count; @@ -5175,7 +5184,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields, param->copy_field_end=copy; param->recinfo=recinfo; - store_record(table,default_values); // Make empty default record + store_record(table,default_values); // Make empty default record if (thd->variables.tmp_table_size == ~(ulong) 0) // No limit table->max_rows= ~(ha_rows) 0; @@ -5947,7 +5956,8 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos) else { if (!table->key_read && table->used_keys.is_set(tab->ref.key) && - !table->no_keyread) + !table->no_keyread && + (int) table->reginfo.lock_type <= (int) TL_READ_HIGH_PRIORITY) { table->key_read=1; table->file->extra(HA_EXTRA_KEYREAD); @@ -8317,10 +8327,11 @@ calc_group_buffer(JOIN *join,ORDER *group) join->tmp_table_param.group_null_parts=null_parts; } + /* - alloc group fields or take prepared (chached) + allocate group fields or take prepared (cached) - SYNOPSYS + SYNOPSIS make_group_fields() main_join - join of current select curr_join - current join (join of current select or temporary copy of it) @@ -8333,22 +8344,21 @@ calc_group_buffer(JOIN *join,ORDER *group) static bool make_group_fields(JOIN *main_join, JOIN *curr_join) { - if (main_join->group_fields_cache.elements) - { - curr_join->group_fields= main_join->group_fields_cache; - curr_join->sort_and_group= 1; - } - else - { - if (alloc_group_fields(curr_join, curr_join->group_list)) - { - return (1); - } - main_join->group_fields_cache= curr_join->group_fields; - } - return (0); + if (main_join->group_fields_cache.elements) + { + curr_join->group_fields= main_join->group_fields_cache; + curr_join->sort_and_group= 1; + } + else + { + if (alloc_group_fields(curr_join, curr_join->group_list)) + return (1); + main_join->group_fields_cache= curr_join->group_fields; + } + return (0); } + /* Get a list of buffers for saveing last group Groups are saved in reverse order for easyer check loop @@ -8389,7 +8399,6 @@ test_if_group_changed(List<Item_buff> &list) } - /* Setup copy_fields to save fields at start of new group diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 6c4b65a4a70..4642abfcfc4 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -529,7 +529,6 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) } else { - struct tm tm_tmp; const char *str; handler *file=table->file; file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_NO_LOCK); @@ -562,24 +561,21 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild) protocol->store_null(); else { - localtime_r(&file->create_time,&tm_tmp); - localtime_to_TIME(&time, &tm_tmp); + thd->variables.time_zone->gmt_sec_to_TIME(&time, file->create_time); protocol->store(&time); } if (!file->update_time) protocol->store_null(); else { - localtime_r(&file->update_time,&tm_tmp); - localtime_to_TIME(&time, &tm_tmp); + thd->variables.time_zone->gmt_sec_to_TIME(&time, file->update_time); protocol->store(&time); } if (!file->check_time) protocol->store_null(); else { - localtime_r(&file->check_time,&tm_tmp); - localtime_to_TIME(&time, &tm_tmp); + thd->variables.time_zone->gmt_sec_to_TIME(&time, file->check_time); protocol->store(&time); } str= (table->table_charset ? table->table_charset->name : "default"); @@ -1251,7 +1247,7 @@ store_create_info(THD *thd, TABLE *table, String *packet) packet->append(' '); // check for surprises from the previous call to Field::sql_type() if (type.ptr() != tmp) - type.set(tmp, sizeof(tmp),&my_charset_bin); + type.set(tmp, sizeof(tmp), system_charset_info); field->sql_type(type); packet->append(type.ptr(), type.length(), system_charset_info); diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 991fb4d5c5a..1ec0faafa8f 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -24,7 +24,6 @@ #include <my_sys.h> #include <m_string.h> #include <m_ctype.h> -#include <assert.h> #ifdef HAVE_FCONVERT #include <floatingpoint.h> #endif @@ -371,7 +370,7 @@ bool String::copy(const char *str, uint32 arg_length, bool String::set_ascii(const char *str, uint32 arg_length) { - if (!(str_charset->state & MY_CS_NONTEXT)) + if (str_charset->mbminlen == 1) { set(str, arg_length, str_charset); return 0; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 70b6e44d59f..6e447271b2e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -254,7 +254,17 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, } } thd->tmp_table_used= tmp_table_deleted; - if (some_tables_deleted || tmp_table_deleted) + error= 0; + if (wrong_tables.length()) + { + if (!foreign_key_error) + my_error(ER_BAD_TABLE_ERROR,MYF(0), wrong_tables.c_ptr()); + else + my_error(ER_ROW_IS_REFERENCED, MYF(0)); + error= 1; + } + + if (some_tables_deleted || tmp_table_deleted || !error) { query_cache_invalidate3(thd, tables, 0); if (!dont_log_query) @@ -262,7 +272,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, mysql_update_log.write(thd, thd->query,thd->query_length); if (mysql_bin_log.is_open()) { - thd->clear_error(); + if (!error) + thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, tmp_table_deleted && !some_tables_deleted); mysql_bin_log.write(&qinfo); @@ -271,15 +282,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, } unlock_table_names(thd, tables); - error= 0; - if (wrong_tables.length()) - { - if (!foreign_key_error) - my_error(ER_BAD_TABLE_ERROR,MYF(0),wrong_tables.c_ptr()); - else - my_error(ER_ROW_IS_REFERENCED,MYF(0)); - error= 1; - } DBUG_RETURN(error); } @@ -856,7 +858,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, sql_field->sql_type != FIELD_TYPE_VAR_STRING && !f_is_blob(sql_field->pack_flag)) || sql_field->charset == &my_charset_bin || - sql_field->charset->state & MY_CS_NONTEXT || // ucs2 doesn't work yet + sql_field->charset->mbminlen > 1 || // ucs2 doesn't work yet (ft_key_charset && sql_field->charset != ft_key_charset)) { my_printf_error(ER_BAD_FT_COLUMN,ER(ER_BAD_FT_COLUMN),MYF(0), @@ -1811,6 +1813,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, protocol->store(table_name, system_charset_info); protocol->store(operator_name, system_charset_info); +send_result_message: + + DBUG_PRINT("info", ("result_code: %d", result_code)); switch (result_code) { case HA_ADMIN_NOT_IMPLEMENTED: { @@ -1854,6 +1859,29 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, protocol->store("Invalid argument",16, system_charset_info); break; + case HA_ADMIN_TRY_ALTER: + { + /* + This is currently used only by InnoDB. ha_innobase::optimize() answers + "try with alter", so here we close the table, do an ALTER TABLE, + reopen the table and do ha_innobase::analyze() on it. + */ + close_thread_tables(thd); + TABLE_LIST *save_next= table->next; + table->next= 0; + result_code= mysql_recreate_table(thd, table, 0); + close_thread_tables(thd); + if (!result_code) // recreation went ok + { + if ((table->table= open_ltable(thd, table, lock_type)) && + ((result_code= table->table->file->analyze(thd, check_opt)) > 0)) + result_code= 0; // analyze went ok + } + result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK; + table->next= save_next; + goto send_result_message; + } + default: // Probably HA_ADMIN_INTERNAL_ERROR protocol->store("error", 5, system_charset_info); protocol->store("Unknown - internal error during operation", 41 @@ -2483,7 +2511,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, List<create_field> &fields, List<Key> &keys, uint order_num, ORDER *order, enum enum_duplicates handle_duplicates, - ALTER_INFO *alter_info) + ALTER_INFO *alter_info, bool do_send_ok) { TABLE *table,*new_table; int error; @@ -2640,7 +2668,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, Query_log_event qinfo(thd, thd->query, thd->query_length, 0); mysql_bin_log.write(&qinfo); } - send_ok(thd); + if (do_send_ok) + send_ok(thd); } else { @@ -3203,7 +3232,8 @@ end_temporary: my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO), (ulong) (copied + deleted), (ulong) deleted, (ulong) thd->cuted_fields); - send_ok(thd,copied+deleted,0L,tmp_name); + if (do_send_ok) + send_ok(thd,copied+deleted,0L,tmp_name); thd->some_tables_deleted=0; DBUG_RETURN(0); @@ -3353,6 +3383,39 @@ copy_data_between_tables(TABLE *from,TABLE *to, } +/* + Recreates tables by calling mysql_alter_table(). + + SYNOPSIS + mysql_recreate_table() + thd Thread handler + tables Tables to recreate + do_send_ok If we should send_ok() or leave it to caller + + RETURN + Like mysql_alter_table(). +*/ +int mysql_recreate_table(THD *thd, TABLE_LIST *table_list, + bool do_send_ok) +{ + DBUG_ENTER("mysql_recreate_table"); + LEX *lex= thd->lex; + HA_CREATE_INFO create_info; + lex->create_list.empty(); + lex->key_list.empty(); + lex->col_list.empty(); + lex->alter_info.reset(); + bzero((char*) &create_info,sizeof(create_info)); + create_info.db_type=DB_TYPE_DEFAULT; + create_info.row_type=ROW_TYPE_DEFAULT; + create_info.default_table_charset=default_charset_info; + DBUG_RETURN(mysql_alter_table(thd, NullS, NullS, &create_info, + table_list, lex->create_list, + lex->key_list, 0, (ORDER *) 0, + DUP_ERROR, &lex->alter_info, do_send_ok)); +} + + int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt) { TABLE_LIST *table; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index af8a9705e95..18394d007ed 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -332,7 +332,7 @@ int mysql_update(THD *thd, transactional_table= table->file->has_transactions(); log_delayed= (transactional_table || table->tmp_table); - if (updated && (error <= 0 || !transactional_table)) + if ((updated || (error < 0)) && (error <= 0 || !transactional_table)) { mysql_update_log.write(thd,thd->query,thd->query_length); if (mysql_bin_log.is_open()) @@ -1095,7 +1095,9 @@ bool multi_update::send_eof() /* Write the SQL statement to the binlog if we updated rows and we succeeded or if we updated some non - transacational tables + transacational tables. + Note that if we updated nothing we don't write to the binlog (TODO: + fix this). */ if (updated && (local_error <= 0 || !trans_safe)) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8b5eb6867db..e79b5d86e87 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -433,6 +433,8 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token MEDIUMTEXT %token NUMERIC_SYM %token PRECISION +%token PREPARE_SYM +%token DEALLOCATE_SYM %token QUICK %token REAL %token SIGNED_SYM @@ -604,7 +606,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %type <simple_string> remember_name remember_end opt_ident opt_db text_or_password - opt_escape opt_constraint constraint + opt_constraint constraint %type <string> text_string opt_gconcat_separator @@ -632,7 +634,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); using_list expr_or_default set_expr_or_default interval_expr param_marker singlerow_subselect singlerow_subselect_init exists_subselect exists_subselect_init geometry_function - signed_literal now_or_signed_literal + signed_literal now_or_signed_literal opt_escape %type <item_num> NUM_literal @@ -725,6 +727,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); precision subselect_start opt_and charset subselect_end select_var_list select_var_list_init help opt_len opt_extended_describe + prepare prepare_src execute deallocate END_OF_INPUT %type <NONE> @@ -761,10 +764,12 @@ verb_clause: | checksum | commit | create + | deallocate | delete | describe | do | drop + | execute | flush | grant | handler @@ -776,6 +781,7 @@ verb_clause: | optimize | keycache | preload + | prepare | purge | rename | repair @@ -796,6 +802,92 @@ verb_clause: | use ; +deallocate: + deallocate_or_drop PREPARE_SYM ident + { + THD *thd=YYTHD; + LEX *lex= thd->lex; + if (thd->command == COM_PREPARE) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + lex->sql_command= SQLCOM_DEALLOCATE_PREPARE; + lex->prepared_stmt_name= $3; + }; + +deallocate_or_drop: + DEALLOCATE_SYM | + DROP + ; + + +prepare: + PREPARE_SYM ident FROM prepare_src + { + THD *thd=YYTHD; + LEX *lex= thd->lex; + if (thd->command == COM_PREPARE) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + lex->sql_command= SQLCOM_PREPARE; + lex->prepared_stmt_name= $2; + }; + +prepare_src: + TEXT_STRING_sys + { + THD *thd=YYTHD; + LEX *lex= thd->lex; + lex->prepared_stmt_code= $1; + lex->prepared_stmt_code_is_varref= false; + } + | '@' ident_or_text + { + THD *thd=YYTHD; + LEX *lex= thd->lex; + lex->prepared_stmt_code= $2; + lex->prepared_stmt_code_is_varref= true; + }; + +execute: + EXECUTE_SYM ident + { + THD *thd=YYTHD; + LEX *lex= thd->lex; + if (thd->command == COM_PREPARE) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + lex->sql_command= SQLCOM_EXECUTE; + lex->prepared_stmt_name= $2; + } + execute_using + {} + ; + +execute_using: + /* nothing */ + | USING execute_var_list + ; + +execute_var_list: + execute_var_list ',' execute_var_ident + | execute_var_ident + ; + +execute_var_ident: '@' ident_or_text + { + LEX *lex=Lex; + LEX_STRING *lexstr= (LEX_STRING*)sql_memdup(&$2, sizeof(LEX_STRING)); + if (!lexstr || lex->prepared_stmt_params.push_back(lexstr)) + YYABORT; + } + ; + /* help */ help: @@ -3484,8 +3576,12 @@ having_clause: ; opt_escape: - ESCAPE_SYM TEXT_STRING_literal { $$= $2.str; } - | /* empty */ { $$= (char*) "\\"; }; + ESCAPE_SYM simple_expr { $$= $2; } + | /* empty */ + { + $$= new Item_string("\\", 1, &my_charset_latin1); + } + ; /* @@ -4912,6 +5008,7 @@ keyword: | DATETIME {} | DATE_SYM {} | DAY_SYM {} + | DEALLOCATE_SYM {} | DELAY_KEY_WRITE_SYM {} | DES_KEY_FILE {} | DIRECTORY_SYM {} @@ -5010,6 +5107,7 @@ keyword: | PASSWORD {} | POINT_SYM {} | POLYGON {} + | PREPARE_SYM {} | PREV_SYM {} | PROCESS {} | PROCESSLIST_SYM {} diff --git a/sql/table.cc b/sql/table.cc index 0bd6d094ea5..6bf1d8c3323 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1126,7 +1126,7 @@ File create_frm(register my_string name, uint reclength, uchar *fileinfo, char fill[IO_SIZE]; #if SIZEOF_OFF_T > 4 - /* Fix this in MySQL 4.0; The current limit is 4G rows (QQ) */ + /* Fix this when we have new .frm files; Current limit is 4G rows (QQ) */ if (create_info->max_rows > ~(ulong) 0) create_info->max_rows= ~(ulong) 0; if (create_info->min_rows > ~(ulong) 0) diff --git a/sql/time.cc b/sql/time.cc index 992f1afc4af..b5550b98e8c 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -23,16 +23,26 @@ static ulong const days_at_timestart=719528; /* daynr at 1970.01.01 */ uchar *days_in_month= (uchar*) "\037\034\037\036\037\036\037\037\036\037\036\037"; - /* Init some variabels needed when using my_local_time */ - /* Currently only my_time_zone is inited */ +/* + Offset of system time zone from UTC in seconds used to speed up + work of my_system_gmt_sec() function. +*/ static long my_time_zone=0; + +/* + Prepare offset of system time zone from UTC for my_system_gmt_sec() func. + + SYNOPSIS + init_time() +*/ void init_time(void) { time_t seconds; struct tm *l_time,tm_tmp;; TIME my_time; + bool not_used; seconds= (time_t) time((time_t*) 0); localtime_r(&seconds,&tm_tmp); @@ -44,33 +54,40 @@ void init_time(void) my_time.hour= (uint) l_time->tm_hour; my_time.minute= (uint) l_time->tm_min; my_time.second= (uint) l_time->tm_sec; - my_gmt_sec(&my_time, &my_time_zone); /* Init my_time_zone */ + my_system_gmt_sec(&my_time, &my_time_zone, ¬_used); /* Init my_time_zone */ } + /* - Convert current time to sec. since 1970.01.01 - This code handles also day light saving time. - The idea is to cache the time zone (including daylight saving time) - for the next call to make things faster. + Convert time in TIME representation in system time zone to its + my_time_t form (number of seconds in UTC since begginning of Unix Epoch). -*/ + SYNOPSIS + my_system_gmt_sec() + t - time value to be converted + my_timezone - pointer to long where offset of system time zone + from UTC will be stored for caching + in_dst_time_gap - set to true if time falls into spring time-gap -long my_gmt_sec(TIME *t, long *my_timezone) + NOTES + The idea is to cache the time zone offset from UTC (including daylight + saving time) for the next call to make things faster. But currently we + just calculate this offset during startup (by calling init_time() + function) and use it all the time. + Time value provided should be legal time value (e.g. '2003-01-01 25:00:00' + is not allowed). + + RETURN VALUE + Time in UTC seconds since Unix Epoch representation. +*/ +my_time_t +my_system_gmt_sec(const TIME *t, long *my_timezone, bool *in_dst_time_gap) { uint loop; time_t tmp; struct tm *l_time,tm_tmp; long diff, current_timezone; - if (t->year > TIMESTAMP_MAX_YEAR || t->year < TIMESTAMP_MIN_YEAR) - return 0; - - if (t->hour >= 24) - { /* Fix for time-loop */ - t->day+=t->hour/24; - t->hour%=24; - } - /* Calculate the gmt time based on current time and timezone The -1 on the end is to ensure that if have a date that exists twice @@ -125,14 +142,13 @@ long my_gmt_sec(TIME *t, long *my_timezone) tmp+=3600 - t->minute*60 - t->second; // Move to next hour else if (diff == -3600) tmp-=t->minute*60 + t->second; // Move to previous hour + + *in_dst_time_gap= 1; } *my_timezone= current_timezone; - if (tmp < TIMESTAMP_MIN_VALUE || tmp > TIMESTAMP_MAX_VALUE) - tmp= 0; - - return (long) tmp; -} /* my_gmt_sec */ + return (my_time_t) tmp; +} /* my_system_gmt_sec */ /* Some functions to calculate dates */ @@ -164,6 +180,7 @@ long calc_daynr(uint year,uint month,uint day) } /* calc_daynr */ +#ifndef TESTTIME /* Calc weekday from daynr */ /* Returns 0 for monday, 1 for tuesday .... */ @@ -346,6 +363,8 @@ static char time_separator=':'; flags Bitmap of following items TIME_FUZZY_DATE Set if we should allow partial dates TIME_DATETIME_ONLY Set if we only allow full datetimes. + was_cut Set to 1 if value was cut during conversion or to 0 + otherwise. DESCRIPTION At least the following formats are recogniced (based on number of digits) @@ -383,7 +402,8 @@ static char time_separator=':'; #define MAX_DATE_PARTS 8 timestamp_type -str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) +str_to_TIME(const char *str, uint length, TIME *l_time, uint flags, + int *was_cut) { uint field_length, year_length, digits, i, number_of_fields; uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; @@ -391,7 +411,6 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) ulong not_zero_date, allow_space; bool is_internal_format; const char *pos, *last_field_pos; - const char *str_begin= str; const char *end=str+length; const uchar *format_position; bool found_delimitier= 0, found_space= 0; @@ -403,11 +422,16 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) LINT_INIT(year_length); LINT_INIT(last_field_pos); + *was_cut= 0; + // Skip space at start for (; str != end && my_isspace(&my_charset_latin1, *str) ; str++) ; if (str == end || ! my_isdigit(&my_charset_latin1, *str)) + { + *was_cut= 1; DBUG_RETURN(TIMESTAMP_NONE); + } is_internal_format= 0; /* This has to be changed if want to activate different timestamp formats */ @@ -449,7 +473,10 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) if (pos == end) { if (flags & TIME_DATETIME_ONLY) + { + *was_cut= 1; DBUG_RETURN(TIMESTAMP_NONE); // Can't be a full datetime + } /* Date field. Set hour, minutes and seconds to 0 */ date[0]= date[1]= date[2]= date[3]= date[4]= 0; start_loop= 5; // Start with first date part @@ -486,7 +513,10 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) } date_len[i]= (uint) (str - start); if (tmp_value > 999999) // Impossible date part + { + *was_cut= 1; DBUG_RETURN(TIMESTAMP_NONE); + } date[i]=tmp_value; not_zero_date|= tmp_value; @@ -523,7 +553,10 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) if (my_isspace(&my_charset_latin1,*str)) { if (!(allow_space & (1 << i))) + { + *was_cut= 1; DBUG_RETURN(TIMESTAMP_NONE); + } found_space= 1; } str++; @@ -551,7 +584,10 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) last_field_pos= str; } if (found_delimitier && !found_space && (flags & TIME_DATETIME_ONLY)) + { + *was_cut= 1; DBUG_RETURN(TIMESTAMP_NONE); // Can't be a datetime + } str= last_field_pos; @@ -566,7 +602,10 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) { year_length= date_len[(uint) format_position[0]]; if (!year_length) // Year must be specified + { + *was_cut= 1; DBUG_RETURN(TIMESTAMP_NONE); + } l_time->year= date[(uint) format_position[0]]; l_time->month= date[(uint) format_position[1]]; @@ -584,7 +623,10 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) if (format_position[7] != (uchar) 255) { if (l_time->hour > 12) + { + *was_cut= 1; goto err; + } l_time->hour= l_time->hour%12 + add_hours; } } @@ -624,7 +666,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) } } if (not_zero_date) - current_thd->cuted_fields++; + *was_cut= 1; goto err; } @@ -635,8 +677,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags) { if (!my_isspace(&my_charset_latin1,*str)) { - make_truncated_value_warning(current_thd, str_begin, length, - l_time->time_type); + *was_cut= 1; break; } } @@ -650,43 +691,59 @@ err: } -time_t str_to_timestamp(const char *str,uint length) +/* + Convert a timestamp string to a TIME value and produce a warning + if string was truncated during conversion. + + NOTE + See description of str_to_TIME() for more information. +*/ +timestamp_type +str_to_TIME_with_warn(const char *str, uint length, TIME *l_time, uint flags) { - TIME l_time; - long not_used; - time_t timestamp= 0; - - if (str_to_TIME(str,length,&l_time,0) > TIMESTAMP_DATETIME_ERROR && - !(timestamp= my_gmt_sec(&l_time, ¬_used))) - current_thd->cuted_fields++; - return timestamp; + int was_cut; + timestamp_type ts_type= str_to_TIME(str, length, l_time, flags, &was_cut); + if (was_cut) + make_truncated_value_warning(current_thd, str, length, ts_type); + return ts_type; } /* - Convert a string to datetime. + Convert a datetime from broken-down TIME representation to corresponding + TIMESTAMP value. SYNOPSIS - str_to_datetime() - str String to parse (see str_to_TIME() synopsis) - length Length of str - fuzzy_date Flags (see str_to_TIME() synopsis) - + TIME_to_timestamp() + thd - current thread + t - datetime in broken-down representation, + in_dst_time_gap - pointer to bool which is set to true if t represents + value which doesn't exists (falls into the spring + time-gap) or to false otherwise. + RETURN - -1 if error - datetime value otherwise + Number seconds in UTC since start of Unix Epoch corresponding to t. + 0 - t contains datetime value which is out of TIMESTAMP range. + */ - -longlong str_to_datetime(const char *str,uint length, uint fuzzy_date) +my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *in_dst_time_gap) { - TIME l_time; - if (str_to_TIME(str,length,&l_time,fuzzy_date) <= TIMESTAMP_DATETIME_ERROR) - return -1; - return (longlong) (l_time.year*LL(10000000000) + - l_time.month*LL(100000000)+ - l_time.day*LL(1000000)+ - l_time.hour*LL(10000)+ - (longlong) (l_time.minute*100+l_time.second)); + my_time_t timestamp; + + *in_dst_time_gap= 0; + + if (t->year < TIMESTAMP_MAX_YEAR && t->year > TIMESTAMP_MIN_YEAR || + t->year == TIMESTAMP_MAX_YEAR && t->month == 1 && t->day == 1 || + t->year == TIMESTAMP_MIN_YEAR && t->month == 12 && t->day == 31) + { + thd->time_zone_used= 1; + timestamp= thd->variables.time_zone->TIME_to_gmt_sec(t, in_dst_time_gap); + if (timestamp >= TIMESTAMP_MIN_VALUE && timestamp <= TIMESTAMP_MAX_VALUE) + return timestamp; + } + + /* If we are here we have range error. */ + return(0); } @@ -701,6 +758,8 @@ longlong str_to_datetime(const char *str,uint length, uint fuzzy_date) There may be an optional [.second_part] after seconds length Length of str l_time Store result here + was_cut Set to 1 if value was cut during conversion or to 0 + otherwise. NOTES Because of the extra days argument, this function can only @@ -711,15 +770,15 @@ longlong str_to_datetime(const char *str,uint length, uint fuzzy_date) 1 error */ -bool str_to_time(const char *str,uint length,TIME *l_time) +bool str_to_time(const char *str, uint length, TIME *l_time, int *was_cut) { long date[5],value; const char *end=str+length, *end_of_days; - const char *str_begin= str; bool found_days,found_hours; uint state; l_time->neg=0; + *was_cut= 0; for (; str != end && my_isspace(&my_charset_latin1,*str) ; str++) length--; if (str != end && *str == '-') @@ -736,9 +795,12 @@ bool str_to_time(const char *str,uint length,TIME *l_time) { // Probably full timestamp enum timestamp_type res= str_to_TIME(str,length,l_time, (TIME_FUZZY_DATE | - TIME_DATETIME_ONLY)); + TIME_DATETIME_ONLY), + was_cut); if ((int) res >= (int) TIMESTAMP_DATETIME_ERROR) return res == TIMESTAMP_DATETIME_ERROR; + /* We need to restore was_cut flag since str_to_TIME can modify it */ + *was_cut= 0; } /* Not a timestamp. Try to get this as a DAYS_TO_SECOND string */ @@ -841,7 +903,7 @@ fractional: /* Some simple checks */ if (date[2] >= 60 || date[3] >= 60) { - current_thd->cuted_fields++; + *was_cut= 1; return 1; } l_time->year= 0; // For protocol::store_time @@ -860,8 +922,7 @@ fractional: { if (!my_isspace(&my_charset_latin1,*str)) { - make_truncated_value_warning(current_thd, str_begin, length, - TIMESTAMP_TIME); + *was_cut= 1; break; } } while (++str != end); @@ -871,6 +932,113 @@ fractional: /* + Convert a time string to a TIME struct and produce a warning + if string was cut during conversion. + + NOTE + See str_to_time() for more info. +*/ +bool +str_to_time_with_warn(const char *str, uint length, TIME *l_time) +{ + int was_cut; + bool ret_val= str_to_time(str, length, l_time, &was_cut); + if (was_cut) + make_truncated_value_warning(current_thd, str, length, TIMESTAMP_TIME); + return ret_val; +} + + +/* + Convert datetime value specified as number to broken-down TIME + representation and form value of DATETIME type as side-effect. + + SYNOPSIS + number_to_TIME() + nr - datetime value as number + time_res - pointer for structure for broken-down representation + fuzzy_date - indicates whenever we allow fuzzy dates + was_cut - set ot 1 if there was some kind of error during + conversion or to 0 if everything was OK. + + DESCRIPTION + Convert a datetime value of formats YYMMDD, YYYYMMDD, YYMMDDHHMSS, + YYYYMMDDHHMMSS to broken-down TIME representation. Return value in + YYYYMMDDHHMMSS format as side-effect. + + This function also checks if datetime value fits in DATETIME range. + + RETURN VALUE + Datetime value in YYYYMMDDHHMMSS format. + If input value is not valid datetime value then 0 is returned. +*/ + +longlong number_to_TIME(longlong nr, TIME *time_res, bool fuzzy_date, + int *was_cut) +{ + long part1,part2; + + *was_cut= 0; + + if (nr == LL(0) || nr >= LL(10000101000000)) + goto ok; + if (nr < 101) + goto err; + if (nr <= (YY_PART_YEAR-1)*10000L+1231L) + { + nr= (nr+20000000L)*1000000L; // YYMMDD, year: 2000-2069 + goto ok; + } + if (nr < (YY_PART_YEAR)*10000L+101L) + goto err; + if (nr <= 991231L) + { + nr= (nr+19000000L)*1000000L; // YYMMDD, year: 1970-1999 + goto ok; + } + if (nr < 10000101L) + goto err; + if (nr <= 99991231L) + { + nr= nr*1000000L; + goto ok; + } + if (nr < 101000000L) + goto err; + if (nr <= (YY_PART_YEAR-1)*LL(10000000000)+LL(1231235959)) + { + nr= nr+LL(20000000000000); // YYMMDDHHMMSS, 2000-2069 + goto ok; + } + if (nr < YY_PART_YEAR*LL(10000000000)+ LL(101000000)) + goto err; + if (nr <= LL(991231235959)) + nr= nr+LL(19000000000000); // YYMMDDHHMMSS, 1970-1999 + + ok: + part1=(long) (nr/LL(1000000)); + part2=(long) (nr - (longlong) part1*LL(1000000)); + time_res->year= (int) (part1/10000L); part1%=10000L; + time_res->month= (int) part1 / 100; + time_res->day= (int) part1 % 100; + time_res->hour= (int) (part2/10000L); part2%=10000L; + time_res->minute=(int) part2 / 100; + time_res->second=(int) part2 % 100; + + if (time_res->year <= 9999 && time_res->month <= 12 && + time_res->day <= 31 && time_res->hour <= 23 && + time_res->minute <= 59 && time_res->second <= 59 && + (fuzzy_date || (time_res->month != 0 && time_res->day != 0) || nr==0)) + return nr; + + err: + + *was_cut= 1; + return LL(0); +} + + +/* Convert a system time structure to TIME */ @@ -1307,6 +1475,7 @@ void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)), str->set_charset(&my_charset_bin); } + void make_truncated_value_warning(THD *thd, const char *str_val, uint str_length, timestamp_type time_type) { @@ -1323,19 +1492,17 @@ void make_truncated_value_warning(THD *thd, const char *str_val, case TIMESTAMP_DATE: type_str= "date"; break; - case TIMESTAMP_DATETIME: - type_str= "datetime"; - break; case TIMESTAMP_TIME: type_str= "time"; break; + case TIMESTAMP_DATETIME: // FALLTHROUGH default: - type_str= "string"; + type_str= "datetime"; break; } sprintf(warn_buff, ER(ER_TRUNCATED_WRONG_VALUE), type_str, str.ptr()); - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_TRUNCATED_WRONG_VALUE, warn_buff); } @@ -1446,3 +1613,5 @@ void TIME_to_string(const TIME *time, String *str) DBUG_ASSERT(0); } } + +#endif diff --git a/sql/tzfile.h b/sql/tzfile.h new file mode 100644 index 00000000000..623cddc1f12 --- /dev/null +++ b/sql/tzfile.h @@ -0,0 +1,137 @@ +/* Copyright (C) 2004 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 */ + +/* + This file is based on public domain code from ftp://elsie.ncih.nist.gov/ + Initial source code is in the public domain, so clarified as of + 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). +*/ + +/* + Information about time zone files. +*/ + +#ifndef TZDIR +#define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */ +#endif /* !defined TZDIR */ + +/* + Each file begins with. . . +*/ + +#define TZ_MAGIC "TZif" + +struct tzhead { + char tzh_magic[4]; /* TZ_MAGIC */ + char tzh_reserved[16]; /* reserved for future use */ + char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */ + char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ + char tzh_leapcnt[4]; /* coded number of leap seconds */ + char tzh_timecnt[4]; /* coded number of transition times */ + char tzh_typecnt[4]; /* coded number of local time types */ + char tzh_charcnt[4]; /* coded number of abbr. chars */ +}; + +/* + . . .followed by. . . + + tzh_timecnt (char [4])s coded transition times a la time(2) + tzh_timecnt (unsigned char)s types of local time starting at above + tzh_typecnt repetitions of + one (char [4]) coded UTC offset in seconds + one (unsigned char) used to set tm_isdst + one (unsigned char) that's an abbreviation list index + tzh_charcnt (char)s '\0'-terminated zone abbreviations + tzh_leapcnt repetitions of + one (char [4]) coded leap second transition times + one (char [4]) total correction after above + tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition + time is standard time, if FALSE, + transition time is wall clock time + if absent, transition times are + assumed to be wall clock time + tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition + time is UTC, if FALSE, + transition time is local time + if absent, transition times are + assumed to be local time +*/ + +/* + In the current implementation, we refuse to deal with files that + exceed any of the limits below. +*/ + +#ifndef TZ_MAX_TIMES +/* + The TZ_MAX_TIMES value below is enough to handle a bit more than a + year's worth of solar time (corrected daily to the nearest second) or + 138 years of Pacific Presidential Election time + (where there are three time zone transitions every fourth year). +*/ +#define TZ_MAX_TIMES 370 +#endif /* !defined TZ_MAX_TIMES */ + +#ifndef TZ_MAX_TYPES +#ifdef SOLAR +#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ +#else +/* + Must be at least 14 for Europe/Riga as of Jan 12 1995, + as noted by Earl Chew <earl@hpato.aus.hp.com>. +*/ +#define TZ_MAX_TYPES 20 /* Maximum number of local time types */ +#endif /* defined SOLAR */ +#endif /* !defined TZ_MAX_TYPES */ + +#ifndef TZ_MAX_CHARS +#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ + /* (limited by what unsigned chars can hold) */ +#endif /* !defined TZ_MAX_CHARS */ + +#ifndef TZ_MAX_LEAPS +#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ +#endif /* !defined TZ_MAX_LEAPS */ + +#ifndef TZ_MAX_REV_RANGES +#ifdef SOLAR +/* Solar (Asia/RiyadhXX) zones need significantly bigger TZ_MAX_REV_RANGES */ +#define TZ_MAX_REV_RANGES (TZ_MAX_TIMES*2+TZ_MAX_LEAPS*2+2) +#else +#define TZ_MAX_REV_RANGES (TZ_MAX_TIMES+TZ_MAX_LEAPS+2) +#endif +#endif + +#define SECS_PER_MIN 60 +#define MINS_PER_HOUR 60 +#define HOURS_PER_DAY 24 +#define DAYS_PER_WEEK 7 +#define DAYS_PER_NYEAR 365 +#define DAYS_PER_LYEAR 366 +#define SECS_PER_HOUR (SECS_PER_MIN * MINS_PER_HOUR) +#define SECS_PER_DAY ((long) SECS_PER_HOUR * HOURS_PER_DAY) +#define MONS_PER_YEAR 12 + +#define TM_YEAR_BASE 1900 + +#define EPOCH_YEAR 1970 + +/* + Accurate only for the past couple of centuries, + that will probably do. +*/ + +#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) diff --git a/sql/tztime.cc b/sql/tztime.cc new file mode 100644 index 00000000000..0b0ae2839df --- /dev/null +++ b/sql/tztime.cc @@ -0,0 +1,2560 @@ +/* Copyright (C) 2004 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 */ + +/* + Most of the following code and structures were derived from + public domain code from ftp://elsie.nci.nih.gov/pub + (We will refer to this code as to elsie-code further.) +*/ + +#ifdef __GNUC__ +#pragma implementation // gcc: Class implementation +#endif + + +#include "mysql_priv.h" +#include "tzfile.h" +#include <m_string.h> +#include <my_dir.h> + + +/* + Now we don't use abbreviations in server but we will do this in future. +*/ +#if defined(TZINFO2SQL) || defined(TESTTIME) +#define ABBR_ARE_USED +#else +#if !defined(DBUG_OFF) +/* Let use abbreviations for debug purposes */ +#undef ABBR_ARE_USED +#define ABBR_ARE_USED +#endif /* !defined(DBUG_OFF) */ +#endif /* defined(TZINFO2SQL) || defined(TESTTIME) */ + +/* Structure describing local time type (e.g. Moscow summer time (MSD)) */ +typedef struct ttinfo +{ + long tt_gmtoff; // Offset from UTC in seconds + uint tt_isdst; // Is daylight saving time or not. Used to set tm_isdst +#ifdef ABBR_ARE_USED + uint tt_abbrind; // Index of start of abbreviation for this time type. +#endif + /* + We don't use tt_ttisstd and tt_ttisgmt members of original elsie-code struct + since we don't support POSIX-style TZ descriptions in variables. + */ +} TRAN_TYPE_INFO; + +/* Structure describing leap-second corrections. */ +typedef struct lsinfo +{ + my_time_t ls_trans; // Transition time + long ls_corr; // Correction to apply +} LS_INFO; + +/* + Structure with information describing ranges of my_time_t shifted to local + time (my_time_t + offset). Used for local TIME -> my_time_t conversion. + See comments for TIME_to_gmt_sec() for more info. +*/ +typedef struct revtinfo +{ + long rt_offset; // Offset of local time from UTC in seconds + uint rt_type; // Type of period 0 - Normal period. 1 - Spring time-gap +} REVT_INFO; + +#ifdef TZNAME_MAX +#define MY_TZNAME_MAX TZNAME_MAX +#endif +#ifndef TZNAME_MAX +#define MY_TZNAME_MAX 255 +#endif + +/* + Structure which fully describes time zone which is + described in our db or in zoneinfo files. +*/ +typedef struct st_time_zone_info +{ + uint leapcnt; // Number of leap-second corrections + uint timecnt; // Number of transitions between time types + uint typecnt; // Number of local time types + uint charcnt; // Number of characters used for abbreviations + uint revcnt; // Number of transition descr. for TIME->my_time_t conversion + /* The following are dynamical arrays are allocated in MEM_ROOT */ + my_time_t *ats; // Times of transitions between time types + unsigned char *types; // Local time types for transitions + TRAN_TYPE_INFO *ttis; // Local time types descriptions +#ifdef ABBR_ARE_USED + /* Storage for local time types abbreviations. They are stored as ASCIIZ */ + char *chars; +#endif + /* + Leap seconds corrections descriptions, this array is shared by + all time zones who use leap seconds. + */ + LS_INFO *lsis; + /* + Starting points and descriptions of shifted my_time_t (my_time_t + offset) + ranges on which shifted my_time_t -> my_time_t mapping is linear or undefined. + Used for tm -> my_time_t conversion. + */ + my_time_t *revts; + REVT_INFO *revtis; + /* + Time type which is used for times smaller than first transition or if + there are no transitions at all. + */ + TRAN_TYPE_INFO *fallback_tti; + +} TIME_ZONE_INFO; + + +static my_bool prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage); + + +#if defined(TZINFO2SQL) || defined(TESTTIME) + +/* + Load time zone description from zoneinfo (TZinfo) file. + + SYNOPSIS + tz_load() + name - path to zoneinfo file + sp - TIME_ZONE_INFO structure to fill + + RETURN VALUES + 0 - Ok + 1 - Error +*/ +static my_bool +tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) +{ + char *p; + int read_from_file; + uint i; + FILE *file; + + if (!(file= my_fopen(name, O_RDONLY|O_BINARY, MYF(MY_WME)))) + return 1; + { + union + { + struct tzhead tzhead; + char buf[sizeof(struct tzhead) + sizeof(my_time_t) * TZ_MAX_TIMES + + TZ_MAX_TIMES + sizeof(TRAN_TYPE_INFO) * TZ_MAX_TYPES + +#ifdef ABBR_ARE_USED + max(TZ_MAX_CHARS + 1, (2 * (MY_TZNAME_MAX + 1))) + +#endif + sizeof(LS_INFO) * TZ_MAX_LEAPS]; + } u; + uint ttisstdcnt; + uint ttisgmtcnt; + char *tzinfo_buf; + + read_from_file= my_fread(file, u.buf, sizeof(u.buf), MYF(MY_WME)); + + if (my_fclose(file, MYF(MY_WME)) != 0) + return 1; + + if (read_from_file < (int)sizeof(struct tzhead)) + return 1; + + ttisstdcnt= int4net(u.tzhead.tzh_ttisgmtcnt); + ttisgmtcnt= int4net(u.tzhead.tzh_ttisstdcnt); + sp->leapcnt= int4net(u.tzhead.tzh_leapcnt); + sp->timecnt= int4net(u.tzhead.tzh_timecnt); + sp->typecnt= int4net(u.tzhead.tzh_typecnt); + sp->charcnt= int4net(u.tzhead.tzh_charcnt); + p= u.tzhead.tzh_charcnt + sizeof u.tzhead.tzh_charcnt; + if (sp->leapcnt > TZ_MAX_LEAPS || + sp->typecnt == 0 || sp->typecnt > TZ_MAX_TYPES || + sp->timecnt > TZ_MAX_TIMES || + sp->charcnt > TZ_MAX_CHARS || + (ttisstdcnt != sp->typecnt && ttisstdcnt != 0) || + (ttisgmtcnt != sp->typecnt && ttisgmtcnt != 0)) + return 1; + if ((uint)(read_from_file - (p - u.buf)) < + sp->timecnt * 4 + /* ats */ + sp->timecnt + /* types */ + sp->typecnt * (4 + 2) + /* ttinfos */ + sp->charcnt + /* chars */ + sp->leapcnt * (4 + 4) + /* lsinfos */ + ttisstdcnt + /* ttisstds */ + ttisgmtcnt) /* ttisgmts */ + return 1; + + if (!(tzinfo_buf= (char *)alloc_root(storage, + ALIGN_SIZE(sp->timecnt * + sizeof(my_time_t)) + + ALIGN_SIZE(sp->timecnt) + + ALIGN_SIZE(sp->typecnt * + sizeof(TRAN_TYPE_INFO)) + +#ifdef ABBR_ARE_USED + ALIGN_SIZE(sp->charcnt) + +#endif + sp->leapcnt * sizeof(LS_INFO)))) + return 1; + + sp->ats= (my_time_t *)tzinfo_buf; + tzinfo_buf+= ALIGN_SIZE(sp->timecnt * sizeof(my_time_t)); + sp->types= (unsigned char *)tzinfo_buf; + tzinfo_buf+= ALIGN_SIZE(sp->timecnt); + sp->ttis= (TRAN_TYPE_INFO *)tzinfo_buf; + tzinfo_buf+= ALIGN_SIZE(sp->typecnt * sizeof(TRAN_TYPE_INFO)); +#ifdef ABBR_ARE_USED + sp->chars= tzinfo_buf; + tzinfo_buf+= ALIGN_SIZE(sp->charcnt); +#endif + sp->lsis= (LS_INFO *)tzinfo_buf; + + for (i= 0; i < sp->timecnt; i++, p+= 4) + sp->ats[i]= int4net(p); + + for (i= 0; i < sp->timecnt; i++) + { + sp->types[i]= (unsigned char) *p++; + if (sp->types[i] >= sp->typecnt) + return 1; + } + for (i= 0; i < sp->typecnt; i++) + { + TRAN_TYPE_INFO * ttisp; + + ttisp= &sp->ttis[i]; + ttisp->tt_gmtoff= int4net(p); + p+= 4; + ttisp->tt_isdst= (unsigned char) *p++; + if (ttisp->tt_isdst != 0 && ttisp->tt_isdst != 1) + return 1; + ttisp->tt_abbrind= (unsigned char) *p++; + if (ttisp->tt_abbrind > sp->charcnt) + return 1; + } + for (i= 0; i < sp->charcnt; i++) + sp->chars[i]= *p++; + sp->chars[i]= '\0'; /* ensure '\0' at end */ + for (i= 0; i < sp->leapcnt; i++) + { + LS_INFO *lsisp; + + lsisp= &sp->lsis[i]; + lsisp->ls_trans= int4net(p); + p+= 4; + lsisp->ls_corr= int4net(p); + p+= 4; + } + /* + Since we don't support POSIX style TZ definitions in variables we + don't read further like glibc or elsie code. + */ + } + + return prepare_tz_info(sp, storage); +} +#endif /* defined(TZINFO2SQL) || defined(TESTTIME) */ + + +/* + Finish preparation of time zone description for use in TIME_to_gmt_sec() + and gmt_sec_to_TIME() functions. + + SYNOPSIS + prepare_tz_info() + sp - pointer to time zone description + storage - pointer to MEM_ROOT where arrays for map allocated + + DESCRIPTION + First task of this function is to find fallback time type which will + be used if there are no transitions or we have moment in time before + any transitions. + Second task is to build "shifted my_time_t" -> my_time_t map used in + TIME -> my_time_t conversion. + Note: See description of TIME_to_gmt_sec() function first. + In order to perform TIME -> my_time_t conversion we need to build table + which defines "shifted by tz offset and leap seconds my_time_t" -> + my_time_t function wich is almost the same (except ranges of ambiguity) + as reverse function to piecewise linear function used for my_time_t -> + "shifted my_time_t" conversion and which is also specified as table in + zoneinfo file or in our db (It is specified as start of time type ranges + and time type offsets). So basic idea is very simple - let us iterate + through my_time_t space from one point of discontinuity of my_time_t -> + "shifted my_time_t" function to another and build our approximation of + reverse function. (Actually we iterate through ranges on which + my_time_t -> "shifted my_time_t" is linear function). + + RETURN VALUES + 0 Ok + 1 Error +*/ +static my_bool +prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage) +{ + my_time_t cur_t= MY_TIME_T_MIN; + my_time_t cur_l, end_t, end_l; + my_time_t cur_max_seen_l= MY_TIME_T_MIN; + long cur_offset, cur_corr, cur_off_and_corr; + uint next_trans_idx, next_leap_idx; + uint i; + /* + Temporary arrays where we will store tables. Needed because + we don't know table sizes ahead. (Well we can estimate their + upper bound but this will take extra space.) + */ + my_time_t revts[TZ_MAX_REV_RANGES]; + REVT_INFO revtis[TZ_MAX_REV_RANGES]; + + LINT_INIT(end_l); + + /* + Let us setup fallback time type which will be used if we have not any + transitions or if we have moment of time before first transition. + We will find first non-DST local time type and use it (or use first + local time type if all of them are DST types). + */ + for (i= 0; i < sp->typecnt && sp->ttis[i].tt_isdst; i++) + /* no-op */ ; + if (i == sp->typecnt) + i= 0; + sp->fallback_tti= &(sp->ttis[i]); + + + /* + Let us build shifted my_time_t -> my_time_t map. + */ + sp->revcnt= 0; + + /* Let us find initial offset */ + if (sp->timecnt == 0 || cur_t < sp->ats[0]) + { + /* + If we have not any transitions or t is before first transition we are using + already found fallback time type which index is already in i. + */ + next_trans_idx= 0; + } + else + { + /* cur_t == sp->ats[0] so we found transition */ + i= sp->types[0]; + next_trans_idx= 1; + } + + cur_offset= sp->ttis[i].tt_gmtoff; + + + /* let us find leap correction... unprobable, but... */ + for (next_leap_idx= 0; next_leap_idx < sp->leapcnt && + cur_t >= sp->lsis[next_leap_idx].ls_trans; + ++next_leap_idx) + continue; + + if (next_leap_idx > 0) + cur_corr= sp->lsis[next_leap_idx - 1].ls_corr; + else + cur_corr= 0; + + /* Iterate trough t space */ + while (sp->revcnt < TZ_MAX_REV_RANGES - 1) + { + cur_off_and_corr= cur_offset - cur_corr; + + /* + We assuming that cur_t could be only overflowed downwards, + we also assume that end_t won't be overflowed in this case. + */ + if (cur_off_and_corr < 0 && + cur_t < MY_TIME_T_MIN - cur_off_and_corr) + cur_t= MY_TIME_T_MIN - cur_off_and_corr; + + cur_l= cur_t + cur_off_and_corr; + + /* + Let us choose end_t as point before next time type change or leap + second correction. + */ + end_t= min((next_trans_idx < sp->timecnt) ? sp->ats[next_trans_idx] - 1: + MY_TIME_T_MAX, + (next_leap_idx < sp->leapcnt) ? + sp->lsis[next_leap_idx].ls_trans - 1: MY_TIME_T_MAX); + /* + again assuming that end_t can be overlowed only in positive side + we also assume that end_t won't be overflowed in this case. + */ + if (cur_off_and_corr > 0 && + end_t > MY_TIME_T_MAX - cur_off_and_corr) + end_t= MY_TIME_T_MAX - cur_off_and_corr; + + end_l= end_t + cur_off_and_corr; + + + if (end_l > cur_max_seen_l) + { + /* We want special handling in the case of first range */ + if (cur_max_seen_l == MY_TIME_T_MIN) + { + revts[sp->revcnt]= cur_l; + revtis[sp->revcnt].rt_offset= cur_off_and_corr; + revtis[sp->revcnt].rt_type= 0; + sp->revcnt++; + cur_max_seen_l= end_l; + } + else + { + if (cur_l > cur_max_seen_l + 1) + { + /* We have a spring time-gap and we are not at the first range */ + revts[sp->revcnt]= cur_max_seen_l + 1; + revtis[sp->revcnt].rt_offset= revtis[sp->revcnt-1].rt_offset; + revtis[sp->revcnt].rt_type= 1; + sp->revcnt++; + if (sp->revcnt == TZ_MAX_TIMES + TZ_MAX_LEAPS + 1) + break; /* That was too much */ + cur_max_seen_l= cur_l - 1; + } + + /* Assume here end_l > cur_max_seen_l (because end_l>=cur_l) */ + + revts[sp->revcnt]= cur_max_seen_l + 1; + revtis[sp->revcnt].rt_offset= cur_off_and_corr; + revtis[sp->revcnt].rt_type= 0; + sp->revcnt++; + cur_max_seen_l= end_l; + } + } + + if (end_t == MY_TIME_T_MAX || + (cur_off_and_corr > 0) && + (end_t >= MY_TIME_T_MAX - cur_off_and_corr)) + /* end of t space */ + break; + + cur_t= end_t + 1; + + /* + Let us find new offset and correction. Because of our choice of end_t + cur_t can only be point where new time type starts or/and leap + correction is performed. + */ + if (sp->timecnt != 0 && cur_t >= sp->ats[0]) /* else reuse old offset */ + if (next_trans_idx < sp->timecnt && + cur_t == sp->ats[next_trans_idx]) + { + /* We are at offset point */ + cur_offset= sp->ttis[sp->types[next_trans_idx]].tt_gmtoff; + ++next_trans_idx; + } + + if (next_leap_idx < sp->leapcnt && + cur_t == sp->lsis[next_leap_idx].ls_trans) + { + /* we are at leap point */ + cur_corr= sp->lsis[next_leap_idx].ls_corr; + ++next_leap_idx; + } + } + + /* check if we have had enough space */ + if (sp->revcnt == TZ_MAX_REV_RANGES - 1) + return 1; + + /* set maximum end_l as finisher */ + revts[sp->revcnt]= end_l; + + /* Allocate arrays of proper size in sp and copy result there */ + if (!(sp->revts= (my_time_t *)alloc_root(storage, + sizeof(my_time_t) * (sp->revcnt + 1))) || + !(sp->revtis= (REVT_INFO *)alloc_root(storage, + sizeof(REVT_INFO) * sp->revcnt))) + return 1; + + memcpy(sp->revts, revts, sizeof(my_time_t) * (sp->revcnt + 1)); + memcpy(sp->revtis, revtis, sizeof(REVT_INFO) * sp->revcnt); + + return 0; +} + + +static const uint mon_lengths[2][MONS_PER_YEAR]= +{ + { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, + { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } +}; + +static const uint mon_starts[2][MONS_PER_YEAR]= +{ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }, + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 } +}; + +static const uint year_lengths[2]= +{ + DAYS_PER_NYEAR, DAYS_PER_LYEAR +}; + +#define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400) + + +/* + Converts time from my_time_t representation (seconds in UTC since Epoch) + to broken down representation using given local time zone offset. + + SYNOPSIS + sec_to_TIME() + tmp - pointer to structure for broken down representation + t - my_time_t value to be converted + offset - local time zone offset + + DESCRIPTION + Convert my_time_t with offset to TIME struct. Differs from timesub + (from elsie code) because doesn't contain any leap correction and + TM_GMTOFF and is_dst setting and contains some MySQL specific + initialization. Funny but with removing of these we almost have + glibc's offtime function. +*/ +static void +sec_to_TIME(TIME * tmp, my_time_t t, long offset) +{ + long days; + long rem; + int y; + int yleap; + const uint *ip; + + days= t / SECS_PER_DAY; + rem= t % SECS_PER_DAY; + + /* + We do this as separate step after dividing t, because this + allows us handle times near my_time_t bounds without overflows. + */ + rem+= offset; + while (rem < 0) + { + rem+= SECS_PER_DAY; + days--; + } + while (rem >= SECS_PER_DAY) + { + rem -= SECS_PER_DAY; + days++; + } + tmp->hour= (uint)(rem / SECS_PER_HOUR); + rem= rem % SECS_PER_HOUR; + tmp->minute= (uint)(rem / SECS_PER_MIN); + /* + A positive leap second requires a special + representation. This uses "... ??:59:60" et seq. + */ + tmp->second= (uint)(rem % SECS_PER_MIN); + + y= EPOCH_YEAR; + while (days < 0 || days >= (long)year_lengths[yleap= isleap(y)]) + { + int newy; + + newy= y + days / DAYS_PER_NYEAR; + if (days < 0) + newy--; + days-= (newy - y) * DAYS_PER_NYEAR + + LEAPS_THRU_END_OF(newy - 1) - + LEAPS_THRU_END_OF(y - 1); + y= newy; + } + tmp->year= y; + + ip= mon_lengths[yleap]; + for (tmp->month= 0; days >= (long) ip[tmp->month]; tmp->month++) + days= days - (long) ip[tmp->month]; + tmp->month++; + tmp->day= (uint)(days + 1); + + /* filling MySQL specific TIME members */ + tmp->neg= 0; tmp->second_part= 0; + tmp->time_type= TIMESTAMP_DATETIME; +} + + +/* + Find time range wich contains given my_time_t value + + SYNOPSIS + find_time_range() + t - my_time_t value for which we looking for range + range_boundaries - sorted array of range starts. + higher_bound - number of ranges + + DESCRIPTION + Performs binary search for range which contains given my_time_t value. + It has sense if number of ranges is greater than zero and my_time_t value + is greater or equal than beginning of first range. It also assumes that + t belongs to some range specified or end of last is MY_TIME_T_MAX. + + With this localtime_r on real data may takes less time than with linear + search (I've seen 30% speed up). + + RETURN VALUE + Index of range to which t belongs +*/ +static uint +find_time_range(my_time_t t, const my_time_t *range_boundaries, + uint higher_bound) +{ + uint i, lower_bound= 0; + + /* + Function will work without this assertion but result would be meaningless. + */ + DBUG_ASSERT(higher_bound > 0 && t >= range_boundaries[0]); + + /* + Do binary search for minimal interval which contain t. We preserve: + range_boundaries[lower_bound] <= t < range_boundaries[higher_bound] + invariant and decrease this higher_bound - lower_bound gap twice + times on each step. + */ + + while (higher_bound - lower_bound > 1) + { + i= (lower_bound + higher_bound) >> 1; + if (range_boundaries[i] <= t) + lower_bound= i; + else + higher_bound= i; + } + return lower_bound; +} + +/* + Find local time transition for given my_time_t. + + SYNOPSIS + find_transition_type() + t - my_time_t value to be converted + sp - pointer to struct with time zone description + + RETURN VALUE + Pointer to structure in time zone description describing + local time type for given my_time_t. +*/ +static +const TRAN_TYPE_INFO * +find_transition_type(my_time_t t, const TIME_ZONE_INFO *sp) +{ + if (unlikely(sp->timecnt == 0 || t < sp->ats[0])) + { + /* + If we have not any transitions or t is before first transition let + us use fallback time type. + */ + return sp->fallback_tti; + } + + /* + Do binary search for minimal interval between transitions which + contain t. With this localtime_r on real data may takes less + time than with linear search (I've seen 30% speed up). + */ + return &(sp->ttis[sp->types[find_time_range(t, sp->ats, sp->timecnt)]]); +} + + +/* + Converts time in my_time_t representation (seconds in UTC since Epoch) to + broken down TIME representation in local time zone. + + SYNOPSIS + gmt_sec_to_TIME() + tmp - pointer to structure for broken down represenatation + sec_in_utc - my_time_t value to be converted + sp - pointer to struct with time zone description + + TODO + We can improve this function by creating joined array of transitions and + leap corrections. This will require adding extra field to TRAN_TYPE_INFO + for storing number of "extra" seconds to minute occured due to correction + (60th and 61st second, look how we calculate them as "hit" in this + function). + Under realistic assumptions about frequency of transitions the same array + can be used fot TIME -> my_time_t conversion. For this we need to + implement tweaked binary search which will take into account that some + TIME has two matching my_time_t ranges and some of them have none. +*/ +static void +gmt_sec_to_TIME(TIME *tmp, my_time_t sec_in_utc, const TIME_ZONE_INFO *sp) +{ + const TRAN_TYPE_INFO *ttisp; + const LS_INFO *lp; + long corr= 0; + int hit= 0; + int i; + + /* + Find proper transition (and its local time type) for our sec_in_utc value. + Funny but again by separating this step in function we receive code + which very close to glibc's code. No wonder since they obviously use + the same base and all steps are sensible. + */ + ttisp= find_transition_type(sec_in_utc, sp); + + /* + Let us find leap correction for our sec_in_utc value and number of extra + secs to add to this minute. + This loop is rarely used because most users will use time zones without + leap seconds, and even in case when we have such time zone there won't + be many iterations (we have about 22 corrections at this moment (2004)). + */ + for ( i= sp->leapcnt; i-- > 0; ) + { + lp= &sp->lsis[i]; + if (sec_in_utc >= lp->ls_trans) + { + if (sec_in_utc == lp->ls_trans) + { + hit= ((i == 0 && lp->ls_corr > 0) || + lp->ls_corr > sp->lsis[i - 1].ls_corr); + if (hit) + { + while (i > 0 && + sp->lsis[i].ls_trans == sp->lsis[i - 1].ls_trans + 1 && + sp->lsis[i].ls_corr == sp->lsis[i - 1].ls_corr + 1) + { + hit++; + i--; + } + } + } + corr= lp->ls_corr; + break; + } + } + + sec_to_TIME(tmp, sec_in_utc, ttisp->tt_gmtoff - corr); + + tmp->second+= hit; +} + + +/* + Converts local time in broken down representation to local + time zone analog of my_time_t represenation. + + SYNOPSIS + sec_since_epoch() + year, mon, mday, hour, min, sec - broken down representation. + + DESCRIPTION + Converts time in broken down representation to my_time_t representation + ignoring time zone. Note that we cannot convert back some valid _local_ + times near ends of my_time_t range because of my_time_t overflow. But we + ignore this fact now since MySQL will never pass such argument. + + RETURN VALUE + Seconds since epoch time representation. +*/ +static my_time_t +sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) +{ +#ifndef WE_WANT_TO_HANDLE_UNORMALIZED_DATES + /* + It turns out that only whenever month is normalized or unnormalized + plays role. + */ + DBUG_ASSERT(mon > 0 && mon < 13); + long days= year * DAYS_PER_NYEAR - EPOCH_YEAR * DAYS_PER_NYEAR + + LEAPS_THRU_END_OF(year - 1) - + LEAPS_THRU_END_OF(EPOCH_YEAR - 1); + days+= mon_starts[isleap(year)][mon - 1]; +#else + long norm_month= (mon - 1) % MONS_PER_YEAR; + long a_year= year + (mon - 1)/MONS_PER_YEAR - (int)(norm_month < 0); + long days= a_year * DAYS_PER_NYEAR - EPOCH_YEAR * DAYS_PER_NYEAR + + LEAPS_THRU_END_OF(a_year - 1) - + LEAPS_THRU_END_OF(EPOCH_YEAR - 1); + days+= mon_starts[isleap(a_year)] + [norm_month + (norm_month < 0 ? MONS_PER_YEAR : 0)]; +#endif + days+= mday - 1; + + return ((days * HOURS_PER_DAY + hour) * MINS_PER_HOUR + min) * + SECS_PER_MIN + sec; +} + + +/* + Converts local time in broken down TIME representation to my_time_t + representation. + + SYNOPSIS + TIME_to_gmt_sec() + t - pointer to structure for broken down represenatation + sp - pointer to struct with time zone description + in_dst_time_gap - pointer to bool which is set to true if datetime + value passed doesn't really exist (i.e. falls into + spring time-gap) and is not touched otherwise. + + DESCRIPTION + This is mktime analog for MySQL. It is essentially different + from mktime (or hypotetical my_mktime) because: + - It has no idea about tm_isdst member so if it + has two answers it will give the smaller one + - If we are in spring time gap then it will return + beginning of the gap + - It can give wrong results near the ends of my_time_t due to + overflows, but we are safe since in MySQL we will never + call this function for such dates (its restriction for year + between 1970 and 2038 gives us several days of reserve). + - By default it doesn't support un-normalized input. But if + sec_since_epoch() function supports un-normalized dates + then this function should handle un-normalized input right, + altough it won't normalize structure TIME. + + Traditional approach to problem of conversion from broken down + representation to time_t is iterative. Both elsie's and glibc + implementation try to guess what time_t value should correspond to + this broken-down value. They perform localtime_r function on their + guessed value and then calculate the difference and try to improve + their guess. Elsie's code guesses time_t value in bit by bit manner, + Glibc's code tries to add difference between broken-down value + corresponding to guess and target broken-down value to current guess. + It also uses caching of last found correction... So Glibc's approach + is essentially faster but introduces some undetermenism (in case if + is_dst member of broken-down representation (tm struct) is not known + and we have two possible answers). + + We use completely different approach. It is better since it is both + faster than iterative implementations and fully determenistic. If you + look at my_time_t to TIME conversion then you'll find that it consist + of two steps: + The first is calculating shifted my_time_t value and the second - TIME + calculation from shifted my_time_t value (well it is a bit simplified + picture). The part in which we are interested in is my_time_t -> shifted + my_time_t conversion. It is piecewise linear function which is defined + by combination of transition times as break points and times offset + as changing function parameter. The possible inverse function for this + converison would be ambiguos but with MySQL's restrictions we can use + some function which is the same as inverse function on unambigiuos + ranges and coincides with one of branches of inverse function in + other ranges. Thus we just need to build table which will determine + this shifted my_time_t -> my_time_t conversion similar to existing + (my_time_t -> shifted my_time_t table). We do this in + prepare_tz_info function. + + TODO + If we can even more improve this function. For doing this we will need to + build joined map of transitions and leap corrections for gmt_sec_to_TIME() + function (similar to revts/revtis). Under realistic assumptions about + frequency of transitions we can use the same array for TIME_to_gmt_sec(). + We need to implement special version of binary search for this. Such step + will be beneficial to CPU cache since we will decrease data-set used for + conversion twice. + + RETURN VALUE + Seconds in UTC since Epoch. + 0 in case of error. +*/ +static my_time_t +TIME_to_gmt_sec(const TIME *t, const TIME_ZONE_INFO *sp, bool *in_dst_time_gap) +{ + my_time_t local_t; + uint saved_seconds; + uint i; + + DBUG_ENTER("TIME_to_gmt_sec"); + + /* We need this for correct leap seconds handling */ + if (t->second < SECS_PER_MIN) + saved_seconds= 0; + else + saved_seconds= t->second; + + /* + NOTE If we want to convert full my_time_t range without MySQL + restrictions we should catch overflow here somehow. + */ + + local_t= sec_since_epoch(t->year, t->month, t->day, + t->hour, t->minute, + saved_seconds ? 0 : t->second); + + /* We have at least one range */ + DBUG_ASSERT(sp->revcnt >= 1); + + if (local_t < sp->revts[0] || local_t > sp->revts[sp->revcnt]) + { + /* + This means that source time can't be represented as my_time_t due to + limited my_time_t range. + */ + DBUG_RETURN(0); + } + + /* binary search for our range */ + i= find_time_range(local_t, sp->revts, sp->revcnt); + + if (sp->revtis[i].rt_type) + { + /* + Oops! We are in spring time gap. + May be we should return error here? + Now we are returning my_time_t value corresponding to the + beginning of the gap. + */ + *in_dst_time_gap= 1; + DBUG_RETURN(sp->revts[i] - sp->revtis[i].rt_offset + saved_seconds); + } + else + DBUG_RETURN(local_t - sp->revtis[i].rt_offset + saved_seconds); +} + + +/* + End of elsie derived code. +*/ + + +#if !defined(TESTTIME) && !defined(TZINFO2SQL) + +/* + String with names of SYSTEM time zone. +*/ +static const String tz_SYSTEM_name("SYSTEM", 6, &my_charset_latin1); + + +/* + Instance of this class represents local time zone used on this system + (specified by TZ environment variable or via any other system mechanism). + It uses system functions (localtime_r, my_system_gmt_sec) for conversion + and is always available. Because of this it is used by default - if there + were no explicit time zone specified. On the other hand because of this + conversion methods provided by this class is significantly slower and + possibly less multi-threaded-friendly than corresponding Time_zone_db + methods so the latter should be preffered there it is possible. +*/ +class Time_zone_system : public Time_zone +{ +public: + virtual my_time_t TIME_to_gmt_sec(const TIME *t, + bool *in_dst_time_gap) const; + virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual const String * get_name() const; +}; + + +/* + Converts local time in system time zone in TIME representation + to its my_time_t representation. + + SYNOPSIS + TIME_to_gmt_sec() + t - pointer to TIME structure with local time in + broken-down representation. + in_dst_time_gap - pointer to bool which is set to true if datetime + value passed doesn't really exist (i.e. falls into + spring time-gap) and is not touched otherwise. + + DESCRIPTION + This method uses system function (localtime_r()) for conversion + local time in system time zone in TIME structure to its my_time_t + representation. Unlike the same function for Time_zone_db class + it it won't handle unnormalized input properly. Still it will + return lowest possible my_time_t in case of ambiguity or if we + provide time corresponding to the time-gap. + + You should call init_time() function before using this function. + + RETURN VALUE + Corresponding my_time_t value or 0 in case of error +*/ +my_time_t +Time_zone_system::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +{ + long not_used; + return my_system_gmt_sec(t, ¬_used, in_dst_time_gap); +} + + +/* + Converts time from UTC seconds since Epoch (my_time_t) representation + to system local time zone broken-down representation. + + SYNOPSIS + gmt_sec_to_TIME() + tmp - pointer to TIME structure to fill-in + t - my_time_t value to be converted + + NOTE + We assume that value passed to this function will fit into time_t range + supported by localtime_r. This conversion is putting restriction on + TIMESTAMP range in MySQL. If we can get rid of SYSTEM time zone at least + for interaction with client then we can extend TIMESTAMP range down to + the 1902 easily. +*/ +void +Time_zone_system::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +{ + struct tm tmp_tm; + time_t tmp_t= (time_t)t; + + localtime_r(&tmp_t, &tmp_tm); + localtime_to_TIME(tmp, &tmp_tm); + tmp->time_type= TIMESTAMP_DATETIME; +} + + +/* + Get name of time zone + + SYNOPSIS + get_name() + + RETURN VALUE + Name of time zone as String +*/ +const String * +Time_zone_system::get_name() const +{ + return &tz_SYSTEM_name; +} + + +/* + Instance of this class represents UTC time zone. It uses system gmtime_r + function for conversions and is always available. It is used only for + my_time_t -> TIME conversions in various UTC_... functions, it is not + intended for TIME -> my_time_t conversions and shouldn't be exposed to user. +*/ +class Time_zone_utc : public Time_zone +{ +public: + virtual my_time_t TIME_to_gmt_sec(const TIME *t, + bool *in_dst_time_gap) const; + virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual const String * get_name() const; +}; + + +/* + Convert UTC time from TIME representation to its my_time_t representation. + + SYNOPSIS + TIME_to_gmt_sec() + t - pointer to TIME structure with local time + in broken-down representation. + in_dst_time_gap - pointer to bool which is set to true if datetime + value passed doesn't really exist (i.e. falls into + spring time-gap) and is not touched otherwise. + + DESCRIPTION + Since Time_zone_utc is used only internally for my_time_t -> TIME + conversions, this function of Time_zone interface is not implemented for + this class and should not be called. + + RETURN VALUE + 0 +*/ +my_time_t +Time_zone_utc::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +{ + /* Should be never called */ + DBUG_ASSERT(0); + return 0; +} + + +/* + Converts time from UTC seconds since Epoch (my_time_t) representation + to broken-down representation (also in UTC). + + SYNOPSIS + gmt_sec_to_TIME() + tmp - pointer to TIME structure to fill-in + t - my_time_t value to be converted + + NOTE + See note for apropriate Time_zone_system method. +*/ +void +Time_zone_utc::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +{ + struct tm tmp_tm; + time_t tmp_t= (time_t)t; + gmtime_r(&tmp_t, &tmp_tm); + localtime_to_TIME(tmp, &tmp_tm); + tmp->time_type= TIMESTAMP_DATETIME; +} + + +/* + Get name of time zone + + SYNOPSIS + get_name() + + DESCRIPTION + Since Time_zone_utc is used only internally by SQL's UTC_* functions it + is not accessible directly, and hence this function of Time_zone + interface is not implemented for this class and should not be called. + + RETURN VALUE + 0 +*/ +const String * +Time_zone_utc::get_name() const +{ + /* Should be never called */ + DBUG_ASSERT(0); + return 0; +} + + +/* + Instance of this class represents some time zone which is + described in mysql.time_zone family of tables. +*/ +class Time_zone_db : public Time_zone +{ +public: + Time_zone_db(TIME_ZONE_INFO *tz_info_arg, const String * tz_name_arg); + virtual my_time_t TIME_to_gmt_sec(const TIME *t, + bool *in_dst_time_gap) const; + virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual const String * get_name() const; +private: + TIME_ZONE_INFO *tz_info; + const String *tz_name; +}; + + +/* + Initializes object representing time zone described by mysql.time_zone + tables. + + SYNOPSIS + Time_zone_db() + tz_info_arg - pointer to TIME_ZONE_INFO structure which is filled + according to db or other time zone description + (for example by my_tz_init()). + Several Time_zone_db instances can share one + TIME_ZONE_INFO structure. + tz_name_arg - name of time zone. +*/ +Time_zone_db::Time_zone_db(TIME_ZONE_INFO *tz_info_arg, + const String *tz_name_arg): + tz_info(tz_info_arg), tz_name(tz_name_arg) +{ +} + + +/* + Converts local time in time zone described from TIME + representation to its my_time_t representation. + + SYNOPSIS + TIME_to_gmt_sec() + t - pointer to TIME structure with local time + in broken-down representation. + in_dst_time_gap - pointer to bool which is set to true if datetime + value passed doesn't really exist (i.e. falls into + spring time-gap) and is not touched otherwise. + + DESCRIPTION + Please see ::TIME_to_gmt_sec for function description and + parameter restrictions. + + RETURN VALUE + Corresponding my_time_t value or 0 in case of error +*/ +my_time_t +Time_zone_db::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +{ + return ::TIME_to_gmt_sec(t, tz_info, in_dst_time_gap); +} + + +/* + Converts time from UTC seconds since Epoch (my_time_t) representation + to local time zone described in broken-down representation. + + SYNOPSIS + gmt_sec_to_TIME() + tmp - pointer to TIME structure to fill-in + t - my_time_t value to be converted +*/ +void +Time_zone_db::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +{ + ::gmt_sec_to_TIME(tmp, t, tz_info); +} + + +/* + Get name of time zone + + SYNOPSIS + get_name() + + RETURN VALUE + Name of time zone as ASCIIZ-string +*/ +const String * +Time_zone_db::get_name() const +{ + return tz_name; +} + + +/* + Instance of this class represents time zone which + was specified as offset from UTC. +*/ +class Time_zone_offset : public Time_zone +{ +public: + Time_zone_offset(long tz_offset_arg); + virtual my_time_t TIME_to_gmt_sec(const TIME *t, + bool *in_dst_time_gap) const; + virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const; + virtual const String * get_name() const; + /* + This have to be public because we want to be able to access it from + my_offset_tzs_get_key() function + */ + long offset; +private: + /* Extra reserve because of snprintf */ + char name_buff[7+16]; + String name; +}; + + +/* + Initializes object representing time zone described by its offset from UTC. + + SYNOPSIS + Time_zone_offset() + tz_offset_arg - offset from UTC in seconds. + Positive for direction to east. +*/ +Time_zone_offset::Time_zone_offset(long tz_offset_arg): + offset(tz_offset_arg) +{ + uint hours= abs((int)(offset / SECS_PER_HOUR)); + uint minutes= abs((int)(offset % SECS_PER_HOUR / SECS_PER_MIN)); + ulong length= my_snprintf(name_buff, sizeof(name_buff), "%s%02d:%02d", + (offset>=0) ? "+" : "-", hours, minutes); + name.set(name_buff, length, &my_charset_latin1); +} + + +/* + Converts local time in time zone described as offset from UTC + from TIME representation to its my_time_t representation. + + SYNOPSIS + TIME_to_gmt_sec() + t - pointer to TIME structure with local time + in broken-down representation. + in_dst_time_gap - pointer to bool which should be set to true if + datetime value passed doesn't really exist + (i.e. falls into spring time-gap) and is not + touched otherwise. + It is not really used in this class. + + RETURN VALUE + Corresponding my_time_t value or 0 in case of error +*/ +my_time_t +Time_zone_offset::TIME_to_gmt_sec(const TIME *t, bool *in_dst_time_gap) const +{ + return sec_since_epoch(t->year, t->month, t->day, + t->hour, t->minute, t->second) - + offset; +} + + +/* + Converts time from UTC seconds since Epoch (my_time_t) representation + to local time zone described as offset from UTC and in broken-down + representation. + + SYNOPSIS + gmt_sec_to_TIME() + tmp - pointer to TIME structure to fill-in + t - my_time_t value to be converted +*/ +void +Time_zone_offset::gmt_sec_to_TIME(TIME *tmp, my_time_t t) const +{ + sec_to_TIME(tmp, t, offset); +} + + +/* + Get name of time zone + + SYNOPSIS + get_name() + + RETURN VALUE + Name of time zone as pointer to String object +*/ +const String * +Time_zone_offset::get_name() const +{ + return &name; +} + + +static Time_zone_utc tz_UTC; +static Time_zone_system tz_SYSTEM; + +Time_zone *my_tz_UTC= &tz_UTC; +Time_zone *my_tz_SYSTEM= &tz_SYSTEM; + +static HASH tz_names; +static HASH offset_tzs; +static MEM_ROOT tz_storage; + +/* + These mutex protects offset_tzs and tz_storage. + These protection needed only when we are trying to set + time zone which is specified as offset, and searching for existing + time zone in offset_tzs or creating if it didn't existed before in + tz_storage. So contention is low. +*/ +static pthread_mutex_t tz_LOCK; + +/* + This two static variables are inteded for holding info about leap seconds + shared by all time zones. +*/ +static uint tz_leapcnt= 0; +static LS_INFO *tz_lsis= 0; + + +typedef struct st_tz_names_entry: public Sql_alloc +{ + String name; + Time_zone *tz; +} TZ_NAMES_ENTRY; + + +/* + We are going to call both of these functions from C code so + they should obey C calling conventions. +*/ + +extern "C" byte* my_tz_names_get_key(TZ_NAMES_ENTRY *entry, uint *length, + my_bool not_used __attribute__((unused))) +{ + *length= entry->name.length(); + return (byte*) entry->name.ptr(); +} + +extern "C" byte* my_offset_tzs_get_key(Time_zone_offset *entry, uint *length, + my_bool not_used __attribute__((unused))) +{ + *length= sizeof(long); + return (byte*) &entry->offset; +} + + +/* + Initialize time zone support infrastructure. + + SYNOPSIS + my_tz_init() + thd - current thread object + default_tzname - default time zone or 0 if none. + bootstrap - indicates whenever we are in bootstrap mode + + DESCRIPTION + This function will init memory structures needed for time zone support, + it will register mandatory SYSTEM time zone in them. It will try to open + mysql.time_zone_leap_seconds table and and load information which further + will be shared among all time zones loaded. It will also try to load + information about default time zone. If system tables with time zone + descriptions don't exist it won't fail (unless default_tzname is time zone + from tables). If bootstrap parameter is true then this routine assumes that + we are in bootstrap mode and won't load time zone descriptions unless someone + specifies default time zone which is supposedly stored in those tables. + It'll also set default time zone if it is specified. + + RETURN VALUES + 0 - ok + 1 - Error +*/ +my_bool +my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) +{ + THD *thd; + TABLE_LIST tables; + TABLE *table; + TABLE *lock_ptr; + MYSQL_LOCK *lock; + TZ_NAMES_ENTRY *tmp_tzname; + my_bool return_val= 1; + int res; + uint not_used; + + DBUG_ENTER("my_tz_init"); + + /* + To be able to run this from boot, we allocate a temporary THD + */ + if (!(thd= new THD)) + DBUG_RETURN(1); + thd->store_globals(); + + /* Init all memory structures that require explicit destruction */ + if (hash_init(&tz_names, &my_charset_latin1, 20, + 0, 0, (hash_get_key)my_tz_names_get_key, 0, 0)) + { + sql_print_error("Fatal error: OOM while initializing time zones"); + goto end; + } + if (hash_init(&offset_tzs, &my_charset_latin1, 26, 0, 0, + (hash_get_key)my_offset_tzs_get_key, 0, 0)) + { + sql_print_error("Fatal error: OOM while initializing time zones"); + hash_free(&tz_names); + goto end; + } + init_alloc_root(&tz_storage, 32 * 1024, 0); + VOID(pthread_mutex_init(&tz_LOCK, MY_MUTEX_INIT_FAST)); + + /* Add 'SYSTEM' time zone to tz_names hash */ + if (!(tmp_tzname= new (&tz_storage) TZ_NAMES_ENTRY())) + { + sql_print_error("Fatal error: OOM while initializing time zones"); + goto end_with_cleanup; + } + tmp_tzname->name.set("SYSTEM", 6, &my_charset_latin1); + tmp_tzname->tz= my_tz_SYSTEM; + if (my_hash_insert(&tz_names, (const byte *)tmp_tzname)) + { + sql_print_error("Fatal error: OOM while initializing time zones"); + goto end_with_cleanup; + } + + if (bootstrap) + { + /* If we are in bootstrap mode we should not load time zone tables */ + return_val= 0; + goto end_with_setting_default_tz; + } + + /* + After this point all memory structures are inited and we even can live + without time zone description tables. Now try to load information about + leap seconds shared by all time zones. + */ + + thd->db= my_strdup("mysql",MYF(0)); + thd->db_length= 5; // Safety + bzero((char*) &tables,sizeof(tables)); + tables.alias= tables.real_name= (char*)"time_zone_leap_second"; + tables.lock_type= TL_READ; + tables.db= thd->db; + + if (open_tables(thd, &tables, ¬_used)) + { + sql_print_error("Warning: Can't open time zone table: %s " + "trying to live without them", thd->net.last_error); + /* We will try emulate that everything is ok */ + return_val= 0; + goto end_with_setting_default_tz; + } + + lock_ptr= tables.table; + if (!(lock= mysql_lock_tables(thd, &lock_ptr, 1))) + { + sql_print_error("Fatal error: Can't lock time zone table: %s", + thd->net.last_error); + goto end_with_cleanup; + } + + + /* + Now we are going to load leap seconds descriptions that are shared + between all time zones that use them. We are using index for getting + records in proper order. Since we share the same MEM_ROOT between + all time zones we just allocate enough memory for it first. + */ + if (!(tz_lsis= (LS_INFO*) alloc_root(&tz_storage, + sizeof(LS_INFO) * TZ_MAX_LEAPS))) + { + sql_print_error("Fatal error: Out of memory while loading " + "mysql.time_zone_leap_second table"); + goto end_with_unlock; + } + + table= tables.table; + table->file->index_init(0); + tz_leapcnt= 0; + + res= table->file->index_first(table->record[0]); + + while (!res) + { + if (tz_leapcnt + 1 > TZ_MAX_LEAPS) + { + sql_print_error("Fatal error: While loading mysql.time_zone_leap_second" + " table: too much leaps"); + table->file->index_end(); + goto end_with_unlock; + } + + tz_lsis[tz_leapcnt].ls_trans= (my_time_t)table->field[0]->val_int(); + tz_lsis[tz_leapcnt].ls_corr= (long)table->field[1]->val_int(); + + tz_leapcnt++; + + DBUG_PRINT("info", + ("time_zone_leap_second table: tz_leapcnt=%u tt_time=%lld offset=%ld", + tz_leapcnt, (longlong)tz_lsis[tz_leapcnt-1].ls_trans, + tz_lsis[tz_leapcnt-1].ls_corr)); + + res= table->file->index_next(table->record[0]); + } + + table->file->index_end(); + + if (res != HA_ERR_END_OF_FILE) + { + sql_print_error("Fatal error: Error while loading " + "mysql.time_zone_leap_second table"); + goto end_with_unlock; + } + + /* + Loading of info about leap seconds succeeded + */ + + return_val= 0; + + +end_with_unlock: + mysql_unlock_tables(thd, lock); + thd->version--; /* Force close to free memory */ + +end_with_setting_default_tz: + /* If not an error and have default time zone try to load it */ + if (!return_val && default_tzname) + { + String tzname(default_tzname, &my_charset_latin1); + if (!(global_system_variables.time_zone= my_tz_find(thd, &tzname))) + { + sql_print_error("Fatal error: Illegal or unknown default time zone '%s'", + default_tzname); + return_val= 1; + } + } + +end_with_cleanup: + + /* if there were error free time zone describing structs */ + if (return_val) + my_tz_free(); +end: + close_thread_tables(thd); + delete thd; + if (org_thd) + org_thd->store_globals(); /* purecov: inspected */ + else + { + /* Remember that we don't have a THD */ + my_pthread_setspecific_ptr(THR_THD, 0); + my_pthread_setspecific_ptr(THR_MALLOC, 0); + } + DBUG_RETURN(return_val); +} + + +/* + Free resources used by time zone support infrastructure. + + SYNOPSIS + my_tz_free() +*/ +void my_tz_free() +{ + VOID(pthread_mutex_destroy(&tz_LOCK)); + hash_free(&offset_tzs); + hash_free(&tz_names); + free_root(&tz_storage, MYF(0)); +} + + +/* + Load time zone description from system tables. + + SYNOPSIS + tz_load_from_db() + thd - current thread object + tz_name - name of time zone that should be loaded. + + DESCRIPTION + This function will try to open system tables describing time zones + and to load information about time zone specified. It will also update + information in hash used for time zones lookup. + + RETURN VALUES + Returns pointer to newly created Time_zone object or 0 in case of error. + +*/ +static Time_zone* +tz_load_from_db(THD *thd, const String *tz_name) +{ + TABLE_LIST tables[4]; + TABLE *table= 0; + TABLE *lock_ptr[4]; + MYSQL_LOCK *lock; + char system_db_name[]= "mysql"; + char *db_save; + uint db_length_save; + TIME_ZONE_INFO *tz_info; + TZ_NAMES_ENTRY *tmp_tzname; + Time_zone *return_val= 0; + int res; + uint tzid, ttid; + my_time_t ttime; + char buff[MAX_FIELD_WIDTH]; + String abbr(buff, sizeof(buff), &my_charset_latin1); + char *alloc_buff, *tz_name_buff; + /* + Temporary arrays that are used for loading of data for filling + TIME_ZONE_INFO structure + */ + my_time_t ats[TZ_MAX_TIMES]; + unsigned char types[TZ_MAX_TIMES]; + TRAN_TYPE_INFO ttis[TZ_MAX_TYPES]; +#ifdef ABBR_ARE_USED + char chars[max(TZ_MAX_CHARS + 1, (2 * (MY_TZNAME_MAX + 1)))]; +#endif + uint not_used; + + DBUG_ENTER("tz_load_from_db"); + + + /* Prepare tz_info for loading also let us make copy of time zone name */ + if (!(alloc_buff= alloc_root(&tz_storage, sizeof(TIME_ZONE_INFO) + + tz_name->length() + 1))) + { + sql_print_error("Error: Out of memory while loading time zone " + "description"); + return 0; + } + tz_info= (TIME_ZONE_INFO *)alloc_buff; + bzero(tz_info, sizeof(TIME_ZONE_INFO)); + tz_name_buff= alloc_buff + sizeof(TIME_ZONE_INFO); + /* + By writing zero to the end we guarantee that we can call ptr() + instead of c_ptr() for time zone name. + */ + strmake(tz_name_buff, tz_name->ptr(), tz_name->length()); + + /* + Open and lock time zone description tables + */ + db_save= thd->db; + db_length_save= thd->db_length; + thd->db= system_db_name; + thd->db_length= 5; + + bzero((char*) &tables,sizeof(tables)); + tables[0].alias= tables[0].real_name= (char*)"time_zone_name"; + tables[1].alias= tables[1].real_name= (char*)"time_zone"; + tables[2].alias= tables[2].real_name= (char*)"time_zone_transition"; + tables[3].alias= tables[3].real_name= (char*)"time_zone_transition_type"; + tables[0].next= tables+1; + tables[1].next= tables+2; + tables[2].next= tables+3; + tables[0].lock_type= tables[1].lock_type= tables[2].lock_type= + tables[3].lock_type= TL_READ; + tables[0].db= tables[1].db= tables[2].db= tables[3].db= thd->db; + if (open_tables(thd, tables, ¬_used)) + { + sql_print_error("Error: Can't open time zone tables: %s", + thd->net.last_error); + goto end; + } + + lock_ptr[0]= tables[0].table; + lock_ptr[1]= tables[1].table; + lock_ptr[2]= tables[2].table; + lock_ptr[3]= tables[3].table; + if (!(lock= mysql_lock_tables(thd, lock_ptr, 4))) + { + sql_print_error("Error: Can't lock time zone tables: %s", + thd->net.last_error); + goto end_with_close; + } + + /* + Let us find out time zone id by its name (there is only one index + and it is specifically for this purpose). + */ + table= tables[0].table; + + table->field[0]->store(tz_name->ptr(), tz_name->length(), &my_charset_latin1); + table->file->index_init(0); + + if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, + 0, HA_READ_KEY_EXACT)) + { + sql_print_error("Error: Can't find description of time zone."); + goto end_with_unlock; + } + + tzid= table->field[1]->val_int(); + + table->file->index_end(); + + /* + Now we need to lookup record in mysql.time_zone table in order to + understand whenever this timezone uses leap seconds (again we are + using the only index in this table). + */ + table= tables[1].table; + table->field[0]->store((longlong)tzid); + table->file->index_init(0); + + if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, + 0, HA_READ_KEY_EXACT)) + { + sql_print_error("Error: Can't find description of time zone."); + goto end_with_unlock; + } + + /* If Uses_leap_seconds == 'Y' */ + if (table->field[1]->val_int() == 1) + { + tz_info->leapcnt= tz_leapcnt; + tz_info->lsis= tz_lsis; + } + + table->file->index_end(); + + /* + Now we will iterate through records for out time zone in + mysql.time_zone_transition_type table. Because we want records + only for our time zone guess what are we doing? + Right - using special index. + */ + table= tables[3].table; + table->field[0]->store((longlong)tzid); + table->file->index_init(0); + + // FIXME Is there any better approach than explicitly specifying 4 ??? + res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, + 4, HA_READ_KEY_EXACT); + while (!res) + { + ttid= table->field[1]->val_int(); + + if (ttid > TZ_MAX_TYPES) + { + sql_print_error("Error while loading time zone description from " + "mysql.time_zone_transition_type table: too big " + "transition type id"); + goto end_with_unlock; + } + + ttis[ttid].tt_gmtoff= table->field[2]->val_int(); + ttis[ttid].tt_isdst= (table->field[3]->val_int() > 0); + +#ifdef ABBR_ARE_USED + // FIXME should we do something with duplicates here ? + table->field[4]->val_str(&abbr, &abbr); + if (tz_info->charcnt + abbr.length() + 1 > sizeof(chars)) + { + sql_print_error("Error while loading time zone description from " + "mysql.time_zone_transition_type table: not enough " + "room for abbreviations"); + goto end_with_unlock; + } + ttis[ttid].tt_abbrind= tz_info->charcnt; + memcpy(chars + tz_info->charcnt, abbr.ptr(), abbr.length()); + tz_info->charcnt+= abbr.length(); + chars[tz_info->charcnt]= 0; + tz_info->charcnt++; + + DBUG_PRINT("info", + ("time_zone_transition_type table: tz_id=%u tt_id=%u tt_gmtoff=%ld " + "abbr='%s' tt_isdst=%u", tzid, ttid, ttis[ttid].tt_gmtoff, + chars + ttis[ttid].tt_abbrind, ttis[ttid].tt_isdst)); +#else + DBUG_PRINT("info", + ("time_zone_transition_type table: tz_id=%u tt_id=%u tt_gmtoff=%ld " + "tt_isdst=%u", tzid, ttid, ttis[ttid].tt_gmtoff, ttis[ttid].tt_isdst)); +#endif + + /* ttid is increasing because we are reading using index */ + DBUG_ASSERT(ttid >= tz_info->typecnt); + + tz_info->typecnt= ttid + 1; + + res= table->file->index_next_same(table->record[0], + (byte*)table->field[0]->ptr, 4); + } + + if (res != HA_ERR_END_OF_FILE) + { + sql_print_error("Error while loading time zone description from " + "mysql.time_zone_transition_type table"); + goto end_with_unlock; + } + + table->file->index_end(); + + + /* + At last we are doing the same thing for records in + mysql.time_zone_transition table. Here we additionaly need records + in ascending order by index scan also satisfies us. + */ + table= tables[2].table; + table->field[0]->store((longlong)tzid); + table->file->index_init(0); + + // FIXME Is there any better approach than explicitly specifying 4 ??? + res= table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, + 4, HA_READ_KEY_EXACT); + while (!res) + { + ttime= (my_time_t)table->field[1]->val_int(); + ttid= (uint)table->field[2]->val_int(); + + if (tz_info->timecnt + 1 > TZ_MAX_TIMES) + { + sql_print_error("Error while loading time zone description from " + "mysql.time_zone_transition table: " + "too much transitions"); + goto end_with_unlock; + } + if (ttid + 1 > tz_info->typecnt) + { + sql_print_error("Error while loading time zone description from " + "mysql.time_zone_transition table: " + "bad transition type id"); + goto end_with_unlock; + } + + ats[tz_info->timecnt]= ttime; + types[tz_info->timecnt]= ttid; + tz_info->timecnt++; + + DBUG_PRINT("info", + ("time_zone_transition table: tz_id=%u tt_time=%lld tt_id=%u", + tzid, (longlong)ttime, ttid)); + + res= table->file->index_next_same(table->record[0], + (byte*)table->field[0]->ptr, 4); + } + + /* + We have to allow HA_ERR_KEY_NOT_FOUND because some time zones + for example UTC have no transitons. + */ + if (res != HA_ERR_END_OF_FILE && res != HA_ERR_KEY_NOT_FOUND) + { + sql_print_error("Error while loading time zone description from " + "mysql.time_zone_transition table"); + goto end_with_unlock; + } + + table->file->index_end(); + table= 0; + + /* + Now we will allocate memory and init TIME_ZONE_INFO structure. + */ + if (!(alloc_buff= alloc_root(&tz_storage, + ALIGN_SIZE(sizeof(my_time_t) * + tz_info->timecnt) + + ALIGN_SIZE(tz_info->timecnt) + +#ifdef ABBR_ARE_USED + ALIGN_SIZE(tz_info->charcnt) + +#endif + sizeof(TRAN_TYPE_INFO) * tz_info->typecnt))) + { + sql_print_error("Error: Out of memory while loading time zone " + "description"); + goto end_with_unlock; + } + + + tz_info->ats= (my_time_t *)alloc_buff; + memcpy(tz_info->ats, ats, tz_info->timecnt * sizeof(my_time_t)); + alloc_buff+= ALIGN_SIZE(sizeof(my_time_t) * tz_info->timecnt); + tz_info->types= (unsigned char *)alloc_buff; + memcpy(tz_info->types, types, tz_info->timecnt); + alloc_buff+= ALIGN_SIZE(tz_info->timecnt); +#ifdef ABBR_ARE_USED + tz_info->chars= alloc_buff; + memcpy(tz_info->chars, chars, tz_info->charcnt); + alloc_buff+= ALIGN_SIZE(tz_info->charcnt); +#endif + tz_info->ttis= (TRAN_TYPE_INFO *)alloc_buff; + memcpy(tz_info->ttis, ttis, tz_info->typecnt * sizeof(TRAN_TYPE_INFO)); + + /* + Let us check how correct our time zone description and build + reversed map. We don't check for tz->timecnt < 1 since it ok for GMT. + */ + if (tz_info->typecnt < 1) + { + sql_print_error("Error: loading time zone without transition types"); + goto end_with_unlock; + } + if (prepare_tz_info(tz_info, &tz_storage)) + { + sql_print_error("Error: Unable to build mktime map for time zone"); + goto end_with_unlock; + } + + + if (!(tmp_tzname= new (&tz_storage) TZ_NAMES_ENTRY()) || + !(tmp_tzname->tz= new (&tz_storage) Time_zone_db(tz_info, + &(tmp_tzname->name))) || + (tmp_tzname->name.set(tz_name_buff, tz_name->length(), + &my_charset_latin1), + my_hash_insert(&tz_names, (const byte *)tmp_tzname))) + { + sql_print_error("Error: Out of memory while loading time zone"); + goto end_with_unlock; + } + + /* + Loading of time zone succeeded + */ + return_val= tmp_tzname->tz; + +end_with_unlock: + + if (table) + table->file->index_end(); + + mysql_unlock_tables(thd, lock); + +end_with_close: + close_thread_tables(thd); + +end: + thd->db= db_save; + thd->db_length= db_length_save; + DBUG_RETURN(return_val); +} + + +/* + Parse string that specifies time zone as offset from UTC. + + SYNOPSIS + str_to_offset() + str - pointer to string which contains offset + length - length of string + offset - out parameter for storing found offset in seconds. + + DESCRIPTION + This function parses string which contains time zone offset + in form similar to '+10:00' and converts found value to + seconds from UTC form (east is positive). + + RETURN VALUE + 0 - Ok + 1 - String doesn't contain valid time zone offset +*/ +my_bool +str_to_offset(const char *str, uint length, long *offset) +{ + const char *end= str + length; + my_bool negative; + ulong number_tmp; + long offset_tmp; + + if (length < 4) + return 1; + + if (*str == '+') + negative= 0; + else if (*str == '-') + negative= 1; + else + return 1; + str++; + + number_tmp= 0; + + while (str < end && my_isdigit(&my_charset_latin1, *str)) + { + number_tmp= number_tmp*10 + *str - '0'; + str++; + } + + if (str + 1 >= end || *str != ':') + return 1; + str++; + + offset_tmp = number_tmp * MINS_PER_HOUR; number_tmp= 0; + + while (str < end && my_isdigit(&my_charset_latin1, *str)) + { + number_tmp= number_tmp * 10 + *str - '0'; + str++; + } + + if (str != end) + return 1; + + offset_tmp= (offset_tmp + number_tmp) * SECS_PER_MIN; + + if (negative) + offset_tmp= -offset_tmp; + + /* + Check if offset is in range prescribed by standard + (from -12:59 to 13:00). + */ + + if (number_tmp > 59 || offset_tmp < -13 * SECS_PER_HOUR + 1 || + offset_tmp > 13 * SECS_PER_HOUR) + return 1; + + *offset= offset_tmp; + + return 0; +} + + +/* + Get Time_zone object for specified time zone. + + SYNOPSIS + my_tz_find() + thd - current thread + name - time zone specification + + DESCRIPTION + This function checks if name is one of time zones described in db, + predefined SYSTEM time zone or valid time zone specification as + offset from UTC (In last case it will create proper Time_zone_offset + object if there were not any.). If name is ok it returns corresponding + Time_zone object. + + Clients of this function are not responsible for releasing resources + occupied by returned Time_zone object so they can just forget pointers + to Time_zone object if they are not needed longer. + + Other important property of this function: if some Time_zone found once + it will be for sure found later, so this function can also be used for + checking if proper Time_zone object exists (and if there will be error + it will be reported during first call). + + If name pointer is 0 then this function returns 0 (this allows to pass 0 + values as parameter without additional external check and this property + is used by @@time_zone variable handling code). + + It will perform lookup in system tables (mysql.time_zone*) if needed. + + RETURN VALUE + Pointer to corresponding Time_zone object. 0 - in case of bad time zone + specification or other error. + +*/ +Time_zone * +my_tz_find(THD *thd, const String * name) +{ + TZ_NAMES_ENTRY *tmp_tzname; + Time_zone *result_tz= 0; + long offset; + + DBUG_ENTER("my_tz_find"); + DBUG_PRINT("enter", ("time zone name='%s'", + name ? ((String *)name)->c_ptr() : "NULL")); + + if (!name) + DBUG_RETURN(0); + + VOID(pthread_mutex_lock(&tz_LOCK)); + + if (!str_to_offset(name->ptr(), name->length(), &offset)) + { + + if (!(result_tz= (Time_zone_offset *)hash_search(&offset_tzs, + (const byte *)&offset, + sizeof(long)))) + { + DBUG_PRINT("info", ("Creating new Time_zone_offset object")); + + if (!(result_tz= new (&tz_storage) Time_zone_offset(offset)) || + my_hash_insert(&offset_tzs, (const byte *) result_tz)) + { + sql_print_error("Fatal error: Out of memory " + "while setting new time zone"); + result_tz= 0; + } + } + } else { + if ((tmp_tzname= (TZ_NAMES_ENTRY *)hash_search(&tz_names, name->ptr(), + name->length()))) + result_tz= tmp_tzname->tz; + else + result_tz= tz_load_from_db(thd, name); + } + + VOID(pthread_mutex_unlock(&tz_LOCK)); + + DBUG_RETURN(result_tz); +} + +#endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */ + + +#ifdef TZINFO2SQL +/* + This code belongs to mysql_tzinfo_to_sql converter command line utility. + This utility should be used by db admin for populating mysql.time_zone + tables. +*/ + + +/* + Print info about time zone described by TIME_ZONE_INFO struct as + SQL statements populating mysql.time_zone* tables. + + SYNOPSIS + print_tz_as_sql() + tz_name - name of time zone + sp - structure describing time zone +*/ +void +print_tz_as_sql(const char* tz_name, const TIME_ZONE_INFO *sp) +{ + uint i; + + /* Here we assume that all time zones have same leap correction tables */ + printf("INSERT INTO time_zone (Use_leap_seconds) VALUES ('%s');\n", + sp->leapcnt ? "Y" : "N"); + printf("SET @time_zone_id= LAST_INSERT_ID();\n"); + printf("INSERT INTO time_zone_name (Name, Time_zone_id) VALUES \ +('%s', @time_zone_id);\n", tz_name); + + if (sp->timecnt) + { + printf("INSERT INTO time_zone_transition \ +(Time_zone_id, Transition_time, Transition_type_id) VALUES\n"); + for (i= 0; i < sp->timecnt; i++) + printf("%s(@time_zone_id, %ld, %u)\n", (i == 0 ? " " : ","), sp->ats[i], + (uint)sp->types[i]); + printf(";\n"); + } + + printf("INSERT INTO time_zone_transition_type \ +(Time_zone_id, Transition_type_id, Offset, Is_DST, Abbreviation) VALUES\n"); + + for (i= 0; i < sp->typecnt; i++) + printf("%s(@time_zone_id, %u, %ld, %d, '%s')\n", (i == 0 ? " " : ","), i, + sp->ttis[i].tt_gmtoff, sp->ttis[i].tt_isdst, + sp->chars + sp->ttis[i].tt_abbrind); + printf(";\n"); +} + + +/* + Print info about leap seconds in time zone as SQL statements + populating mysql.time_zone_leap_second table. + + SYNOPSIS + print_tz_leaps_as_sql() + sp - structure describing time zone +*/ +void +print_tz_leaps_as_sql(const TIME_ZONE_INFO *sp) +{ + uint i; + + /* + We are assuming that there are only one list of leap seconds + For all timezones. + */ + printf("TRUNCATE TABLE time_zone_leap_second;\n"); + + if (sp->leapcnt) + { + printf("INSERT INTO time_zone_leap_second \ +(Transition_time, Correction) VALUES\n"); + for (i= 0; i < sp->leapcnt; i++) + printf("%s(%ld, %ld)\n", (i == 0 ? " " : ","), + sp->lsis[i].ls_trans, sp->lsis[i].ls_corr); + printf(";\n"); + } + + printf("ALTER TABLE time_zone_leap_second ORDER BY Transition_time;\n"); +} + + +/* + Some variables used as temporary or as parameters + in recursive scan_tz_dir() code. +*/ +TIME_ZONE_INFO tz_info; +MEM_ROOT tz_storage; +char fullname[FN_REFLEN + 1]; +char *root_name_end; + + +/* + Recursively scan zoneinfo directory and print all found time zone + descriptions as SQL. + + SYNOPSIS + scan_tz_dir() + name_end - pointer to end of path to directory to be searched. + + DESCRIPTION + This auxiliary recursive function also uses several global + variables as in parameters and for storing temporary values. + + fullname - path to directory that should be scanned. + root_name_end - pointer to place in fullname where part with + path to initial directory ends. + current_tz_id - last used time zone id + + RETURN VALUE + 0 - Ok, 1 - Fatal error + +*/ +my_bool +scan_tz_dir(char * name_end) +{ + MY_DIR *cur_dir; + char *name_end_tmp; + uint i; + + if (!(cur_dir= my_dir(fullname, MYF(MY_WANT_STAT)))) + return 1; + + name_end= strmake(name_end, "/", FN_REFLEN - (name_end - fullname)); + + for (i= 0; i < cur_dir->number_off_files; i++) + { + if (cur_dir->dir_entry[i].name[0] != '.') + { + name_end_tmp= strmake(name_end, cur_dir->dir_entry[i].name, + FN_REFLEN - (name_end - fullname)); + + if (MY_S_ISDIR(cur_dir->dir_entry[i].mystat->st_mode)) + { + if (scan_tz_dir(name_end_tmp)) + { + my_dirend(cur_dir); + return 1; + } + } + else if (MY_S_ISREG(cur_dir->dir_entry[i].mystat->st_mode)) + { + init_alloc_root(&tz_storage, 32768, 0); + if (!tz_load(fullname, &tz_info, &tz_storage)) + print_tz_as_sql(root_name_end + 1, &tz_info); + else + fprintf(stderr, + "Warning: Unable to load '%s' as time zone. Skipping it.\n", + fullname); + free_root(&tz_storage, MYF(0)); + } + else + fprintf(stderr, "Warning: '%s' is not regular file or directory\n", + fullname); + } + } + + my_dirend(cur_dir); + + return 0; +} + + +int +main(int argc, char **argv) +{ + MY_INIT(argv[0]); + + if (argc != 2 && argc != 3) + { + fprintf(stderr, "Usage:\n"); + fprintf(stderr, " %s timezonedir\n", argv[0]); + fprintf(stderr, " %s timezonefile timezonename\n", argv[0]); + fprintf(stderr, " %s --leap timezonefile\n", argv[0]); + return 1; + } + + if (argc == 2) + { + root_name_end= strmake(fullname, argv[1], FN_REFLEN); + + printf("TRUNCATE TABLE time_zone;\n"); + printf("TRUNCATE TABLE time_zone_name;\n"); + printf("TRUNCATE TABLE time_zone_transition;\n"); + printf("TRUNCATE TABLE time_zone_transition_type;\n"); + + if (scan_tz_dir(root_name_end)) + { + fprintf(stderr, "There were fatal errors during processing " + "of zoneinfo directory\n"); + return 1; + } + + printf("ALTER TABLE time_zone_transition " + "ORDER BY Time_zone_id, Transition_time;\n"); + printf("ALTER TABLE time_zone_transition_type " + "ORDER BY Time_zone_id, Transition_type_id;\n"); + } + else + { + init_alloc_root(&tz_storage, 32768, 0); + + if (strcmp(argv[1], "--leap") == 0) + { + if (tz_load(argv[2], &tz_info, &tz_storage)) + { + fprintf(stderr, "Problems with zoneinfo file '%s'\n", argv[2]); + return 1; + } + print_tz_leaps_as_sql(&tz_info); + } + else + { + if (tz_load(argv[1], &tz_info, &tz_storage)) + { + fprintf(stderr, "Problems with zoneinfo file '%s'\n", argv[2]); + return 1; + } + print_tz_as_sql(argv[2], &tz_info); + } + + free_root(&tz_storage, MYF(0)); + } + + return 0; +} + +#endif /* defined(TZINFO2SQL) */ + + +#ifdef TESTTIME + +/* + Some simple brute-force test wich allowed to catch a pair of bugs. + Also can provide interesting facts about system's time zone support + implementation. +*/ + +#ifndef CHAR_BIT +#define CHAR_BIT 8 +#endif + +#ifndef TYPE_BIT +#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT) +#endif + +#ifndef TYPE_SIGNED +#define TYPE_SIGNED(type) (((type) -1) < 0) +#endif + +my_bool +is_equal_TIME_tm(const TIME* time_arg, const struct tm * tm_arg) +{ + return (time_arg->year == (uint)tm_arg->tm_year+TM_YEAR_BASE) && + (time_arg->month == (uint)tm_arg->tm_mon+1) && + (time_arg->day == (uint)tm_arg->tm_mday) && + (time_arg->hour == (uint)tm_arg->tm_hour) && + (time_arg->minute == (uint)tm_arg->tm_min) && + (time_arg->second == (uint)tm_arg->tm_sec) && + time_arg->second_part == 0; +} + + +int +main(int argc, char **argv) +{ + my_bool localtime_negative; + TIME_ZONE_INFO tz_info; + struct tm tmp; + TIME time_tmp; + time_t t, t1, t2; + char fullname[FN_REFLEN+1]; + char *str_end; + long not_used; + bool not_used_2; + MEM_ROOT tz_storage; + + MY_INIT(argv[0]); + + init_alloc_root(&tz_storage, 32768, 0); + + /* let us set some well known timezone */ + setenv("TZ", "MET", 1); + tzset(); + + /* Some initial time zone related system info */ + printf("time_t: %s %u bit\n", TYPE_SIGNED(time_t) ? "signed" : "unsigned", + (uint)TYPE_BIT(time_t)); + if (TYPE_SIGNED(time_t)) + { + t= -100; + localtime_negative= test(localtime_r(&t, &tmp) != 0); + printf("localtime_r %s negative params \ + (time_t=%d is %d-%d-%d %d:%d:%d)\n", + (localtime_negative ? "supports" : "doesn't support"), (int)t, + TM_YEAR_BASE + tmp.tm_year, tmp.tm_mon + 1, tmp.tm_mday, + tmp.tm_hour, tmp.tm_min, tmp.tm_sec); + + printf("mktime %s negative results (%d)\n", + (t == mktime(&tmp) ? "doesn't support" : "supports"), + (int)mktime(&tmp)); + } + + tmp.tm_year= 103; tmp.tm_mon= 2; tmp.tm_mday= 30; + tmp.tm_hour= 2; tmp.tm_min= 30; tmp.tm_sec= 0; tmp.tm_isdst= -1; + t= mktime(&tmp); + printf("mktime returns %s for spring time gap (%d)\n", + (t != (time_t)-1 ? "something" : "error"), (int)t); + + tmp.tm_year= 103; tmp.tm_mon= 8; tmp.tm_mday= 1; + tmp.tm_hour= 0; tmp.tm_min= 0; tmp.tm_sec= 0; tmp.tm_isdst= 0; + t= mktime(&tmp); + printf("mktime returns %s for non existing date (%d)\n", + (t != (time_t)-1 ? "something" : "error"), (int)t); + + tmp.tm_year= 103; tmp.tm_mon= 8; tmp.tm_mday= 1; + tmp.tm_hour= 25; tmp.tm_min=0; tmp.tm_sec=0; tmp.tm_isdst=1; + t= mktime(&tmp); + printf("mktime %s unnormalized input (%d)\n", + (t != (time_t)-1 ? "handles" : "doesn't handle"), (int)t); + + tmp.tm_year= 103; tmp.tm_mon= 9; tmp.tm_mday= 26; + tmp.tm_hour= 0; tmp.tm_min= 30; tmp.tm_sec= 0; tmp.tm_isdst= 1; + mktime(&tmp); + tmp.tm_hour= 2; tmp.tm_isdst= -1; + t= mktime(&tmp); + tmp.tm_hour= 4; tmp.tm_isdst= 0; + mktime(&tmp); + tmp.tm_hour= 2; tmp.tm_isdst= -1; + t1= mktime(&tmp); + printf("mktime is %s (%d %d)\n", + (t == t1 ? "determenistic" : "is non-determenistic"), + (int)t, (int)t1); + + /* Let us load time zone description */ + str_end= strmake(fullname, TZDIR, FN_REFLEN); + strmake(str_end, "/MET", FN_REFLEN - (str_end - fullname)); + + if (tz_load(fullname, &tz_info, &tz_storage)) + { + printf("Unable to load time zone info from '%s'\n", fullname); + free_root(&tz_storage, MYF(0)); + return 1; + } + + printf("Testing our implementation\n"); + + if (TYPE_SIGNED(time_t) && localtime_negative) + { + for (t= -40000; t < 20000; t++) + { + localtime_r(&t, &tmp); + gmt_sec_to_TIME(&time_tmp, (my_time_t)t, &tz_info); + if (!is_equal_TIME_tm(&time_tmp, &tmp)) + { + printf("Problem with negative time_t = %d\n", (int)t); + free_root(&tz_storage, MYF(0)); + return 1; + } + } + printf("gmt_sec_to_TIME = localtime for time_t in [-40000,20000) range\n"); + } + + for (t= 1000000000; t < 1100000000; t+= 13) + { + localtime_r(&t,&tmp); + gmt_sec_to_TIME(&time_tmp, (my_time_t)t, &tz_info); + + if (!is_equal_TIME_tm(&time_tmp, &tmp)) + { + printf("Problem with time_t = %d\n", (int)t); + free_root(&tz_storage, MYF(0)); + return 1; + } + } + printf("gmt_sec_to_TIME = localtime for time_t in [1000000000,1100000000) range\n"); + + init_time(); + + /* + Be careful here! my_system_gmt_sec doesn't fully handle unnormalized + dates. + */ + for (time_tmp.year= 1980; time_tmp.year < 2010; time_tmp.year++) + for (time_tmp.month= 1; time_tmp.month < 13; time_tmp.month++) + for (time_tmp.day= 1; + time_tmp.day < mon_lengths[isleap(time_tmp.year)][time_tmp.month-1]; + time_tmp.day++) + for (time_tmp.hour= 0; time_tmp.hour < 24; time_tmp.hour++) + for (time_tmp.minute= 0; time_tmp.minute < 60; time_tmp.minute+= 5) + for (time_tmp.second=0; time_tmp.second<60; time_tmp.second+=25) + { + t= (time_t)my_system_gmt_sec(&time_tmp, ¬_used, ¬_used_2); + t1= (time_t)TIME_to_gmt_sec(&time_tmp, &tz_info, ¬_used_2); + if (t != t1) + { + /* + We need special handling during autumn since my_system_gmt_sec + prefers greater time_t values (in MET) for ambiguity. + And BTW that is a bug which should be fixed !!! + */ + tmp.tm_year= time_tmp.year - TM_YEAR_BASE; + tmp.tm_mon= time_tmp.month - 1; + tmp.tm_mday= time_tmp.day; + tmp.tm_hour= time_tmp.hour; + tmp.tm_min= time_tmp.minute; + tmp.tm_sec= time_tmp.second; + tmp.tm_isdst= 1; + + t2= mktime(&tmp); + + if (t1 == t2) + continue; + + printf("Problem: %u/%u/%u %u:%u:%u with times t=%d, t1=%d\n", + time_tmp.year, time_tmp.month, time_tmp.day, + time_tmp.hour, time_tmp.minute, time_tmp.second, + (int)t,(int)t1); + + free_root(&tz_storage, MYF(0)); + return 1; + } + } + + printf("TIME_to_gmt_sec = my_system_gmt_sec for test range\n"); + + free_root(&tz_storage, MYF(0)); + return 0; +} + +#endif /* defined(TESTTIME) */ diff --git a/sql/tztime.h b/sql/tztime.h new file mode 100644 index 00000000000..ed92441d790 --- /dev/null +++ b/sql/tztime.h @@ -0,0 +1,71 @@ +/* Copyright (C) 2004 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 */ + + +#ifdef __GNUC__ +#pragma interface /* gcc class interface */ +#endif + +#if !defined(TESTTIME) && !defined(TZINFO2SQL) +/* + This class represents abstract time zone and provides + basic interface for TIME <-> my_time_t conversion. + Actual time zones which are specified by DB, or via offset + or use system functions are its descendants. +*/ +class Time_zone: public Sql_alloc +{ +public: + /* + Converts local time in broken down TIME representation to + my_time_t (UTC seconds since Epoch) represenation. + Returns 0 in case of error. Sets in_dst_time_gap to true if date provided + falls into spring time-gap (or lefts it untouched otherwise). + */ + virtual my_time_t TIME_to_gmt_sec(const TIME *t, + bool *in_dst_time_gap) const = 0; + /* + Converts time in my_time_t representation to local time in + broken down TIME representation. + */ + virtual void gmt_sec_to_TIME(TIME *tmp, my_time_t t) const = 0; + /* + Because of constness of String returned by get_name() time zone name + have to be already zeroended to be able to use String::ptr() instead + of c_ptr(). + */ + virtual const String * get_name() const = 0; + + /* + We need this only for surpressing warnings, objects of this type are + allocated on MEM_ROOT and should not require destruction. + */ + virtual ~Time_zone() {}; +}; + +extern Time_zone * my_tz_UTC; +extern Time_zone * my_tz_SYSTEM; +extern Time_zone * my_tz_find(THD *thd, const String *name); +extern my_bool my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap); +extern void my_tz_free(); + +/* + Maximum length of time zone name that we support + (Time zone name is char(64) in db) +*/ +#define MAX_TIME_ZONE_NAME_LENGTH 72 + +#endif /* !defined(TESTTIME) && !defined(TZINFO2SQL) */ diff --git a/sql/unireg.cc b/sql/unireg.cc index 8eae3c38328..b5f6c3546a4 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -632,6 +632,7 @@ static bool make_empty_rec(File file,enum db_type table_type, DBUG_RETURN(1); } + table.in_use= current_thd; table.db_low_byte_first= handler->low_byte_first(); table.blob_ptr_size=portable_sizeof_char_ptr; diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index af8f5d49654..ff53f61c053 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6270,6 +6270,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_big5_chinese_ci_handler = { + NULL, /* init */ my_strnncoll_big5, my_strnncollsp_big5, my_strnxfrm_big5, @@ -6282,6 +6283,7 @@ static MY_COLLATION_HANDLER my_collation_big5_chinese_ci_handler = static MY_CHARSET_HANDLER my_charset_big5_handler= { + NULL, /* init */ ismbchar_big5, mbcharlen_big5, my_numchars_mb, @@ -6298,7 +6300,6 @@ static MY_CHARSET_HANDLER my_charset_big5_handler= my_long10_to_str_8bit, my_longlong10_to_str_8bit, my_fill_8bit, - my_strntol_8bit, my_strntoul_8bit, my_strntoll_8bit, @@ -6314,20 +6315,22 @@ CHARSET_INFO my_charset_big5_chinese_ci= "big5", /* cs name */ "big5_chinese_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_big5, to_lower_big5, to_upper_big5, sort_order_big5, + NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_big5_handler, &my_collation_big5_chinese_ci_handler }; @@ -6340,20 +6343,22 @@ CHARSET_INFO my_charset_big5_bin= "big5", /* cs name */ "big5_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_big5, to_lower_big5, to_upper_big5, sort_order_big5, + NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_big5_handler, &my_collation_mb_bin_handler }; diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 35630eb854f..cc83471f264 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -343,6 +343,7 @@ skip: MY_COLLATION_HANDLER my_collation_8bit_bin_handler = { + NULL, /* init */ my_strnncoll_binary, my_strnncollsp_binary, my_strnxfrm_bin, @@ -356,6 +357,7 @@ MY_COLLATION_HANDLER my_collation_8bit_bin_handler = static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ NULL, /* ismbchar */ my_mbcharlen_8bit, /* mbcharlen */ my_numchars_8bit, @@ -388,15 +390,17 @@ CHARSET_INFO my_charset_bin = "binary", /* cs name */ "binary", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_bin, /* ctype */ bin_char_array, /* to_lower */ bin_char_array, /* to_upper */ bin_char_array, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 9175451ceb7..6f9e9f74d35 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -576,6 +576,7 @@ static MY_UNI_IDX idx_uni_8859_2[]={ static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler = { + NULL, /* init */ my_strnncoll_czech, my_strnncollsp_czech, my_strnxfrm_czech, @@ -593,14 +594,17 @@ CHARSET_INFO my_charset_latin2_czech_ci = "latin2", /* cs name */ "latin2_czech_cs", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_czech, to_lower_czech, to_upper_czech, sort_order_czech, + NULL, /* contractions */ NULL, /* sort_order_big*/ tab_8859_2_uni, /* tab_to_uni */ idx_uni_8859_2, /* tab_from_uni */ - "","", + NULL, /* state_map */ + NULL, /* ident_map */ 4, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 8f955c15a73..fd8659a181c 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -8637,6 +8637,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_ci_handler = { + NULL, /* init */ my_strnncoll_simple, /* strnncoll */ my_strnncollsp_simple, my_strnxfrm_simple, /* strnxfrm */ @@ -8649,6 +8650,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ ismbchar_euc_kr, mbcharlen_euc_kr, my_numchars_mb, @@ -8681,20 +8683,22 @@ CHARSET_INFO my_charset_euckr_korean_ci= "euckr", /* cs name */ "euckr_korean_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_euc_kr, to_lower_euc_kr, to_upper_euc_kr, sort_order_euc_kr, + NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_ci_handler }; @@ -8707,20 +8711,22 @@ CHARSET_INFO my_charset_euckr_bin= "euckr", /* cs name */ "euckr_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_euc_kr, to_lower_euc_kr, to_upper_euc_kr, sort_order_euc_kr, + NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_mb_bin_handler }; diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index 51a9531fbf5..3672dcd0b33 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -24,20 +24,23 @@ CHARSET_INFO compiled_charsets[] = { NullS, /* cs name */ NullS, /* name */ NullS, /* comment */ - NULL, - NULL, - NULL, - NULL, + NULL, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - "","", - 0, - 0, - 0, - 0, - 0, - NULL, - NULL + NULL, /* state_map */ + NULL, /* ident_map */ + 0, /* strxfrm_mul */ + 0, /* mbminlen */ + 0, /* mbmaxlen */ + 0, /* min_sort_ord */ + 0, /* max_sort_ord */ + NULL, /* cset handler */ + NULL /* coll handler */ } }; diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index b76511fc4f3..b9f61256717 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -5688,6 +5688,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_ci_handler = { + NULL, /* init */ my_strnncoll_simple, /* strnncoll */ my_strnncollsp_simple, my_strnxfrm_simple, /* strnxfrm */ @@ -5700,6 +5701,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ ismbchar_gb2312, mbcharlen_gb2312, my_numchars_mb, @@ -5732,20 +5734,22 @@ CHARSET_INFO my_charset_gb2312_chinese_ci= "gb2312", /* cs name */ "gb2312_chinese_ci",/* name */ "", /* comment */ + NULL, /* tailoring */ ctype_gb2312, to_lower_gb2312, to_upper_gb2312, sort_order_gb2312, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_ci_handler }; @@ -5757,20 +5761,22 @@ CHARSET_INFO my_charset_gb2312_bin= "gb2312", /* cs name */ "gb2312_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_gb2312, to_lower_gb2312, to_upper_gb2312, sort_order_gb2312, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_mb_bin_handler }; diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 18024db3f35..2ef75e27d9a 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -9919,6 +9919,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_ci_handler = { + NULL, /* init */ my_strnncoll_gbk, my_strnncollsp_gbk, my_strnxfrm_gbk, @@ -9931,6 +9932,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ ismbchar_gbk, mbcharlen_gbk, my_numchars_mb, @@ -9963,20 +9965,22 @@ CHARSET_INFO my_charset_gbk_chinese_ci= "gbk", /* cs name */ "gbk_chinese_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_gbk, to_lower_gbk, to_upper_gbk, sort_order_gbk, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_ci_handler }; @@ -9988,20 +9992,22 @@ CHARSET_INFO my_charset_gbk_bin= "gbk", /* cs name */ "gbk_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_gbk, to_lower_gbk, to_upper_gbk, sort_order_gbk, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_mb_bin_handler }; diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 257d8e37eee..652794fa84d 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -380,6 +380,7 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ NULL, my_mbcharlen_8bit, my_numchars_8bit, @@ -412,19 +413,22 @@ CHARSET_INFO my_charset_latin1= "latin1", /* cs name */ "latin1_swedish_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_latin1, to_lower_latin1, to_upper_latin1, sort_order_latin1, + NULL, /* contractions */ NULL, /* sort_order_big*/ cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ - "","", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_8bit_simple_ci_handler }; @@ -673,6 +677,7 @@ void my_hash_sort_latin1_de(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_german2_ci_handler= { + NULL, /* init */ my_strnncoll_latin1_de, my_strnncollsp_latin1_de, my_strnxfrm_latin1_de, @@ -691,19 +696,22 @@ CHARSET_INFO my_charset_latin1_german2_ci= "latin1", /* cs name */ "latin1_german2_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_latin1, to_lower_latin1, to_upper_latin1, sort_order_latin1_de, + NULL, /* contractions */ NULL, /* sort_order_big*/ cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ - "","", + NULL, /* state_map */ + NULL, /* ident_map */ 2, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 247, /* max_sort_char */ &my_charset_handler, &my_collation_german2_ci_handler }; @@ -716,20 +724,22 @@ CHARSET_INFO my_charset_latin1_bin= "latin1", /* cs name */ "latin1_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_latin1, to_lower_latin1, to_upper_latin1, sort_order_latin1_de, + NULL, /* contractions */ NULL, /* sort_order_big*/ cs_to_uni, /* tab_to_uni */ NULL, /* tab_from_uni */ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_8bit_bin_handler }; diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 129e2f2d9a9..7b0dadcfa19 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -521,6 +521,7 @@ static int my_wildcmp_mb_bin(CHARSET_INFO *cs, MY_COLLATION_HANDLER my_collation_mb_bin_handler = { + NULL, /* init */ my_strnncoll_mb_bin, my_strnncollsp_mb_bin, my_strnxfrm_mb_bin, diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 3ef8a9d5997..8e295b9e13e 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -20,7 +20,6 @@ #include <errno.h> #include "stdarg.h" -#include "assert.h" int my_strnxfrm_simple(CHARSET_INFO * cs, @@ -1146,8 +1145,133 @@ skip: } +typedef struct +{ + int nchars; + MY_UNI_IDX uidx; +} uni_idx; + +#define PLANE_SIZE 0x100 +#define PLANE_NUM 0x100 +#define PLANE_NUMBER(x) (((x)>>8) % PLANE_NUM) + +static int pcmp(const void * f, const void * s) +{ + const uni_idx *F= (const uni_idx*) f; + const uni_idx *S= (const uni_idx*) s; + int res; + + if (!(res=((S->nchars)-(F->nchars)))) + res=((F->uidx.from)-(S->uidx.to)); + return res; +} + +static my_bool create_fromuni(CHARSET_INFO *cs, void *(*alloc)(uint)) +{ + uni_idx idx[PLANE_NUM]; + int i,n; + + /* Clear plane statistics */ + bzero(idx,sizeof(idx)); + + /* Count number of characters in each plane */ + for (i=0; i< 0x100; i++) + { + uint16 wc=cs->tab_to_uni[i]; + int pl= PLANE_NUMBER(wc); + + if (wc || !i) + { + if (!idx[pl].nchars) + { + idx[pl].uidx.from=wc; + idx[pl].uidx.to=wc; + }else + { + idx[pl].uidx.from=wc<idx[pl].uidx.from?wc:idx[pl].uidx.from; + idx[pl].uidx.to=wc>idx[pl].uidx.to?wc:idx[pl].uidx.to; + } + idx[pl].nchars++; + } + } + + /* Sort planes in descending order */ + qsort(&idx,PLANE_NUM,sizeof(uni_idx),&pcmp); + + for (i=0; i < PLANE_NUM; i++) + { + int ch,numchars; + + /* Skip empty plane */ + if (!idx[i].nchars) + break; + + numchars=idx[i].uidx.to-idx[i].uidx.from+1; + if (!(idx[i].uidx.tab=(uchar*) alloc(numchars * sizeof(*idx[i].uidx.tab)))) + return TRUE; + + bzero(idx[i].uidx.tab,numchars*sizeof(*idx[i].uidx.tab)); + + for (ch=1; ch < PLANE_SIZE; ch++) + { + uint16 wc=cs->tab_to_uni[ch]; + if (wc >= idx[i].uidx.from && wc <= idx[i].uidx.to && wc) + { + int ofs= wc - idx[i].uidx.from; + idx[i].uidx.tab[ofs]= ch; + } + } + } + + /* Allocate and fill reverse table for each plane */ + n=i; + if (!(cs->tab_from_uni= (MY_UNI_IDX*) alloc(sizeof(MY_UNI_IDX)*(n+1)))) + return TRUE; + + for (i=0; i< n; i++) + cs->tab_from_uni[i]= idx[i].uidx; + + /* Set end-of-list marker */ + bzero(&cs->tab_from_uni[i],sizeof(MY_UNI_IDX)); + return FALSE; +} + +static my_bool my_cset_init_8bit(CHARSET_INFO *cs, void *(*alloc)(uint)) +{ + return create_fromuni(cs, alloc); +} + +static void set_max_sort_char(CHARSET_INFO *cs) +{ + uchar max_char; + uint i; + + if (!cs->sort_order) + return; + + max_char=cs->sort_order[(uchar) cs->max_sort_char]; + for (i= 0; i < 256; i++) + { + if ((uchar) cs->sort_order[i] > max_char) + { + max_char=(uchar) cs->sort_order[i]; + cs->max_sort_char= i; + } + } +} + +static my_bool my_coll_init_simple(CHARSET_INFO *cs, + void *(*alloc)(uint) __attribute__((unused))) +{ + set_max_sort_char(cs); + return FALSE; +} + + + MY_CHARSET_HANDLER my_charset_8bit_handler= { + my_cset_init_8bit, NULL, /* ismbchar */ my_mbcharlen_8bit, /* mbcharlen */ my_numchars_8bit, @@ -1174,6 +1298,7 @@ MY_CHARSET_HANDLER my_charset_8bit_handler= MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler = { + my_coll_init_simple, /* init */ my_strnncoll_simple, my_strnncollsp_simple, my_strnxfrm_simple, diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index cfe59bb2852..5fd005f842e 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4537,6 +4537,7 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_ci_handler = { + NULL, /* init */ my_strnncoll_sjis, my_strnncollsp_sjis, my_strnxfrm_sjis, @@ -4550,6 +4551,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ ismbchar_sjis, mbcharlen_sjis, my_numchars_mb, @@ -4582,20 +4584,22 @@ CHARSET_INFO my_charset_sjis_japanese_ci= "sjis", /* cs name */ "sjis_japanese_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_sjis, to_lower_sjis, to_upper_sjis, sort_order_sjis, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_ci_handler }; @@ -4607,20 +4611,22 @@ CHARSET_INFO my_charset_sjis_bin= "sjis", /* cs name */ "sjis_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_sjis, to_lower_sjis, to_upper_sjis, sort_order_sjis, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 2, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_mb_bin_handler }; diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index b9ee8825eef..c7d859a6ead 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -910,6 +910,7 @@ int my_wc_mb_tis620(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_ci_handler = { + NULL, /* init */ my_strnncoll_tis620, my_strnncollsp_tis620, my_strnxfrm_tis620, @@ -922,6 +923,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ NULL, /* ismbchar */ my_mbcharlen_8bit, /* mbcharlen */ my_numchars_8bit, @@ -955,15 +957,17 @@ CHARSET_INFO my_charset_tis620_thai_ci= "tis620", /* cs name */ "tis620_thai_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_tis620, to_lower_tis620, to_upper_tis620, sort_order_tis620, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 4, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ @@ -980,15 +984,17 @@ CHARSET_INFO my_charset_tis620_bin= "tis620", /* cs name */ "tis620_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_tis620, to_lower_tis620, to_upper_tis620, sort_order_tis620, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index ba7d308ec5c..a388e0cb2a2 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -19,14 +19,15 @@ UCA (Unicode Collation Algorithm) support. Written by Alexander Barkov <bar@mysql.com> - Currently supports only subset of the full UCA. - + Currently supports only subset of the full UCA: - Only Primary level key comparison + - Basic Latin letters contraction is implemented - Variable weighting is done for Non-ignorable option + + Features that are not implemented yet: - No Normalization From D is done + No decomposition is done + No Thai/Lao orderding is done - - No contraction is done - No combining marks processing is done */ @@ -36,8 +37,6 @@ #include "m_ctype.h" -#ifdef HAVE_CHARSET_ucs2 - #define MY_UCA_NPAGES 256 #define MY_UCA_NCHARS 256 #define MY_UCA_CMASK 255 @@ -6521,6 +6520,139 @@ NULL ,page0F9data,page0FAdata,page0FBdata, page0FCdata,page0FDdata,page0FEdata,page0FFdata }; +/* + Some sources treat LETTER A WITH DIARESIS (00E4,00C4) + secondary greater than LETTER AE (00E6,00C6). + http://www.evertype.com/alphabets/icelandic.pdf + http://developer.mimer.com/collations/charts/icelandic.htm + + Other sources do not provide any special rules + for LETTER A WITH DIARESIS: + http://www.omniglot.com/writing/icelandic.htm + http://en.wikipedia.org/wiki/Icelandic_alphabet + http://oss.software.ibm.com/icu/charts/collation/is.html + + Let's go the first way. +*/ + +static const char icelandic[]= + "& A < \\u00E1 <<< \\u00C1 " + "& D < \\u00F0 <<< \\u00D0 " + "& E < \\u00E9 <<< \\u00C9 " + "& I < \\u00ED <<< \\u00CD " + "& O < \\u00F3 <<< \\u00D3 " + "& U < \\u00FA <<< \\u00DA " + "& Y < \\u00FD <<< \\u00DD " + "& Z < \\u00FE <<< \\u00DE " + "< \\u00E6 <<< \\u00C6 << \\u00E4 <<< \\u00C4 " + "< \\u00F6 <<< \\u00D6 << \\u00F8 <<< \\u00D8 " + "< \\u00E5 <<< \\u00C5 "; + +/* + Some sources treat I and Y primary different. + Other sources treat I and Y the same on primary level. + We'll go the first way. +*/ + +static const char latvian[]= + "& C < \\u010D <<< \\u010C " + "& G < \\u0123 <<< \\u0122 " + "& I < \\u0079 <<< \\u0059 " + "& K < \\u0137 <<< \\u0136 " + "& L < \\u013C <<< \\u013B " + "& N < \\u0146 <<< \\u0145 " + "& R < \\u0157 <<< \\u0156 " + "& S < \\u0161 <<< \\u0160 " + "& Z < \\u017E <<< \\u017D "; + + +static const char romanian[]= + "& A < \\u0103 <<< \\u0102 < \\u00E2 <<< \\u00C2 " + "& I < \\u00EE <<< \\u00CE " + "& S < \\u0219 <<< \\u0218 << \\u015F <<< \\u015E " + "& T < \\u021B <<< \\u021A << \\u0163 <<< \\u0162 "; + +static const char slovenian[]= + "& C < \\u010D <<< \\u010C " + "& S < \\u0161 <<< \\u0160 " + "& Z < \\u017E <<< \\u017D "; + + +static const char polish[]= + "& A < \\u0105 <<< \\u0104 " + "& C < \\u0107 <<< \\u0106 " + "& E < \\u0119 <<< \\u0118 " + "& L < \\u0142 <<< \\u0141 " + "& N < \\u0144 <<< \\u0143 " + "& O < \\u00F3 <<< \\u00D3 " + "& S < \\u015B <<< \\u015A " + "& Z < \\u017A <<< \\u0179 < \\u017C <<< \\u017B"; + +static const char estonian[]= + "& S < \\u0161 <<< \\u0160 " + " < \\u007A <<< \\u005A " + " < \\u017E <<< \\u017D " + "& W < \\u00F5 <<< \\u00D5 " + "< \\u00E4 <<< \\u00C4 " + "< \\u00F6 <<< \\u00D6 " + "< \\u00FC <<< \\u00DC "; + +static const char spanish[]= "& N < \\u00F1 <<< \\u00D1 "; + +/* + Some sources treat V and W as similar on primary level. + We'll treat V and W as different on primary level. +*/ + +static const char swedish[]= + "& Y <<\\u00FC <<< \\u00DC " + "& Z < \\u00E5 <<< \\u00C5 " + "< \\u00E4 <<< \\u00C4 << \\u00E6 <<< \\u00C6 " + "< \\u00F6 <<< \\u00D6 << \\u00F8 <<< \\u00D8 "; + +static const char turkish[]= + "& C < \\u00E7 <<< \\u00C7 " + "& G < \\u011F <<< \\u011E " + "& H < \\u0131 <<< \\u0049 " + "& O < \\u00F6 <<< \\u00D6 " + "& S < \\u015F <<< \\u015E " + "& U < \\u00FC <<< \\u00DC "; + + +static const char czech[]= + "& C < \\u010D <<< \\u010C " + "& H < ch <<< Ch <<< CH" + "& R < \\u0159 <<< \\u0158" + "& S < \\u0161 <<< \\u0160" + "& Z < \\u017E <<< \\u017D"; + +static const char danish[]= /* Also good for Norwegian */ + "& Y << \\u00FC <<< \\u00DC << \\u0171 <<< \\u0170" + "& Z < \\u00E6 <<< \\u00C6 << \\u00E4 <<< \\u00C4" + " < \\u00F8 <<< \\u00D8 << \\u00F6 <<< \\u00D6 << \\u0151 <<< \\u0150" + " < \\u00E5 <<< \\u00C5 << aa <<< Aa <<< AA"; + +static const char lithuanian[]= + "& C << ch <<< Ch <<< CH< \\u010D <<< \\u010C" + "& E << \\u0119 <<< \\u0118 << \\u0117 <<< \\u0116" + "& I << y <<< Y" + "& S < \\u0161 <<< \\u0160" + "& Z < \\u017E <<< \\u017D"; + +static const char slovak[]= + "& A < \\u00E4 <<< \\u00C4" + "& C < \\u010D <<< \\u010C" + "& H < ch <<< Ch <<< CH" + "& O < \\u00F4 <<< \\u00D4" + "& S < \\u0161 <<< \\u0160" + "& Z < \\u017E <<< \\017D"; + +static const char spanish2[]= /* Also good for Asturian and Galician */ + "&C < ch <<< Ch <<< CH" + "&L < ll <<< Ll <<< LL" + "&N < \\u00F1 <<< \\u00D1" + "&R << rr <<< Rr <<< RR"; + /* Unicode Collation Algorithm: @@ -6535,12 +6667,28 @@ typedef struct my_uca_scanner_st const uchar *send; /* End of the input string */ uchar *uca_length; uint16 **uca_weight; + uint16 *contractions; uint16 implicit[2]; int page; int code; + CHARSET_INFO *cs; } my_uca_scanner; +/* + Charset dependent scanner part, to optimize + some character sets. +*/ +typedef struct my_uca_scanner_handler_st +{ + void (*init)(my_uca_scanner *scanner, CHARSET_INFO *cs, + const uchar *str, uint length); + int (*next)(my_uca_scanner *scanner); +} my_uca_scanner_handler; + +static uint16 nochar[]= {0}; + +#ifdef HAVE_CHARSET_ucs2 /* Initialize collation weight scanner @@ -6552,15 +6700,15 @@ typedef struct my_uca_scanner_st length Length of the string. NOTES: + Optimized for UCS2 RETURN N/A */ -static uint16 nochar[]= {0}; -static void my_uca_scanner_init(my_uca_scanner *scanner, - CHARSET_INFO *cs __attribute__((unused)), - const uchar *str, uint length) +static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, + CHARSET_INFO *cs __attribute__((unused)), + const uchar *str, uint length) { /* Note, no needs to initialize scanner->wbeg */ scanner->sbeg= str; @@ -6568,6 +6716,7 @@ static void my_uca_scanner_init(my_uca_scanner *scanner, scanner->wbeg= nochar; scanner->uca_length= cs->sort_order; scanner->uca_weight= cs->sort_order_big; + scanner->contractions= cs->contractions; } @@ -6580,6 +6729,8 @@ static void my_uca_scanner_init(my_uca_scanner *scanner, scanner Address of a previously initialized scanner strucuture NOTES: + Optimized for UCS2 + Checks if the current character's weight string has been fully scanned, if no, then returns the next weight for this character, else scans the next character and returns its first weight. @@ -6610,7 +6761,7 @@ static void my_uca_scanner_init(my_uca_scanner *scanner, Or -1 on error (END-OF-STRING or ILLEGAL MULTIBYTE SEQUENCE) */ -static int my_uca_scanner_next(my_uca_scanner *scanner) +static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner) { /* @@ -6634,6 +6785,121 @@ static int my_uca_scanner_next(my_uca_scanner *scanner) scanner->code= (unsigned char)scanner->sbeg[1]; scanner->sbeg+= 2; + if (scanner->contractions && (scanner->sbeg <= scanner->send)) + { + int cweight; + + if (!scanner->page && !scanner->sbeg[0] && + (scanner->sbeg[1] > 0x40) && (scanner->sbeg[1] < 0x80) && + (scanner->code > 0x40) && (scanner->code < 0x80) && + (cweight= scanner->contractions[(scanner->code-0x40)*0x40+scanner->sbeg[1]-0x40])) + { + scanner->implicit[0]= 0; + scanner->wbeg= scanner->implicit; + scanner->sbeg+=2; + return cweight; + } + } + + if (!ucaw[scanner->page]) + goto implicit; + scanner->wbeg= ucaw[scanner->page] + scanner->code * ucal[scanner->page]; + } while (!scanner->wbeg[0]); + + return *scanner->wbeg++; + +implicit: + + scanner->code= (scanner->page << 8) + scanner->code; + scanner->implicit[0]= (scanner->code & 0x7FFF) | 0x8000; + scanner->implicit[1]= 0; + scanner->wbeg= scanner->implicit; + + scanner->page= scanner->page >> 7; + + if (scanner->code >= 0x3400 && scanner->code <= 0x4DB5) + scanner->page+= 0xFB80; + else if (scanner->code >= 0x4E00 && scanner->code <= 0x9FA5) + scanner->page+= 0xFB40; + else + scanner->page+= 0xFBC0; + + return scanner->page; +} + +static my_uca_scanner_handler my_ucs2_uca_scanner_handler= +{ + my_uca_scanner_init_ucs2, + my_uca_scanner_next_ucs2 +}; + +#endif + + +/* + The same two functions for any character set +*/ +static void my_uca_scanner_init_any(my_uca_scanner *scanner, + CHARSET_INFO *cs __attribute__((unused)), + const uchar *str, uint length) +{ + /* Note, no needs to initialize scanner->wbeg */ + scanner->sbeg= str; + scanner->send= str + length; + scanner->wbeg= nochar; + scanner->uca_length= cs->sort_order; + scanner->uca_weight= cs->sort_order_big; + scanner->contractions= cs->contractions; + scanner->cs= cs; +} + +static int my_uca_scanner_next_any(my_uca_scanner *scanner) +{ + + /* + Check if the weights for the previous character have been + already fully scanned. If yes, then get the next character and + initialize wbeg and wlength to its weight string. + */ + + if (scanner->wbeg[0]) + return *scanner->wbeg++; + + do + { + uint16 **ucaw= scanner->uca_weight; + uchar *ucal= scanner->uca_length; + my_wc_t wc; + int mblen; + + if (((mblen= scanner->cs->cset->mb_wc(scanner->cs, &wc, + scanner->sbeg, scanner->send)) < 0)) + return -1; + + scanner->page= wc >> 8; + scanner->code= wc & 0xFF; + scanner->sbeg+= mblen; + + if (scanner->contractions && !scanner->page && + (scanner->code > 0x40) && (scanner->code < 0x80)) + { + uint page1, code1, cweight; + + if (((mblen= scanner->cs->cset->mb_wc(scanner->cs, &wc, + scanner->sbeg, + scanner->send)) >=0) && + (!(page1= (wc >> 8))) && + ((code1= (wc & 0xFF)) > 0x40) && + (code1 < 0x80) && + (cweight= scanner->contractions[(scanner->code-0x40)*0x40 + code1-0x40])) + { + scanner->implicit[0]= 0; + scanner->wbeg= scanner->implicit; + scanner->sbeg+= mblen; + return cweight; + } + } + if (!ucaw[scanner->page]) goto implicit; scanner->wbeg= ucaw[scanner->page] + scanner->code * ucal[scanner->page]; @@ -6661,6 +6927,12 @@ implicit: } +static my_uca_scanner_handler my_any_uca_scanner_handler= +{ + my_uca_scanner_init_any, + my_uca_scanner_next_any +}; + /* Compares two strings according to the collation @@ -6703,6 +6975,7 @@ implicit: */ static int my_strnncoll_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, const uchar *s, uint slen, const uchar *t, uint tlen, my_bool t_is_prefix) @@ -6712,20 +6985,18 @@ static int my_strnncoll_uca(CHARSET_INFO *cs, int s_res; int t_res; - my_uca_scanner_init(&sscanner, cs, s, slen); - my_uca_scanner_init(&tscanner, cs, t, tlen); + scanner_handler->init(&sscanner, cs, s, slen); + scanner_handler->init(&tscanner, cs, t, tlen); do { - s_res= my_uca_scanner_next(&sscanner); - t_res= my_uca_scanner_next(&tscanner); + s_res= scanner_handler->next(&sscanner); + t_res= scanner_handler->next(&tscanner); } while ( s_res == t_res && s_res >0); return (t_is_prefix && t_res < 0) ? 0 : (s_res - t_res); } - - /* Compares two strings according to the collation, ignoring trailing spaces. @@ -6750,8 +7021,9 @@ static int my_strnncoll_uca(CHARSET_INFO *cs, */ static int my_strnncollsp_uca(CHARSET_INFO *cs, - const uchar *s, uint slen, - const uchar *t, uint tlen) + my_uca_scanner_handler *scanner_handler, + const uchar *s, uint slen, + const uchar *t, uint tlen) { my_uca_scanner sscanner; my_uca_scanner tscanner; @@ -6761,19 +7033,18 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs, slen= cs->cset->lengthsp(cs, (char*) s, slen); tlen= cs->cset->lengthsp(cs, (char*) t, tlen); - my_uca_scanner_init(&sscanner, cs, s, slen); - my_uca_scanner_init(&tscanner, cs, t, tlen); + scanner_handler->init(&sscanner, cs, s, slen); + scanner_handler->init(&tscanner, cs, t, tlen); do { - s_res= my_uca_scanner_next(&sscanner); - t_res= my_uca_scanner_next(&tscanner); + s_res= scanner_handler->next(&sscanner); + t_res= scanner_handler->next(&tscanner); } while ( s_res == t_res && s_res >0); return ( s_res - t_res ); } - /* Calculates hash value for the given string, according to the collation, and ignoring trailing spaces. @@ -6798,6 +7069,7 @@ static int my_strnncollsp_uca(CHARSET_INFO *cs, */ static void my_hash_sort_uca(CHARSET_INFO *cs, + my_uca_scanner_handler *scanner_handler, const uchar *s, uint slen, ulong *n1, ulong *n2) { @@ -6805,9 +7077,9 @@ static void my_hash_sort_uca(CHARSET_INFO *cs, my_uca_scanner scanner; slen= cs->cset->lengthsp(cs, (char*) s, slen); - my_uca_scanner_init(&scanner, cs, s, slen); + scanner_handler->init(&scanner, cs, s, slen); - while ((s_res= my_uca_scanner_next(&scanner)) >0) + while ((s_res= scanner_handler->next(&scanner)) >0) { n1[0]^= (((n1[0] & 63)+n2[0])*(s_res >> 8))+ (n1[0] << 8); n2[0]+=3; @@ -6849,24 +7121,28 @@ static void my_hash_sort_uca(CHARSET_INFO *cs, */ static int my_strnxfrm_uca(CHARSET_INFO *cs, - uchar *dst, uint dstlen, - const uchar *src, uint srclen) + my_uca_scanner_handler *scanner_handler, + uchar *dst, uint dstlen, + const uchar *src, uint srclen) { uchar *de = dst + dstlen; const uchar *dst_orig = dst; int s_res; my_uca_scanner scanner; - my_uca_scanner_init(&scanner, cs, src, srclen); + scanner_handler->init(&scanner, cs, src, srclen); - while (dst < de && (s_res= my_uca_scanner_next(&scanner)) >0) + while (dst < de && (s_res= scanner_handler->next(&scanner)) >0) { dst[0]= s_res >> 8; dst[1]= s_res & 0xFF; dst+= 2; } + for ( ; dst < de; *dst++='\0'); return dst - dst_orig; } + + /* This function compares if two characters are the same. The sign +1 or -1 does not matter. The only @@ -7037,34 +7313,876 @@ int my_wildcmp_uca(CHARSET_INFO *cs, } +/* + Collation language is implemented according to + subset of ICU Collation Customization (tailorings): + http://oss.software.ibm.com/icu/userguide/Collate_Customization.html + + Collation language elements: + Delimiters: + space - skipped + + <char> := A-Z | a-z | \uXXXX + + Shift command: + <shift> := & - reset at this letter. + + Diff command: + <d1> := < - Identifies a primary difference. + <d2> := << - Identifies a secondary difference. + <d3> := <<< - Idenfifies a tertiary difference. + + + Collation rules: + <ruleset> := <rule> { <ruleset> } + + <rule> := <d1> <string> + | <d2> <string> + | <d3> <string> + | <shift> <char> + + <string> := <char> [ <string> ] + + An example, Polish collation: + + &A < \u0105 <<< \u0104 + &C < \u0107 <<< \u0106 + &E < \u0119 <<< \u0118 + &L < \u0142 <<< \u0141 + &N < \u0144 <<< \u0143 + &O < \u00F3 <<< \u00D3 + &S < \u015B <<< \u015A + &Z < \u017A <<< \u017B +*/ + + +typedef enum my_coll_lexem_num_en +{ + MY_COLL_LEXEM_EOF = 0, + MY_COLL_LEXEM_DIFF = 1, + MY_COLL_LEXEM_SHIFT = 4, + MY_COLL_LEXEM_CHAR = 5, + MY_COLL_LEXEM_ERROR = 6 +} my_coll_lexem_num; + + +typedef struct my_coll_lexem_st +{ + const char *beg; + const char *end; + const char *prev; + int diff; + int code; +} MY_COLL_LEXEM; + + +/* + Initialize collation rule lexical anilizer + + SYNOPSIS + my_coll_lexem_init + lexem Lex analizer to init + str Const string to parse + strend End of the string + USAGE + + RETURN VALUES + N/A +*/ + +static void my_coll_lexem_init(MY_COLL_LEXEM *lexem, + const char *str, const char *strend) +{ + lexem->beg= str; + lexem->prev= str; + lexem->end= strend; + lexem->diff= 0; + lexem->code= 0; +} + + +/* + Print collation customization expression parse error, with context. + + SYNOPSIS + my_coll_lexem_print_error + lexem Lex analizer to take context from + errstr sting to write error to + errsize errstr size + txt error message + USAGE + + RETURN VALUES + N/A +*/ + +static void my_coll_lexem_print_error(MY_COLL_LEXEM *lexem, + char *errstr, size_t errsize, + const char *txt) +{ + char tail[30]; + size_t len= lexem->end - lexem->prev; + strmake (tail, lexem->prev, min(len, sizeof(tail)-1)); + errstr[errsize-1]= '\0'; + my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail); +} + + +/* + Convert a hex digit into its numeric value + + SYNOPSIS + ch2x + ch hex digit to convert + USAGE + + RETURN VALUES + an integer value in the range 0..15 + -1 on error +*/ + +static int ch2x(int ch) +{ + if (ch >= '0' && ch <= '9') + return ch - '0'; + + if (ch >= 'a' && ch <= 'f') + return 10 + ch - 'a'; + + if (ch >= 'A' && ch <= 'F') + return 10 + ch - 'A'; + + return -1; +} + + +/* + Collation language lexical parser: + Scans the next lexem. + + SYNOPSIS + my_coll_lexem_next + lexem Lex analizer, previously initialized by + my_coll_lexem_init. + USAGE + Call this function in a loop + + RETURN VALUES + Lexem number: eof, diff, shift, char or error. +*/ + +static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem) +{ + const char *beg; + my_coll_lexem_num rc; + + for (beg= lexem->beg ; beg < lexem->end ; beg++) + { + if (*beg == ' ' || *beg == '\t' || *beg == '\r' || *beg == '\n') + continue; + + if (*beg == '&') + { + beg++; + rc= MY_COLL_LEXEM_SHIFT; + goto ex; + } + + if (beg[0] == '<') + { + for (beg++, lexem->diff= 1; + (beg < lexem->end) && + (*beg == '<') && (lexem->diff<3); + beg++, lexem->diff++); + rc= MY_COLL_LEXEM_DIFF; + goto ex; + } + + if ((*beg >= 'a' && *beg <= 'z') || (*beg >= 'A' && *beg <= 'Z')) + { + lexem->code= *beg++; + rc= MY_COLL_LEXEM_CHAR; + goto ex; + } + + if ((*beg == '\\') && (beg+2 < lexem->end) && (beg[1] == 'u')) + { + int ch; + + beg+= 2; + lexem->code= 0; + while ((beg < lexem->end) && ((ch= ch2x(beg[0])) >= 0)) + { + lexem->code= (lexem->code << 4) + ch; + beg++; + } + rc= MY_COLL_LEXEM_CHAR; + goto ex; + } + + rc= MY_COLL_LEXEM_ERROR; + goto ex; + } + rc= MY_COLL_LEXEM_EOF; + +ex: + lexem->prev= lexem->beg; + lexem->beg= beg; + return rc; +} + + +/* + Collation rule item +*/ + +typedef struct my_coll_rule_item_st +{ + uint base; /* Base character */ + uint curr[2]; /* Current character */ + int diff[3]; /* Primary, Secondary and Tertiary difference */ +} MY_COLL_RULE; + + +/* + Collation language syntax parser. + Uses lexical parser. + + SYNOPSIS + my_coll_rule_parse + rule Collation rule list to load to. + str A string containin collation language expression. + strend End of the string. + USAGE + + RETURN VALUES + A positive number means the number of rules loaded. + -1 means ERROR, e.g. too many items, syntax error, etc. +*/ + +static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems, + const char *str, const char *strend, + char *errstr, size_t errsize) +{ + MY_COLL_LEXEM lexem; + my_coll_lexem_num lexnum; + my_coll_lexem_num prevlexnum= MY_COLL_LEXEM_ERROR; + MY_COLL_RULE item; + int state= 0; + size_t nitems= 0; + + /* Init all variables */ + errstr[0]= '\0'; + bzero(&item, sizeof(item)); + my_coll_lexem_init(&lexem, str, strend); + + while ((lexnum= my_coll_lexem_next(&lexem))) + { + if (lexnum == MY_COLL_LEXEM_ERROR) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Unknown character"); + return -1; + } + + switch (state) { + case 0: + if (lexnum != MY_COLL_LEXEM_SHIFT) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& expected"); + return -1; + } + prevlexnum= lexnum; + state= 2; + continue; + + case 1: + if (lexnum != MY_COLL_LEXEM_SHIFT && lexnum != MY_COLL_LEXEM_DIFF) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& or < expected"); + return -1; + } + prevlexnum= lexnum; + state= 2; + continue; + + case 2: + if (lexnum != MY_COLL_LEXEM_CHAR) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"character expected"); + return -1; + } + + if (prevlexnum == MY_COLL_LEXEM_SHIFT) + { + item.base= lexem.code; + item.diff[0]= 0; + item.diff[1]= 0; + item.diff[2]= 0; + } + else if (prevlexnum == MY_COLL_LEXEM_DIFF) + { + MY_COLL_LEXEM savlex; + savlex= lexem; + item.curr[0]= lexem.code; + if ((lexnum= my_coll_lexem_next(&lexem)) == MY_COLL_LEXEM_CHAR) + { + item.curr[1]= lexem.code; + } + else + { + item.curr[1]= 0; + lexem=savlex; /* Restore previous parser state */ + } + if (lexem.diff == 3) + { + item.diff[2]++; + } + else if (lexem.diff == 2) + { + item.diff[1]++; + item.diff[2]= 0; + } + else if (lexem.diff == 1) + { + item.diff[0]++; + item.diff[1]= 0; + item.diff[2]= 0; + } + if (nitems >= mitems) + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Too many rules"); + return -1; + } + rule[nitems++]= item; + } + else + { + my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Should never happen"); + return -1; + } + state= 1; + continue; + } + } + return (size_t) nitems; +} + +#define MY_MAX_COLL_RULE 64 + +/* + This function copies an UCS2 collation from + the default Unicode Collation Algorithm (UCA) + weights applying tailorings, i.e. a set of + alternative weights for some characters. + + The default UCA weights are stored in uca_weight/uca_length. + They consist of 256 pages, 256 character each. + + If a page is not overwritten by tailoring rules, + it is copies as is from UCA as is. + + If a page contains some overwritten characters, it is + allocated. Untouched characters are copied from the + default weights. +*/ + +static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) +{ + MY_COLL_RULE rule[MY_MAX_COLL_RULE]; + char errstr[128]; + uchar *newlengths; + uint16 **newweights; + const uchar *deflengths= uca_length; + uint16 **defweights= uca_weight; + int rc, i; + int ncontractions= 0; + + if (!cs->tailoring) + return 1; + + /* Parse ICU Collation Customization expression */ + if ((rc= my_coll_rule_parse(rule, MY_MAX_COLL_RULE, + cs->tailoring, + cs->tailoring + strlen(cs->tailoring), + errstr, sizeof(errstr))) < 0) + { + /* + TODO: add error message reporting. + printf("Error: %d '%s'\n", rc, errstr); + */ + return 1; + } + + if (!(newweights= (uint16**) (*alloc)(256*sizeof(uint16*)))) + return 1; + bzero(newweights, 256*sizeof(uint16*)); + + if (!(newlengths= (uchar*) (*alloc)(256))) + return 1; + + memcpy(newlengths, deflengths, 256); + + /* + Calculate maximum lenghts for the pages + which will be overwritten. + */ + for (i=0; i < rc; i++) + { + if (!rule[i].curr[1]) /* If not a contraction */ + { + uint pageb= (rule[i].base >> 8) & 0xFF; + uint pagec= (rule[i].curr[0] >> 8) & 0xFF; + + if (newlengths[pagec] < deflengths[pageb]) + newlengths[pagec]= deflengths[pageb]; + } + else + ncontractions++; + } + + for (i=0; i < rc; i++) + { + uint pageb= (rule[i].base >> 8) & 0xFF; + uint pagec= (rule[i].curr[0] >> 8) & 0xFF; + uint chb, chc; + + if (rule[i].curr[1]) /* Skip contraction */ + continue; + + if (!newweights[pagec]) + { + /* Alloc new page and copy the default UCA weights */ + uint size= 256*newlengths[pagec]*sizeof(uint16); + + if (!(newweights[pagec]= (uint16*) (*alloc)(size))) + return 1; + bzero((void*) newweights[pagec], size); + + for (chc=0 ; chc < 256; chc++) + { + memcpy(newweights[pagec] + chc*newlengths[pagec], + defweights[pagec] + chc*deflengths[pagec], + deflengths[pagec]*sizeof(uint16)); + } + } + + /* + Aply the alternative rule: + shift to the base character and primary difference. + */ + chc= rule[i].curr[0] & 0xFF; + chb= rule[i].base & 0xFF; + memcpy(newweights[pagec] + chc*newlengths[pagec], + defweights[pageb] + chb*deflengths[pageb], + deflengths[pageb]*sizeof(uint16)); + /* Apply primary difference */ + newweights[pagec][chc*newlengths[pagec]]+= rule[i].diff[0]; + } + + /* Copy non-overwritten pages from the default UCA weights */ + for (i= 0; i < 256 ; i++) + { + if (!newweights[i]) + newweights[i]= defweights[i]; + } + + cs->sort_order= newlengths; + cs->sort_order_big= newweights; + cs->contractions= NULL; + + /* Now process contractions */ + if (ncontractions) + { + uint size= 0x40*0x40*sizeof(uint16); /* 8K, for basic latin letter only */ + if (!(cs->contractions= (uint16*) (*alloc)(size))) + return 1; + bzero((void*)cs->contractions, size); + for (i=0; i < rc; i++) + { + if (rule[i].curr[1]) + { + uint pageb= (rule[i].base >> 8) & 0xFF; + uint chb= rule[i].base & 0xFF; + uint16 *offsb= defweights[pageb] + chb*deflengths[pageb]; + uint offsc; + + if (offsb[1] || + rule[i].curr[0] < 0x40 || rule[i].curr[0] > 0x7f || + rule[i].curr[1] < 0x40 || rule[i].curr[1] > 0x7f) + { + /* + TODO: add error reporting; + We support only basic latin letters contractions at this point. + Also, We don't support contractions with weight longer than one. + Otherwise, we'd need much more memory. + */ + return 1; + } + offsc= (rule[i].curr[0]-0x40)*0x40+(rule[i].curr[1]-0x40); + + /* Copy base weight applying primary difference */ + cs->contractions[offsc]= offsb[0] + rule[i].diff[0]; + } + } + } + return 0; +} + + +/* + Universal CHARSET_INFO compatible wrappers + for the above internal functions. + Should work for any character set. +*/ + +static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(uint)) +{ + return create_tailoring(cs, alloc); +} + +static int my_strnncoll_any_uca(CHARSET_INFO *cs, + const uchar *s, uint slen, + const uchar *t, uint tlen, + my_bool t_is_prefix) +{ + return my_strnncoll_uca(cs, &my_any_uca_scanner_handler, + s, slen, t, tlen, t_is_prefix); +} + +static int my_strnncollsp_any_uca(CHARSET_INFO *cs, + const uchar *s, uint slen, + const uchar *t, uint tlen) +{ + return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler, + s, slen, t, tlen); +} + +static void my_hash_sort_any_uca(CHARSET_INFO *cs, + const uchar *s, uint slen, + ulong *n1, ulong *n2) +{ + my_hash_sort_uca(cs, &my_any_uca_scanner_handler, s, slen, n1, n2); +} + +static int my_strnxfrm_any_uca(CHARSET_INFO *cs, + uchar *dst, uint dstlen, + const uchar *src, uint srclen) +{ + return my_strnxfrm_uca(cs, &my_any_uca_scanner_handler, + dst, dstlen, src, srclen); +} + + +#ifdef HAVE_CHARSET_ucs2 +/* + UCS2 optimized CHARSET_INFO compatible wrappers. +*/ +static int my_strnncoll_ucs2_uca(CHARSET_INFO *cs, + const uchar *s, uint slen, + const uchar *t, uint tlen, + my_bool t_is_prefix) +{ + return my_strnncoll_uca(cs, &my_ucs2_uca_scanner_handler, + s, slen, t, tlen, t_is_prefix); +} + +static int my_strnncollsp_ucs2_uca(CHARSET_INFO *cs, + const uchar *s, uint slen, + const uchar *t, uint tlen) +{ + return my_strnncollsp_uca(cs, &my_ucs2_uca_scanner_handler, + s, slen, t, tlen); +} + +static void my_hash_sort_ucs2_uca(CHARSET_INFO *cs, + const uchar *s, uint slen, + ulong *n1, ulong *n2) +{ + my_hash_sort_uca(cs, &my_ucs2_uca_scanner_handler, s, slen, n1, n2); +} + +static int my_strnxfrm_ucs2_uca(CHARSET_INFO *cs, + uchar *dst, uint dstlen, + const uchar *src, uint srclen) +{ + return my_strnxfrm_uca(cs, &my_ucs2_uca_scanner_handler, + dst, dstlen, src, srclen); +} + MY_COLLATION_HANDLER my_collation_ucs2_uca_handler = { - my_strnncoll_uca, - my_strnncollsp_uca, - my_strnxfrm_uca, + my_coll_init_uca, /* init */ + my_strnncoll_ucs2_uca, + my_strnncollsp_ucs2_uca, + my_strnxfrm_ucs2_uca, my_like_range_simple, my_wildcmp_uca, NULL, my_instr_mb, - my_hash_sort_uca + my_hash_sort_ucs2_uca }; CHARSET_INFO my_charset_ucs2_general_uca= { - 45,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONTEXT, + 128,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "ucs2", /* cs name */ - "ucs2_general_uca", /* name */ + "ucs2_unicode_ci", /* name */ "", /* comment */ + "", /* tailoring */ NULL, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ uca_length, /* sort_order */ + NULL, /* contractions */ uca_weight, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= +{ + 129,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_icelandic_ci",/* name */ + "", /* comment */ + icelandic, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_latvian_uca_ci= +{ + 130,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_latvian_ci", /* name */ + "", /* comment */ + latvian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_romanian_uca_ci= +{ + 131,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_romanian_ci", /* name */ + "", /* comment */ + romanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= +{ + 132,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_slovenian_ci",/* name */ + "", /* comment */ + slovenian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_polish_uca_ci= +{ + 133,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_polish_ci", /* name */ + "", /* comment */ + polish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_estonian_uca_ci= +{ + 134,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_estonian_ci", /* name */ + "", /* comment */ + estonian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_spanish_uca_ci= +{ + 135,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_spanish_ci", /* name */ + "", /* comment */ + spanish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_swedish_uca_ci= +{ + 136,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_swedish_ci", /* name */ + "", /* comment */ + swedish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_turkish_uca_ci= +{ + 137,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_turkish_ci", /* name */ + "", /* comment */ + turkish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ 8, /* strxfrm_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ @@ -7074,5 +8192,591 @@ CHARSET_INFO my_charset_ucs2_general_uca= &my_collation_ucs2_uca_handler }; +CHARSET_INFO my_charset_ucs2_czech_uca_ci= +{ + 138,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_czech_ci", /* name */ + "", /* comment */ + czech, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + +CHARSET_INFO my_charset_ucs2_danish_uca_ci= +{ + 139,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_danish_ci", /* name */ + "", /* comment */ + danish, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= +{ + 140,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_lithuanian_ci",/* name */ + "", /* comment */ + lithuanian, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_slovak_uca_ci= +{ + 141,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_slovak_ci", /* name */ + "", /* comment */ + slovak, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= +{ + 142,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "ucs2", /* cs name */ + "ucs2_spanish2_ci", /* name */ + "", /* comment */ + spanish2, /* tailoring */ + NULL, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + +#endif + + +#ifdef HAVE_CHARSET_utf8 +MY_COLLATION_HANDLER my_collation_any_uca_handler = +{ + my_coll_init_uca, /* init */ + my_strnncoll_any_uca, + my_strnncollsp_any_uca, + my_strnxfrm_any_uca, + my_like_range_simple, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_any_uca +}; + +/* + We consider bytes with code more than 127 as a letter. + This garantees that word boundaries work fine with regular + expressions. Note, there is no need to mark byte 255 as a + letter, it is illegal byte in UTF8. +*/ +static uchar ctype_utf8[] = { + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 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, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0 +}; +extern MY_CHARSET_HANDLER my_charset_utf8_handler; + +CHARSET_INFO my_charset_utf8_general_uca_ci= +{ + 192,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_unicode_ci", /* name */ + "", /* comment */ + "", /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + uca_length, /* sort_order */ + NULL, /* contractions */ + uca_weight, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 1, /* mbminlen */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8_icelandic_uca_ci= +{ + 193,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_icelandic_ci",/* name */ + "", /* comment */ + icelandic, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_latvian_uca_ci= +{ + 194,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_latvian_ci", /* name */ + "", /* comment */ + latvian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_romanian_uca_ci= +{ + 195,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_romanian_ci", /* name */ + "", /* comment */ + romanian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_slovenian_uca_ci= +{ + 196,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_slovenian_ci",/* name */ + "", /* comment */ + slovenian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_polish_uca_ci= +{ + 197,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_polish_ci", /* name */ + "", /* comment */ + polish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_estonian_uca_ci= +{ + 198,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_estonian_ci", /* name */ + "", /* comment */ + estonian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_spanish_uca_ci= +{ + 199,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_spanish_ci", /* name */ + "", /* comment */ + spanish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_swedish_uca_ci= +{ + 200,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_swedish_ci", /* name */ + "", /* comment */ + swedish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_turkish_uca_ci= +{ + 201,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_turkish_ci", /* name */ + "", /* comment */ + turkish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_czech_uca_ci= +{ + 202,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_czech_ci", /* name */ + "", /* comment */ + czech, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8_danish_uca_ci= +{ + 203,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_danish_ci", /* name */ + "", /* comment */ + danish, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= +{ + 204,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_lithuanian_ci",/* name */ + "", /* comment */ + lithuanian, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_slovak_uca_ci= +{ + 205,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_slovak_ci", /* name */ + "", /* comment */ + slovak, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8_spanish2_uca_ci= +{ + 206,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_spanish2_ci", /* name */ + "", /* comment */ + spanish2, /* tailoring */ + ctype_utf8, /* ctype */ + NULL, /* to_lower */ + NULL, /* to_upper */ + NULL, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ + NULL, /* tab_to_uni */ + NULL, /* tab_from_uni */ + NULL, /* state_map */ + NULL, /* ident_map */ + 8, /* strxfrm_multiply */ + 2, /* mbminlen */ + 2, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; #endif diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 040fc5f65fd..20a5ff58d3a 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -320,7 +320,6 @@ static int my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) , #include <m_string.h> #include <stdarg.h> -#include <assert.h> static int my_vsnprintf_ucs2(char *dst, uint n, const char* fmt, va_list ap) { @@ -1389,6 +1388,7 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs, static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = { + NULL, /* init */ my_strnncoll_ucs2, my_strnncollsp_ucs2, my_strnxfrm_ucs2, @@ -1402,6 +1402,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler = { + NULL, /* init */ my_strnncoll_ucs2_bin, my_strnncollsp_ucs2_bin, my_strnxfrm_ucs2_bin, @@ -1415,6 +1416,7 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler = MY_CHARSET_HANDLER my_charset_ucs2_handler= { + NULL, /* init */ my_ismbchar_ucs2, /* ismbchar */ my_mbcharlen_ucs2, /* mbcharlen */ my_numchars_ucs2, @@ -1443,19 +1445,21 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler= CHARSET_INFO my_charset_ucs2_general_ci= { 35,0,0, /* number */ - MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONTEXT, + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE, "ucs2", /* cs name */ "ucs2_general_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_ucs2, /* ctype */ to_lower_ucs2, /* to_lower */ to_upper_ucs2, /* to_upper */ to_upper_ucs2, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ @@ -1468,19 +1472,21 @@ CHARSET_INFO my_charset_ucs2_general_ci= CHARSET_INFO my_charset_ucs2_bin= { 90,0,0, /* number */ - MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONTEXT, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, "ucs2", /* cs name */ "ucs2_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_ucs2, /* ctype */ to_lower_ucs2, /* to_lower */ to_upper_ucs2, /* to_upper */ to_upper_ucs2, /* sort_order */ + NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 2, /* mbminlen */ 2, /* mbmaxlen */ diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index fd3692553be..3f53a07f527 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8423,6 +8423,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e) static MY_COLLATION_HANDLER my_collation_ci_handler = { + NULL, /* init */ my_strnncoll_simple,/* strnncoll */ my_strnncollsp_simple, my_strnxfrm_simple, /* strnxfrm */ @@ -8435,14 +8436,15 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = static MY_CHARSET_HANDLER my_charset_handler= { + NULL, /* init */ ismbchar_ujis, mbcharlen_ujis, my_numchars_mb, my_charpos_mb, my_well_formed_len_mb, my_lengthsp_8bit, - my_mb_wc_euc_jp, /* mb_wc */ - my_wc_mb_euc_jp, /* wc_mb */ + my_mb_wc_euc_jp, /* mb_wc */ + my_wc_mb_euc_jp, /* wc_mb */ my_caseup_str_mb, my_casedn_str_mb, my_caseup_mb, @@ -8468,20 +8470,22 @@ CHARSET_INFO my_charset_ujis_japanese_ci= "ujis", /* cs name */ "ujis_japanese_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_ujis, to_lower_ujis, to_upper_ujis, sort_order_ujis, + NULL, /* sort_order_big*/ + NULL, /* contractions */ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_ci_handler }; @@ -8494,20 +8498,22 @@ CHARSET_INFO my_charset_ujis_bin= "ujis", /* cs name */ "ujis_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_ujis, to_lower_ujis, to_upper_ujis, sort_order_ujis, + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ + 255, /* max_sort_char */ &my_charset_handler, &my_collation_mb_bin_handler }; diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 48882f356fd..bf2d8a17fb4 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1524,8 +1524,12 @@ MY_UNICASE_INFO *uni_plane[256]={ #ifdef HAVE_CHARSET_utf8 -/* These arrays are taken from usa7 implementation */ - +/* + We consider bytes with code more than 127 as a letter. + This garantees that word boundaries work fine with regular + expressions. Note, there is no need to mark byte 255 as a + letter, it is illegal byte in UTF8. +*/ static uchar ctype_utf8[] = { 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, @@ -1536,16 +1540,18 @@ static uchar ctype_utf8[] = { 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, - 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, - 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0 }; +/* The below are taken from usa7 implementation */ + static uchar to_lower_utf8[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, @@ -2040,6 +2046,7 @@ static int my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint c) static MY_COLLATION_HANDLER my_collation_ci_handler = { + NULL, /* init */ my_strnncoll_utf8, my_strnncollsp_utf8, my_strnxfrm_utf8, @@ -2050,8 +2057,9 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = my_hash_sort_utf8 }; -static MY_CHARSET_HANDLER my_charset_handler= +MY_CHARSET_HANDLER my_charset_utf8_handler= { + NULL, /* init */ my_ismbchar_utf8, my_mbcharlen_utf8, my_numchars_mb, @@ -2085,21 +2093,23 @@ CHARSET_INFO my_charset_utf8_general_ci= "utf8", /* cs name */ "utf8_general_ci", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_utf8, /* ctype */ to_lower_utf8, /* to_lower */ to_upper_utf8, /* to_upper */ to_upper_utf8, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ - &my_charset_handler, + 255, /* max_sort_char */ + &my_charset_utf8_handler, &my_collation_ci_handler }; @@ -2111,27 +2121,28 @@ CHARSET_INFO my_charset_utf8_bin= "utf8", /* cs name */ "utf8_bin", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_utf8, /* ctype */ to_lower_utf8, /* to_lower */ to_upper_utf8, /* to_upper */ to_upper_utf8, /* sort_order */ + NULL, /* contractions */ + NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - NULL, /* sort_order_big*/ - "", - "", + NULL, /* state_map */ + NULL, /* ident_map */ 1, /* strxfrm_multiply */ 1, /* mbminlen */ 3, /* mbmaxlen */ 0, /* min_sort_char */ - 0, /* max_sort_char */ - &my_charset_handler, + 255, /* max_sort_char */ + &my_charset_utf8_handler, &my_collation_mb_bin_handler }; #ifdef MY_TEST_UTF8 - #include <stdio.h> static void test_mb(CHARSET_INFO *cs, uchar *s) @@ -2163,7 +2174,7 @@ int main() test_mb(cs,(uchar*)str); - pr1;2cintf("orig :'%s'\n",str); + printf("orig :'%s'\n",str); my_caseup_utf8(cs,str,15); printf("caseup :'%s'\n",str); diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 65d20ceedc9..b4dbda3e8ed 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -610,6 +610,7 @@ my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)), static MY_COLLATION_HANDLER my_collation_czech_ci_handler = { + NULL, /* init */ my_strnncoll_win1250ch, my_strnncollsp_win1250ch, my_strnxfrm_win1250ch, @@ -628,14 +629,17 @@ CHARSET_INFO my_charset_cp1250_czech_ci = "cp1250", /* cs name */ "cp1250_czech_cs", /* name */ "", /* comment */ + NULL, /* tailoring */ ctype_win1250ch, to_lower_win1250ch, to_upper_win1250ch, sort_order_win1250ch, + NULL, /* contractions */ NULL, /* sort_order_big*/ tab_cp1250_uni, /* tab_to_uni */ idx_uni_cp1250, /* tab_from_uni */ - "","", + NULL, /* state_map */ + NULL, /* ident_map */ 2, /* strxfrm_multiply */ 1, /* mbminlen */ 1, /* mbmaxlen */ diff --git a/strings/ctype.c b/strings/ctype.c index 44bf20ada5c..4454d3c45e1 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -124,6 +124,7 @@ static struct my_cs_file_section_st * cs_file_sec(const char *attr, uint len) } #define MY_CS_CSDESCR_SIZE 64 +#define MY_CS_TAILORING_SIZE 128 typedef struct my_cs_file_info { @@ -135,7 +136,8 @@ typedef struct my_cs_file_info uchar sort_order[MY_CS_SORT_ORDER_TABLE_SIZE]; uint16 tab_to_uni[MY_CS_TO_UNI_TABLE_SIZE]; char comment[MY_CS_CSDESCR_SIZE]; - size_t sort_order_length; + char tailoring[MY_CS_TAILORING_SIZE]; + size_t tailoring_length; CHARSET_INFO cs; int (*add_collation)(CHARSET_INFO *cs); } MY_CHARSET_LOADER; @@ -186,7 +188,7 @@ static int cs_enter(MY_XML_PARSER *st,const char *attr, uint len) bzero(&i->cs,sizeof(i->cs)); if (s && (s->state == _CS_COLLATION)) - i->sort_order_length= 0; + i->tailoring_length= 0; return MY_XML_OK; } @@ -283,12 +285,12 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len) */ char arg[16]; const char *cmd[]= {"&","<","<<","<<<"}; - i->cs.sort_order= i->sort_order; + i->cs.tailoring= i->tailoring; mstr(arg,attr,len,sizeof(arg)-1); - if (i->sort_order_length + 20 < sizeof(i->sort_order)) + if (i->tailoring_length + 20 < sizeof(i->tailoring)) { - char *dst= i->sort_order_length + i->sort_order; - i->sort_order_length+= sprintf(dst," %s %s",cmd[state-_CS_RESET],arg); + char *dst= i->tailoring_length + i->tailoring; + i->tailoring_length+= sprintf(dst," %s %s",cmd[state-_CS_RESET],arg); } } } diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index dc03c130dcd..784c4762724 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -18,7 +18,6 @@ #include <m_string.h> #include <stdarg.h> #include <m_ctype.h> -#include <assert.h> /* Limited snprintf() implementations diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh index 5fdde0d2963..d25686f1c21 100644 --- a/support-files/my-huge.cnf.sh +++ b/support-files/my-huge.cnf.sh @@ -1,6 +1,6 @@ -# Example mysql config file for very large systems. +# Example MySQL config file for very large systems. # -# This is for large system with memory of 1G-2G where the system runs mainly +# This is for a large system with memory of 1G-2G where the system runs mainly # MySQL. # # You can copy this file to @@ -9,9 +9,9 @@ # installation this directory is @localstatedir@) or # ~/.my.cnf to set user-specific options. # -# One can in this file use all long options that the program supports. +# In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program -# with the --help option. +# with the "--help" option. # The following options will be passed to all MySQL clients [client] diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 54df6a8bfe6..6def311f474 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -13,8 +13,8 @@ # (@localstatedir@ for this installation) or to # ~/.my.cnf to set user-specific options. # -# In this file, you can use all long options that the program supports. -# If you want to know the options a program supports, run the program +# In this file, you can use all long options that a program supports. +# If you want to know which options a program supports, run the program # with the "--help" option. # # More detailed information about the individual options can also be diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh index a17ec7b5227..59aca4b32f2 100644 --- a/support-files/my-large.cnf.sh +++ b/support-files/my-large.cnf.sh @@ -1,6 +1,6 @@ -# Example mysql config file for large systems. +# Example MySQL config file for large systems. # -# This is for large system with memory = 512M where the system runs mainly +# This is for a large system with memory = 512M where the system runs mainly # MySQL. # # You can copy this file to @@ -9,9 +9,9 @@ # installation this directory is @localstatedir@) or # ~/.my.cnf to set user-specific options. # -# One can in this file use all long options that the program supports. +# In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program -# with the --help option. +# with the "--help" option. # The following options will be passed to all MySQL clients [client] diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh index d50d0717c17..529740d59f0 100644 --- a/support-files/my-medium.cnf.sh +++ b/support-files/my-medium.cnf.sh @@ -1,4 +1,4 @@ -# Example mysql config file for medium systems. +# Example MySQL config file for medium systems. # # This is for a system with little memory (32M - 64M) where MySQL plays # an important part, or systems up to 128M where MySQL is used together with @@ -10,9 +10,9 @@ # installation this directory is @localstatedir@) or # ~/.my.cnf to set user-specific options. # -# One can in this file use all long options that the program supports. +# In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program -# with the --help option. +# with the "--help" option. # The following options will be passed to all MySQL clients [client] diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh index 2ae62fb48f1..b2ecca6127e 100644 --- a/support-files/my-small.cnf.sh +++ b/support-files/my-small.cnf.sh @@ -1,4 +1,4 @@ -# Example mysql config file for small systems. +# Example MySQL config file for small systems. # # This is for a system with little memory (<= 64M) where MySQL is only used # from time to time and it's important that the mysqld daemon @@ -10,9 +10,9 @@ # installation this directory is @localstatedir@) or # ~/.my.cnf to set user-specific options. # -# One can in this file use all long options that the program supports. +# In this file, you can use all long options that a program supports. # If you want to know which options a program supports, run the program -# with the --help option. +# with the "--help" option. # The following options will be passed to all MySQL clients [client] diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 8583b623392..c3d74b147f3 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -397,7 +397,7 @@ useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/nul chown -R mysql $mysql_datadir # Initiate databases -mysql_install_db --rpm +mysql_install_db -IN-RPM --user=mysql # Change permissions again to fix any new files. chown -R mysql $mysql_datadir diff --git a/tests/Makefile.am b/tests/Makefile.am index 5d6e6a68ae2..5d0e4627b69 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -36,7 +36,6 @@ LIBS = @CLIENT_LIBS@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la client_test_LDADD= $(LDADD) $(CXXLDFLAGS) client_test_SOURCES= client_test.c -client_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) diff --git a/tests/client_test.c b/tests/client_test.c index 06b757810a6..c035691fe47 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -19,12 +19,6 @@ protocol Main author: venu ( venu@mysql.com ) - - NOTES: - - To be able to test which fields are used, we are not clearing - the MYSQL_BIND with bzero() but instead just clearing the fields that - are used by the API. - ***************************************************************************/ #include <my_global.h> @@ -183,7 +177,8 @@ static void client_connect() int rc; myheader_r("client_connect"); - fprintf(stdout, "\n Establishing a connection to '%s' ...", opt_host); + fprintf(stdout, "\n Establishing a connection to '%s' ...", + opt_host ? opt_host : ""); if (!(mysql= mysql_init(NULL))) { @@ -790,17 +785,11 @@ static void test_tran_bdb() myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* create the table 'mytran_demo' of type BDB' or 'InnoDB' */ rc= mysql_query(mysql, "CREATE TABLE my_demo_transaction( " "col1 int , col2 varchar(30)) TYPE= BDB"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* insert a row and commit the transaction */ rc= mysql_query(mysql, "INSERT INTO my_demo_transaction VALUES(10, 'venu')"); myquery(rc); @@ -869,17 +858,11 @@ static void test_tran_innodb() rc= mysql_query(mysql, "DROP TABLE IF EXISTS my_demo_transaction"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* create the table 'mytran_demo' of type BDB' or 'InnoDB' */ rc= mysql_query(mysql, "CREATE TABLE my_demo_transaction(col1 int, " "col2 varchar(30)) TYPE= InnoDB"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* insert a row and commit the transaction */ rc= mysql_query(mysql, "INSERT INTO my_demo_transaction VALUES(10, 'venu')"); myquery(rc); @@ -943,9 +926,6 @@ static void test_prepare_simple() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_simple"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prepare_simple(" "id int, name varchar(50))"); myquery(rc); @@ -1014,9 +994,6 @@ static void test_prepare_field_result() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_field_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prepare_field_result(int_c int, " "var_c varchar(50), ts_c timestamp(14), " "char_c char(3), date_c date, extra tinyint)"); @@ -1065,9 +1042,6 @@ static void test_prepare_syntax() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_syntax"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prepare_syntax(" "id int, name varchar(50), extra int)"); myquery(rc); @@ -1111,9 +1085,6 @@ static void test_prepare() rc= mysql_query(mysql, "DROP TABLE IF EXISTS my_prepare"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE my_prepare(col1 tinyint, " "col2 varchar(15), col3 int, " "col4 smallint, col5 bigint, " @@ -1283,9 +1254,6 @@ static void test_double_compare() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_double_compare"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_double_compare(col1 tinyint, " " col2 float, col3 double )"); myquery(rc); @@ -1364,9 +1332,6 @@ static void test_null() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_null"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_null(col1 int, col2 varchar(50))"); myquery(rc); @@ -1543,9 +1508,6 @@ static void test_fetch_null() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_fetch_null"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_fetch_null(" " col1 tinyint, col2 smallint, " " col3 int, col4 bigint, " @@ -1556,9 +1518,6 @@ static void test_fetch_null() " col11 char(20))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_fetch_null (col11) " "VALUES (1000), (88), (389789)"); myquery(rc); @@ -1670,18 +1629,12 @@ static void test_select_direct() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_select"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_select(id int, id1 tinyint, " " id2 float, " " id3 double, " " name varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* insert a row and commit the transaction */ rc= mysql_query(mysql, "INSERT INTO test_select VALUES(10, 5, 2.3, 4.5, 'venu')"); myquery(rc); @@ -1716,15 +1669,9 @@ static void test_select_prepare() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_select"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_select(id int, name varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* insert a row and commit the transaction */ rc= mysql_query(mysql, "INSERT INTO test_select VALUES(10, 'venu')"); myquery(rc); @@ -1744,17 +1691,11 @@ static void test_select_prepare() rc= mysql_query(mysql, "DROP TABLE test_select"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_select(id tinyint, id1 int, " " id2 float, id3 float, " " name varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* insert a row and commit the transaction */ rc= mysql_query(mysql, "INSERT INTO test_select(id, id1, id2, name) VALUES(10, 5, 2.3, 'venu')"); myquery(rc); @@ -1792,22 +1733,13 @@ static void test_select() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_select"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_select(id int, name varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* insert a row and commit the transaction */ rc= mysql_query(mysql, "INSERT INTO test_select VALUES(10, 'venu')"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* now insert the second row, and rollback the transaction */ rc= mysql_query(mysql, "INSERT INTO test_select VALUES(20, 'mysql')"); myquery(rc); @@ -2282,16 +2214,10 @@ static void test_simple_update() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_update"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_update(col1 int, " " col2 varchar(50), col3 int )"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_update VALUES(1, 'MySQL', 100)"); myquery(rc); @@ -2364,16 +2290,10 @@ static void test_long_data() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_long_data"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_long_data(col1 int, " " col2 long varchar, col3 long varbinary)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - strmov(query, "INSERT INTO test_long_data(col1, col2) VALUES(?)"); stmt= mysql_simple_prepare(mysql, query); check_stmt_r(stmt); @@ -2454,15 +2374,9 @@ static void test_long_data_str() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_long_data_str"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_long_data_str(id int, longstr long varchar)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - strmov(query, "INSERT INTO test_long_data_str VALUES(?, ?)"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2550,15 +2464,9 @@ static void test_long_data_str1() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_long_data_str"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_long_data_str(longstr long varchar, blb long varbinary)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - strmov(query, "INSERT INTO test_long_data_str VALUES(?, ?)"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2707,15 +2615,9 @@ static void test_long_data_bin() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_long_data_bin"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_long_data_bin(id int, longbin long varbinary)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - strmov(query, "INSERT INTO test_long_data_bin VALUES(?, ?)"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2789,16 +2691,10 @@ static void test_simple_delete() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_simple_delete"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_simple_delete(col1 int, \ col2 varchar(50), col3 int )"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_simple_delete VALUES(1, 'MySQL', 100)"); myquery(rc); @@ -2875,14 +2771,9 @@ static void test_update() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_update"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - - rc= mysql_query(mysql, "CREATE TABLE test_update(col1 int primary key auto_increment, \ - col2 varchar(50), col3 int )"); - myquery(rc); - - rc= mysql_commit(mysql); + rc= mysql_query(mysql, "CREATE TABLE test_update(" + "col1 int primary key auto_increment, " + "col2 varchar(50), col3 int )"); myquery(rc); strmov(query, "INSERT INTO test_update(col2, col3) VALUES(?, ?)"); @@ -2972,13 +2863,10 @@ static void test_prepare_noparam() rc= mysql_query(mysql, "DROP TABLE IF EXISTS my_prepare"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE my_prepare(col1 int , col2 varchar(50))"); + rc= mysql_query(mysql, "CREATE TABLE my_prepare(col1 int, col2 varchar(50))"); myquery(rc); - /* insert by prepare */ strmov(query, "INSERT INTO my_prepare VALUES(10, 'venu')"); stmt= mysql_simple_prepare(mysql, query); @@ -3025,15 +2913,9 @@ static void test_bind_result() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_result(col1 int , col2 varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_bind_result VALUES(10, 'venu')"); myquery(rc); @@ -3124,22 +3006,17 @@ static void test_bind_result_ext() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - - rc= mysql_query(mysql, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint, \ - c3 int, c4 bigint, \ - c5 float, c6 double, \ - c7 varbinary(10), \ - c8 varchar(50))"); - myquery(rc); - - rc= mysql_commit(mysql); + rc= mysql_query(mysql, "CREATE TABLE test_bind_result(c1 tinyint, " + " c2 smallint, " + " c3 int, c4 bigint, " + " c5 float, c6 double, " + " c7 varbinary(10), " + " c8 varchar(50))"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_bind_result VALUES(19, 2999, 3999, 4999999, \ - 2345.6, 5678.89563, \ - 'venu', 'mysql')"); + rc= mysql_query(mysql, "INSERT INTO test_bind_result " + "VALUES (19, 2999, 3999, 4999999, " + " 2345.6, 5678.89563, 'venu', 'mysql')"); myquery(rc); rc= mysql_commit(mysql); @@ -3246,9 +3123,6 @@ static void test_bind_result_ext1() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_result(c1 tinyint, c2 smallint, \ c3 int, c4 bigint, \ c5 float, c6 double, \ @@ -3256,9 +3130,6 @@ static void test_bind_result_ext1() c8 varchar(10))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_bind_result VALUES(120, 2999, 3999, 54, \ 2.6, 58.89, \ '206', '6.7')"); @@ -3356,8 +3227,11 @@ static void bind_fetch(int row_count) { MYSQL_STMT *stmt; int rc, i, count= row_count; - ulong bit; long data[10]; + int8 i8_data; + int16 i16_data; + int32 i32_data; + longlong i64_data; float f_data; double d_data; char s_data[10]; @@ -3413,9 +3287,16 @@ static void bind_fetch(int row_count) } bind[0].buffer_type= MYSQL_TYPE_TINY; + bind[0].buffer= (char *)&i8_data; + bind[1].buffer_type= MYSQL_TYPE_SHORT; + bind[1].buffer= (char *)&i16_data; + bind[2].buffer_type= MYSQL_TYPE_LONG; + bind[2].buffer= (char *)&i32_data; + bind[3].buffer_type= MYSQL_TYPE_LONGLONG; + bind[3].buffer= (char *)&i64_data; bind[4].buffer_type= MYSQL_TYPE_FLOAT; bind[4].buffer= (char *)&f_data; @@ -3442,36 +3323,47 @@ static void bind_fetch(int row_count) check_execute(stmt, rc); fprintf(stdout, "\n"); - fprintf(stdout, "\n tiny : %ld(%lu)", data[0], length[0]); - fprintf(stdout, "\n short : %ld(%lu)", data[1], length[1]); - fprintf(stdout, "\n int : %ld(%lu)", data[2], length[2]); - fprintf(stdout, "\n longlong : %ld(%lu)", data[3], length[3]); + fprintf(stdout, "\n tiny : %ld(%lu)", (ulong) i8_data, length[0]); + fprintf(stdout, "\n short : %ld(%lu)", (ulong) i16_data, length[1]); + fprintf(stdout, "\n int : %ld(%lu)", (ulong) i32_data, length[2]); + fprintf(stdout, "\n longlong : %ld(%lu)", (ulong) i64_data, length[3]); fprintf(stdout, "\n float : %f(%lu)", f_data, length[4]); fprintf(stdout, "\n double : %g(%lu)", d_data, length[5]); fprintf(stdout, "\n char : %s(%lu)", s_data, length[6]); - bit= 1; rc= 10+row_count; - for (i= 0; i < 4; i++) - { - assert(data[i] == rc+i); - assert(length[i] == bit); - bit<<= 1; - rc+= 12; - } + + /* TINY */ + assert((int) i8_data == rc); + assert(length[0] == 1); + rc+= 13; + + /* SHORT */ + assert((int) i16_data == rc); + assert(length[1] == 2); + rc+= 13; + + /* LONG */ + assert((int) i32_data == rc); + assert(length[2] == 4); + rc+= 13; + + /* LONGLONG */ + assert((int) i64_data == rc); + assert(length[3] == 8); + rc+= 13; /* FLOAT */ - rc+= i; assert((int)f_data == rc); assert(length[4] == 4); + rc+= 13; /* DOUBLE */ - rc+= 13; assert((int)d_data == rc); assert(length[5] == 8); + rc+= 13; /* CHAR */ - rc+= 13; { char buff[20]; long len= my_sprintf(buff, (buff, "%d", rc)); @@ -3505,9 +3397,6 @@ static void test_fetch_date() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_result(c1 date, c2 time, \ c3 timestamp(14), \ c4 year, \ @@ -3516,9 +3405,6 @@ static void test_fetch_date() c7 timestamp(6))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_bind_result VALUES('2002-01-02', \ '12:49:00', \ '2002-01-02 17:46:59', \ @@ -3632,9 +3518,6 @@ static void test_fetch_str() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_fetch"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_fetch(c1 char(10), \ c2 char(10), \ c3 char(20), \ @@ -3644,9 +3527,6 @@ static void test_fetch_str() c7 char(20))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - bind_fetch(3); } @@ -3662,9 +3542,6 @@ static void test_fetch_long() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_fetch"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_fetch(c1 int unsigned, \ c2 int unsigned, \ c3 int, \ @@ -3674,9 +3551,6 @@ static void test_fetch_long() c7 int)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - bind_fetch(4); } @@ -3692,9 +3566,6 @@ static void test_fetch_short() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_fetch"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_fetch(c1 smallint unsigned, \ c2 smallint, \ c3 smallint unsigned, \ @@ -3704,9 +3575,6 @@ static void test_fetch_short() c7 smallint unsigned)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - bind_fetch(5); } @@ -3722,9 +3590,6 @@ static void test_fetch_tiny() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_fetch"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_fetch(c1 tinyint unsigned, \ c2 tinyint, \ c3 tinyint unsigned, \ @@ -3734,9 +3599,6 @@ static void test_fetch_tiny() c7 tinyint unsigned)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - bind_fetch(3); } @@ -3753,9 +3615,6 @@ static void test_fetch_bigint() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_fetch"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_fetch(c1 bigint, \ c2 bigint, \ c3 bigint unsigned, \ @@ -3765,9 +3624,6 @@ static void test_fetch_bigint() c7 bigint unsigned)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - bind_fetch(2); } @@ -3784,9 +3640,6 @@ static void test_fetch_float() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_fetch"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_fetch(c1 float(3), \ c2 float, \ c3 float unsigned, \ @@ -3796,9 +3649,6 @@ static void test_fetch_float() c7 float(10) unsigned)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - bind_fetch(2); } @@ -3815,18 +3665,12 @@ static void test_fetch_double() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bind_fetch"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_bind_fetch(c1 double(5, 2), " "c2 double unsigned, c3 double unsigned, " "c4 double unsigned, c5 double unsigned, " "c6 double unsigned, c7 double unsigned)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - bind_fetch(3); } @@ -3849,9 +3693,6 @@ static void test_prepare_ext() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_ext"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - sql= (char *)"CREATE TABLE test_prepare_ext\ (\ c1 tinyint, \ @@ -3969,18 +3810,12 @@ static void test_field_names() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_field_names2"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_field_names1(id int, name varchar(50))"); myquery(rc); rc= mysql_query(mysql, "CREATE TABLE test_field_names2(id int, name varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* with table name included with TRUE column name */ rc= mysql_query(mysql, "SELECT id as 'id-alias' FROM test_field_names1"); myquery(rc); @@ -4074,9 +3909,6 @@ static void test_insert() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_insert"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prep_insert(col1 tinyint, \ col2 varchar(50))"); myquery(rc); @@ -4151,9 +3983,6 @@ static void test_prepare_resultset() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_resultset"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prepare_resultset(id int, \ name varchar(50), extra double)"); myquery(rc); @@ -4186,9 +4015,6 @@ static void test_field_flags() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_field_flags"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_field_flags(id int NOT NULL AUTO_INCREMENT PRIMARY KEY, \ id1 int NOT NULL, \ id2 int UNIQUE, \ @@ -4198,9 +4024,6 @@ static void test_field_flags() KEY(id3, id4))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - /* with table name included with TRUE column name */ rc= mysql_query(mysql, "SELECT * FROM test_field_flags"); myquery(rc); @@ -4462,9 +4285,6 @@ static void test_insert_meta() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_insert"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prep_insert(col1 tinyint, \ col2 varchar(50), col3 varchar(30))"); myquery(rc); @@ -4527,9 +4347,6 @@ static void test_update_meta() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_update"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prep_update(col1 tinyint, \ col2 varchar(50), col3 varchar(30))"); myquery(rc); @@ -4596,9 +4413,6 @@ static void test_select_meta() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_select"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_prep_select(col1 tinyint, \ col2 varchar(50), col3 varchar(30))"); myquery(rc); @@ -4663,9 +4477,6 @@ static void test_func_fields() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_dateformat"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_dateformat(id int, \ ts timestamp)"); myquery(rc); @@ -4734,7 +4545,8 @@ static void test_multi_stmt() { MYSQL_STMT *stmt, *stmt1, *stmt2; - int rc, id; + int rc; + ulong id; char name[50]; MYSQL_BIND bind[2]; ulong length[2]; @@ -4766,7 +4578,7 @@ static void test_multi_stmt() */ bzero((char*) bind, sizeof(bind)); - bind[0].buffer_type= MYSQL_TYPE_SHORT; + bind[0].buffer_type= MYSQL_TYPE_LONG; bind[0].buffer= (char *)&id; bind[0].is_null= &is_null[0]; bind[0].length= &length[0]; @@ -4793,7 +4605,7 @@ static void test_multi_stmt() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n int_data: %d(%lu)", id, length[0]); + fprintf(stdout, "\n int_data: %lu(%lu)", id, length[0]); fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); assert(id == 10); assert(strcmp(name, "mysql") == 0); @@ -4822,7 +4634,7 @@ static void test_multi_stmt() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n int_data: %d(%lu)", id, length[0]); + fprintf(stdout, "\n int_data: %lu(%lu)", id, length[0]); fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); assert(id == 10); assert(strcmp(name, "updated") == 0); @@ -5241,15 +5053,9 @@ static void test_store_result() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_store_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_store_result(col1 int , col2 varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_store_result VALUES(10, 'venu'), (20, 'mysql')"); myquery(rc); @@ -5365,15 +5171,9 @@ static void test_store_result1() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_store_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_store_result(col1 int , col2 varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_store_result VALUES(10, 'venu'), (20, 'mysql')"); myquery(rc); @@ -5429,15 +5229,9 @@ static void test_store_result2() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_store_result"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_store_result(col1 int , col2 varchar(50))"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_store_result VALUES(10, 'venu'), (20, 'mysql')"); myquery(rc); @@ -5522,18 +5316,12 @@ static void test_subselect() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_sub2"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_sub1(id int)"); myquery(rc); rc= mysql_query(mysql, "CREATE TABLE test_sub2(id int, id1 int)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "INSERT INTO test_sub1 values(2)"); myquery(rc); @@ -5777,9 +5565,6 @@ static void test_date() myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - test_bind_date_conv(5); } @@ -5802,9 +5587,6 @@ static void test_date_date() myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - test_bind_date_conv(3); } @@ -5827,9 +5609,6 @@ static void test_date_time() myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - test_bind_date_conv(3); } @@ -5852,9 +5631,6 @@ static void test_date_ts() myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - test_bind_date_conv(2); } @@ -5874,9 +5650,6 @@ static void test_date_dt() " c2 datetime, c3 datetime, c4 date)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - test_bind_date_conv(2); } @@ -5961,7 +5734,6 @@ static void test_pure_coverage() mysql_stmt_close(stmt); mysql_query(mysql, "DROP TABLE test_pure"); - mysql_commit(mysql); } @@ -6535,6 +6307,7 @@ static void test_field_misc() result= mysql_stmt_result_metadata(stmt); mytest(result); + assert(mysql_stmt_field_count(stmt) == mysql_num_fields(result)); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -8052,9 +7825,6 @@ static void test_sqlmode() rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_piping"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE test_piping(name varchar(10))"); myquery(rc); @@ -8189,9 +7959,6 @@ static void test_ts() rc= mysql_query(mysql, "CREATE TABLE test_ts(a DATE, b TIME, c TIMESTAMP)"); myquery(rc); - rc= mysql_commit(mysql); - myquery(rc); - stmt= mysql_simple_prepare(mysql, "INSERT INTO test_ts VALUES(?, ?, ?), (?, ?, ?)"); check_stmt(stmt); @@ -9985,7 +9752,7 @@ static void test_bug3796() MYSQL_STMT *stmt; MYSQL_BIND bind[1]; const char *concat_arg0= "concat_with_"; - const int OUT_BUFF_SIZE= 30; + enum { OUT_BUFF_SIZE= 30 }; char out_buff[OUT_BUFF_SIZE]; char canonical_buff[OUT_BUFF_SIZE]; ulong out_length; @@ -10058,6 +9825,145 @@ static void test_bug3796() myquery(rc); } + +static void test_bug4026() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[2]; + MYSQL_TIME time_in, time_out; + MYSQL_TIME datetime_in, datetime_out; + const char *stmt_text; + int rc; + + myheader("test_bug4026"); + + /* Check that microseconds are inserted and selected successfully */ + + /* Create a statement handle and prepare it with select */ + stmt= mysql_stmt_init(mysql); + stmt_text= "SELECT ?, ?"; + + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + + /* Bind input buffers */ + bzero(bind, sizeof(bind)); + bzero(&time_in, sizeof(time_in)); + bzero(&time_out, sizeof(time_out)); + bzero(&datetime_in, sizeof(datetime_in)); + bzero(&datetime_out, sizeof(datetime_out)); + + bind[0].buffer_type= MYSQL_TYPE_TIME; + bind[0].buffer= (char*) &time_in; + bind[1].buffer_type= MYSQL_TYPE_DATETIME; + bind[1].buffer= (char*) &datetime_in; + + time_in.hour= 23; + time_in.minute= 59; + time_in.second= 59; + time_in.second_part= 123456; + + datetime_in= time_in; + datetime_in.year= 2003; + datetime_in.month= 12; + datetime_in.day= 31; + + mysql_stmt_bind_param(stmt, bind); + + /* Execute the select statement */ + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + bind[0].buffer= (char*) &time_out; + bind[1].buffer= (char*) &datetime_out; + + mysql_stmt_bind_result(stmt, bind); + + rc= mysql_stmt_fetch(stmt); + assert(rc == 0); + printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, + time_out.second_part); + printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, + datetime_out.day, datetime_out.hour, + datetime_out.minute, datetime_out.second, + datetime_out.second_part); + assert(memcmp(&time_in, &time_out, sizeof(time_in)) == 0); + assert(memcmp(&datetime_in, &datetime_out, sizeof(datetime_in)) == 0); + mysql_stmt_close(stmt); +} + + +static void test_bug4079() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[1]; + const char *stmt_text; + unsigned long res; + int rc; + + myheader("test_bug4079"); + + /* Create and fill table */ + mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + mysql_query(mysql, "CREATE TABLE t1 (a int)"); + mysql_query(mysql, "INSERT INTO t1 VALUES (1), (2)"); + + /* Prepare erroneous statement */ + stmt= mysql_stmt_init(mysql); + stmt_text= "SELECT 1 < (SELECT a FROM t1)"; + + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + + /* Execute the select statement */ + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + /* Bind input buffers */ + bzero(bind, sizeof(bind)); + + bind[0].buffer_type= MYSQL_TYPE_LONG; + bind[0].buffer= (char*) &res; + + mysql_stmt_bind_result(stmt, bind); + + rc= mysql_stmt_fetch(stmt); + assert(rc != 0 && rc != MYSQL_NO_DATA); + printf("Got error from mysql_stmt_fetch (as expected):\n%s\n", + mysql_stmt_error(stmt)); + /* buggy version of libmysql hanged up here */ + mysql_stmt_close(stmt); +} + + +static void test_bug4236() +{ + MYSQL_STMT *stmt; + const char *stmt_text; + int rc; + MYSQL_STMT backup; + + myheader("test_bug4296"); + + stmt= mysql_stmt_init(mysql); + + /* mysql_stmt_execute() of statement with statement id= 0 crashed server */ + stmt_text= "SELECT 1"; + /* We need to prepare statement to pass by possible check in libmysql */ + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + /* Hack to check that server works OK if statement wasn't found */ + backup.stmt_id= stmt->stmt_id; + stmt->stmt_id= 0; + rc= mysql_stmt_execute(stmt); + assert(rc); + /* Restore original statement id to be able to reprepare it */ + stmt->stmt_id= backup.stmt_id; + + mysql_stmt_close(stmt); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -10350,6 +10256,9 @@ int main(int argc, char **argv) (Bug #3686 */ test_ps_i18n(); /* test for i18n support in binary protocol */ test_bug3796(); /* test for select concat(?, <string>) */ + test_bug4026(); /* test microseconds precision of time types */ + test_bug4079(); /* erroneous subquery in prepared statement */ + test_bug4236(); /* init -> execute */ /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c index 45865e97ab7..bb0a76d6c49 100644 --- a/tools/mysqlmanager.c +++ b/tools/mysqlmanager.c @@ -687,7 +687,7 @@ HANDLE_DECL(handle_stop_exec) error="Process not running"; goto err; } - if (mysql_shutdown(&e->mysql)) + if (mysql_shutdown(&e->mysql, SHUTDOWN_DEFAULT)) { /* e->th=0; */ /* th may be a struct */ pthread_mutex_unlock(&e->lock); |